Add WAGTAIL_SLIM_SIDEBAR = False setting to switch back to legacy sidebar

pull/7881/head
Thibaud Colas 2022-01-14 17:00:37 +00:00 zatwierdzone przez Matt Westcott
rodzic 18c4d7c813
commit 2e6378aa19
3 zmienionych plików z 11 dodań i 2 usunięć
docs/reference
wagtail/admin

Wyświetl plik

@ -217,6 +217,15 @@ If a user has not uploaded a profile picture, Wagtail will look for an avatar li
Changes whether the Submit for Moderation button is displayed in the action menu.
``WAGTAIL_SLIM_SIDEBAR``
------------------------
.. code-block:: python
WAGTAIL_SLIM_SIDEBAR = False
Disables Wagtails slim sidebar to use the legacy sidebar instead.
Comments
========

Wyświetl plik

@ -769,7 +769,7 @@ def locales():
@register.simple_tag()
def slim_sidebar_enabled():
return 'legacy-sidebar' not in getattr(settings, 'WAGTAIL_EXPERIMENTAL_FEATURES', [])
return getattr(settings, 'WAGTAIL_SLIM_SIDEBAR', True)
@register.simple_tag(takes_context=True)

Wyświetl plik

@ -32,7 +32,7 @@ class TestMenuRendering(TestCase, WagtailTestUtils):
response = self.client.get(reverse('wagtailadmin_home'))
self.assertContains(response, 'sidebar-collapsed')
@override_settings(WAGTAIL_EXPERIMENTAL_FEATURES={'legacy-sidebar'})
@override_settings(WAGTAIL_SLIM_SIDEBAR=False)
def test_not_collapsed_with_legacy(self):
'''Sidebar should only remember its collapsed state with the slim implementation.'''
# Sidebar should not be collapsed because the feature flag is not enabled