root / snf-astakos-app / astakos / im / templates / im / table_render.html @ b7c802a2
History | View | Annotate | Download (4.4 kB)
1 |
{% spaceless %} |
---|---|
2 |
{% load django_tables2 %} |
3 |
{% load i18n %} |
4 |
{% if table.page %} |
5 |
<div class="table-container"> |
6 |
{% endif %} |
7 |
{% block table %} |
8 |
<table{% if %} {{ table.attrs.as_html }}{% endif %}> |
9 |
{% if table.caption %} |
10 |
<caption>{{ table.caption }}</caption> |
11 |
{% endif %} |
12 |
{% nospaceless %} |
13 |
{% block table.thead %} |
14 |
<thead>
|
15 |
<tr>
|
16 |
{% for column in table.columns %} |
17 |
{% if column.orderable %} |
18 |
<th {{ column.attrs.th.as_html }}><a href="{% querystring table.prefixed_order_by_field=column.order_by_alias.next %}#{{ table.attrs.id }}">{{ column.header }}</a></th> |
19 |
{% else %} |
20 |
<th {{ column.attrs.th.as_html }}>{{ column.header }}</th> |
21 |
{% endif %} |
22 |
{% endfor %} |
23 |
</tr>
|
24 |
</thead>
|
25 |
{% endblock table.thead %} |
26 |
{% block table.tbody %} |
27 |
<tbody>
|
28 |
{% for row in table.page.object_list|default:table.rows %} {# support pagination #} |
29 |
{% block table.tbody.row %} |
30 |
<tr class="{% cycle "odd" "even" %}"> |
31 |
{% for column, cell in row.items %} |
32 |
<td {{ column.attrs.td.as_html }}>{{ cell }}</td> |
33 |
{% endfor %} |
34 |
</tr>
|
35 |
{% endblock table.tbody.row %} |
36 |
{% empty %} |
37 |
{% if table.empty_text %} |
38 |
{% block table.tbody.empty_text %} |
39 |
<tr><td colspan="{{ table.columns|length }}">{{ table.empty_text }}</td></tr> |
40 |
{% endblock table.tbody.empty_text %} |
41 |
{% endif %} |
42 |
{% endfor %} |
43 |
</tbody>
|
44 |
{% endblock table.tbody %} |
45 |
{% block table.tfoot %} |
46 |
<tfoot></tfoot> |
47 |
{% endblock table.tfoot %} |
48 |
{% endnospaceless %} |
49 |
</table>
|
50 |
{% endblock table %} |
51 |
|
52 |
{% if table.page %} |
53 |
{% with table.page.paginator.count as total %} |
54 |
{% with table.page.object_list|length as count %} |
55 |
{% block pagination %} |
56 |
<div class="pagination clearfix"> |
57 |
<p class="next-prev"> |
58 |
{% if table.page.has_previous %} |
59 |
{% nospaceless %}{% block pagination.previous %}<a href="{% querystring table.prefixed_page_field=table.page.previous_page_number %}#{{ table.attrs.id }}"><{% trans "Previous" %}</a>{% endblock pagination.previous %}{% endnospaceless %} |
60 |
{% else %} |
61 |
<a href="" class="disabled">< {% trans "Previous" %}</a> |
62 |
{% endif %} |
63 |
|
64 |
{% if table.page.has_next %} |
65 |
{% nospaceless %}{% block pagination.next %}<a href="{% querystring table.prefixed_page_field=table.page.next_page_number %}#{{ table.attrs.id }}">{% trans "Next" %} ></a>{% endblock pagination.next %}{% endnospaceless %} |
66 |
{% else %} |
67 |
<a href="" class="disabled">{% trans "Next" %} ></a> |
68 |
{% endif %} |
69 |
|
70 |
</p>
|
71 |
<span class="num"> |
72 |
{% if table.page.has_previous or table.page.has_next %} |
73 |
{% nospaceless %}{% block pagination.current %} {% blocktrans with table.page.number as current and table.paginator.num_pages as total %}Page {{ current }} of {{ total }}{% endblocktrans %} {% endblock pagination.current %}{% endnospaceless %} |
74 |
{% endif %} |
75 |
{% comment %} |
76 |
( {% nospaceless %}{% block pagination.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 %}{% endblock pagination.cardinality %}{% endnospaceless %} ) |
77 |
{% endcomment %} |
78 |
|
79 |
|
80 |
</span>
|
81 |
</div>
|
82 |
|
83 |
|
84 |
<ul class="pagination"> |
85 |
{% comment %} |
86 |
{% if table.page.has_previous %} |
87 |
{% nospaceless %}{% block pagination.previous %}<li class="previous"><a href="{% querystring table.prefixed_page_field=table.page.previous_page_number %}#{{ table.attrs.id }}">{% trans "Previous" %}</a></li>{% endblock pagination.previous %}{% endnospaceless %} |
88 |
{% endif %} |
89 |
|
90 |
{% if table.page.has_previous or table.page.has_next %} |
91 |
{% 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 %} |
92 |
{% endif %} |
93 |
|
94 |
{% if table.page.has_next %} |
95 |
{% nospaceless %}{% block pagination.next %}<li class="next"><a href="{% querystring table.prefixed_page_field=table.page.next_page_number %}#{{ table.attrs.id }}">{% trans "Next" %}</a></li>{% endblock pagination.next %}{% endnospaceless %} |
96 |
{% endif %} |
97 |
{% endcomment %} |
98 |
|
99 |
</ul>
|
100 |
{% endblock pagination %} |
101 |
{% endwith %} |
102 |
{% endwith %} |
103 |
</div>
|
104 |
{% endif %} |
105 |
{% endspaceless %} |