From 6d352bc62361edd4ce15189e31fccff5f0eb5e9a Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 22 Dec 2013 21:47:41 -0500 Subject: Pull the bug link generation into a templatetag --- README.BRANDING | 1 + main/templatetags/bugs.py | 6 ++++++ templates/mirrors/mirror_details.html | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 main/templatetags/bugs.py diff --git a/README.BRANDING b/README.BRANDING index a3855f77..e75eaeb9 100644 --- a/README.BRANDING +++ b/README.BRANDING @@ -9,6 +9,7 @@ Files used to configure branding/url stuff * `settings.py` * `templates/templatetags/package_extras.py` * `main/templatetags/wiki.py` + * `main/templatetags/bugs.py` Files with minor Arch stuff that's just easier to patch ------------------------------------------------------- diff --git a/main/templatetags/bugs.py b/main/templatetags/bugs.py new file mode 100644 index 00000000..d5764435 --- /dev/null +++ b/main/templatetags/bugs.py @@ -0,0 +1,6 @@ +from django import template +register = template.Library() + +@register.simple_tag +def bug_link(bugid): + return "FS#"+bugid+"" diff --git a/templates/mirrors/mirror_details.html b/templates/mirrors/mirror_details.html index a6abcb5e..09e24925 100644 --- a/templates/mirrors/mirror_details.html +++ b/templates/mirrors/mirror_details.html @@ -55,7 +55,7 @@ Flyspray Issue: - {% if mirror.bug %}FS#{{ mirror.bug }}{% endif %} + {% if mirror.bug %}{% bug_link mirror.bug %}{% endif %} Notes: -- cgit v1.2.3-2-g168b