diff options
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Zurich.pm | 10 | ||||
-rw-r--r-- | templates/web/zurich/admin/index-dm.html | 29 | ||||
-rw-r--r-- | templates/web/zurich/report/updates.html | 18 |
3 files changed, 47 insertions, 10 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm index 4e3fd2d01..67329a13f 100644 --- a/perllib/FixMyStreet/Cobrand/Zurich.pm +++ b/perllib/FixMyStreet/Cobrand/Zurich.pm @@ -78,11 +78,11 @@ sub admin { state => 'unconfirmed', bodies_str => $c->stash->{body}->id, }); - $c->stash->{approval} = $c->cobrand->problems->search({ - 'me.state' => 'in progress', - bodies_str => \@children, - 'comments.state' => 'unconfirmed' - }, { join => 'comments', distinct => 1 } ); + $c->stash->{approval} = $c->model('DB::Comment')->search({ + 'problem.state' => 'in progress', + 'problem.bodies_str' => \@children, + 'me.state' => 'unconfirmed' + }, { join => 'problem' } ); $c->stash->{other} = $c->cobrand->problems->search({ state => { '!=', 'unconfirmed' }, bodies_str => \@all, diff --git a/templates/web/zurich/admin/index-dm.html b/templates/web/zurich/admin/index-dm.html index 62c073640..6ece5385b 100644 --- a/templates/web/zurich/admin/index-dm.html +++ b/templates/web/zurich/admin/index-dm.html @@ -4,8 +4,27 @@ <h2>New reports</h2> [% INCLUDE list, problems = unconfirmed.all %] -<h2>Reports needing attention</h2> -[% INCLUDE list, problems = approval.all %] +<h2>Updates needing attention</h2> +<table cellspacing="0" cellpadding="2" border="1"> + <tr> + <th>[% loc('ID') %]</th> + <th>[% loc('Problem ID') %]</th> + <th>[% loc('Category') %]</th> + <th>[% loc('Text') %]</th> + <th>[% loc('Created') %]</th> + <th>*</th> + </tr> +[%- FOR update IN approval.all %] + <tr[% ' class="adminhidden"' IF problem.state == 'hidden' %]> + <td>[% update.id %]</td> + <td>[% update.problem.id %]</td> + <td>[% update.problem.category %]</td> + <td>[% update.text %]</td> + <td>[% PROCESS format_time time=update.created %]</td> + <td><a href="[% c.uri_for( 'update_edit', update.id ) %]">[% loc('Edit') %]</a></td> + </tr> +[%- END -%] +</table> <h2>All reports</h2> [% INCLUDE list, problems = other.all %] @@ -24,9 +43,9 @@ [%- FOR problem IN problems %] <tr[% ' class="adminhidden"' IF problem.state == 'hidden' %]> <td>[% problem.id %]</td> - <td>[% PROCESS value_or_nbsp value=problem.title %]</td> - <td>[% problem.category %]</td> - <td>[% PROCESS format_time time=problem.created %]</td> + <td>[% PROCESS value_or_nbsp value=problem.title %]</td> + <td>[% problem.category %]</td> + <td>[% PROCESS format_time time=problem.created %]</td> <td><a href="[% c.uri_for( 'report_edit', problem.id ) %]">[% loc('Edit') %]</a></td> </tr> [%- END -%] diff --git a/templates/web/zurich/report/updates.html b/templates/web/zurich/report/updates.html new file mode 100644 index 000000000..60a26b6da --- /dev/null +++ b/templates/web/zurich/report/updates.html @@ -0,0 +1,18 @@ +[% FOREACH update IN updates %] +[% INCLUDE 'report/update.html' %] +[% 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 %] + |