~xibo-maintainers/xibo/tempel

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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
{#
/*
 * Spring Signage Ltd - http://www.springsignage.com
 * Copyright (C) 2015 Spring Signage Ltd
 * (${FILE_NAME})
 */

#}
{% extends "authed.twig" %}
{% import "inline.twig" as inline %}

{% block pageContent %}
    <div class="row">
        <div class="col-lg-3 col-md-6 col-xs-12">
            <div class="widget">
                <div class="widget-body">
                    <div class="widget-icon orange pull-left">
                        <i class="fa fa-desktop"></i>
                    </div>
                    <div class="widget-content pull-left">
                        <div class="title">{{ displays|length }}</div>
                        <div class="comment">{% if displays|length == 1 %}{% trans "Display" %}{% else %}{% trans "Displays" %}{% endif %}</div>
                    </div>
                    <div class="clearfix"></div>
                </div>
            </div>
        </div>
        <div class="col-lg-3 col-md-6 col-xs-12">
            <div class="widget">
                <div class="widget-body">
                    <div class="widget-icon red pull-left">
                        <i class="fa fa-tasks"></i>
                    </div>
                    <div class="widget-content pull-left">
                        <div class="title">{{ librarySize }}</div>
                        <div class="comment">{% trans "Library Size" %}</div>
                    </div>
                    <div class="clearfix"></div>
                </div>
            </div>
        </div>
        <div class="col-lg-3 col-md-6 col-xs-12">
            <div class="widget">
                <div class="widget-body">
                    <div class="widget-icon green pull-left">
                        <i class="fa fa-users"></i>
                    </div>
                    <div class="widget-content pull-left">
                        <div class="title">{{ countUsers }}</div>
                        <div class="comment">{% if countUsers == 1 %}{% trans "User" %}{% else %}{% trans "Users" %}{% endif %}</div>
                    </div>
                    <div class="clearfix"></div>
                </div>
            </div>
        </div>
        <div class="col-lg-3 col-md-6 col-xs-12">
            <div class="widget">
                <div class="widget-body">
                    <div class="widget-icon blue pull-left">
                        <i class="fa fa-cogs"></i>
                    </div>
                    <div class="widget-content pull-left">
                        {% if embedded-widget != "" %}
                            {{ embedded-widget|raw }}
                        {% else %}
                            <div class="title">{{ nowShowing }}</div>
                            <div class="comment">{% trans "Now Showing" %}</div>
                        {% endif %}
                    </div>
                    <div class="clearfix"></div>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-lg-6">
            <div class="widget">
                <div class="widget-title">
                    <i class="fa fa-cloud-download"></i>
                    {% if xmdsLimit != "" %}
                        {% trans %}Bandwidth Usage. Limit {{ xmdsLimit }}{% endtrans %}
                    {% else %}
                        {% trans %}Bandwidth Usage ({{ bandwidthSuffix }}){% endtrans %}
                    {% endif %}
                    {% if currentUser.routeViewable("/stats") %}
                    <a class="pull-right" href="{{ urlFor("stats.view") }}">{% trans "More Statistics" %}</a>
                    {% endif %}
                    <div class="clearfix"></div>
                </div>
                <div class="widget-body medium no-padding">
                    <div id="bandwidthChart" class="morrisChart" style="width:99%; height: 230px;"></div>
                </div>
            </div>
        </div>
        <div class="col-lg-6">
            <div class="widget">
                <div class="widget-title">
                    <i class="fa fa-tasks"></i>
                    {% if libraryLimitSet != "" %}
                        {% trans %}Library Usage. Limit {{ libraryLimit }}{% endtrans %}
                    {% else %}
                        {% trans "Library Usage" %}
                    {% endif %}
                    <div class="clearfix"></div>
                </div>
                <div class="widget-body medium no-padding">
                    <div id="libraryChart" class="morrisChart" style="width:99%; height: 230px;"></div>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-lg-6">
            <div class="widget">
                <div class="widget-title">
                    <i class="fa fa-desktop"></i>
                    {% trans "Display Activity" %}
                    <div class="clearfix"></div>
                </div>
                <div class="widget-body medium no-padding">
                    <div class="table-responsive">
                        <table class="table">
                            <thead>
                            <tr>
                                <th>{% trans "Display" %}</th>
                                <th>{% trans "Logged In" %}</th>
                                <th>{% trans "Authorised" %}</th>
                            </tr>
                            </thead>
                            <tbody>
                            {% for row in displays %}
                                {% if row.mediaInventoryStatus == 1 %}
                                    {% set class = "success" %}
                                {% elseif row.mediaInventoryStatus == 2 %}
                                    {% set class = "danger" %}
                                {% else %}
                                    {% set class = "warning" %}
                                {% endif %}
                                <tr class="{{ class }}">
                                    <td>{{ row.display }}</td>
                                    <td><span class="glyphicon {% if row.loggedIn == 1 %}glyphicon-ok{% else %}glyphicon-remove{% endif %}"></span></td>
                                    <td><span class="glyphicon {% if row.licensed == 1 %}glyphicon-ok{% else %}glyphicon-remove{% endif %}"></span></td>
                                </tr>
                            {% endfor %}
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-lg-6">
            <div class="widget news-widget">
                <div class="widget-title">
                    <i class="fa fa-book"></i>
                    {% trans "Latest News" %}
                    <div class="clearfix"></div>
                </div>
                <div class="widget-body medium">
                    {% if latestNews|length > 0 %}
                        {% for news in latestNews %}
                            <div class="article">
                                <h4 class="article_title">{{ news.title }}</h4>
                                <p>{{ news.description|raw }} {% if news.link %}<a href="{{ news.link }}" title="Read" target="_blank">{% trans "Full Article" %}</a>.{% endif %}</p>
                            </div>
                        {% endfor %}
                    {% endif %}
                </div>
            </div>
        </div>
    </div>
{% endblock %}

{% block javaScript %}
    <script type="text/javascript">

        {% if xmdsLimitSet %}
            var yKeys = ['value','limit'];
            var labels = ['{% trans "Value" %}','{% trans "Remaining" %}'];
        {% else %}
            var yKeys = ['value'];
            var labels = ['{% trans "Value" %}'];
        {% endif %}

        var bandwidthChart = {
            type: 'bar',
            data: {
                element: 'bandwidthChart',
                data: {{ bandwidthWidget|raw }},
                xkey: 'label',
                ykeys: yKeys,
                labels: labels,
                stacked: {% if xmdsLimitSet %}true{% else %}false{% endif %}
        }
        };

        var libraryChart = {
            type: 'donut',
            data: {
                element: 'libraryChart',
                data: {{ libraryWidget|raw }},
                formatter: function (y, data) { return y + "{{ librarySuffix }}"; }
            }
        };
    </script>
{% endblock %}