aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorHakim Cassimally <hakim@mysociety.org>2015-02-02 15:33:42 +0000
committerDave Arter <davea@mysociety.org>2015-10-06 09:09:24 +0100
commit657177eba893c29d6d3f9e4b9f4f24ede5b78bc4 (patch)
treed26ebbf2474beb467c8f9eff591ab71628de6464 /templates
parent735536dc5e269f2094d122e49f2c648928db4acb (diff)
Add "time spent" admin logging.
Mechanism is general, but current implementation only used for Zurich. - Zurich: Record time_spent field mysociety/FixMyStreet-Commercial#676 - template changes (including jQuery spinner) - backend changes to save data are made: - in log_edit, if supplied - and time on category change (and arbitrary actions) - Add update_admin_log to all paths for DM, ensuring that it gets called, while resetting the `time_spent` parameter, to make sure that there is never a duplicate record created. - Also quell warning about using DateTime values in query. - Also add (seemingly unrelated) parens to stop misparsing of OK line in questionnaire test now that DT::Format::Pg is used in Zurich cobrand See mysociety/FixMyStreet-Commercial#676
Diffstat (limited to 'templates')
-rw-r--r--templates/web/zurich/admin/report_edit-sdm.html18
-rw-r--r--templates/web/zurich/admin/report_edit.html17
2 files changed, 35 insertions, 0 deletions
diff --git a/templates/web/zurich/admin/report_edit-sdm.html b/templates/web/zurich/admin/report_edit-sdm.html
index 82bbeba23..6e952022a 100644
--- a/templates/web/zurich/admin/report_edit-sdm.html
+++ b/templates/web/zurich/admin/report_edit-sdm.html
@@ -46,6 +46,10 @@
<li><span class="mock-label">[% loc('Phone:') %]</span> [% IF problem.user.phone %][% problem.user.phone | html %][% ELSE %]<em>[% loc('None') %]</em>[% END %]</li>
<li><span class="mock-label">[% loc('Created:') %]</span> [% PROCESS format_date this_date=problem.created %] [% problem.created.hms %]</li>
+<li>
+ <label>[% loc('Time spent (in minutes):') %]</label> [% problem.get_time_spent %]
+</li>
+
[% IF problem.photo %]
<li><img alt="" src="[% c.cobrand.base_url %]/photo/[% problem.photo %].temp.jpeg"></li>
[% END %]
@@ -60,6 +64,20 @@
</ul>
+<p class="report-edit-action">
+<label for="time_spent">[% loc('Time spent (in minutes):') %]</label>
+<input type="text" name="time_spent" id="form_time_spent" style="width: 4em" value="0">
+<script>
+ $(function () {
+ $('#form_time_spent').spinner({
+ spin: function (e, ui) {
+ if (ui.value < 0) { return false }
+ }
+ });
+ });
+</script>
+</p>
+
<p class="cf">
<input style="float:left" type="submit" name="Submit changes" value="[% loc('Submit changes') %]" >
<input style="float:right" type="submit" name="no_more_updates" value="[% loc('No further updates') %]">
diff --git a/templates/web/zurich/admin/report_edit.html b/templates/web/zurich/admin/report_edit.html
index d2c1760ff..89f27dcda 100644
--- a/templates/web/zurich/admin/report_edit.html
+++ b/templates/web/zurich/admin/report_edit.html
@@ -60,6 +60,9 @@
<li><span class="mock-label">[% loc('Phone:') %]</span> [% IF problem.user.phone %][% problem.user.phone | html %][% ELSE %]<em>[% loc('None') %]</em>[% END %]</li>
<li><span class="mock-label">[% loc('Created:') %]</span> [% PROCESS format_date this_date=problem.created %] [% problem.created.hms %]</li>
+<li>
+ <label>[% loc('Time spent (in minutes):') %]</label> [% problem.get_time_spent %]
+</li>
[% IF problem.photo %]
<li>
@@ -215,6 +218,20 @@ Ihre Stadt Zürich
[% END %]
+<p>
+<label for="time_spent">[% loc('Time spent (in minutes):') %]</label>
+<input type="text" name="time_spent" id="form_time_spent" style="width: 4em" value="0">
+<script>
+ $(function () {
+ $('#form_time_spent').spinner({
+ spin: function (e, ui) {
+ if (ui.value < 0) { return false }
+ }
+ });
+ });
+</script>
+</p>
+
<p align="right">
[% IF problem.state == 'planned' %]
<input type="submit" name="publish_response" value="[% loc('Publish the response') %]">