summaryrefslogtreecommitdiff
path: root/templates/js.jinja
blob: 531c9e1a319b63e849cd79efcfa6a41c08ef3622 (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
{% set js_lib = {
    "kosten" : "js/kosten.js",
    "highstock" : "js/lib/highstock-4.2.2.js",
    "jquery" : "js/lib/jquery-1.11.2.min.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 %}