From 65e693c6e81b0ef1475d15584182f59002909a5a Mon Sep 17 00:00:00 2001 From: Tidiane Date: Fri, 3 Nov 2023 10:42:17 +0000 Subject: [PATCH] Link feature release links to corresponding pages in guide Wagtail Guide will automatically redirect to `latest` if the specific release is not found --- CHANGELOG.txt | 1 + docs/releases/6.0.md | 1 + wagtail/templatetags/wagtailcore_tags.py | 6 ++++++ 3 files changed, 8 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 9ddb1b4f2e..f72d7e5069 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -52,6 +52,7 @@ Changelog * Add support for `caption` on admin UI Table component (Aman Pandey) * Add API support for a redirects (contrib) endpoint (Rohit Sharma, Jaap Roes, Andreas Donig) * Add the default ability for all `SnippetViewSet` & `ModelViewSet` to support being copied (Shlomo Markowitz) + * Support dynamic Wagtail guide links in the admin that are based on the running version of Wagtail (Tidiane Dia) * 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) diff --git a/docs/releases/6.0.md b/docs/releases/6.0.md index e0690ea932..a986deb67e 100644 --- a/docs/releases/6.0.md +++ b/docs/releases/6.0.md @@ -84,6 +84,7 @@ This feature was implemented by Nick Lee, Thibaud Colas, and Sage Abdullah. * Add support for `caption` on admin UI Table component (Aman Pandey) * Add API support for a [redirects (contrib)](redirects_api_endpoint) endpoint (Rohit Sharma, Jaap Roes, Andreas Donig) * Add the default ability for all `SnippetViewSet` & `ModelViewSet` to support [being copied](modelviewset_copy), this can be disabled by `copy_view_enabled = False` (Shlomo Markowitz) + * Support dynamic Wagtail guide links in the admin that are based on the running version of Wagtail (Tidiane Dia) ### Bug fixes diff --git a/wagtail/templatetags/wagtailcore_tags.py b/wagtail/templatetags/wagtailcore_tags.py index 2deb0a3f8b..8bf37965c0 100644 --- a/wagtail/templatetags/wagtailcore_tags.py +++ b/wagtail/templatetags/wagtailcore_tags.py @@ -98,11 +98,17 @@ def wagtail_release_notes_path(): @register.simple_tag def wagtail_feature_release_whats_new_link(): + major, minor, patch, release, num = VERSION + if release == "final": + return f"https://guide.wagtail.org/en-{major}.{minor}.x/releases/new-in-wagtail-{major}-{minor}/" return "https://guide.wagtail.org/en-latest/releases/latest/" @register.simple_tag def wagtail_feature_release_editor_guide_link(): + major, minor, patch, release, num = VERSION + if release == "final": + return f"https://guide.wagtail.org/en-{major}.{minor}.x/" return "https://guide.wagtail.org/"