aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--locale/de_CH.UTF-8/LC_MESSAGES/FixMyStreet.po9
-rw-r--r--perllib/FixMyStreet/App/Controller/Admin.pm31
-rw-r--r--perllib/FixMyStreet/Cobrand/Zurich.pm151
-rw-r--r--templates/web/default/admin/body.html4
-rw-r--r--templates/web/zurich/admin/body-form.html4
-rw-r--r--templates/web/zurich/admin/body.html67
-rw-r--r--templates/web/zurich/admin/header.html2
-rw-r--r--templates/web/zurich/admin/index-dm.html30
-rw-r--r--templates/web/zurich/admin/problem_row.html28
-rw-r--r--templates/web/zurich/admin/report_edit.html158
-rw-r--r--templates/web/zurich/admin/reports.html25
-rw-r--r--templates/web/zurich/header.html2
12 files changed, 370 insertions, 141 deletions
diff --git a/locale/de_CH.UTF-8/LC_MESSAGES/FixMyStreet.po b/locale/de_CH.UTF-8/LC_MESSAGES/FixMyStreet.po
index 2582d6df4..1a7024576 100644
--- a/locale/de_CH.UTF-8/LC_MESSAGES/FixMyStreet.po
+++ b/locale/de_CH.UTF-8/LC_MESSAGES/FixMyStreet.po
@@ -575,7 +575,7 @@ msgstr "Mangel lokalisieren"
#: templates/web/fixmystreet/report/update-form.html:28
#: templates/web/fixmystreet/report/update-form.html:30
msgid "Closed"
-msgstr "Geschlossen"
+msgstr "Erledigt"
#: perllib/FixMyStreet/DB/Result/Problem.pm:696
msgid "Closed by council"
@@ -1789,7 +1789,7 @@ msgstr ""
#: templates/web/zurich/admin/report_edit.html:28
#: templates/web/zurich/admin/update_edit.html:18
msgid "Open"
-msgstr "Öffnen"
+msgstr "Aufgenommen"
#: templates/web/default/my/my.html:22 templates/web/fixmystreet/my/my.html:26
msgid "Open reports"
@@ -1915,7 +1915,7 @@ msgstr "Fotos von neuen Meldungen in der Nähe"
#: templates/web/fixmystreet/report/update-form.html:28
#: templates/web/fixmystreet/report/update-form.html:29
msgid "Planned"
-msgstr "Geplant"
+msgstr "Rückmeldung ausstehend"
#: templates/web/fixmystreet/questionnaire/index.html:44
msgid ""
@@ -2907,9 +2907,8 @@ msgstr ""
#: templates/web/zurich/admin/report_edit.html:26
#: templates/web/zurich/admin/report_edit.html:27
#: templates/web/zurich/report/banner.html:15
-#, fuzzy
msgid "Submitted"
-msgstr "Abschicken"
+msgstr "Erfasst"
#: templates/web/bromley/report/display.html:44
#: templates/web/default/alert/updates.html:17
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm
index 8ed135e6d..0a2a8830c 100644
--- a/perllib/FixMyStreet/App/Controller/Admin.pm
+++ b/perllib/FixMyStreet/App/Controller/Admin.pm
@@ -312,7 +312,7 @@ sub update_contacts : Private {
my ( $self, $c ) = @_;
my $posted = $c->req->param('posted');
- my $editor = $c->req->remote_user || _('*unknown*');
+ my $editor = $c->req->remote_user || ($c->user && $c->user->name) || _('*unknown*');
if ( $posted eq 'new' ) {
$c->forward('check_token');
@@ -661,11 +661,6 @@ sub report_edit : Path('report_edit') : Args(1) {
my $flagged = $c->req->param('flagged') ? 1 : 0;
my $non_public = $c->req->param('non_public') ? 1 : 0;
- # Predefine the hash so it's there for lookups
- # XXX Note you need to shallow copy each time you set it, due to a bug? in FilterColumn.
- my $extra = $problem->extra || {};
- $extra->{internal_notes} ||= '';
-
# do this here so before we update the values in problem
if ( $c->req->param('anonymous') ne $problem->anonymous
|| $c->req->param('name') ne $problem->name
@@ -673,8 +668,6 @@ sub report_edit : Path('report_edit') : Args(1) {
|| $c->req->param('title') ne $problem->title
|| $c->req->param('detail') ne $problem->detail
|| ($c->req->param('body') && $c->req->param('body') ne $problem->bodies_str)
- || ($c->req->param('internal_notes') && $c->req->param('internal_notes') ne $extra->{internal_notes})
- || ($c->cobrand->moniker eq 'zurich' && $c->req->param('publish_photo') ne $extra->{publish_photo})
|| $flagged != $problem->flagged
|| $non_public != $problem->non_public )
{
@@ -687,19 +680,6 @@ sub report_edit : Path('report_edit') : Args(1) {
$problem->state( $new_state );
$problem->name( $c->req->param('name') );
$problem->bodies_str( $c->req->param('body') ) if $c->req->param('body');
- if ($c->req->param('internal_notes')) {
- $extra->{internal_notes} = $c->req->param('internal_notes');
- $problem->extra( { %$extra } );
- }
-
- # Zurich have photos being published or not, and third parties getting
- # personal data; can't just check as with e.g. internal_notes as it's a
- # checkbox and won't be set if it's not ticked
- if ($c->cobrand->moniker eq 'zurich') {
- $extra->{publish_photo} = $c->req->params->{publish_photo} || 0;
- $extra->{third_personal} = $c->req->params->{third_personal} || 0;
- $problem->extra( { %$extra } );
- }
$problem->flagged( $flagged );
$problem->non_public( $non_public );
@@ -741,15 +721,6 @@ sub report_edit : Path('report_edit') : Args(1) {
# do this here otherwise lastupdate and confirmed times
# do not display correctly
$problem->discard_changes;
-
- if ( $c->cobrand->moniker eq 'zurich' && $c->req->param('body') ) {
- my $problem_body = $c->req->param('body');
- my $admin_body = $c->stash->{body};
- if ($admin_body->id ne $problem_body) {
- $c->detach('index');
- }
- }
-
}
}
diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm
index 455e2bbbb..d70e785d7 100644
--- a/perllib/FixMyStreet/Cobrand/Zurich.pm
+++ b/perllib/FixMyStreet/Cobrand/Zurich.pm
@@ -39,6 +39,34 @@ sub show_unconfirmed_reports {
}
# Specific administrative displays
+
+sub admin_pages {
+ my $self = shift;
+ my $c = $self->{c};
+
+ my $type = $c->stash->{admin_type};
+ my $pages = {
+ 'summary' => [_('Summary'), 0],
+ 'reports' => [_('Reports'), 2],
+ 'report_edit' => [undef, undef],
+ 'update_edit' => [undef, undef],
+ };
+ return $pages if $type eq 'sdm';
+
+ $pages = { %$pages,
+ 'bodies' => [_('Bodies'), 1],
+ 'body' => [undef, undef],
+ 'body_edit' => [undef, undef],
+ };
+ return $pages if $type eq 'dm';
+
+ $pages = { %$pages,
+ 'users' => [_('Users'), 3],
+ 'user_edit' => [undef, undef],
+ };
+ return $pages if $type eq 'super';
+}
+
sub admin_type {
my $self = shift;
my $c = $self->{c};
@@ -75,7 +103,7 @@ sub admin {
# XXX No multiples or missing bodies
$c->stash->{unconfirmed} = $c->cobrand->problems->search({
- state => 'unconfirmed',
+ state => [ 'unconfirmed', 'confirmed' ],
bodies_str => $c->stash->{body}->id,
});
$c->stash->{approval} = $c->cobrand->problems->search({
@@ -83,7 +111,7 @@ sub admin {
bodies_str => $c->stash->{body}->id,
});
$c->stash->{other} = $c->cobrand->problems->search({
- state => { -not_in => [ 'unconfirmed', 'planned' ] },
+ state => { -not_in => [ 'unconfirmed', 'confirmed', 'planned' ] },
bodies_str => \@all,
});
} elsif ($type eq 'sdm') {
@@ -127,6 +155,10 @@ sub admin_report_edit {
@bodies = sort { strcoll($a->name, $b->name) } @bodies;
$c->stash->{bodies} = \@bodies;
+ # Can change category to any other
+ my @categories = $c->model('DB::Contact')->not_deleted->all;
+ $c->stash->{categories} = [ map { $_->category } @categories ];
+
} elsif ($type eq 'dm') {
# Can assign to:
@@ -138,7 +170,87 @@ sub admin_report_edit {
@bodies = sort { strcoll($a->name, $b->name) } @bodies;
$c->stash->{bodies} = \@bodies;
- } elsif ($type eq 'sdm') {
+ # Can change category to any other
+ my @categories = $c->model('DB::Contact')->not_deleted->all;
+ $c->stash->{categories} = [ map { $_->category } @categories ];
+
+ }
+
+ # Problem updates upon submission
+ if ( ($type eq 'super' || $type eq 'dm') && $c->req->param('submit') ) {
+ $c->forward('check_token');
+
+ # Predefine the hash so it's there for lookups
+ # XXX Note you need to shallow copy each time you set it, due to a bug? in FilterColumn.
+ my $extra = $problem->extra || {};
+ $extra->{internal_notes} = $c->req->param('internal_notes');
+ $extra->{publish_photo} = $c->req->params->{publish_photo} || 0;
+ $extra->{third_personal} = $c->req->params->{third_personal} || 0;
+ $problem->extra( { %$extra } );
+
+ # Workflow things
+ my $redirect = 0;
+ my $new_cat = $c->req->params->{category};
+ if ( $new_cat && $new_cat ne $problem->category ) {
+ my $cat = $c->model('DB::Contact')->search( { category => $c->req->params->{category} } )->first;
+ $problem->category( $new_cat );
+ $problem->bodies_str( $cat->body_id );
+ $problem->whensent( undef );
+ $redirect = 1 if $cat->body_id ne $body->id;
+ } elsif ( my $subdiv = $c->req->params->{body_subdivision} ) {
+ $problem->state( 'in progress' );
+ $problem->bodies_str( $subdiv );
+ $problem->whensent( undef );
+ $redirect = 1;
+ } elsif ( my $external = $c->req->params->{body_external} ) {
+ $problem->state( 'closed' );
+ $problem->bodies_str( $external );
+ $problem->whensent( undef );
+ $redirect = 1;
+ } else {
+ $problem->state( $c->req->params->{state} ) if $c->req->params->{state};
+ }
+
+ $problem->title( $c->req->param('title') );
+ $problem->detail( $c->req->param('detail') );
+
+ # 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' );
+ }
+
+ $problem->lastupdate( \'ms_current_timestamp()' );
+ $problem->update;
+
+ $c->stash->{status_message} =
+ '<p><em>' . _('Updated!') . '</em></p>';
+
+ # do this here otherwise lastupdate and confirmed times
+ # do not display correctly
+ $problem->discard_changes;
+
+ if ( $redirect ) {
+ $c->detach('index');
+ }
+
+ $c->stash->{updates} = [ $c->model('DB::Comment')
+ ->search( { problem_id => $problem->id }, { order_by => 'created' } )
+ ->all ];
+
+ return 1;
+ }
+
+ if ($type eq 'sdm') {
# Has cut-down edit template for adding update and sending back up only
$c->stash->{template} = 'admin/report_edit-sdm.html';
@@ -150,20 +262,7 @@ sub admin_report_edit {
$problem->state( 'confirmed' );
$problem->update;
# log here
-
$c->res->redirect( '/admin/summary' );
- return 1;
-
- } elsif ($c->req->param('no_more_updates')) {
- $c->forward('check_token');
-
- $problem->bodies_str( $body->parent->id );
- $problem->state( 'planned' );
- $problem->update;
- # log here
-
- $c->res->redirect( '/admin/summary' );
- return 1;
} elsif ($c->req->param('submit')) {
$c->forward('check_token');
@@ -191,12 +290,22 @@ sub admin_report_edit {
$c->stash->{status_message} = '<p><em>' . _('Updated!') . '</em></p>';
- $c->stash->{updates} = [ $c->model('DB::Comment')
- ->search( { problem_id => $problem->id }, { order_by => 'created' } )
- ->all ];
-
- return 1;
+ # If they clicked the no more updates button, we're done.
+ if ($c->req->param('no_more_updates')) {
+ $problem->bodies_str( $body->parent->id );
+ $problem->state( 'planned' );
+ $problem->update;
+ # log here
+ $c->res->redirect( '/admin/summary' );
+ }
}
+
+ $c->stash->{updates} = [ $c->model('DB::Comment')
+ ->search( { problem_id => $problem->id }, { order_by => 'created' } )
+ ->all ];
+
+ return 1;
+
}
return 0;
diff --git a/templates/web/default/admin/body.html b/templates/web/default/admin/body.html
index 4b397d045..120a07da9 100644
--- a/templates/web/default/admin/body.html
+++ b/templates/web/default/admin/body.html
@@ -6,8 +6,6 @@
</p>
[% END %]
-[% IF c.cobrand.moniker != 'zurich' OR admin_type == 'super' %]
-
<p>
[% IF example_pc %]
<a href="[% c.uri_for_email( '/around', { pc => example_pc } ) %]">[% tprintf( loc('Example postcode %s'), example_pc ) | html %]</a> |
@@ -111,8 +109,6 @@
</div>
</form>
-[% END %]
-
<h2>[% loc('Edit body details') %]</h2>
[% INCLUDE 'admin/body-form.html' %]
diff --git a/templates/web/zurich/admin/body-form.html b/templates/web/zurich/admin/body-form.html
index 1fa606008..5ae8eb8a6 100644
--- a/templates/web/zurich/admin/body-form.html
+++ b/templates/web/zurich/admin/body-form.html
@@ -5,14 +5,10 @@
<input type="text" name="name" id="name" value="[% body.name %]" size="50">
</p>
-[% IF admin_type == 'dm' %]
<p>
<label for="email">[% loc('Email') %]</label>
<input type="text" name="endpoint" id="email" value="[% body.endpoint %]" size="50">
</p>
-[% ELSE %]
- <input type="hidden" name="endpoint" id="endpoint" value="[% body.endpoint %]">
-[% END %]
[% IF admin_type == 'super' %]
<p>
diff --git a/templates/web/zurich/admin/body.html b/templates/web/zurich/admin/body.html
new file mode 100644
index 000000000..4eecb9839
--- /dev/null
+++ b/templates/web/zurich/admin/body.html
@@ -0,0 +1,67 @@
+[% INCLUDE 'admin/header.html' title=tprintf(loc('Council contacts for %s'), body.name) -%]
+
+[% IF updated %]
+<p>
+<em>[% updated %]</em>
+</p>
+[% END %]
+
+[% IF admin_type == 'super' AND body.parent AND body.bodies # A division %]
+ <table cellspacing="0" cellpadding="2" border="1">
+ <tr>
+ <th>[% loc('Category') %]</th>
+ <th>[% loc('Email') %]</th>
+ <th>[% loc('Last editor') %]</th>
+ <th>[% loc('Note') %]</th>
+ <th>[% loc('When edited') %]</th>
+ </tr>
+ [% WHILE ( contact = contacts.next ) %]
+ <tr>
+ <td><a href="[% c.uri_for( 'body_edit', body_id, contact.category ) %]">[% contact.category %]</a></td>
+ <td>[% contact.email | html %]</td>
+ <td>[% contact.editor %]</td>
+ <td>[% contact.note | html %]</td>
+ <td>[% contact.whenedited.ymd _ ' ' _ contact.whenedited.hms %]</td>
+ </tr>
+ [% END %]
+ </table>
+
+ <h2>[% loc('Add new category') %]</h2>
+
+ <form method="post" action="[% c.uri_for('body', body_id ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
+
+ [% IF c.cobrand.moniker != 'emptyhomes' %]
+ <p>
+ <strong>[% loc('Category:') %] </strong><input type="text" name="category" size="30">
+ </p>
+ [% END %]
+
+ <p>
+ <strong>[% loc('Email:') %] </strong><input type="text" name="email" size="30">
+ </p>
+
+ <input type="hidden" name="confirmed" value="1" id="confirmed">
+ <input type="hidden" name="deleted" value="1" id="deleted">
+
+ <p>
+ <strong>[% loc('Note:') %] </strong> <textarea name="note" rows="3" cols="40"></textarea>
+ </p>
+
+ <p>
+ <input type="hidden" name="posted" value="new" >
+ <input type="hidden" name="token" value="[% token %]" >
+ <input type="submit" name="Create category" value="[% loc('Create category') %]" >
+ </p>
+
+ <div>
+ <input type="hidden" name=".cgifields" value="confirmed" >
+ <input type="hidden" name=".cgifields" value="deleted" >
+ </div>
+ </form>
+
+[% END %]
+
+ <h2>[% loc('Edit body details') %]</h2>
+ [% INCLUDE 'admin/body-form.html' %]
+
+[% INCLUDE 'admin/footer.html' %]
diff --git a/templates/web/zurich/admin/header.html b/templates/web/zurich/admin/header.html
index e9a0ac04a..d837919ad 100644
--- a/templates/web/zurich/admin/header.html
+++ b/templates/web/zurich/admin/header.html
@@ -11,7 +11,7 @@ select { width: auto; }
<a href="/admin/summary">[% loc('Summary') %]</a>
[% IF admin_type == 'dm' OR admin_type == 'super' %]
| <a href="/admin/bodies">[% loc('Bodies') %]</a>
- <!-- | <a href="/admin/reports">[% loc('Reports') %]</a> -->
+ | <a href="/admin/reports">[% loc('Reports') %]</a>
<!-- | <a href="timeline">Timeline</a> -->
<!-- | <a href="questionnaire">Survey</a> -->
<!-- | <a href="/admin/users">[% loc('Users') %]</a> -->
diff --git a/templates/web/zurich/admin/index-dm.html b/templates/web/zurich/admin/index-dm.html
index 6b7fbab85..e4676b811 100644
--- a/templates/web/zurich/admin/index-dm.html
+++ b/templates/web/zurich/admin/index-dm.html
@@ -1,24 +1,15 @@
[% INCLUDE 'admin/header.html' title=loc('Summary') -%]
[% PROCESS 'admin/report_blocks.html' %]
-[%
- states = {
- 'unconfirmed' = loc('Submitted'),
- 'confirmed' = loc('Open'),
- 'in progress' = loc('In progress'),
- 'planned' = loc('Planned'),
- 'fixed - council' = loc('Closed'),
- 'hidden' = loc('Hidden'),
- 'closed' = loc('Closed'),
- }
-%]
-<h2>New reports</h2>
+[% status_message %]
+
+<h2>[% loc('Submitted') %]</h2>
[% INCLUDE list, problems = unconfirmed.all %]
<h2>[% loc('Planned') %]</h2>
[% INCLUDE list, problems = approval.all %]
-<h2>All reports</h2>
+<h2>[% loc('All reports') %]</h2>
[% INCLUDE list, problems = other.all %]
[% INCLUDE 'admin/footer.html' %]
@@ -28,7 +19,7 @@
<tr>
<th>[% loc('ID') %]</th>
<th>[% loc('Title') %]</th>
- <th>[% loc('Status') %]</th>
+ <th>[% loc('State') %]</th>
<th>[% loc('Category') %]</th>
<th>[% loc('Created') %]</th>
<th>*</th>
@@ -36,15 +27,6 @@
<tr class="filter-row">
<td colspan="6"><input type="text" placeholder="[%= loc('Filter report list') %]" /></td>
</tr>
-[%- FOR problem IN problems %]
- <tr[% ' class="adminhidden"' IF problem.state == 'hidden' %]>
- <td class="record-id">[% problem.id %]</td>
- <td>[% PROCESS value_or_nbsp value=problem.title %]</td>
- <td>[% states.${problem.state} %]</td>
- <td>[% problem.category %]</td>
- <td>[% PROCESS format_date this_date=problem.created %]</td>
- <td><a href="[% c.uri_for( 'report_edit', problem.id ) %]">[% loc('Edit') %]</a></td>
- </tr>
-[%- END -%]
+[% INCLUDE 'admin/problem_row.html' %]
</table>
[% END %]
diff --git a/templates/web/zurich/admin/problem_row.html b/templates/web/zurich/admin/problem_row.html
new file mode 100644
index 000000000..75cee6002
--- /dev/null
+++ b/templates/web/zurich/admin/problem_row.html
@@ -0,0 +1,28 @@
+[%
+ states = {
+ 'unconfirmed' = loc('Submitted'),
+ 'confirmed' = loc('Open'),
+ 'in progress' = loc('In progress'),
+ 'planned' = loc('Planned'),
+ 'fixed - council' = loc('Closed'),
+ 'hidden' = loc('Hidden'),
+ 'closed' = loc('Closed'),
+ }
+%]
+[%- FOR problem IN problems %]
+ [% SET p_body = problem.bodies.values.0 %]
+ [% NEXT IF admin_type == 'sdm' AND p_body.id != body.id %]
+ [% NEXT IF admin_type == 'dm' AND p_body.id != body.id AND p_body.parent.id != body.id %]
+ <tr[% ' class="adminhidden"' IF problem.state == 'hidden' %]>
+ <td class="record-id">[%- IF problem.is_visible -%]
+ <a href="[% c.uri_for_email( '/report', problem.id ) %]">[% problem.id %]</a>
+ [%- ELSE %]
+ [%- problem.id %]
+ [%- END -%]</td>
+ <td>[% PROCESS value_or_nbsp value=problem.title %]</td>
+ <td>[% states.${problem.state} %]</td>
+ <td>[% PROCESS value_or_nbsp value=problem.category %]</td>
+ <td>[% PROCESS format_date this_date=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/admin/report_edit.html b/templates/web/zurich/admin/report_edit.html
index 85f8b901f..468280668 100644
--- a/templates/web/zurich/admin/report_edit.html
+++ b/templates/web/zurich/admin/report_edit.html
@@ -3,30 +3,15 @@
[% status_message %]
+[% IF problem.state == 'planned' %]
+[% INCLUDE 'admin/list_updates.html' %]
+[% END %]
+
<form method="post" action="[% c.uri_for( 'report_edit', problem.id ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
<input type="hidden" name="token" value="[% token %]" >
<input type="hidden" name="submit" value="1" >
-<!--
-[% IF NOT state OR state.0 == 'unconfirmed' %]
-<p>[% loc('Body:') %]
- <select name="body_external">
- [% FOR body IN bodies %]
- [% NEXT IF !body.parent AND !body.bodies %]
- <option value="[% body.id %]"[% IF body.id == problem.bodies_str%] selected[% END %]>[% body.name %]</option>
- [% END %]
- </select>
-
-<p>[% loc('Body:') %]
- <select name="body_external">
- [% FOR body IN bodies %]
- [% NEXT IF body.parent OR body.bodies %]
- <option value="[% body.id %]"[% IF body.id == problem.bodies_str%] selected[% END %]>[% body.name %]</option>
- [% END %]
- </select>
-
-[% END %]
--->
+<div style="float:left; margin-top: 1em; width:48%; margin-right:2%">
<ul>
[%- cobrand_data = problem.cobrand_data %]
@@ -36,37 +21,10 @@
<li><label for='detail'>[% loc('Details:') %]</label>
<textarea name='detail' id='detail' cols=60 rows=5>[% problem.detail | html %]</textarea></li>
<li>[% loc('Co-ordinates:') %] [% problem.local_coords.join(',') %] ([% problem.latitude %],[% problem.longitude %]) ([% loc('originally entered') %] &lsquo;[% problem.postcode | html %]&rsquo;, [% IF problem.used_map %][% loc('used map') %][% ELSE %][% loc("didn't use map") %][% END %])</li>
-<li>[% loc('Body:') %]
- <select name="body">
- [% FOR body IN bodies %]
- <option value="[% body.id %]"[% IF body.id == problem.bodies_str%] selected[% END %]>[% body.name %]</option>
- [% END %]
- </select>
- <input type="checkbox" name="third_personal" id="third_personal" value="1"[% ' checked' IF problem.extra.third_personal %]>
- <label for="third_personal" class="inline">Include reporter personal details</label>
-</li>
-<li>[% loc('State:') %] <select name="state" id="state">
- [% FOREACH state IN [
- ['unconfirmed',loc('Submitted')]
- ['confirmed', loc('Open')],
- ['in progress', loc('In progress')],
- ['planned', loc('Planned')],
- ['fixed - council', loc('Closed')],
- ['closed', loc('Closed')],
- ['hidden', loc('Hidden')],
- ] %]
- <option [% 'selected ' IF state.0 == problem.state %] value="[% state.0 %]">[% state.1 %]</option>
- [% END %]
-</select></li>
-
-<li><label for="internal_notes">[% loc('Internal notes:') %]</label>
-<textarea name='internal_notes' id='internal_notes' cols=60 rows=5>[% problem.extra.internal_notes | 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>[% loc('Name:') %] [% problem.name | html %] <input type='hidden' name='name' id='name' value='[% problem.name | html %]'></li>
+<li>[% loc('Email:') %] [% problem.user.email | html %] <input type='hidden' id='email' name='email' value='[% problem.user.email | html %]'>
[% IF problem.extra.email_confirmed %][% loc('Confirmed') %][% END %]
</li>
<li>[% loc('Phone:') %] [% IF problem.user.phone %][% problem.user.phone | html %][% ELSE %]<em>[% loc('None') %]</em>[% END %]</li>
@@ -76,7 +34,7 @@
[% IF problem.photo %]
[% photo = problem.get_photo_params %]
-<li><img alt="" height="[% photo.height %]" width="[% photo.width %]" src="[% c.cobrand.base_url %][% photo.url %]">
+<li><img alt="" src="[% c.cobrand.base_url %][% photo.url %]">
<br>
[% IF rotated %]Photo may be cached. View image directly to check<br>[% END %]
<input type="submit" name="rotate_photo" value="Rotate Left" />
@@ -86,8 +44,106 @@
<label class="inline" for="publish_photo">[% loc("Publish photo") %]</label></li>
[% END %]
</ul>
-<input type="submit" name="Submit changes" value="[% loc('Submit changes') %]" ></form>
+</div>
+
+<div style="float:right;width:48%">
+
+<p><label for="internal_notes">[% loc('Internal notes:') %]</label>
+<textarea name='internal_notes' id='internal_notes' cols=60 rows=5>[% problem.extra.internal_notes | html %]</textarea></p>
+
+[% IF problem.state == 'unconfirmed' OR problem.state == 'confirmed' %]
+ <p>[% loc('State:') %] <select name="state" id="state">
+ <option value="">--</option>
+ [% FOREACH s IN [
+ ['unconfirmed',loc('Submitted')]
+ ['confirmed', loc('Open')],
+ ['hidden', loc('Hidden')],
+ ] %]
+ <option [% 'selected ' IF s.0 == problem.state %] value="[% s.0 %]">[% s.1 %]</option>
+ [% END %]
+ </select></p>
+
+<ul>
+<li class="assignation">
+<label for="body_subdivision">[% loc('Assign to subdivision:') %]</label>
+ <select name="body_subdivision" id="body_subdivision">
+ <option value="">--</option>
+ [% FOR body IN bodies %]
+ [% NEXT UNLESS body.parent.id == c.user.from_body.id %]
+ <option value="[% body.id %]"[% IF body.id == problem.bodies_str %] selected[% END %]>[% body.name %]</option>
+ [% END %]
+ </select>
+
+<li class="assignation">
+<label for="category">
+[% loc('Category:') %] [% problem.category %]<br>
+[% loc('Assign to different category:') %]</label>
+ <select name="category" id="category">
+ <option value="">--</option>
+ [% FOREACH cat IN categories %]
+ <option value="[% cat %]">[% cat %]</option>
+ [% END %]
+ </select></li>
+
+<li class="assignation">
+<label for="body_external">[% loc('Assign to external body:') %]</label>
+ <select name="body_external" id="body_external">
+ <option value="">--</option>
+ [% FOR body IN bodies %]
+ [% NEXT IF body.parent OR body.bodies %]
+ <option value="[% body.id %]"[% IF body.id == problem.bodies_str %] selected[% END %]>[% body.name %]</option>
+ [% END %]
+ </select>
+ <br>
+ <input type="checkbox" name="third_personal" id="third_personal" value="1"[% ' checked' IF problem.extra.third_personal %]>
+ <label for="third_personal" class="inline">Include reporter personal details</label>
+
+</ul>
+
+<script type="text/javascript">
+$(function(){
+ $('.assignation select').change(function(){
+ if (this.value == "") {
+ $('.assignation').css('color', '#000');
+ } else {
+ var a = $(this).closest('li').css('color', '#000');
+ $('.assignation select').not(this).val("");
+ $('.assignation').not(a).css('color', '#999');
+ }
+ });
+});
+</script>
+
+[% ELSIF problem.state == 'planned' %]
+
+ <p>[% loc('State:') %] <select name="state" id="state">
+ <option value="">--</option>
+ [% FOREACH s IN [
+ ['planned', loc('Planned')],
+ ['hidden', loc('Hidden')],
+ ] %]
+ <option [% 'selected ' IF s.0 == problem.state %] value="[% s.0 %]">[% s.1 %]</option>
+ [% END %]
+ </select></p>
+
+ <ul>
+<li><label for="status_update">[% loc('Public response:') %]</label>
+<textarea name='status_update' id='status_update' cols=60 rows=5></textarea></li>
+ </ul>
+
+[% END %]
+
+</div>
+
+<div style="clear:both"></div>
+<p align="right"><input type="submit" name="Submit changes" value="[% loc('Submit changes') %]" ></p>
+
+</form>
+
+[% IF problem.state != 'planned' %]
[% INCLUDE 'admin/list_updates.html' %]
+[% END %]
+
[% INCLUDE 'admin/footer.html' %]
diff --git a/templates/web/zurich/admin/reports.html b/templates/web/zurich/admin/reports.html
new file mode 100644
index 000000000..372e94367
--- /dev/null
+++ b/templates/web/zurich/admin/reports.html
@@ -0,0 +1,25 @@
+[% INCLUDE 'admin/header.html' title=loc('Search Reports') %]
+[% PROCESS 'admin/report_blocks.html' %]
+
+<form method="get" action="[% c.uri_for('reports') %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
+ <p><label for="search">[% loc('Search:') %]</label> <input type="text" name="search" size="30" id="search">
+</form>
+
+[% IF searched %]
+<table cellspacing="0" cellpadding="2" border="1">
+ <tr>
+ <th>[% loc('ID') %]</th>
+ <th>[% loc('Title') %]</th>
+ <th>[% loc('State') %]</th>
+ <th>[% loc('Category') %]</th>
+ <th>[% loc('Created') %]</th>
+ <th>*</th>
+ </tr>
+ [% INCLUDE 'admin/problem_row.html' %]
+</table>
+
+[% INCLUDE 'admin/list_updates.html' %]
+
+[% END %]
+
+[% INCLUDE 'admin/footer.html' %]
diff --git a/templates/web/zurich/header.html b/templates/web/zurich/header.html
index 1e730267d..fdc4f1800 100644
--- a/templates/web/zurich/header.html
+++ b/templates/web/zurich/header.html
@@ -24,7 +24,7 @@
<script src="[% start %][% version('/js/modernizr.custom.js') %]" charset="utf-8"></script>
<script src="[% start %][% version('/cobrands/fixmystreet/position_map.js') %]" charset="utf-8"></script>
- [% INCLUDE 'common_header_tags.html', js_override = '/cobrands/fixmystreet/fixmystreet.js', site_title = 'FixMyZ&uuml;rich' %]
+ [% INCLUDE 'common_header_tags.html', js_override = '/cobrands/fixmystreet/fixmystreet.js', site_title = 'FixMyZurich' %]
[% extra_js %]
<!-- CDN for now FIXME --><script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js" charset="utf-8"></script>