diff --git a/asuzr/tables.py b/asuzr/tables.py index 9525ffc..cad42c0 100644 --- a/asuzr/tables.py +++ b/asuzr/tables.py @@ -132,4 +132,4 @@ class VisitTable(tables.Table): class Meta: attrs = {'class': 'paleblue'} - template = 'asuzr/table_templ.html' + template = 'asuzr/weekend_table.html' diff --git a/templates/asuzr/weekend_table.html b/templates/asuzr/weekend_table.html new file mode 100644 index 0000000..e3d4c5d --- /dev/null +++ b/templates/asuzr/weekend_table.html @@ -0,0 +1,77 @@ +{% spaceless %} +{% load django_tables2 %} +{% load i18n %} +{% if table.page %} +
+{% endif %} +{% block table %} + + {% nospaceless %} + {% block table.thead %} + + + {% for column in table.columns %} + {% if column.orderable %} + {{ column.header }} + {% else %} + {{ column.header }} + {% endif %} + {% endfor %} + + + {% endblock table.thead %} + {% block table.tbody %} + + {% for row in table.page.object_list|default:table.rows %} {# support pagination #} + {% block table.tbody.row %} + {% if row.date.is_weekend %} + {# avoid cycle for Django 1.2-1.6 compatibility #} + {% else %} + {# avoid cycle for Django 1.2-1.6 compatibility #} + {% endif %} + {% for column, cell in row.items %} + {% if column.localize == None %}{{ cell }}{% else %}{% if column.localize %}{{ cell|localize }}{% else %}{{ cell|unlocalize }}{% endif %}{% endif %} + {% endfor %} + + {% endblock table.tbody.row %} + {% empty %} + {% if table.empty_text %} + {% block table.tbody.empty_text %} + {{ table.empty_text }} + {% endblock table.tbody.empty_text %} + {% endif %} + {% endfor %} + + {% endblock table.tbody %} + {% block table.tfoot %} + + {% endblock table.tfoot %} + {% endnospaceless %} + +{% endblock table %} + +{% if table.page %} +{% with table.page.paginator.count as total %} +{% with table.page.object_list|length as count %} +{% block pagination %} + +{% endblock pagination %} +{% endwith %} +{% endwith %} +
+{% endif %} +{% endspaceless %}