summaryrefslogtreecommitdiffstats
path: root/admin_tools/dashboard/templates/admin_tools/dashboard/dashboard.html
blob: 88831ae801d2f3306191053730a77358a83e0217 (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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
{% load i18n admin_tools_dashboard_tags %}

{% block dashboard_scripts %}
<script type="text/javascript" src="{{ media_url }}/admin_tools/js/utils.js"></script>

<script type="text/javascript" charset="utf-8">
    // Load js files syncronously and conditionally

    var js_files = [
        {
            src : '{{ media_url }}/admin_tools/js/jquery/jquery.min.js',
            test: function() { return typeof(jQuery) == 'undefined'; }
        },
        {
            src : '{{ media_url }}/admin_tools/js/jquery/jquery-ui.min.js',
            test: function() { return typeof(jQuery.ui) == 'undefined'; }
        },
        {
            src : '{{ media_url }}/admin_tools/js/json.min.js',
            test: function() { return typeof(JSON.stringify) == 'undefined'; }
        },
        {
            src : '{{ media_url }}/admin_tools/js/jquery/jquery.cookie.min.js',
            test: function() { return typeof(jQuery.cookie) == 'undefined'; }
        },
        {
            src : '{{ media_url }}/admin_tools/js/jquery/jquery.dashboard.js',
            test: function() { return true; }
        },
        {
            src : '{{ media_url }}/admin_tools/js/dashboard.js',
            test: function() { return true; }
        }{% for js in dashboard.Media.js %},
        {
            src : '{{ media_url }}/{{ js }}',
            test: function() { return true; }
        }{% endfor %}
    ];

    loadScripts(js_files, function(){
        jQuery(function($) {
            init_dashboard(
                '{{ dashboard.get_id }}',
                {{ dashboard.columns }},
                {% autoescape off %}{{ dashboard_preferences }}{% endautoescape %},
                '{% url 'admin-tools-dashboard-set-preferences' dashboard.get_id %}'
            );
        });
    });
</script>
{% endblock %}

{% block dashboard_title %}
{% if dashboard.title %}
<h1 class="dashboard-title">{{ dashboard.title }}</h1>
{% endif %}
{% endblock %}

{% block dashboard_panel %}
<div id="dashboard-panel">
    <h3><a href="#">{% trans "Modules" %}</a></h3>
    {% if has_disabled_modules %}
    <ul>
        {% spaceless %}
        {% for module in dashboard.children %}
        {% if not module.enabled %}
        <li><a href="#" rel="module_{{ module.id }}" class="addlink add-dashboard-module">{{ module.title }}</a></li>
        {% endif %}
        {% endfor %}
        {% endspaceless %}
    </ul>
    {% endif %}
</div>
{% endblock %}

{% block dashboard_container %}
<div id="{{ dashboard.get_id }}" class="dashboard-container">
    {% for module in dashboard.children %}
{% admin_tools_render_dashboard_module module %}{% endfor %}
</div>
{% endblock %}