From 59e4cc1a2f12b92596ed52da3c9123cf979f4664 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ses=C3=B3stris=20Vieira?= Date: Thu, 14 Apr 2022 11:35:41 -0300 Subject: [PATCH] Filtro flutuante no changelist --- sigi/static/css/changelists.css | 22 +++++ sigi/templates/admin/change_list.html | 125 +++++++++++++------------- 2 files changed, 85 insertions(+), 62 deletions(-) create mode 100644 sigi/static/css/changelists.css diff --git a/sigi/static/css/changelists.css b/sigi/static/css/changelists.css new file mode 100644 index 0000000..e17816b --- /dev/null +++ b/sigi/static/css/changelists.css @@ -0,0 +1,22 @@ +.side-wrapper { + width: 100%; +} +#changelist { + width:100% +} + +.float-filter { + right: 0; + left: auto; + position: fixed; + width: 300px; + top: 0; + margin: 0; + height: calc(100% + 60px); + padding-bottom: 60px; + background-color: #fff; + z-index: 999; + overflow-y: auto; + will-change: transform; + backface-visibility: hidden; +} \ No newline at end of file diff --git a/sigi/templates/admin/change_list.html b/sigi/templates/admin/change_list.html index c7e446f..6a0cdca 100644 --- a/sigi/templates/admin/change_list.html +++ b/sigi/templates/admin/change_list.html @@ -4,73 +4,76 @@ {% block extrastyle %} {{ block.super }} - -{% endblock extrastyle %} + {% block date_hierarchy %}{% date_hierarchy cl %}{% endblock %} -{% block object-tools %} -
- - build - - -
-{% endblock %} -{% block side_wrapper %} -
-
-
- {% if action_form and actions_on_top and cl.show_admin_actions %}{% admin_actions %}{% endif %} -
-
- {% block search %}{% search_form cl %}{% endblock %} -
-
- {% block filters %} - {{ block.super }} - {% endblock %} + {% block result_list %} + {% result_list cl %} + {% if action_form and actions_on_bottom and cl.show_admin_actions %}{% admin_actions %}{% endif %} + {% endblock %} + {% block pagination %}{% pagination cl %}{% endblock %} + +
+ {% block side_wrapper %} +
+
+
+ {% if action_form and actions_on_top and cl.show_admin_actions %}{% admin_actions %}{% endif %} +
+
+ {% block search %}{% search_form cl %}{% endblock %} +
+
+ {% block filters %} + {{ block.super }} + {% endblock %} +
+ {% endblock %} +
{% endblock %} @@ -80,7 +83,6 @@ $(document).ready(function(){ $('.fixed-action-btn').floatingActionButton(); M.Tooltip.init($('.tooltipped'), {}); -// M.Sidenav.init($("#filter"), {edge: 'right'}); $('.float-filter').each(function() { var id=this.id; $(`[data-target="${id}"]`).on("click", function(e) { @@ -93,4 +95,3 @@ }); {% endblock footer %} -