diff options
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Zurich.pm | 17 | ||||
-rw-r--r-- | templates/web/zurich/admin/index-dm.html | 17 | ||||
-rw-r--r-- | templates/web/zurich/admin/report_edit.html | 10 |
3 files changed, 34 insertions, 10 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm index d3cc638c1..4fbc99838 100644 --- a/perllib/FixMyStreet/Cobrand/Zurich.pm +++ b/perllib/FixMyStreet/Cobrand/Zurich.pm @@ -65,9 +65,24 @@ sub admin { if ($type eq 'dm') { $c->stash->{template} = 'admin/index-dm.html'; + + my $body = $c->stash->{body}; + my @children = map { $_->id } $body->bodies; + my @all = (@children, $body->id); + + # XXX No multiples or missing bodies $c->stash->{unconfirmed} = $c->cobrand->problems->search({ state => 'unconfirmed', - bodies_str => $c->stash->{body}->id, # XXX No multiples or missing + 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->{other} = $c->cobrand->problems->search({ + state => { '!=', 'unconfirmed' }, + bodies_str => \@all, }); } elsif ($type eq 'sdm') { $c->stash->{template} = 'admin/index-sdm.html'; diff --git a/templates/web/zurich/admin/index-dm.html b/templates/web/zurich/admin/index-dm.html index 8eea65019..c85afedce 100644 --- a/templates/web/zurich/admin/index-dm.html +++ b/templates/web/zurich/admin/index-dm.html @@ -2,7 +2,17 @@ [% PROCESS 'admin/report_blocks.html' %] <h2>New reports</h2> +[% INCLUDE list, problems = unconfirmed.all %] +<h2>Reports needing attention</h2> +[% INCLUDE list, problems = approval.all %] + +<h2>All reports</h2> +[% INCLUDE list, problems = other.all %] + +[% INCLUDE 'admin/footer.html' %] + +[% BLOCK list %] <table cellspacing="0" cellpadding="2" border="1"> <tr> <th>[% loc('ID') %]</th> @@ -11,7 +21,7 @@ <th>[% loc('Created') %]</th> <th>*</th> </tr> -[%- FOR problem IN unconfirmed.all %] +[%- FOR problem IN problems %] <tr[% ' class="hidden"' IF problem.state == 'hidden' %]> <td>[% problem.id %]</td> <td>[% PROCESS value_or_nbsp value=problem.title %]</td> @@ -21,7 +31,4 @@ </tr> [%- END -%] </table> -[%# WHILE ( problem = unconfirmed.next ) %] -[%# END %] - -[% INCLUDE 'admin/footer.html' %] +[% END %] diff --git a/templates/web/zurich/admin/report_edit.html b/templates/web/zurich/admin/report_edit.html index ef3bbe5d1..b40d0ba17 100644 --- a/templates/web/zurich/admin/report_edit.html +++ b/templates/web/zurich/admin/report_edit.html @@ -21,10 +21,8 @@ [% END %] </select> </li> -<li><label for="extra">[% loc('Internal notes:') %]</label> -<textarea name='extra' id='extra' cols=60 rows=5>[% problem.extra | html %]</textarea></li> -<li><label class="inline" for="state">[% loc('State:') %]</label> <select name="state" id="state"> +<li>[% loc('State:') %] <select name="state" id="state"> [% FOREACH state IN [ ['unconfirmed',loc('Submitted')] ['confirmed', loc('Open')], @@ -36,11 +34,15 @@ <option [% 'selected ' IF state.0 == problem.state %] value="[% state.0 %]">[% state.1 %]</option> [% END %] </select></li> + +<li><label for="extra">[% loc('Internal notes:') %]</label> +<textarea name='extra' id='extra' cols=60 rows=5>[% problem.extra | html %]</textarea></li> + <li>[% loc('Category:') %] [% problem.category | html %] </li> <input type="hidden" name="anonymous" value="[% problem.anonymous %]"> <li>[% loc('Name:') %] <input type='text' name='name' id='name' value='[% problem.name | html %]'></li> <li>[% loc('Email:') %] <input type='text' id='email' name='email' value='[% problem.user.email | html %]'></li> -<li>[% loc('Phone:') %] [% problem.user.phone | html %]</li> +<li>[% loc('Phone:') %] [% IF problem.user.phone %][% problem.user.phone | html %][% ELSE %]<em>[% loc('None') %]</em>[% END %]</li> <li>[% loc('Created:') %] [% PROCESS format_time time=problem.created %]</li> <input type="hidden" name="flagged" value="[% problem.flagged %]"> <input type="hidden" name="non_public" value="[% problem.non_public %]"> |