paginated_list_panel.html 1.15 KB
{% load i18n get %}

{% with paginer|get:id as paginer_obj %}
  {% if paginer_obj.params.sort_fields %}
    <ul id={{ id }}_sort-choices class="sort-choices">
      {% for field in paginer_obj.params.sort_fields %}
        <li id="{{ id }}_{{ field }}_sort-choice" class="sort-choice">
          <span class="sort-icon ui-icon"></span>
          <a>
            <div class="sort-direction">1</div>
            <div class="sort-field-name">{{ field }}</div>{% trans field %}</a>
        {# TODO nazwa pola... #}
        </li>
      {% endfor %}
    </ul>
    <div class="clearer"></div>
  {% endif %}
  {% if paginer_obj.params.filter_fields %}
    <form id="{{ id }}_filter-panel" class="filter-panel" action="">
      {% for filter in paginer_obj.params.filter_fields %}
        {% with paginer_obj.filter_forms|get:filter as form %}
          {% if not form.1 or user.is_authenticated %}
            {{ form.0.as_ul }}
          {% endif %}
        {% endwith %}
      {% endfor %}
      <p>
        <button type="button" id="{{ id }}_filter-button" class="filter-button">
          {% trans "Pokaż" %}
        </button>
      </p>
    </form>
  {% endif %}
{% endwith %}