From 0dd9bb02c51d368fa38229b42d76a2a8fcc9f8d8 Mon Sep 17 00:00:00 2001 From: Roger Souza Date: Wed, 17 Oct 2018 22:53:09 -0300 Subject: [PATCH] Add the filters form to a collapsible container --- core/templates/dataset-detail.html | 41 +++---------------------- core/templates/filters-form.html | 48 ++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 37 deletions(-) create mode 100644 core/templates/filters-form.html diff --git a/core/templates/dataset-detail.html b/core/templates/dataset-detail.html index cac0a428..b8dace4c 100644 --- a/core/templates/dataset-detail.html +++ b/core/templates/dataset-detail.html @@ -53,44 +53,10 @@

{{ dataset.name }}

-
-
-
Filtros
- -
-
- -
- - -
- - {% for field in fields %} - {% if field.frontend_filter %}{% with value=query_dict|getplainattribute:field|default:'' %} -
- - {% if field.has_choices %} - - {% else %} - - {% endif %} -
- {% endwith %}{% endif %} - {% endfor %} - -
-
- -
- -
+
+ {% include "filters-form.html" with fields=fields query_dict=query_dict %}
-
+

@@ -197,5 +163,6 @@

Filtros
"bInfo": false, }); }); + {% endblock %} diff --git a/core/templates/filters-form.html b/core/templates/filters-form.html new file mode 100644 index 00000000..f60c4a0a --- /dev/null +++ b/core/templates/filters-form.html @@ -0,0 +1,48 @@ +{% load utils %} + +
    +
  • +
    + filter_list + Filtros + keyboard_arrow_down +
    +
    + +
    +
    +
    + + +
    + {% for field in fields %} + {% if field.frontend_filter %}{% with value=query_dict|getplainattribute:field|default:'' %} +
    + + {% if field.has_choices %} + + {% else %} + + {% endif %} +
    + {% endwith %}{% endif %} + {% endfor %} +
    +
    + +
    +
    +
    +
  • +
+ + \ No newline at end of file