From 1fdd01e827537d20b1f98af1cd37ccaaeacc88d1 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Sun, 1 Feb 2026 04:39:18 +0000 Subject: [PATCH] Fix Admin Search: Override search_form template for compact inline layout --- core/templates/admin/search_form.html | 18 +++++++++++++++++ static/css/custom.css | 28 +++++++-------------------- staticfiles/css/custom.css | 28 +++++++-------------------- 3 files changed, 32 insertions(+), 42 deletions(-) create mode 100644 core/templates/admin/search_form.html diff --git a/core/templates/admin/search_form.html b/core/templates/admin/search_form.html new file mode 100644 index 0000000..a4f78b5 --- /dev/null +++ b/core/templates/admin/search_form.html @@ -0,0 +1,18 @@ +{% load i18n static %} +{% if cl.search_fields %} +
+ +
+{% endif %} diff --git a/static/css/custom.css b/static/css/custom.css index b3c7f4b..263cf93 100644 --- a/static/css/custom.css +++ b/static/css/custom.css @@ -179,37 +179,23 @@ body.model-platformprofile label[for="id_admin_panel_logo"] { border-bottom: 1px solid #f0f0f0; } -/* --- Fix Admin Search Box Layout --- */ +/* --- Fix Admin Search Box Layout (Backup for overridden template) --- */ /* Target the search form container in Jazzmin/AdminLTE */ -#changelist-search, -#changelist-search .form-group, #changelist-search .input-group { display: flex !important; - align-items: center !important; - flex-wrap: nowrap !important; /* Prevent wrapping */ - max-width: 400px !important; /* Reduce the overall width */ + flex-wrap: nowrap !important; + max-width: 300px !important; } -/* Make the input field take available space but respect the container width */ +/* Make the input field take available space */ #changelist-search input[type="text"] { - width: auto !important; flex-grow: 1 !important; - margin-right: 8px !important; /* Space between input and button */ + width: auto !important; } -/* Fix for RTL */ -[dir="rtl"] #changelist-search input[type="text"] { - margin-right: 0 !important; - margin-left: 8px !important; -} - -/* Ensure the button stays inline and overrides any block behavior */ +/* Ensure the button stays inline */ #changelist-search button[type="submit"], #changelist-search .btn { - margin-top: 0 !important; - margin-bottom: 0 !important; white-space: nowrap !important; - width: auto !important; - height: auto !important; -} \ No newline at end of file +} diff --git a/staticfiles/css/custom.css b/staticfiles/css/custom.css index b3c7f4b..263cf93 100644 --- a/staticfiles/css/custom.css +++ b/staticfiles/css/custom.css @@ -179,37 +179,23 @@ body.model-platformprofile label[for="id_admin_panel_logo"] { border-bottom: 1px solid #f0f0f0; } -/* --- Fix Admin Search Box Layout --- */ +/* --- Fix Admin Search Box Layout (Backup for overridden template) --- */ /* Target the search form container in Jazzmin/AdminLTE */ -#changelist-search, -#changelist-search .form-group, #changelist-search .input-group { display: flex !important; - align-items: center !important; - flex-wrap: nowrap !important; /* Prevent wrapping */ - max-width: 400px !important; /* Reduce the overall width */ + flex-wrap: nowrap !important; + max-width: 300px !important; } -/* Make the input field take available space but respect the container width */ +/* Make the input field take available space */ #changelist-search input[type="text"] { - width: auto !important; flex-grow: 1 !important; - margin-right: 8px !important; /* Space between input and button */ + width: auto !important; } -/* Fix for RTL */ -[dir="rtl"] #changelist-search input[type="text"] { - margin-right: 0 !important; - margin-left: 8px !important; -} - -/* Ensure the button stays inline and overrides any block behavior */ +/* Ensure the button stays inline */ #changelist-search button[type="submit"], #changelist-search .btn { - margin-top: 0 !important; - margin-bottom: 0 !important; white-space: nowrap !important; - width: auto !important; - height: auto !important; -} \ No newline at end of file +}