From de5f96afb8609e9ba65447d71bb4f9b2ac949014 Mon Sep 17 00:00:00 2001 From: Elijah Date: Wed, 22 Nov 2023 19:48:15 +0100 Subject: [PATCH] Added styling to the tables with new functionality so they resemble the existing tables --- idhub/templates/idhub/custom_table.html | 98 +++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 idhub/templates/idhub/custom_table.html diff --git a/idhub/templates/idhub/custom_table.html b/idhub/templates/idhub/custom_table.html new file mode 100644 index 0000000..2153191 --- /dev/null +++ b/idhub/templates/idhub/custom_table.html @@ -0,0 +1,98 @@ +{% load django_tables2 %} +{% load i18n %} +{% block table-wrapper %} +
+ {% block table %} + + {% block table.thead %} + {% if table.show_header %} + + + {% for column in table.columns %} + + {% endfor %} + + + {% endif %} + {% endblock table.thead %} + {% block table.tbody %} + + {% for row in table.paginated_rows %} + {% block table.tbody.row %} + + {% for column, cell in row.items %} + + {% endfor %} + + {% endblock table.tbody.row %} + {% empty %} + {% if table.empty_text %} + {% block table.tbody.empty_text %} + + {% endblock table.tbody.empty_text %} + {% endif %} + {% endfor %} + + {% endblock table.tbody %} + {% block table.tfoot %} + {% if table.has_footer %} + + + {% for column in table.columns %} + + {% endfor %} + + + {% endif %} + {% endblock table.tfoot %} +
+ {% if column.orderable %} + {{ column.header }} + {% else %} + {{ column.header }} + {% endif %} +
{% if column.localize == None %}{{ cell }}{% else %}{% if column.localize %}{{ cell|localize }}{% else %}{{ cell|unlocalize }}{% endif %}{% endif %}
{{ table.empty_text }}
{{ column.footer }}
+ {% endblock table %} + + {% block pagination %} + {% if table.page and table.paginator.num_pages > 1 %} + + {% endif %} + {% endblock pagination %} +
+{% endblock table-wrapper %}