aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-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
9 files changed, 235 insertions, 85 deletions
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>