aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2012-12-20 17:16:21 +0000
committerMatthew Somerville <matthew@mysociety.org>2012-12-20 17:16:21 +0000
commit39116ace1ea45d88b94dff7835b686c1d6451842 (patch)
tree4eed1a3da5b7c5aa1c310c8c55ba54272ac93ff3
parent50299b7dd2f0ec4b7eef16e0cfdc260a713314ca (diff)
Zurich cut-down update editing (auth still to do).
-rw-r--r--perllib/FixMyStreet/Cobrand/Zurich.pm2
-rw-r--r--templates/web/default/admin/body_edit.html2
-rw-r--r--templates/web/default/admin/update_edit.html5
-rw-r--r--templates/web/zurich/admin/index-sdm.html6
-rw-r--r--templates/web/zurich/admin/update_edit.html40
5 files changed, 51 insertions, 4 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm
index 67329a13f..b62be6468 100644
--- a/perllib/FixMyStreet/Cobrand/Zurich.pm
+++ b/perllib/FixMyStreet/Cobrand/Zurich.pm
@@ -94,7 +94,7 @@ sub admin {
# XXX No multiples or missing bodies
my $p = $c->cobrand->problems->search({
- 'me.state' => 'in progress',
+ 'me.state' => [ 'in progress', 'fixed - council' ],
bodies_str => $body->id,
} );
$c->stash->{reports_new} = $p->search({
diff --git a/templates/web/default/admin/body_edit.html b/templates/web/default/admin/body_edit.html
index 7c9ad5fab..1fde716c9 100644
--- a/templates/web/default/admin/body_edit.html
+++ b/templates/web/default/admin/body_edit.html
@@ -32,7 +32,7 @@
<input type="checkbox" name="deleted" value="1" id="deleted"[% ' checked' IF contact.deleted %]>
<label class="inline" for="deleted">[% loc('Deleted') %]</label>
<input type="checkbox" name="non_public" value="1" id="non_public"[% ' checked' IF contact.non_public %]>
- <label class="inline" for="non_public">[% loc('Private') %]</label><br>
+ <label class="inline" for="non_public">[% loc('Private') %]</label>
<p><strong>[% loc('Note:') %] </strong><textarea name="note" rows="3" cols="40">[% contact.note | html %]</textarea>
diff --git a/templates/web/default/admin/update_edit.html b/templates/web/default/admin/update_edit.html
index 752a6f9db..26d262f73 100644
--- a/templates/web/default/admin/update_edit.html
+++ b/templates/web/default/admin/update_edit.html
@@ -10,7 +10,10 @@
[%- cobrand_data = update.cobrand_data %]
[%- cobrand_data = c.data_for_generic_update IF !update.cobrand %]
<li><a href="[% c.uri_for_email( '/report', update.problem_id, cobrand_data ) %]#update_[% update.id %]">[% loc('View report on site' )%]</a></li>
-<li><label for='detail'>[% loc('Text:') %]</label><br><textarea name='text' id='text' cols=60 rows=10>[% update.text | html %]</textarea></li>
+
+<li><label for='detail'>[% loc('Text:') %]</label>
+<textarea name='text' id='text' cols=60 rows=10>[% update.text | html %]</textarea></li>
+
<li><label for="anonymous">[% loc('Anonymous:') %]</label> <select name="anonymous" id="anonymous">
<option [% 'selected ' IF update.anonymous %]value="1">[% loc('Yes') %]</option>
<option [% 'selected ' IF !update.anonymous %]value="0">[% loc('No') %]</option>
diff --git a/templates/web/zurich/admin/index-sdm.html b/templates/web/zurich/admin/index-sdm.html
index 3d15940f7..7f5d81970 100644
--- a/templates/web/zurich/admin/index-sdm.html
+++ b/templates/web/zurich/admin/index-sdm.html
@@ -5,7 +5,7 @@
[% INCLUDE list, problems = reports_new.all %]
<h2>Reports awaiting approval</h2>
-[% INCLUDE list, problems = reports_unpublished.all %]
+[% INCLUDE list, problems = reports_unpublished.all, no_edit = 1 %]
<h2>Reports published</h2>
[% INCLUDE list, problems = reports_published.all %]
@@ -19,7 +19,9 @@
<th>[% loc('Title') %]</th>
<th>[% loc('Category') %]</th>
<th>[% loc('Created') %]</th>
+ [% IF NOT no_edit %]
<th>*</th>
+ [% END %]
</tr>
[%- FOR problem IN problems %]
<tr[% ' class="adminhidden"' IF problem.state == 'hidden' %]>
@@ -27,7 +29,9 @@
<td>[% PROCESS value_or_nbsp value=problem.title %]</td>
<td>[% problem.category %]</td>
<td>[% PROCESS format_time time=problem.created %]</td>
+ [% IF NOT no_edit %]
<td><a href="[% c.uri_for( 'report_edit', problem.id ) %]">[% loc('Edit') %]</a></td>
+ [% END %]
</tr>
[%- END -%]
</table>
diff --git a/templates/web/zurich/admin/update_edit.html b/templates/web/zurich/admin/update_edit.html
new file mode 100644
index 000000000..d5c62c020
--- /dev/null
+++ b/templates/web/zurich/admin/update_edit.html
@@ -0,0 +1,40 @@
+[% INCLUDE 'admin/header.html' title=tprintf(loc('Editing update %d'), update.id ) -%]
+[% PROCESS 'admin/report_blocks.html' %]
+
+[% status_message %]
+
+<form method="post" action="[% c.uri_for( 'update_edit', update.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" >
+<ul>
+<li><a href="[% c.uri_for_email( '/report', update.problem_id ) %]#update_[% update.id %]">[% loc('View report on site' )%]</a></li>
+
+<li><label for='detail'>[% loc('Text:') %]</label>
+<textarea name='text' id='text' cols=60 rows=5>[% update.text | html %]</textarea></li>
+
+<input type="hidden" name="anonymous" value="[% update.anonymous %]">
+
+<li>[% loc('State:') %] <select name="state" id="state">
+ [% FOREACH state IN [ ['confirmed', loc('Open')], ['hidden', loc('Hidden')], ['unconfirmed',loc('Unconfirmed')] ] %]
+ <option [% 'selected ' IF state.0 == update.state %] value="[% state.0 %]">[% state.1 %]</option>
+ [% END %]
+</select></li>
+<input type='hidden' name='name' id='name' value='[% update.name | html %]'>
+<input type='hidden' id='email' name='email' value='[% update.user.email | html %]'>
+[% IF update.problem_state %]
+<li>[% tprintf(loc('Update changed problem state to %s'), update.problem_state) %]</li>
+[% END %]
+</li>
+
+<li>[% loc('Created:') %] [% PROCESS format_time time=update.created %]</li>
+
+[% IF update.photo %]
+[% photo = update.get_photo_params %]
+<li><img alt="" height="[% photo.height %]" width="[% photo.width %]" src="[% photo.url %]">
+<input type="checkbox" id="remove_photo" name="remove_photo" value="1">
+<label for="remove_photo" class="inline">[% loc("Remove photo (can't be undone!)") %]</label></li>
+[% END %]
+</ul>
+<input type="submit" name="Submit changes" value="[% loc('Submit changes') %]" ></form>
+
+[% INCLUDE 'admin/footer.html' %]