2017-05-16 16:19:55 -04:00
|
|
|
{% load django_tables2 %}
|
|
|
|
|
2021-10-14 13:44:54 -04:00
|
|
|
<div class="table-responsive">
|
|
|
|
<table{% if table.attrs %} {{ table.attrs.as_html }}{% endif %}>
|
2017-05-16 16:19:55 -04:00
|
|
|
{% if table.show_header %}
|
2021-10-14 13:44:54 -04:00
|
|
|
<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 %}
|
|
|
|
</tr>
|
|
|
|
</thead>
|
2017-05-16 16:19:55 -04:00
|
|
|
{% endif %}
|
|
|
|
<tbody>
|
2021-10-14 13:44:54 -04:00
|
|
|
{% for row in table.page.object_list|default:table.rows %}
|
|
|
|
<tr {{ row.attrs.as_html }}>
|
|
|
|
{% for column, cell in row.items %}
|
|
|
|
<td {{ column.attrs.td.as_html }}>{{ cell }}</td>
|
|
|
|
{% endfor %}
|
|
|
|
</tr>
|
|
|
|
{% empty %}
|
|
|
|
{% if table.empty_text %}
|
|
|
|
<tr>
|
|
|
|
<td colspan="{{ table.columns|length }}" class="text-center text-muted">— {{ table.empty_text }} —</td>
|
|
|
|
</tr>
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
2017-05-16 16:19:55 -04:00
|
|
|
</tbody>
|
|
|
|
{% if table.has_footer %}
|
2021-10-14 13:44:54 -04:00
|
|
|
<tfoot>
|
|
|
|
<tr>
|
|
|
|
{% for column in table.columns %}
|
|
|
|
<td>{{ column.footer }}</td>
|
|
|
|
{% endfor %}
|
|
|
|
</tr>
|
|
|
|
</tfoot>
|
2017-05-16 16:19:55 -04:00
|
|
|
{% endif %}
|
2021-10-14 13:44:54 -04:00
|
|
|
</table>
|
|
|
|
</div>
|