summaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorJelle van der Waa <jelle@archlinux.org>2019-03-17 18:08:39 +0100
committerJelle van der Waa <jelle@archlinux.org>2019-03-17 18:08:39 +0100
commit05f324c76c675857ea1cd8225c55075408beff33 (patch)
treec0dd4c67f124926871edeb52a9e4f623cd14de23 /main
parentf829a33ea72429382ba11a856fe6b6c8955002eb (diff)
downloadarchweb-05f324c76c675857ea1cd8225c55075408beff33.tar.gz
archweb-05f324c76c675857ea1cd8225c55075408beff33.zip
templates: Add tag for d3js
Create a simple tag for outputting the d3js <script> html so updating will be easier and the version has be changed in one file. Signed-off-by: Jelle van der Waa <jelle@archlinux.org>
Diffstat (limited to 'main')
-rw-r--r--main/templatetags/cdn.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/main/templatetags/cdn.py b/main/templatetags/cdn.py
index c0ce83d8..23c13314 100644
--- a/main/templatetags/cdn.py
+++ b/main/templatetags/cdn.py
@@ -21,4 +21,11 @@ def jquery_tablesorter():
link = staticfiles_storage.url(filename)
return format_html('<script type="text/javascript" src="%s"></script>' % link)
+@register.simple_tag
+def d3js():
+ version = '3.0.6'
+ filename = 'd3-%s.min.js' % version
+ link = staticfiles_storage.url(filename)
+ return format_html('<script type="text/javascript" src="%s"></script>' % link)
+
# vim: set ts=4 sw=4 et: