aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perllib/FixMyStreet/Cobrand/Zurich.pm16
-rw-r--r--templates/web/zurich/admin/report_edit.html10
-rw-r--r--templates/web/zurich/report/updates.html31
3 files changed, 27 insertions, 30 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm
index 4857dde03..4846e6f1e 100644
--- a/perllib/FixMyStreet/Cobrand/Zurich.pm
+++ b/perllib/FixMyStreet/Cobrand/Zurich.pm
@@ -223,17 +223,11 @@ sub admin_report_edit {
# Final, public, Update from DM
if (my $update = $c->req->param('status_update')) {
- FixMyStreet::App->model('DB::Comment')->create( {
- text => $update,
- user => $c->user->obj,
- state => 'confirmed',
- confirmed => \'ms_current_timestamp()',
- problem => $problem,
- mark_fixed => 0,
- problem_state => 'fixed - council',
- anonymous => 1,
- } );
- $problem->state( 'fixed - council' );
+ $extra->{public_response} = $update;
+ $problem->extra( { %$extra } );
+ if ($c->req->params->{publish_response}) {
+ $problem->state( 'fixed - council' );
+ }
}
$problem->lastupdate( \'ms_current_timestamp()' );
diff --git a/templates/web/zurich/admin/report_edit.html b/templates/web/zurich/admin/report_edit.html
index 1bc2a5922..66d0a159f 100644
--- a/templates/web/zurich/admin/report_edit.html
+++ b/templates/web/zurich/admin/report_edit.html
@@ -147,8 +147,9 @@ $(function(){
</li>
<li><label for="status_update">[% loc('Public response:') %]</label>
- <textarea name='status_update' id='status_update' cols=60 rows=5></textarea></li>
+ <textarea name='status_update' id='status_update' cols=60 rows=5>[% problem.extra.public_response | html %]</textarea>
+ </li>
</ul>
[% END %]
@@ -156,7 +157,12 @@ $(function(){
</div>
<div style="clear:both"></div>
-<p align="right"><input type="submit" name="Submit changes" value="[% loc('Submit changes') %]" ></p>
+<p align="right">
+[% IF problem.state == 'planned' %]
+<input type="submit" name="publish_response" value="[% loc('Publish the response') %]">
+[% END %]
+<input type="submit" name="Submit changes" value="[% loc('Submit changes') %]" >
+</p>
</form>
diff --git a/templates/web/zurich/report/updates.html b/templates/web/zurich/report/updates.html
index 60a26b6da..34b65e998 100644
--- a/templates/web/zurich/report/updates.html
+++ b/templates/web/zurich/report/updates.html
@@ -1,18 +1,15 @@
-[% FOREACH update IN updates %]
-[% INCLUDE 'report/update.html' %]
+[% IF problem.state == 'fixed - council' %]
+<section class="full-width">
+ <h4 class="static-with-rule">[% loc('Updates') %]</h4>
+ <ul class="issue-list">
+ <li>
+ <div class="update-wrap">
+ <div class="update-text">
+ <p class="meta-2">[% prettify_epoch( problem.lastupdate_local.epoch ) %]</p>
+ [% add_links( problem.extra.public_response ) | html_para %]
+ </div>
+ </div>
+ </li>
+ </ul>
+</section>
[% END %]
-
-[% BLOCK meta_line %]
-
- [%- IF update.user.from_body;
- user_name = update.user.name | html;
- body = update.user.body;
- %]
- [% tprintf( loc( 'Posted by %s (<strong>%s</strong>) at %s' ), user_name, body, prettify_epoch( update.confirmed_local.epoch ) ) -%]
- [%- ELSE %]
- [% tprintf( loc( 'Posted by %s at %s' ), update.name, prettify_epoch( update.confirmed_local.epoch ) ) | html -%]
- [%- END -%]
- [%- ", " _ loc( 'reopened' ) IF update.problem_state == 'confirmed' %]
- [%- ", " _ tprintf(loc( 'marked as %s' ), update.meta_problem_state) IF update.problem_state AND update.problem_state != 'confirmed' %]
-[% END %]
-