From a714de80389d8660fe9e7ff327d80558b2a29a6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lebleu?= Date: Mon, 4 Oct 2021 09:21:41 +0200 Subject: [PATCH] Use SVG icon instead of font icon in modeladmin index view - This uses the same classes and tags than 'wagtailadmin/shared/header.html' - constructs the
element and its children and blocks to that convention --- CHANGELOG.txt | 2 +- docs/releases/2.15.rst | 2 +- .../modeladmin/templates/modeladmin/index.html | 16 ++++++++++------ 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 6f71dcd039..f1f867d64b 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -40,7 +40,7 @@ Changelog * Added the ability to customise the pre-filled Image title on upload and it now defaults to the filename without the file extension (LB Johnston) * Add support for Python 3.10 (Matt Westcott) * Introduce, `autocomplete`, a separate method which performs partial matching on specific autocomplete fields. This is useful for suggesting pages to the user in real-time as they type their query. (Karl Hobley, Matt Westcott) - * Use SVG icons in StreamField buttons and headers (Jérôme Lebleu) + * Use SVG icons in modeladmin headers and StreamField buttons/headers (Jérôme Lebleu) * Add tags to existing Django registered checks (LB Johnston) * Upgrade admin frontend JS libraries jQuery to 3.6.0 and Modernizr to 2.8.3 (Fabien Le Frapper) * Fix: Delete button is now correct colour on snippets and modeladmin listings (Brandon Murch) diff --git a/docs/releases/2.15.rst b/docs/releases/2.15.rst index 50f8f6254f..85fe92f4e0 100644 --- a/docs/releases/2.15.rst +++ b/docs/releases/2.15.rst @@ -56,7 +56,7 @@ Other features * Added the ability to customise the pre-filled Image title on upload and it now defaults to the filename without the file extension (LB Johnston) * Add support for Python 3.10 (Matt Westcott) * Introduce, ``autocomplete``, a separate method which performs partial matching on specific autocomplete fields. This is useful for suggesting pages to the user in real-time as they type their query. (Karl Hobley, Matt Westcott) - * Use SVG icons in StreamField buttons and headers (Jérôme Lebleu) + * Use SVG icons in modeladmin headers and StreamField buttons/headers (Jérôme Lebleu) * Add tags to existing Django registered checks (LB Johnston) * Upgrade admin frontend JS libraries jQuery to 3.6.0 and Modernizr to 2.8.3 (Fabien Le Frapper) diff --git a/wagtail/contrib/modeladmin/templates/modeladmin/index.html b/wagtail/contrib/modeladmin/templates/modeladmin/index.html index 8a43c71c1a..a7650b7214 100644 --- a/wagtail/contrib/modeladmin/templates/modeladmin/index.html +++ b/wagtail/contrib/modeladmin/templates/modeladmin/index.html @@ -15,15 +15,18 @@ {% block content %} {% block header %} -
-
+
+ {% block breadcrumb %}{% endblock %} +
{% block h1 %} -

- {{ view.get_page_title }} - {% include 'modeladmin/includes/result_count.html' %} -

+

+ {% if view.header_icon %}{% icon name=view.header_icon class_name="header-title-icon" %}{% endif %} + {{ view.get_page_title }} + {% if view.get_page_subtitle %} {{ view.get_page_subtitle }} {% endif %} + {% include 'modeladmin/includes/result_count.html' %} +

{% endblock %}
{% block search %}{% search_form %}{% endblock %} @@ -47,6 +50,7 @@
{% endblock %}
+ {% block extra_rows %}{% endblock %}
{% endblock %}