From 707503b49d383e81272016b15f00ae0c51f5f2c7 Mon Sep 17 00:00:00 2001 From: "Mustafa M. A. U. AbuGhazy" Date: Tue, 8 Mar 2022 17:52:47 +0200 Subject: [PATCH] add a body class list-filter-sticky --- .../admin_interface/css/form-controls.css | 15 ++++++++++++++ .../templates/admin/base_site.html | 20 +------------------ 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/admin_interface/static/admin_interface/css/form-controls.css b/admin_interface/static/admin_interface/css/form-controls.css index 500b52a..c0610af 100644 --- a/admin_interface/static/admin_interface/css/form-controls.css +++ b/admin_interface/static/admin_interface/css/form-controls.css @@ -31,6 +31,21 @@ padding-left: 30px; padding-right: 30px; } + + /* list-filter sticky */ + .admin-interface.list-filter-sticky .module.filtered #changelist-filter { + position: sticky; + top: 40px; + float: right; + z-index: 30; + } + + /* feature not available for django < 3.1.2 */ + .admin-interface.list-filter-sticky .module.filtered #toolbar + #changelist-filter { + position: absolute; + top: 0px; + z-index: 30; + } } @media (min-width:1024px) { diff --git a/admin_interface/templates/admin/base_site.html b/admin_interface/templates/admin/base_site.html index 025f00b..ebb2263 100644 --- a/admin_interface/templates/admin/base_site.html +++ b/admin_interface/templates/admin/base_site.html @@ -66,25 +66,6 @@ --admin-interface-related-modal-close-button-display: none; {% endif %} } - - /* list-filter sticky */ - {% if theme.list_filter_sticky %} - @media (min-width: 768px) { - .admin-interface .module.filtered #changelist-filter { - position: sticky; - top: 40px; - float: right; - z-index: 30; - } - - /* feature not available for django < 3.1.2 */ - .admin-interface .module.filtered #toolbar + #changelist-filter { - position: absolute; - top: 0px; - z-index: 30; - } - } - {% endif %} @@ -144,6 +125,7 @@ flat-theme admin-interface {% if theme.foldable_apps %} foldable-apps {% endif %} {% if theme.form_submit_sticky %} sticky-submit {% endif %} {% if theme.form_pagination_sticky %} sticky-pagination {% endif %} +{% if theme.list_filter_sticky %} list-filter-sticky {% endif %} {% endblock %} {% block branding %}