summaryrefslogtreecommitdiff
path: root/templates/js.jinja
blob: 1590679a0d6da0af3ae16687946baa8416d6bb36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{% set js_lib = {
    "kosten" : "js/kosten.js",
    "highstock" : "js/lib/highstock-4.2.2.js",
    "jquery" : "js/lib/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 %}