Tiny cleanup for site root page chooser (#7407)

* Pulling in _editor_js.html is unnecessary - the only JS dependency that isn't in form media is now modal_workflow.js. (So close to being able to ditch the template override entirely!)
* Omit the 'clear' button, as this is a required field.
pull/7413/head
Matt Westcott 2021-08-05 19:51:56 +01:00
rodzic ae14c8c718
commit 07402a545a
5 zmienionych plików z 8 dodań i 3 usunięć

Wyświetl plik

@ -11,6 +11,7 @@ Changelog
* Fix: Delete button is now correct colour on snippets and modeladmin listings (Brandon Murch)
* Fix: Ensure that StreamBlock / ListBlock-level validation errors are counted towards error counts (Matt Westcott)
* Fix: InlinePanel add button is now keyboard navigatable (Jesse Menn)
* Fix: Remove redundant 'clear' button from site root page chooser (Matt Westcott)
2.14 (02.08.2021)

Wyświetl plik

@ -26,6 +26,7 @@ Bug fixes
* Delete button is now correct colour on snippets and modeladmin listings (Brandon Murch)
* Ensure that StreamBlock / ListBlock-level validation errors are counted towards error counts (Matt Westcott)
* InlinePanel add button is now keyboard navigatable (Jesse Menn)
* Remove redundant 'clear' button from site root page chooser (Matt Westcott)
Upgrade considerations
======================

Wyświetl plik

@ -9,7 +9,8 @@ class SiteForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields['root_page'].widget = AdminPageChooser(
choose_one_text=_('Choose a root page'), choose_another_text=_('Choose a different root page')
choose_one_text=_('Choose a root page'), choose_another_text=_('Choose a different root page'),
show_clear_link=False
)
required_css_class = "required"

Wyświetl plik

@ -1,6 +1,7 @@
{% extends "wagtailadmin/generic/create.html" %}
{% load wagtailadmin_tags %}
{% block extra_js %}
{{ block.super }}
{% include "wagtailadmin/pages/_editor_js.html" %}
<script src="{% versioned_static 'wagtailadmin/js/modal-workflow.js' %}"></script>
{% endblock %}

Wyświetl plik

@ -1,6 +1,7 @@
{% extends "wagtailadmin/generic/edit.html" %}
{% load wagtailadmin_tags %}
{% block extra_js %}
{{ block.super }}
{% include "wagtailadmin/pages/_editor_js.html" %}
<script src="{% versioned_static 'wagtailadmin/js/modal-workflow.js' %}"></script>
{% endblock %}