From 6b261760f47d5db585cde0766736c4667dd099dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Pinto?= Date: Thu, 6 Nov 2025 13:48:33 +0000 Subject: [PATCH 1/2] feat: improves theme navigation --- surface/surfapp/templates/admin/base.html | 17 -------- .../surfapp/templates/admin/change_list.html | 20 ---------- .../templates/unfold/helpers/header.html | 37 +++++++++++------- .../unfold/helpers/header_title.html | 25 ++++++++++++ .../templates/unfold/helpers/welcomemsg.html | 39 ------------------- 5 files changed, 47 insertions(+), 91 deletions(-) create mode 100644 surface/surfapp/templates/unfold/helpers/header_title.html delete mode 100644 surface/surfapp/templates/unfold/helpers/welcomemsg.html diff --git a/surface/surfapp/templates/admin/base.html b/surface/surfapp/templates/admin/base.html index e98d87dd..dc4bad54 100644 --- a/surface/surfapp/templates/admin/base.html +++ b/surface/surfapp/templates/admin/base.html @@ -13,23 +13,6 @@
{% include "unfold/helpers/header.html" %} - {% if not is_popup %} - {% spaceless %} - {% block breadcrumbs %} -
-
-
    - {% url 'admin:index' as link %} - {% trans 'Home' as name %} - {% include 'unfold/helpers/breadcrumb_item.html' with link=link name=name %} - {% block custom_breadcrumbs %}{% endblock %} -
-
-
- {% endblock %} - {% endspaceless %} - {% endif %} - {% block messages %}
diff --git a/surface/surfapp/templates/admin/change_list.html b/surface/surfapp/templates/admin/change_list.html index aa3d1c2a..c1bc6dee 100644 --- a/surface/surfapp/templates/admin/change_list.html +++ b/surface/surfapp/templates/admin/change_list.html @@ -28,26 +28,6 @@ {% block bodyclass %}{{ block.super }} app-{{ opts.app_label }} model-{{ opts.model_name }} change-list{% endblock %} -{% if not is_popup %} - {% block breadcrumbs %} -
-
-
    - {% url 'admin:index' as link %} - {% trans 'Home' as name %} - {% include 'unfold/helpers/breadcrumb_item.html' with link=link name=name %} - - {% url 'admin:app_list' app_label=cl.opts.app_label as link %} - {% include 'unfold/helpers/breadcrumb_item.html' with link=link name=cl.opts.app_config.verbose_name %} - - {% url opts|admin_urlname:'changelist' as link %} - {% include 'unfold/helpers/breadcrumb_item.html' with link=link name=cl.opts.verbose_name_plural|capfirst no_separator=True %} -
-
-
- {% endblock %} -{% endif %} - {% block coltype %}{% endblock %} {% block nav-global-side %} diff --git a/surface/surfapp/templates/unfold/helpers/header.html b/surface/surfapp/templates/unfold/helpers/header.html index b61097d7..7373d491 100644 --- a/surface/surfapp/templates/unfold/helpers/header.html +++ b/surface/surfapp/templates/unfold/helpers/header.html @@ -1,25 +1,32 @@ {% load unfold %} {% if not is_popup %} {% block header %} -
+
-
-
- {% block usertools %} - {% if has_permission %} - {% block welcome-msg %} - {% include 'unfold/helpers/welcomemsg.html' %} +
+ {% block usertools %} + {% if has_permission %} + {% block welcome-msg %} + {% include 'unfold/helpers/welcomemsg.html' %} + {% endblock %} + {% if request.resolver_match.url_name == 'index' %} + {% block search %} +
+
+
+ + {% component "unfold/components/button.html" with type="submit" class="text-s font-semibold" %}Search{% endcomponent %} +
+
+
{% endblock %} - {% component "unfold/components/navigation.html" with items=navigation %}{% endcomponent %} {% endif %} - {% endblock %} -
-
- {% block userlinks %} - {% include 'unfold/helpers/userlinks.html' %} - {% endblock %} -
+ {% block userlinks %} + {% include 'unfold/helpers/userlinks.html' %} + {% endblock %} + {% endif %} + {% endblock %}
diff --git a/surface/surfapp/templates/unfold/helpers/header_title.html b/surface/surfapp/templates/unfold/helpers/header_title.html new file mode 100644 index 00000000..a38a3883 --- /dev/null +++ b/surface/surfapp/templates/unfold/helpers/header_title.html @@ -0,0 +1,25 @@ +{% load i18n admin_urls %} +{% spaceless %} + {% url 'admin:index' as admin_index_url %} + {% if not request or request.path != admin_index_url %} + + {% translate "Home" %} + + + {% if parts %} + chevron_right + {% endif %} + {% endif %} + + {% if parts %} + {% for part in parts %} + <{% if part.link %}a href="{{ part.link }}"{% else %}span{% endif %} class="align-middle inline-block leading-5 tracking-tight"> + {{ part.title|capfirst }} + + + {% if not forloop.last %} + chevron_right + {% endif %} + {% endfor %} + {% endif %} +{% endspaceless %} \ No newline at end of file diff --git a/surface/surfapp/templates/unfold/helpers/welcomemsg.html b/surface/surfapp/templates/unfold/helpers/welcomemsg.html deleted file mode 100644 index e864514d..00000000 --- a/surface/surfapp/templates/unfold/helpers/welcomemsg.html +++ /dev/null @@ -1,39 +0,0 @@ -{% load unfold i18n %} - -
- {% if is_nav_sidebar_enabled %} - - - dock_to_right - - - - dock_to_right - - - {% endif %} - - - - {% include "unfold/helpers/header_back_button.html" %} - -

- {% if content_title %} - - {{ pretitle }} - - {{ content_title }} - - - {% if cl and cl.full_result_count != cl.result_count and cl.paginator|class_name != "InfinitePaginator" %} - - {% blocktranslate count counter=cl.result_count %}{{ counter }} result{% plural %}{{ counter }} results{% endblocktranslate %} ({% if cl.show_full_result_count %}{% blocktranslate with full_result_count=cl.full_result_count %}{{ full_result_count }} total{% endblocktranslate %}{% else %}{% translate "Show all" %}{% endif %}) - - {% endif %} - - {% if content_subtitle %} - {{ content_subtitle }} - {% endif %} - {% endif %} -

-
\ No newline at end of file From 85544d29385934d2f4f2c6ad6a2d269a6e313534 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Pinto?= Date: Thu, 6 Nov 2025 13:51:54 +0000 Subject: [PATCH 2/2] rm header --- .../templates/unfold/helpers/header.html | 35 ------------------- 1 file changed, 35 deletions(-) delete mode 100644 surface/surfapp/templates/unfold/helpers/header.html diff --git a/surface/surfapp/templates/unfold/helpers/header.html b/surface/surfapp/templates/unfold/helpers/header.html deleted file mode 100644 index 7373d491..00000000 --- a/surface/surfapp/templates/unfold/helpers/header.html +++ /dev/null @@ -1,35 +0,0 @@ -{% load unfold %} -{% if not is_popup %} - {% block header %} -
-
-
-
- {% block usertools %} - {% if has_permission %} - {% block welcome-msg %} - {% include 'unfold/helpers/welcomemsg.html' %} - {% endblock %} - {% if request.resolver_match.url_name == 'index' %} - {% block search %} -
-
-
- - {% component "unfold/components/button.html" with type="submit" class="text-s font-semibold" %}Search{% endcomponent %} -
-
-
- {% endblock %} - {% endif %} - {% block userlinks %} - {% include 'unfold/helpers/userlinks.html' %} - {% endblock %} - {% endif %} - {% endblock %} -
-
-
-
- {% endblock %} -{% endif %} \ No newline at end of file