Support block `extra_actions` in generic and snippets index templates

- Closes #11275
pull/11262/head
DevilsAutumn 2023-11-26 22:02:51 +05:30 zatwierdzone przez LB (Ben Johnston)
rodzic 1c5c802f10
commit c3fd8ee84a
5 zmienionych plików z 13 dodań i 6 usunięć

Wyświetl plik

@ -12,6 +12,7 @@ Changelog
* Make use of `IndexView.get_add_url()` in snippets index view template (Christer Jensen, Sage Abdullah)
* Allow `Page.permissions_for_user()` to be overridden by specific page types (Sébastien Corbin)
* Improve visual alignment of explore icon in Page listings for longer content (Krzysztof Jeziorny)
* Add `extra_actions` blocks to Snippets and generic index templates (Bhuvnesh Sharma)
* Fix: Update system check for overwriting storage backends to recognise the `STORAGES` setting introduced in Django 4.2 (phijma-leukeleu)
* Fix: Prevent password change form from raising a validation error when browser autocomplete fills in the "Old password" field (Chiemezuo Akujobi)
* Fix: Ensure that the legacy dropdown options, when closed, do not get accidentally clicked by other interactions wide viewports (CheesyPhoenix, Christer Jensen)

Wyświetl plik

@ -771,6 +771,7 @@
* Cassidy Pittman
* Gunnar Scherf
* Mariana Bedran Lesche
* Bhuvnesh Sharma
## Translators

Wyświetl plik

@ -22,6 +22,7 @@ depth: 1
* Make use of `IndexView.get_add_url()` in snippets index view template (Christer Jensen, Sage Abdullah)
* Allow `Page.permissions_for_user()` to be overridden by specific page types (Sébastien Corbin)
* Improve visual alignment of explore icon in Page listings for longer content (Krzysztof Jeziorny)
* Add `extra_actions` blocks to Snippets and generic index templates (Bhuvnesh Sharma)
### Bug fixes

Wyświetl plik

@ -3,9 +3,11 @@
{% block main_header %}
{% fragment as extra_actions %}
{% if view.list_export %}
{% include view.export_buttons_template_name %}
{% endif %}
{% block extra_actions %}
{% if view.list_export %}
{% include view.export_buttons_template_name %}
{% endif %}
{% endblock %}
{% endfragment %}
{% include "wagtailadmin/shared/header.html" with title=page_title subtitle=page_subtitle action_url=header_action_url action_text=header_action_label action_icon=header_action_icon extra_actions=extra_actions icon=header_icon search_url=search_url search_form=search_form search_results_url=index_results_url only %}
{% endblock %}

Wyświetl plik

@ -17,9 +17,11 @@
{% fragment as action_url_add_snippet %}{% if can_add_snippet %}{{ add_url }}{% endif %}{% endfragment %}
{% fragment as action_text_snippet %}{% blocktrans trimmed with snippet_type_name=model_opts.verbose_name %}Add {{ snippet_type_name }}{% endblocktrans %}{% endfragment %}
{% fragment as extra_actions %}
{% if view.list_export %}
{% include view.export_buttons_template_name %}
{% endif %}
{% block extra_actions %}
{% if view.list_export %}
{% include view.export_buttons_template_name %}
{% endif %}
{% endblock %}
{% endfragment %}
{% include 'wagtailadmin/shared/header.html' with title=model_opts.verbose_name_plural|capfirst icon=header_icon search_url=search_url base_actions=base_action_locale action_url=action_url_add_snippet action_icon="plus" action_text=action_text_snippet extra_actions=extra_actions search_results_url=index_results_url %}
<div class="nice-padding{% if filters %} filterable{% endif %}">