aboutsummaryrefslogtreecommitdiffstats
path: root/templates/web/base/dashboard
diff options
context:
space:
mode:
Diffstat (limited to 'templates/web/base/dashboard')
-rw-r--r--templates/web/base/dashboard/heatmap-list.html8
-rwxr-xr-xtemplates/web/base/dashboard/heatmap.html10
-rw-r--r--templates/web/base/dashboard/index.html4
-rw-r--r--templates/web/base/dashboard/status.html68
4 files changed, 79 insertions, 11 deletions
diff --git a/templates/web/base/dashboard/heatmap-list.html b/templates/web/base/dashboard/heatmap-list.html
index d736a11f4..53720af35 100644
--- a/templates/web/base/dashboard/heatmap-list.html
+++ b/templates/web/base/dashboard/heatmap-list.html
@@ -1,12 +1,12 @@
-<h3>Five newest reports</h3>
+<h3>[% loc('Five newest reports') %]</h3>
[% INCLUDE column problems = five_newest %]
-<h3>Five most recent commented reports<br>
-<small>Not from yourself/backend</small>
+<h3>[% loc('Five most recent commented reports') %]<br>
+<small>[% loc('Not from yourself/backend') %]</small>
</h3>
[% INCLUDE column problems = five_commented %]
-<h3>Ten least recently updated open reports</h3>
+<h3>[% loc('Ten least recently updated open reports') %]</h3>
[% INCLUDE column problems = ten_oldest %]
[% BLOCK column %]
diff --git a/templates/web/base/dashboard/heatmap.html b/templates/web/base/dashboard/heatmap.html
index ca4d02926..42c601a4c 100755
--- a/templates/web/base/dashboard/heatmap.html
+++ b/templates/web/base/dashboard/heatmap.html
@@ -26,11 +26,11 @@
<input type="hidden" id="body" name="body" value="[% body.id | html %]">
<p class="report-list-filters" style='padding-top:0.25em'>
- From <input type="date" id="start_date" name="start_date" class="form-control" value="[% start_date | html %]">
- To <input type="date" id="end_date" name="end_date" class="form-control" value="[% end_date | html %]">
+ [% loc('From') %] <input type="date" id="start_date" name="start_date" class="form-control" value="[% start_date | html %]">
+ [% loc('To') %] <input type="date" id="end_date" name="end_date" class="form-control" value="[% end_date | html %]">
<p class="report-list-filters">
-In wards <select class="form-control js-multiple" multiple id="wards" name="wards">
+[% loc('In wards') %] <select class="form-control js-multiple" multiple id="wards" name="wards">
[% FOR child IN children.values.sort('name') %]
[% SET aid = child.id %]
<option value="[% child.name | html %]"[% ' selected' IF ward_hash.$aid %]>[% child.name %]</option>
@@ -41,9 +41,9 @@ In wards <select class="form-control js-multiple" multiple id="wards" name="ward
<p class="segmented-control segmented-control--radio">
<input type="radio" name="heatmap" id="heatmap_yes" value="Yes" checked>
- <label class="btn" for="heatmap_yes">Heatmap</label>
+ <label class="btn" for="heatmap_yes">[% loc('Heatmap') %]</label>
<input type="radio" name="heatmap" id="heatmap_no" value="No">
- <label class="btn" for="heatmap_no">Pin map</label>
+ <label class="btn" for="heatmap_no">[% loc('Pin map') %]</label>
</p>
<div id="js-reports-list">
diff --git a/templates/web/base/dashboard/index.html b/templates/web/base/dashboard/index.html
index 5ac414bde..6a3075c61 100644
--- a/templates/web/base/dashboard/index.html
+++ b/templates/web/base/dashboard/index.html
@@ -105,8 +105,8 @@
<li>[% INCLUDE gb new_gb='device+site' text=loc('Device and Site') %]</li>
<li class="pull-right">
<span>[% loc('Export as CSV') %]:</span>
- <a href="[% c.uri_with({ export => 1 }) %]">[% loc('Reports') %]</a>
- <a href="[% c.uri_with({ export => 1, updates => 1 }) %]">[% loc('Updates') %]</a>
+ <a href="[% c.uri_with({ export => 2 }) %]">[% loc('Reports') %]</a>
+ <a href="[% c.uri_with({ export => 2, updates => 1 }) %]">[% loc('Updates') %]</a>
</li>
</ul>
diff --git a/templates/web/base/dashboard/status.html b/templates/web/base/dashboard/status.html
new file mode 100644
index 000000000..734bb9ad3
--- /dev/null
+++ b/templates/web/base/dashboard/status.html
@@ -0,0 +1,68 @@
+[% USE date %]
+[% IF NOT c.get_param('ajax') %]
+[% INCLUDE 'header.html'
+ title = loc('Dashboard')
+ robots = 'noindex, nofollow'
+ bodyclass = 'fullwidthpage';
+%]
+
+[% 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 %]
+
+<p><a href="[% c.uri_for_action('dashboard/index') %]">[% loc('Back') %]</a></p>
+
+[% END %]
+
+<table id="overview" cellpadding=8 cellspacing=0>
+ <tr>
+ <th scope="col">[% loc('Created') %]</th>
+ <th scope="col">[% loc('CSV File') %]</th>
+ </tr>
+ [% in_progress = 0 %]
+ [% FOR file IN rows %]
+ <tr>
+ <td>[% date.format(file.ctime, format = '%Y-%m-%d %H:%M') %]</td>
+ <td>
+ [% IF file.finished %]
+ <a href="/dashboard/csv/[% file.name %]">[% file.name %]</a>
+ <br>[% file.size div 1024 %]KB
+ [% ELSE %]
+ [% file.name %]
+ <br>[% file.size div 1024 %]KB
+ <i>[% loc('In progress') %]</i>
+ [% in_progress = 1 %]
+ [% END %]
+ </td>
+ </tr>
+ [% END %]
+</table>
+
+[% IF NOT c.get_param('ajax') %]
+
+[% IF in_progress %]
+<script nonce="[% csp_nonce %]">
+(function() {
+ var wait = 1;
+ setTimeout(function refresh() {
+ $('#overview').load('[% c.uri_for_action('dashboard/status') %]?ajax=1', function() {
+ if ($(this).html().indexOf('<i>[% loc('In progress', "JS") %]</i>') === -1) {
+ return;
+ }
+ wait += 1;
+ if (wait > 10) {
+ wait = 10;
+ }
+ setTimeout(refresh, wait * 1000);
+ });
+ }, wait * 1000);
+})();
+</script>
+[% END %]
+
+[% INCLUDE 'footer.html' %]
+[% END %]