diff --git a/templates/question_table_view.html b/templates/question_table_view.html index a3663b6a..885f7cf8 100644 --- a/templates/question_table_view.html +++ b/templates/question_table_view.html @@ -1,10 +1,7 @@ - {% extends app_name|add:'/base.html' %} {% load crispy_forms_tags %} {% load render_table from django_tables2 %} -{% block css %} -{% endblock %} {% block content %} @@ -39,45 +36,34 @@ - - - + +
- +
+ + {# show active filters count if available via GET params #} + {% comment %} Compute active filters count (excluding 'page') using supported template tags {% endcomment %} + {% with request.GET|length as param_count %} + {% if param_count > 0 %} + {% if request.GET.page %} + {% with param_count|add:"-1" as active_count %} + {# active_count may be a string; only show badge when not zero #} + {% if active_count != "0" %} + {{ active_count }} + {% endif %} + {% endwith %} + {% else %} + {{ param_count }} + {% endif %} + {% endif %} + {% endwith %} +
- +
@@ -89,28 +75,33 @@
- +
-
+
{% for field in filter.form.visible_fields %}
-
- {{ field.label_tag }} - {{ field }} +
+
+ {{ field.label_tag }} +
+
+ {{ field }} +
{% if field.errors %}
{{ field.errors|striptags }}
{% endif %} {% if field.help_text %} - {{ field.help_text }} +
{{ field.help_text }}
{% endif %}
{% endfor %}
-
- - Reset +
+ +  Reset +
@@ -118,4 +109,101 @@
-{% endblock %} \ No newline at end of file + + +{% endblock %} + \ No newline at end of file