From fbec6acf2a5139803610213f9a83f428ca2cc858 Mon Sep 17 00:00:00 2001 From: daveoconnor Date: Thu, 16 Jan 2025 13:55:46 -0800 Subject: [PATCH] Master develop icons (#1601) Co-authored-by: Rob Beeston --- libraries/templatetags/branch_url_tag.py | 10 ++++ templates/libraries/detail.html | 3 +- .../libraries/includes/dev_master_links.html | 58 +++++++++++++++++++ .../includes/library_preferences.html | 3 +- 4 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 libraries/templatetags/branch_url_tag.py create mode 100644 templates/libraries/includes/dev_master_links.html diff --git a/libraries/templatetags/branch_url_tag.py b/libraries/templatetags/branch_url_tag.py new file mode 100644 index 00000000..baf8e97d --- /dev/null +++ b/libraries/templatetags/branch_url_tag.py @@ -0,0 +1,10 @@ +from django import template +from django.urls import reverse + +register = template.Library() + + +@register.simple_tag() +def branch_url_tag(view: str, branch: str, kwargs: dict): + kwargs["version_slug"] = branch + return reverse(view, kwargs=kwargs) diff --git a/templates/libraries/detail.html b/templates/libraries/detail.html index aafd2c27..f4c9f76c 100644 --- a/templates/libraries/detail.html +++ b/templates/libraries/detail.html @@ -21,7 +21,8 @@ {{ object.display_name }} -
+
+ {% include "libraries/includes/dev_master_links.html" %} {% version_select %}
diff --git a/templates/libraries/includes/dev_master_links.html b/templates/libraries/includes/dev_master_links.html new file mode 100644 index 00000000..8111af5c --- /dev/null +++ b/templates/libraries/includes/dev_master_links.html @@ -0,0 +1,58 @@ +{% load branch_url_tag %} +
+
+
M
+ +
+
+
D
+ +
+
+ diff --git a/templates/libraries/includes/library_preferences.html b/templates/libraries/includes/library_preferences.html index db710036..93327f34 100644 --- a/templates/libraries/includes/library_preferences.html +++ b/templates/libraries/includes/library_preferences.html @@ -41,7 +41,8 @@ {# Select a version #} -
+
+ {% include "libraries/includes/dev_master_links.html" %} {% version_select %}