59 lines
2.2 KiB
HTML
59 lines
2.2 KiB
HTML
{% extends "django_tables2/table.html" %}
|
|
|
|
{% load django_tables2 %}
|
|
|
|
{% block table.thead %}
|
|
<thead>
|
|
<tr>
|
|
{% for column in table.columns %}
|
|
{% if column.orderable %}
|
|
<th {{ column.attrs.th.as_html }}><a href="{% querystring table.prefixed_order_by_field=column.order_by_alias.next %}">{{ column.header }}</a></th>
|
|
{% else %}
|
|
<th {{ column.attrs.th.as_html }}>{{ column.header }}</th>
|
|
{% endif %}
|
|
{% endfor %}
|
|
{% block table.head.last.column %}
|
|
{% endblock %}
|
|
</tr>
|
|
</thead>
|
|
{% endblock table.thead %}
|
|
|
|
{% block table.tbody.row %}
|
|
<tr data-ref="{{ row.record.id }}" class="{{ forloop.counter|divisibleby:2|yesno:"even,odd" }}"> {# avoid cycle for Django 1.2-1.6 compatibility #}
|
|
{% for column, cell in row.items %}
|
|
<td {{ column.attrs.td.as_html }}>{% if column.localize == None %}{{ cell }}{% else %}{% if column.localize %}{{ cell|localize }}{% else %}{{ cell|unlocalize }}{% endif %}{% endif %}</td>
|
|
{% endfor %}
|
|
{% block table.tbody.last.column %}
|
|
{% endblock %}
|
|
</tr>
|
|
{% endblock table.tbody.row %}
|
|
|
|
{% block pagination %}
|
|
<p class="paginator">
|
|
{% if table.page.number > 1 %}
|
|
{% if table.page.previous_page_number != 1 %}
|
|
<a href="{% querystring table.prefixed_page_field=1 %}">1</a>
|
|
...
|
|
{% endif %}
|
|
{% endif %}
|
|
|
|
{% if table.page.has_previous %}
|
|
<a href="{% querystring table.prefixed_page_field=table.page.previous_page_number %}">{{ table.page.previous_page_number }}</a>
|
|
{% endif %}
|
|
|
|
<span class="this-page">{{ table.page.number }}</span>
|
|
|
|
{% if table.page.has_next %}
|
|
<a href="{% querystring table.prefixed_page_field=table.page.next_page_number %}">{{ table.page.next_page_number }}</a>
|
|
{% endif %}
|
|
{% if table.page.number != table.page.paginator.num_pages %}
|
|
{% if table.page.paginator.num_pages > 1 %}
|
|
{% if table.page.next_page_number != table.page.paginator.num_pages %}
|
|
...
|
|
<a href="{% querystring table.prefixed_page_field=table.page.paginator.num_pages %}">{{ table.page.paginator.num_pages }}</a>
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endif %}
|
|
</p>
|
|
{% endblock %}
|