summaryrefslogtreecommitdiff
path: root/templates/js.jinja
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--templates/js.jinja26
1 files changed, 26 insertions, 0 deletions
diff --git a/templates/js.jinja b/templates/js.jinja
new file mode 100644
index 0000000..db26182
--- /dev/null
+++ b/templates/js.jinja
@@ -0,0 +1,26 @@
+{% set js_lib = {
+ "kosten" : "js/kosten.js",
+ "highstock" : "js/highstock-4.2.2.js",
+ "jquery" : "js/jquery-1.11.2.min.js",
+ "jqueryui" : "jqueryui/jquery-ui.js"
+ }
+%}
+
+{% macro script(name) %}
+ {% if name in js_lib %}
+ <script type="text/javascript" src="{{ js_lib[name] | static_url }}"></script>
+ {% endif %}
+{% endmacro %}
+
+{% macro scripts(names) %}
+ {% if names is not string %}
+ {% for name in names %}
+ {{ script(name) }}
+ {% endfor %}
+ {% else %}
+ {{ script(names) }}
+ {% for name in varargs %}
+ {{ script(name) }}
+ {% endfor %}
+ {% endif %}
+{% endmacro %}