summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2013-12-22 21:47:41 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2013-12-22 21:47:41 -0500
commit6d352bc62361edd4ce15189e31fccff5f0eb5e9a (patch)
treeaa84f7b59a48d7ce5cd644756b11a4b1d5f10dbf
parentbad36ff78ead3ad4868227f8120a9ef0cefd1365 (diff)
Pull the bug link generation into a templatetag
-rw-r--r--README.BRANDING1
-rw-r--r--main/templatetags/bugs.py6
-rw-r--r--templates/mirrors/mirror_details.html2
3 files changed, 8 insertions, 1 deletions
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 "<a href=\"https://bugs.archlinux.org/task/"+bugid+"\">FS#"+bugid+"</a>"
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 @@
</tr>
<tr>
<th>Flyspray Issue:</th>
- <td>{% if mirror.bug %}<a href="https://bugs.archlinux.org/task/{{ mirror.bug }}">FS#{{ mirror.bug }}</a>{% endif %}</td>
+ <td>{% if mirror.bug %}{% bug_link mirror.bug %}{% endif %}</td>
</tr>
<tr>
<th>Notes:</th>