blob: 5377fa93882b90f3ead6e8a111a53f1867b8e3d3 (
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
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
|
[% USE Number.Format %]
[% extra_css = BLOCK %]
<link rel="stylesheet" href="[% version('/cobrands/fixmystreet/dashboard.css') %]">
[% END %]
[%
INCLUDE 'header.html'
title = loc('Dashboard')
robots = 'noindex, nofollow'
bodyclass = 'fullwidthpage'
%]
<form>
[% IF body %]
<hgroup>
[% tprintf(loc('<h2>Reports, Statistics and Actions for</h2> <h1>%s</h1>'), body_name) %]
</hgroup>
[% ELSE %]
<h1>[% loc('Summary statistics') %]</h1>
[% END %]
<div class="filters">
[% IF body %]
<input type="hidden" name="body" value="[% body.id | html %]">
[% IF NOT c.user.area_id %]
<p>
<label for="ward">[% loc('Ward:') %]</label>
<select class="form-control" name="ward" id="ward"><option value=''>[% loc('All') %]</option>
[% FOR w IN children.values.sort('name') %]
<option value="[% w.id %]"[% ' selected' IF w.id == ward %]>[% w.name %]</option>
[% END %]
</select>
</p>
[% END %]
<p>
<label for="category">[% loc('Category:') %]</label>
<select class="form-control" name="category" id="category"><option value=''>[% loc('All') %]</option>
[% FOR cat IN contacts %]
<option value='[% cat.category | html %]'[% ' selected' IF category == cat.category %]>[% cat.category_display | html %]</option>
[% END %]
</select>
</p>
[% ELSE %]
<p>
<label for="ward">[% loc('Council:') %]</label>
<select class="form-control" name="body" id="body"><option value=''>[% loc('All') %]</option>
[% FOR b IN bodies %]
[% NEXT IF NOT b.area_count %]
<option value="[% b.id %]">[% b.name %]</option>
[% END %]
</select>
</p>
[% END %]
<p>
<label for="state">[% loc('Report state:') %]</label>
<select class="form-control" name="state" id="state">
<option value=''>[% loc('All') %]</option>
[% FOR group IN filter_states %]
[% FOR state IN group.1 %]
[% NEXT IF state == 'hidden' %]
<option [% 'selected ' IF state == q_state %] value="[% state %]">[% prettify_state(state, 1) %]</option>
[% END %]
[% END %]
</select>
</p>
<p>
<label for="start_date">[% loc('Start Date') %]</label>
<input name="start_date" id="start_date" type="date" value="[% start_date | html %]" class="form-control">
</p>
<p>
<label for="end_date">[% loc('End Date') %]</label>
<input name="end_date" id="end_date" type="date" value="[% end_date | html %]" class="form-control">
</p>
<p class="no-label">
<input type="submit" class="btn" value="[% loc('Look up') %]">
</p>
</div>
<input type="hidden" name="group_by" value="[% group_by | html %]">
</form>
[% BLOCK gb %]
[% IF group_by == new_gb %]
<strong title="[% tprintf(loc('Currently grouped by %s'), text) %]">[% text %]</strong>
[% ELSE %]
<a href="[% c.uri_with({ group_by => new_gb }) %]" title="[% tprintf(loc('Group by %s'), text) %]">[% text %]</a>
[% END %]
[% END %]
<ul class="dashboard-options-tabs">
<li role="presentation"><span>[% loc('Group by:') %]</span><li>
<li>[% INCLUDE gb new_gb='category' text=loc('Category') %]</li>
<li>[% INCLUDE gb new_gb='state' text=loc('State') %]</li>
<li>[% INCLUDE gb new_gb='month' text=loc('Month') %]</li>
<li>[% INCLUDE gb new_gb='category+state' text=loc('Category and State') %]</li>
<li>[% INCLUDE gb new_gb='device+site' text=loc('Device and Site') %]</li>
<li class="pull-right"><a href="[% c.uri_with({ export => 1 }) %]">[% loc('Export as CSV') %]</a></li>
</ul>
<table width="100%" id="overview">
<tr>
<th></th>
[% IF group_by == 'category+state' %]
<th scope="col">[% loc('Open') %]</th>
<th scope="col">[% loc('Closed') %]</th>
<th scope="col">[% loc('Fixed') %]</th>
<th scope="col">[% loc('Total') %]</th>
[% ELSE %]
[% FOR k2 IN columns.sort %]
<th scope="col">[% k2 or loc('Website') %]</td>
[% END %]
<th scope="col">[% loc('Total') %]</th>
[% END %]
</tr>
[% FOR k IN rows %]
<tr>
[% IF group_by == 'state' %]
<th scope="row">[% prettify_state(k) %]</th>
[% ELSE %]
<th scope="row">[% k %]</th>
[% END %]
[% IF group_by == 'category+state' %]
<td>[% grouped.$k.open OR 0 %]</td>
<td>[% grouped.$k.closed OR 0 %]</td>
<td>[% grouped.$k.fixed OR 0 %]</td>
<td>[% grouped.$k.total OR 0 %]</td>
[% ELSE %]
[% FOR k2 IN columns.sort %]
<td>[% grouped.$k.$k2 OR 0 %]</td>
[% END %]
<td>[% grouped.$k.total OR 0 %]</td>
[% END %]
</tr>
[% END %]
<tr class="subtotal">
<th scope="row">[% loc('Total') %]</th>
[% IF group_by == 'category+state' %]
<td>[% totals.open OR 0 %]</td>
<td>[% totals.closed OR 0 %]</td>
<td>[% totals.fixed OR 0 %]</td>
[% ELSE %]
[% FOR k2 IN columns.sort %]
<td>[% totals.$k2 OR 0 %]</td>
[% END %]
[% END %]
<td>[% totals.total OR 0 %]</td>
</tr>
</table>
<p>
[% loc('Within the specified timeframe:') %]
[%
summary_open = summary_open | format_number;
summary_closed = summary_closed | format_number;
summary_fixed = summary_fixed | format_number;
tprintf( loc('%s opened, %s closed, %s fixed'),
decode(summary_open), decode(summary_closed), decode(summary_fixed) ) %]
</p>
[% INCLUDE 'footer.html' %]
|