Răsfoiți Sursa

Link feature release links to corresponding pages in guide

Wagtail Guide will automatically redirect to `latest` if the specific release is not found
Tidiane 1 an în urmă
părinte
comite
65e693c6e8
3 a modificat fișierele cu 8 adăugiri și 0 ștergeri
  1. 1 0
      CHANGELOG.txt
  2. 1 0
      docs/releases/6.0.md
  3. 6 0
      wagtail/templatetags/wagtailcore_tags.py

+ 1 - 0
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)

+ 1 - 0
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

+ 6 - 0
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/"