From 5d135a20b22004bd1ede5f804852987238bc445e Mon Sep 17 00:00:00 2001 From: krantheman Date: Thu, 5 Feb 2026 12:45:23 +0700 Subject: [PATCH] fix: show search filter on portals and fix layout --- frappe/templates/includes/list/filters.html | 18 ++++++++++-------- frappe/templates/includes/list/list.html | 10 ++++++---- frappe/www/portal.py | 3 ++- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/frappe/templates/includes/list/filters.html b/frappe/templates/includes/list/filters.html index 8c364327d1..513403dfd9 100644 --- a/frappe/templates/includes/list/filters.html +++ b/frappe/templates/includes/list/filters.html @@ -1,22 +1,24 @@ -
+
{% if txt %} -
-
Results filtered by {{ txt }}. - ( × {{ _("clear") }} )
-
+
+ Results filtered by {{ txt }}. +
{% endif %}
diff --git a/frappe/templates/includes/list/list.html b/frappe/templates/includes/list/list.html index f3149023b4..0795101e75 100644 --- a/frappe/templates/includes/list/list.html +++ b/frappe/templates/includes/list/list.html @@ -1,7 +1,12 @@ {% if sub_title %}

{{ sub_title }}

{% endif %} -{% if not result -%} + +{% if (not hide_filters) and (result or txt) %} + {% include "templates/includes/list/filters.html" %} +{% endif %} + +{% if not result %}
@@ -11,9 +16,6 @@ {% else %}
- {% if result_heading_template %}{% include result_heading_template %}{% endif %}
diff --git a/frappe/www/portal.py b/frappe/www/portal.py index 2c858c6a82..610063cdc2 100644 --- a/frappe/www/portal.py +++ b/frappe/www/portal.py @@ -52,7 +52,7 @@ def get( list_context = frappe.flags.list_context if not raw_result: - return {"result": []} + return {"result": [], "txt": txt} if txt: list_context.default_subtitle = _('Filtered by "{0}"').format(txt) @@ -84,4 +84,5 @@ def get( "result": result, "show_more": show_more, "next_start": limit_start + limit, + "txt": txt, }