Skip to content

Commit

Permalink
Use SVG icon instead of font icon in modeladmin index view
Browse files Browse the repository at this point in the history
- This uses the same classes and tags than 'wagtailadmin/shared/header.html'
- constructs the <header> element and its children and blocks to that convention
  • Loading branch information
jeromelebleu authored and lb- committed Oct 10, 2021
1 parent 50f5550 commit a714de8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion docs/releases/2.15.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
16 changes: 10 additions & 6 deletions wagtail/contrib/modeladmin/templates/modeladmin/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,18 @@

{% block content %}
{% block header %}
<header class="nice-padding hasform">
<div class="row">
<header class="hasform">
{% block breadcrumb %}{% endblock %}
<div class="row nice-padding">
<div class="left header-left">
<div class="col header-title">
{% block h1 %}
<h1 {% if view.header_icon %}class="icon icon-{{ view.header_icon }}"{% endif %}>
{{ view.get_page_title }}
{% include 'modeladmin/includes/result_count.html' %}
</h1>
<h1>
{% if view.header_icon %}{% icon name=view.header_icon class_name="header-title-icon" %}{% endif %}
{{ view.get_page_title }}
{% if view.get_page_subtitle %} <span>{{ view.get_page_subtitle }}</span> {% endif %}
{% include 'modeladmin/includes/result_count.html' %}
</h1>
{% endblock %}
</div>
{% block search %}{% search_form %}{% endblock %}
Expand All @@ -47,6 +50,7 @@ <h1 {% if view.header_icon %}class="icon icon-{{ view.header_icon }}"{% endif %}
</div>
{% endblock %}
</div>
{% block extra_rows %}{% endblock %}
</header>
{% endblock %}

Expand Down

0 comments on commit a714de8

Please sign in to comment.