{% extends "page_view.html" %} {% load i18n static crispy_forms_tags mvp %} {% block title %} {{ page.title }} {% if page_obj and page_obj.paginator.num_pages > 1 %} {% blocktrans with number=page_obj.number total=page_obj.paginator.num_pages %}(page {{ number }} of {{ total }}){% endblocktrans %} {% endif %} {% endblock title %} {% block page.title %} {% comment %} The title row holds the title, subtitle and info button. page.actions is empty and stays for a page that fills it; Add is in the toolbar below. {% endcomment %} {% block page.actions %} {% endblock page.actions %} {% endblock page.title %} {% block page.content %} {% comment %} Each part of the page is its own block, so a project can replace one and keep the rest: page.toolbar, page.refinements (and inside it page.summary), page.results (and inside it page.empty), and page.pagination. {% endcomment %}
{% block page.toolbar %} {% comment %} One form holds the toolbar's fields and the filter modal. It is display: contents, so its fields sit in the toolbar's row as if it were not there. The Filter button only opens the modal, so it sits outside the form, kept together with Add at the end of the row; Add's create dialog is never inside the filter form. A view with no filterset draws no form at all. {% endcomment %} {% if filter %}
{# Enter in a text field submits only through a submit button, and some forms have none. #} {% for field in toolbar_fields %} {% endfor %} {% endif %}
{% if toolbar_sort %}{% endif %}
{% endblock page.toolbar %} {% block page.refinements %} {% if result_count or refinements %} {# The result count leads the row of applied filters, directly above the results it counts. #}
{% block page.summary %} {% endblock page.summary %} {% if sort_label %}

{% blocktrans with order=sort_label %}Sorted by {{ order }}{% endblocktrans %}

{% endif %}
{% endif %} {% endblock page.refinements %} {% block page.results %} {% block page.empty %} {% endblock page.empty %} {% endblock page.results %}
{% block page.pagination %} {% if page_obj %}{% endif %} {% endblock page.pagination %} {% endblock page.content %} {% block extra_js %} {{ block.super }} {% if filter %}{{ filter.form.media }}{% endif %} {% endblock extra_js %}