2 {% load django_tables2 %}
5 <div class=
"table-container">
8 <table{% if table.attrs %} {{ table.attrs.as_html }}{% endif %}
>
10 {% block table.thead %}
13 {% for column in table.columns %}
14 {% if column.header ==
"Status" %}
15 <th {{ column.attrs.th.as_html }}
>
16 {% if column.orderable %}
17 <a href=
"{{ ajax_url }}{% querystring table.prefixed_order_by_field=column.order_by_alias.next %}"></a>
20 {% elif column.orderable %}
21 <th {{ column.attrs.th.as_html }}
><a href=
"{{ ajax_url }}{% querystring table.prefixed_order_by_field=column.order_by_alias.next %}">{{ column.header }}
</a></th>
23 <th {{ column.attrs.th.as_html }}
>{{ column.header }}
</th>
28 {% endblock table.thead %}
29 {% block table.tbody %}
31 {% for row in table.page.object_list|default:table.rows %} {# support pagination #}
32 {% block table.tbody.row %}
33 <tr class=
"{% cycle "odd
" "even
" %}">
34 {% for column, cell in row.items %}
35 <td {{ column.attrs.td.as_html }}
>{{ cell }}
</td>
38 {% endblock table.tbody.row %}
40 {% if table.empty_text %}
41 {% block table.tbody.empty_text %}
42 <tr><td colspan=
"{{ table.columns|length }}">{{ table.empty_text }}
</td></tr>
43 {% endblock table.tbody.empty_text %}
47 {% endblock table.tbody %}
48 {% block table.tfoot %}
50 {% endblock table.tfoot %}
56 {% with table.page.paginator.count as total %}
57 {% with table.page.object_list|length as count %}
58 {% block pagination %}
59 <ul class=
"pagination">
60 {% if table.page.has_previous %}
61 {% nospaceless %}{% block pagination.previous %}
<li class=
"previous"><a href=
"{{ ajax_url }}{% querystring table.prefixed_page_field=table.page.previous_page_number %}">{% trans
"Previous" %}
</a></li>{% endblock pagination.previous %}{% endnospaceless %}
64 {% if table.page.has_previous or table.page.has_next %}
65 {% nospaceless %}{% block pagination.current %}
<li class=
"current">{% blocktrans with table.page.number as current and table.paginator.num_pages as total %}Page {{ current }} of {{ total }}{% endblocktrans %}
</li>{% endblock pagination.current %}{% endnospaceless %}
68 {% if table.page.has_next %}
69 {% nospaceless %}{% block pagination.next %}
<li class=
"next"><a href=
"{{ ajax_url }}{% querystring table.prefixed_page_field=table.page.next_page_number %}">{% trans
"Next" %}
</a></li>{% endblock pagination.next %}{% endnospaceless %}
72 {% nospaceless %}{% block pagination.cardinality %}
<li class=
"cardinality">{% if total != count %}{% blocktrans %}{{ count }} of {{ total }}{% endblocktrans %}{% else %}{{ total }}{% endif %} {% if total ==
1 %}{{ table.data.verbose_name }}{% else %}{{ table.data.verbose_name_plural }}{% endif %}
</li>{% endblock pagination.cardinality %}{% endnospaceless %}
74 {% endblock pagination %}