diff options
Diffstat (limited to 'templates/web/base')
-rw-r--r-- | templates/web/base/admin/stats/index.html | 9 | ||||
-rw-r--r-- | templates/web/base/dashboard/heatmap-list.html | 28 | ||||
-rwxr-xr-x | templates/web/base/dashboard/heatmap.html | 55 | ||||
-rw-r--r-- | templates/web/base/reports/_list-filter-status.html | 2 |
4 files changed, 93 insertions, 1 deletions
diff --git a/templates/web/base/admin/stats/index.html b/templates/web/base/admin/stats/index.html index d47054427..452af001e 100644 --- a/templates/web/base/admin/stats/index.html +++ b/templates/web/base/admin/stats/index.html @@ -5,6 +5,15 @@ <li><a href="[% c.uri_for_action('admin/stats/state') %]">[% loc('Problem breakdown by state') %]</a></li> <li><a href="[% c.uri_for_action('admin/stats/fix_rate') %]">[% loc('Category fix rate for problems > 4 weeks old') %]</a></li> <li><a href="[% c.uri_for_action('dashboard/index') %]">[% loc('Summary statistics') %]</a></li> +[% IF c.cobrand.feature('heatmap').keys %] + <li>[% loc('Heatmap') %] <ul> + [% FOR body IN c.cobrand.feature('heatmap').pairs %] + <li><a href="[% c.uri_for_action('dashboard/heatmap') %]?body=[% body.value %]">[% body.key %]</a></li> + [% END %] + </ul> </li> +[% ELSIF c.cobrand.feature('heatmap') %] +<li><a href="[% c.uri_for_action('dashboard/heatmap') %]">[% loc('Heatmap') %]</a></li> +[% END %] [% IF c.cobrand.moniker == 'fixmystreet' %] <li><a href="[% c.uri_for_action('admin/stats/refused') %]">Refused</a></li> [% END %] diff --git a/templates/web/base/dashboard/heatmap-list.html b/templates/web/base/dashboard/heatmap-list.html new file mode 100644 index 000000000..d736a11f4 --- /dev/null +++ b/templates/web/base/dashboard/heatmap-list.html @@ -0,0 +1,28 @@ +<h3>Five newest reports</h3> +[% INCLUDE column problems = five_newest %] + +<h3>Five most recent commented reports<br> +<small>Not from yourself/backend</small> +</h3> +[% INCLUDE column problems = five_commented %] + +<h3>Ten least recently updated open reports</h3> +[% INCLUDE column problems = ten_oldest %] + +[% BLOCK column %] +<section class="full-width"> + <ul class="item-list item-list--reports"> + [% IF problems.size %] + [% FOREACH problem IN problems %] + [% INCLUDE 'reports/_list-entry.html' include_sentinfo = 1 include_lastupdate = 1 %] + [% END %] + [% ELSE %] + <li class="item-list__item item-list__item--empty"> + <p>[% loc('There are no reports to show.') %]</p> + </li> + [% END %] + </ul> +</section> +[% END %] + + diff --git a/templates/web/base/dashboard/heatmap.html b/templates/web/base/dashboard/heatmap.html new file mode 100755 index 000000000..ba5c10c17 --- /dev/null +++ b/templates/web/base/dashboard/heatmap.html @@ -0,0 +1,55 @@ +[% + map_js.push( + '/vendor/HeatmapLayer.js', + '/cobrands/fixmystreet/density-map.js', + ); + PROCESS "maps/${map.type}.html"; + SET bodyclass = 'mappage'; + INCLUDE 'header.html', + title = tprintf(loc('%s - Summary reports'), body.name) +%] + +[% map_html %] + +</div> +<div id="map_sidebar"> + <div id="side"> + + <h1 id="reports_heading"> + [% body.name %] + </h1> + +<div class="full-width"> + +[% INCLUDE "reports/_list-filters.html", use_form_wrapper = 1 heatmap=1 %] + +<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 %]"> + +<p class="report-list-filters"> +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> + [% END %] +</select> + +</div> + +<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> + <input type="radio" name="heatmap" id="heatmap_no" value="No"> + <label class="btn" for="heatmap_no">Pin map</label> +</p> + +<div id="js-reports-list"> + [% INCLUDE 'dashboard/heatmap-list.html' %] +</div> + + </div> +</div> +[% INCLUDE 'footer.html' %] diff --git a/templates/web/base/reports/_list-filter-status.html b/templates/web/base/reports/_list-filter-status.html index 6923a7929..6fa998fc1 100644 --- a/templates/web/base/reports/_list-filter-status.html +++ b/templates/web/base/reports/_list-filter-status.html @@ -20,7 +20,7 @@ [%~ END ~%] [% INCLUDE 'reports/_status_filter_options.html' %] > - [% IF c.user_exists AND c.user.has_body_permission_to('planned_reports') AND !shortlist %] + [% IF c.user_exists AND c.user.has_body_permission_to('planned_reports') AND !shortlist AND !heatmap %] <option value="shortlisted"[% ' selected' IF filter_status.shortlisted %]>[% loc('Shortlisted') %]</option> <option value="unshortlisted"[% ' selected' IF filter_status.unshortlisted %]>[% loc('Unshortlisted') %]</option> [% END %] |