diff options
Diffstat (limited to 'templates/web/default')
46 files changed, 386 insertions, 277 deletions
diff --git a/templates/web/default/admin/bodies.html b/templates/web/default/admin/bodies.html new file mode 100644 index 000000000..a1555cac9 --- /dev/null +++ b/templates/web/default/admin/bodies.html @@ -0,0 +1,50 @@ +[% INCLUDE 'admin/header.html' title=loc('Bodies') -%] + +[% INCLUDE 'admin/edit-league.html' %] + +<table cellspacing="0" cellpadding="2" border="1"> + <tr> + <th>[% loc('Name') %]</th> + [% IF c.cobrand.moniker == 'zurich' %] + <th>[% loc('Email') %]</th> + [% ELSE %] + <th>[% loc('Category') %]</th> + [% END %] + </tr> +[%- FOREACH body IN bodies %] + [%- SET id = body.id %] + [% NEXT IF c.cobrand.moniker == 'zurich' AND admin_type == 'dm' AND (body.parent OR body.bodies) %] + <tr> + <td> + [% IF c.cobrand.moniker == 'zurich' %] + [% FILTER repeat(4*body.api_key) %] [% END %] + [% END %] + <a href="[% c.uri_for( 'body', id ) %]">[% body.name %]</a> + [% IF c.cobrand.moniker != 'zurich' %] + [%- ', ' _ body.parent.name IF body.parent -%] + [% END %] + </td> + [% IF c.cobrand.moniker == 'zurich' %] + <td>[% body.endpoint %]</td> + [% ELSE %] + <td> + [% IF counts.$id %] + [% tprintf( loc('%d addresses'), counts.$id.c) IF c.cobrand.moniker != 'emptyhomes' %] + [% IF counts.$id.deleted %] + (1+ deleted) + [% ELSIF counts.$id.confirmed != counts.$id.c %] + (some unconfirmed) + [% END %] + [% ELSE %] + no categories + [% END %] + </td> + [% END %] + </tr> +[%- END %] +</table> + +<h2>[% loc('Add body') %]</h2> +[% INCLUDE 'admin/body-form.html', body='' %] + +[% INCLUDE 'admin/footer.html' %] diff --git a/templates/web/default/admin/body-form.html b/templates/web/default/admin/body-form.html new file mode 100644 index 000000000..039d83ae2 --- /dev/null +++ b/templates/web/default/admin/body-form.html @@ -0,0 +1,85 @@ + <form method="post" action="[% body ? c.uri_for('body', body.id) : c.uri_for('bodies') %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8"> + + <p> + <label for="name">[% loc('Name') %]</label> + <input type="text" name="name" id="name" value="[% body.name %]" size="50"> + </p> + + <p> + <label for="parent">[% loc('Parent') %]</label> + <select name="parent" id="parent"> + <option value=""> -- [% loc('Select a body') %] -- </option> + [% FOR b IN bodies %] + <option value="[% b.id %]"[% ' selected' IF body.parent.id == b.id %]>[% b.name %]</option> + [% END %] + </select> + </p> + + <p> + <label for="area_ids">[% loc('Area covered') %]</label> + <select name="area_ids" id="area_ids" multiple> + <option value=""> -- [% loc('Select an area') %] -- </option> + [% FOR area IN areas %] + [% SET aid = area.id %] + <option value="[% area.id %]"[% ' selected' IF body.areas.$aid %]>[% area.name %]</option> + [% END %] + </select> + </p> + + <p> + <label for="send_method">Send Method</label> + <select name="send_method" id="send_method"> + <option value=""> -- Select a method -- </option> + [% FOR method IN send_methods %] + <option value="[% method %]"[% ' selected' IF body.send_method == method %]>[% method %]</option> + [% END %] + </select> + </p> + + <p> + <label for="endpoint">[% loc('Endpoint') %]</label> + <input type="text" name="endpoint" id="endpoint" value="[% body.endpoint %]" size="50"> + </p> + + <p> + <label for="jurisdiction">Open311 Jurisdiction</label> + <input type="text" name="jurisdiction" id="jurisdiction" value="[% body.jurisdiction %]" size="50"> + </p> + + <p> + <label for="api_key">Open311 API Key</label> + <input type="text" name="api_key" id="api_key" value="[% body.api_key %]" size="25"> + </p> + + <p> + <input type="checkbox" id="send_comments" name="send_comments"[% ' checked' IF body.send_comments %]> + <label for="send_comments" class="inline">Use Open311 comment sending extension</label> + </p> + + <p> + <label for"comment_user_id">User ID to attribute fetched comments to</label> + <input type="text" name="comment_user_id" value="[% body.comment_user_id %]"> + </p> + + <p> + <input type="checkbox" id="suppress_alerts" name="suppress_alerts"[% ' checked' IF body.suppress_alerts %]> + <label for="suppress_alerts" class="inline">Do not send email alerts on fetched comments to problem creator</label> + </p> + + <p> + <input type="checkbox" id="can_be_devolved" name="can_be_devolved"[% ' checked' IF body.can_be_devolved %]> + <label for="can_be_devolved" class="inline">Endpoint lookup can be devolved to contacts</label> + </p> + + <p> + <label for="send_extended_statuses">Send extended open311 statuses with service request updates</label>: + <input type="checkbox" id="send_extended_statuses" name="send_extended_statuses"[% ' checked' IF conf.send_extended_statuses %]> + </p> + + <p> + <input type="hidden" name="posted" value="body"> + <input type="hidden" name="token" value="[% token %]"> + <input type="submit" value="[% body ? loc('Update body') : loc('Add body') %]"> + </p> + </form> + diff --git a/templates/web/default/admin/council_contacts.html b/templates/web/default/admin/body.html index 56850a82b..120a07da9 100644 --- a/templates/web/default/admin/council_contacts.html +++ b/templates/web/default/admin/body.html @@ -1,6 +1,4 @@ -[% INCLUDE 'admin/header.html' title=tprintf(loc('Council contacts for %s'), council_name) -%] - -[% conf = open311.next %] +[% INCLUDE 'admin/header.html' title=tprintf(loc('Council contacts for %s'), body.name) -%] [% IF updated %] <p> @@ -13,14 +11,14 @@ <a href="[% c.uri_for_email( '/around', { pc => example_pc } ) %]">[% tprintf( loc('Example postcode %s'), example_pc ) | html %]</a> | [% END %] [% IF c.cobrand.moniker == 'emptyhomes' %] -<a href="[% c.uri_for( 'search_reports', search => 'area:' _ area_id ) %]">[% loc('List all reported problems' ) %]</a> +<a href="[% c.uri_for( 'reports', search => 'body:' _ body_id ) %]">[% loc('List all reported problems' ) %]</a> [% ELSE %] -<a href="[% c.uri_for_email( '/reports/' _ area_id ) %]">[% loc('List all reported problems' ) %]</a> +<a href="[% c.uri_for_email( '/reports/' _ body_id ) %]">[% loc('List all reported problems' ) %]</a> [% END %] -<a href="[% c.uri_for( 'council_contacts', area_id, { text => 1 } ) %]">[% loc('Text only version') %]</a> +<a href="[% c.uri_for( 'body', body_id, { text => 1 } ) %]">[% loc('Text only version') %]</a> </p> -[% IF open311.count > 0 %] +[% IF body.send_method == 'Open311' %] <h2> Council contacts configured via Open311 </h2> @@ -30,7 +28,7 @@ <p class="error">Do not give these out except to people at the council.</p> [% END %] -<form method="post" action="[% c.uri_for('council_contacts', area_id ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8"> +<form method="post" action="[% c.uri_for('body', body_id ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8"> <table cellspacing="0" cellpadding="2" border="1"> <tr> @@ -47,11 +45,11 @@ </tr> [% WHILE ( contact = contacts.next ) %] <tr> - <td><a href="[% c.uri_for( 'council_edit', area_id, contact.category ) %]">[% contact.category %]</a></td> + <td><a href="[% c.uri_for( 'body_edit', body_id, contact.category ) %]">[% contact.category %]</a></td> <td>[% contact.email | html %]</td> <td>[% IF contact.confirmed %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]</td> <td>[% IF contact.deleted %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]</td> - <td>[% IF conf.can_be_devolved && contact.send_method %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]</td> + <td>[% IF body.can_be_devolved && contact.send_method %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]</td> <td>[% contact.editor %]</td> <td>[% contact.note | html %]</td> <td>[% contact.non_public ? loc('Non Public') : loc('Public') %]</td> @@ -62,7 +60,6 @@ </table> <p> - <input type="hidden" name="area_id" value="[% area_id %]"> <input type="hidden" name="posted" value="update"> <input type="hidden" name="token" value="[% token %]"> <input type="submit" name="Update statuses" value="[% loc('Update statuses') %]"> @@ -71,7 +68,7 @@ <h2>[% loc('Add new category') %]</h2> - <form method="post" action="[% c.uri_for('council_contacts', area_id ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8"> + <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> @@ -101,7 +98,6 @@ </p> <p> - <input type="hidden" name="area_id" value="[% area_id %]" > <input type="hidden" name="posted" value="new" > <input type="hidden" name="token" value="[% token %]" > <input type="submit" name="Create category" value="[% loc('Create category') %]" > @@ -113,65 +109,7 @@ </div> </form> - <h2>[% loc('Configure Open311 integration') %]</h2> - <form method="post" action="[% c.uri_for('council_contacts', area_id ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8"> - <p> - <label for="endpoint">Endpoint</label> - <input type="text" name="endpoint" id="endpoint" value="[% conf.endpoint %]" size="50"> - </p> - - <p> - <label for="jurisdiction">Jurisdiction</label> - <input type="text" name="jurisdiction" id="jurisdiction" value="[% conf.jurisdiction %]" size="50"> - </p> - - <p> - <label for="api_key">Api Key</label> - <input type="text" name="api_key" id="api_key" value="[% conf.api_key %]" size="25"> - </p> - - <p> - <label for="send_method">Send Method</label> - <select name="send_method"> - <option value=""> -- Select a method -- </option> - [% FOR method IN send_methods %] - <option value="[% method %]"[% ' selected' IF conf.send_method == method %]>[% method %]</option> - [% END %] - </select> - </p> - - <p> - <input type="checkbox" name="send_comments"[% ' checked' IF conf.send_comments %]> - <label for="send_comments" class="inline">Use Open311 comment sending extension</label> - </p> - - <p> - <label for"comment_user_id">User to attribute fetched comments to</label> - <input type="text" name="comment_user_id" value="[% conf.comment_user_id %]"> - </p> - - <p> - <input type="checkbox" name="suppress_alerts"[% ' checked' IF conf.suppress_alerts %]> - <label for="suppress_alerts" class="inline">Do not send email alerts on fetched comments to problem creator</label> - </p> - - <p> - <input type="checkbox" name="devolved"[% ' checked' IF conf.can_be_devolved %]> - <label for="devolved" class="inline">Endpoint lookup can be devolved to contacts</label> - </p> - - <p> - <label for="extended_statuses">Send extended open311 statuses with service request updates</label>: - <input type="checkbox" name="extended_statuses"[% ' checked' IF conf.send_extended_statuses %]> - </p> - - <p> - <input type="hidden" name="open311_id" value="[% conf.id %]"> - <input type="hidden" name="area_id" value="[% area_id %]"> - <input type="hidden" name="posted" value="open311"> - <input type="hidden" name="token" value="[% token %]"> - <input type="submit" name="Configure Open311" value="[% loc('Configure Open311') %]"> - </p> - </form> + <h2>[% loc('Edit body details') %]</h2> + [% INCLUDE 'admin/body-form.html' %] [% INCLUDE 'admin/footer.html' %] diff --git a/templates/web/default/admin/council_edit.html b/templates/web/default/admin/body_edit.html index 408466b51..1eeff9ab5 100644 --- a/templates/web/default/admin/council_edit.html +++ b/templates/web/default/admin/body_edit.html @@ -1,4 +1,4 @@ -[% INCLUDE 'admin/header.html' title=tprintf(loc('Council contacts for %s'), council_name) -%] +[% INCLUDE 'admin/header.html' title=tprintf(loc('Council contacts for %s'), body.name) -%] [% BLOCK highlightchanged_yesno %] [%- output = loc('No') %] @@ -19,37 +19,50 @@ [% END %] </p> -<form method="post" action="[% c.uri_for('council_contacts', area_id ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8"> - <strong>[% loc('Category:') %] </strong>[% contact.category | html %] +<form method="post" action="[% c.uri_for('body', body_id ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8"> + <p><strong>[% loc('Category:') %] </strong>[% contact.category | html %] <input type="hidden" name="category" value="[% contact.category | html %]" > <input type="hidden" name="token" value="[% token %]" > - <strong>[% loc('Email:') %] </strong> + <p><strong>[% loc('Email:') %] </strong> <input type="text" name="email" value="[% contact.email | html %]" size="30"> - <input type="checkbox" name="confirmed" value="1" id="confirmed"[% ' checked' IF contact.confirmed %]> <label for="confirmed">[% loc('Confirmed' ) %]</label> - <input type="checkbox" name="deleted" value="1" id="deleted"[% ' checked' IF contact.deleted %]> <label for="deleted">[% loc('Deleted') %]</label> - <input type="checkbox" name="non_public" value="1" id="non_public"[% ' checked' IF contact.non_public %]> <label for="non_public">[% loc('Private') %]</label><br> - <strong>[% loc('Note:') %] </strong><textarea name="note" rows="3" cols="40">[% contact.note | html %]</textarea> <br> + <p> + [% IF c.cobrand.moniker != 'zurich' %] + <input type="checkbox" name="confirmed" value="1" id="confirmed"[% ' checked' IF contact.confirmed %]> + <label class="inline" for="confirmed">[% loc('Confirmed' ) %]</label> + [% ELSE %] + <input type="hidden" name="confirmed" value="1"> + [% END %] + <input type="checkbox" name="deleted" value="1" id="deleted"[% ' checked' IF contact.deleted %]> + <label class="inline" for="deleted">[% loc('Deleted') %]</label> + [% IF c.cobrand.moniker != 'zurich' %] + <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> + [% END %] + </p> + + <p><strong>[% loc('Note:') %] </strong><textarea name="note" rows="3" cols="40">[% contact.note | html %]</textarea> + [% IF body.can_be_devolved %] <h2>[% loc('Configure Endpoint') %]</h2> - <form method="post" action="[% c.uri_for('council_contacts', area_id ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8"> + <form method="post" action="[% c.uri_for('body', body_id ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8"> <p> - <label for="endpoint">Endpoint</label>: + <label for="endpoint">Endpoint</label> <input type="text" name="endpoint" id="endpoint" value="[% contact.endpoint %]" size="50"> </p> <p> - <label for="jurisdiction">Jurisdiction</label>: + <label for="jurisdiction">Jurisdiction</label> <input type="text" name="jurisdiction" id="jurisdiction" value="[% contact.jurisdiction %]" size="50"> </p> <p> - <label for="api_key">Api Key</label>: + <label for="api_key">Api Key</label> <input type="text" name="api_key" id="api_key" value="[% contact.api_key %]" size="25"> </p> <p> - <label for="send_method">Send Method</label>: + <label for="send_method">Send Method</label> <select name="send_method"> <option value=""> -- Select a method -- </option> [% FOR method IN send_methods %] @@ -57,10 +70,10 @@ [% END %] </select> </p> + [% END %] - <input type="hidden" name="area_id" value="[% area_id %]"> <input type="hidden" name="posted" value="new"> - <input type="submit" name="Save changes" value="[% loc('Save changes') %]"> + <p><input type="submit" name="Save changes" value="[% loc('Save changes') %]"> </form> <h2>[% loc('History') %]</h2> diff --git a/templates/web/default/admin/council_list.html b/templates/web/default/admin/council_list.html deleted file mode 100644 index ac99368fe..000000000 --- a/templates/web/default/admin/council_list.html +++ /dev/null @@ -1,47 +0,0 @@ -[% INCLUDE 'admin/header.html' title=loc('Council contacts') -%] - -[%- BLOCK details %] -[%- IF councils.size == 0 %] - [%- loc('None') %] -[%- ELSE %] -[%- FOREACH council IN councils %] - [%- IF council.parent_area %] - [%- - p_area = areas.$council.parent_area - parent = ', ' _ areas.$parent.name - %] - [%- ELSE %] - [%- parent = '' %] - [%- END %] - [%- '<ul>' IF loop.first %] - <li><a href="[% c.uri_for( 'council_contacts', council ) %]">[% areas.$council.name %] [% parent %][% tprintf( loc('%d addresses'), counts.$council.c) IF counts.$council && c.cobrand.moniker != 'emptyhomes' %]</a> - [%- '</ul>' IF loop.last %] -[%- END %] -[%- END %] -[%- END %] - -<h2>[% loc('Diligency prize league table') %]</h2> -[% IF edit_activity.count %] -<ul> - [% WHILE ( editor = edit_activity.next ) %] - <li>[% tprintf( loc('%d edits by %s'), editor.get_column('c'), editor.editor ) %]</li> - [% END %] -</ul> -[% ELSE %] -<p> -[% loc('No edits have yet been made.') %] -</p> -[% END %] - -<h2>[% loc('Councils') %]</h2> - -<h3>[% loc('No info at all') %]</h3> -[% PROCESS details councils=no_info %] -<h3>[% loc('Currently has 1+ deleted') %]</h3> -[% PROCESS details councils=one_plus_deleted %] -<h3>[% loc('Some unconfirmeds') %]</h3> -[% PROCESS details councils=unconfirmeds %] -<h3>[% loc('All confirmed') %]</h3> -[% PROCESS details councils=all_confirmed %] - -[% INCLUDE 'admin/footer.html' %] diff --git a/templates/web/default/admin/edit-league.html b/templates/web/default/admin/edit-league.html new file mode 100644 index 000000000..6bf71537e --- /dev/null +++ b/templates/web/default/admin/edit-league.html @@ -0,0 +1,14 @@ +<h2>[% loc('Diligency prize league table') %]</h2> +[% IF edit_activity.count %] +<ul> + [% WHILE ( editor = edit_activity.next ) %] + <li>[% tprintf( loc('%d edits by %s'), editor.get_column('c'), editor.editor ) %]</li> + [% END %] +</ul> +[% ELSE %] +<p> +[% loc('No edits have yet been made.') %] +</p> +[% END %] + + diff --git a/templates/web/default/admin/list_flagged.html b/templates/web/default/admin/flagged.html index 0b22bccb2..5af92a23c 100644 --- a/templates/web/default/admin/list_flagged.html +++ b/templates/web/default/admin/flagged.html @@ -38,7 +38,7 @@ <tr> <td>[% user.name | html %]</td> <td>[% user.email | html %]</td> - <td><a href="[% c.uri_for( 'search_reports', search => user.email ) %]">list content</a></td> + <td><a href="[% c.uri_for( 'reports', search => user.email ) %]">list content</a></td> </tr> [%- END %] </table> diff --git a/templates/web/default/admin/list_updates.html b/templates/web/default/admin/list_updates.html index d21919b16..ff0ec2f31 100644 --- a/templates/web/default/admin/list_updates.html +++ b/templates/web/default/admin/list_updates.html @@ -29,10 +29,10 @@ <td>[% PROCESS format_time time=update.created %]</td> <td>[% IF update.anonymous %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]</td> <td>[% IF update.user.id == update.problem.user_id %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]</td> - <td>[% IF update.user.belongs_to_council( update.problem.council ) %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]</td> + <td>[% IF update.user.belongs_to_body( update.problem.bodies_str ) %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]</td> <td>[% update.cobrand %]<br>[% update.cobrand_data | html %]</td> <td>[% update.text | html %]</td> <td><a href="[% c.uri_for( 'update_edit', update.id ) %]">[% loc('Edit') %]</a></td> - <tr> + </tr> [% END -%] </table> diff --git a/templates/web/default/admin/problem_row.html b/templates/web/default/admin/problem_row.html index 5aa8bbfee..1533f8dd2 100644 --- a/templates/web/default/admin/problem_row.html +++ b/templates/web/default/admin/problem_row.html @@ -10,10 +10,12 @@ <td>[% PROCESS value_or_nbsp value=problem.title %]</td> <td>[% PROCESS value_or_nbsp value=problem.name %]</td> <td>[% PROCESS value_or_nbsp value=problem.user.email %]</td> - <td>[%- IF edit_council_contacts -%] - <a href="[% c.uri_for('council_contacts', problem.council ) %]">[% PROCESS value_or_nbsp value=problem.council %]</a> + <td>[%- IF edit_body_contacts -%] + [% FOR body IN problem.bodies.values %] + <a href="[% c.uri_for('body', body.id ) %]">[% PROCESS value_or_nbsp value=body.name %]</a> + [% END %] [%- ELSE -%] - [%- PROCESS value_or_nbsp value=problem.council -%] + [%- PROCESS value_or_nbsp value=problem.bodies_str -%] [%- END -%]</td> <td>[% PROCESS value_or_nbsp value=problem.category %]</td> <td>[% IF problem.anonymous %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]</td> diff --git a/templates/web/default/admin/report_blocks.html b/templates/web/default/admin/report_blocks.html index f08529ce7..bb9f34cb9 100644 --- a/templates/web/default/admin/report_blocks.html +++ b/templates/web/default/admin/report_blocks.html @@ -15,3 +15,10 @@ [% BLOCK flag_button -%] [% IF user.flagged || user_flagged %]<input type="submit" name="removeuserflag" value="[% loc('Remove flag') %]">[% ELSE %]<input type="submit" name="flaguser" value="[% loc('Flag user') %]" />[% END %] [%- END %] + +[%# note: date format here (i.e., dd.mm.YYYY) currently used by Zurich %] +[% BLOCK format_date -%] + [%- IF this_date %] + [% this_date.strftime('%d.%m.%Y') %] + [% ELSE %][% no_time || ' ' %][% END %][% no_time = '' %] +[%- END %] diff --git a/templates/web/default/admin/report_edit.html b/templates/web/default/admin/report_edit.html index ea98a9be9..cd5072d00 100644 --- a/templates/web/default/admin/report_edit.html +++ b/templates/web/default/admin/report_edit.html @@ -11,19 +11,27 @@ [%- cobrand_data = c.data_for_generic_problem IF !problem.cobrand %] <li><a href="[% c.uri_for_email( '/report', problem.id, cobrand_data ) %]">[% loc('View report on site' )%]</a></li> <li><label for='title'>[% loc('Subject:') %]</label> <input size=60 type='text' id='title' name='title' value='[% problem.title | html %]'></li> -<li><label for='detail'>[% loc('Details:') %]</label><br><textarea name='detail' id='detail' cols=60 rows=10>[% problem.detail | html %]</textarea></li> -<li>[% loc('Co-ordinates:') %] [% problem.latitude %], [% problem.longitude %] ( [% loc('originally entered') %] [% problem.postcode | html %] , [% IF problem.used_map %][% loc('used map') %][% ELSE %][% loc("didn't use map") %][% END %])</li> -<li>[% loc('For council(s):') %] [% IF problem.council %][% problem.council %][% ELSE %]<em>[% loc('None' ) %]</em>[% END %] ([% loc('other areas:') %] [% problem.areas | remove('^,') | remove( ',$' ) %])</li> -<li><label for="state">[% loc('State:') %]</label> <select name="state" id="state"> +<li><label for='detail'>[% loc('Details:') %]</label> +<textarea name='detail' id='detail' cols=60 rows=10>[% problem.detail | html %]</textarea></li> + +<li>[% loc('Co-ordinates:') %] [% problem.latitude %], [% problem.longitude %] +( [% + SET postcode_safe = problem.postcode | html; + tprintf( loc('originally entered: “%s”'), postcode_safe ) +%], +[% IF problem.used_map %][% loc('used map') %][% ELSE %][% loc("didn't use map") %][% END %])</li> + +<li>[% loc('For council(s):') %] [% IF problem.bodies_str %][% problem.bodies_str %][% ELSE %]<em>[% loc('None' ) %]</em>[% END %] ([% loc('other areas:') %] [% problem.areas | remove('^,') | remove( ',$' ) %])</li> +<li><label class="inline" for="state">[% loc('State:') %]</label> <select name="state" id="state"> [% FOREACH state IN [ ['confirmed', loc('Open')], ['investigating', loc('Investigating')], ['planned', loc('Planned')], ['in progress', - loc('In Progress')], ['closed', loc('Closed')], ['fixed', loc('Fixed')], ['fixed - user', + loc('In progress')], ['closed', loc('Closed')], ['fixed', loc('Fixed')], ['fixed - user', loc('Fixed - User')], ['fixed - council', loc('Fixed - Council')], ['hidden', loc('Hidden')], ['partial', loc('Partial')],['unconfirmed',loc('Unconfirmed')] ] %] <option [% 'selected ' IF state.0 == problem.state %] value="[% state.0 %]">[% state.1 %]</option> [% END %] </select></li> <li>[% loc('Category:') %] [% problem.category | html %] </li> -<li><label for="anonymous">[% loc('Anonymous:') %]</label> <select name="anonymous" id="anonymous"> +<li><label class="inline" for="anonymous">[% loc('Anonymous:') %]</label> <select name="anonymous" id="anonymous"> <option [% 'selected ' IF problem.anonymous %]value="1">[% loc('Yes') %]</option> <option [% 'selected ' IF !problem.anonymous %]value="0">[% loc('No') %]</option> </select></li> @@ -39,19 +47,19 @@ <li>[% loc('Cobrand data:') %] [% problem.cobrand_data %]</li> <li>[% loc('Extra data:') %] [% problem.extra ? 'Yes' : 'No' %]</li> <li>[% loc('Going to send questionnaire?') %] [% IF problem.send_questionnaire %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]</li> -<li><label for="flagged">[% loc('Flagged:') %]</label> <input type="checkbox" name="flagged"[% ' checked' IF problem.flagged %]></li> -<li><label for="non_public">[% loc('Private') %]:</label> <input type="checkbox" name="non_public"[% ' checked' IF problem.non_public %]></li> +<li><label class="inline" for="flagged">[% loc('Flagged:') %]</label> <input type="checkbox" name="flagged"[% ' checked' IF problem.flagged %]></li> +<li><label class="inline" for="non_public">[% loc('Private') %]:</label> <input type="checkbox" name="non_public"[% ' checked' IF problem.non_public %]></li> [% IF problem.photo %] [% photo = problem.get_photo_params %] <li><img alt="" height="[% photo.height %]" width="[% photo.width %]" 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" /> -<input type="submit" name="rotate_photo" value="Rotate Right" /> +[% IF rotated %]Photo may be cached for a while.<br>[% END %] +<input type="submit" name="rotate_photo" value="[% loc('Rotate Left') %]"> +<input type="submit" name="rotate_photo" value="[% loc('Rotate Right') %]"> <br> <input type="checkbox" id="remove_photo" name="remove_photo" value="1"> -<label for="remove_photo">[% loc("Remove photo (can't be undone!)") %]</label></li> +<label class="inline" for="remove_photo">[% loc("Remove photo (can't be undone!)") %]</label></li> [% END %] </ul> <input type="submit" name="Submit changes" value="[% loc('Submit changes') %]" ></form> diff --git a/templates/web/default/admin/search_reports.html b/templates/web/default/admin/reports.html index 9702c16a7..600f2b436 100644 --- a/templates/web/default/admin/search_reports.html +++ b/templates/web/default/admin/reports.html @@ -1,8 +1,8 @@ [% INCLUDE 'admin/header.html' title=loc('Search Reports') %] [% PROCESS 'admin/report_blocks.html' %] -<form method="get" action="[% c.uri_for('search_reports') %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8"> - <label for="search">[% loc('Search:') %]</label> <input type="text" name="search" size="30" id="search"> +<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> @@ -13,7 +13,7 @@ <th>[% loc('Title') %]</th> <th>[% loc('Name') %]</th> <th>[% loc('Email') %]</th> - <th>[% loc('Council') %]</th> + <th>[% loc('Body') %]</th> <th>[% loc('Category') %]</th> <th>[% loc('Anonymous') %]</th> <th>[% loc('Cobrand') %]</th> diff --git a/templates/web/default/admin/stats.html b/templates/web/default/admin/stats.html index 234600837..bb42d5b7d 100644 --- a/templates/web/default/admin/stats.html +++ b/templates/web/default/admin/stats.html @@ -81,10 +81,10 @@ </p> <p> - [% loc('Council:') %] <select id='council' name='council'> + [% loc('Council:') %] <select id='body' name='body'> <option value=''>[% loc('No council') %]</option> - [% FOR council IN council_ids %] - <option value="[% council %]"[% ' selected' IF council == selected_council %]>[% council_details.$council.name %]</option> + [% FOR body IN bodies %] + <option value="[% body.id %]"[% ' selected' IF body.id == selected_body %]>[% body.name %]</option> [% END %] </select> </p> diff --git a/templates/web/default/admin/timeline.html b/templates/web/default/admin/timeline.html index 95120e48c..4058f7f06 100644 --- a/templates/web/default/admin/timeline.html +++ b/templates/web/default/admin/timeline.html @@ -1,6 +1,4 @@ [% INCLUDE 'admin/header.html' title=loc('Timeline') %] -[%- USE f = DateTime::Format('DateTime::Format::Strptime', { pattern => "%A, %e %B %Y" }) %] -[%- USE alert_format = DateTime::Format('DateTime::Format::Strptime', { pattern => "%H:%M:%S %e %B %Y" }) %] [%- BLOCK problem_name %] [%- tprintf(loc('by %s'), problem.name) | html %] <[% problem.user.email | html %]>, '[% problem.title | html %]' @@ -8,7 +6,7 @@ [%- date = '' %] [% FOREACH moment IN time.keys.sort.reverse %] - [%- curdate = f.format(time.$moment.0.date) -%] + [%- curdate = time.$moment.0.date.strftime('%A, %e %B %Y') -%] [%- IF date != curdate %] [% '</dl>' IF date %] <h2>[% curdate %]</h2> @@ -25,7 +23,7 @@ [% CASE 'problemConfirmed' %] [%- tprintf( loc('Problem %s confirmed'), '<a href="' _ c.uri_for_email( '/report', item.obj.id, c.cobrand_data ) _ '">' _ item.obj.id _ '</a>') %]; [% PROCESS problem_name problem=item.obj -%] [% CASE 'problemSent' %] - [% tprintf(loc("Problem %s sent to council %s"), '<a href="' _ c.uri_for_email( '/report', item.obj.id, c.cobrand_data ) _ '">' _ item.obj.id _ '</a>', item.obj.council ) %] + [% tprintf(loc("Problem %s sent to council %s"), '<a href="' _ c.uri_for_email( '/report', item.obj.id, c.cobrand_data ) _ '">' _ item.obj.id _ '</a>', item.obj.bodies_str ) %] [% CASE 'quesSent' %] [% tprintf(loc("Questionnaire %d sent for problem %d"), item.obj.id, item.obj.problem_id ) %] [% CASE 'quesAnswered' %] @@ -36,7 +34,7 @@ [% CASE 'alertSub' %] [% tprintf(loc("Alert %d created for %s, type %s, parameters %s / %s"), item.obj.id, item.obj.user.email, item.obj.alert_type.ref, item.obj.parameter, item.obj.parameter2) | html %] [% CASE 'alertDel' %] - [% tprintf(loc("Alert %d disabled (created %s)"), item.obj.id, alert_format.format( item.obj.whensubscribed_local ) ) %] + [% tprintf(loc("Alert %d disabled (created %s)"), item.obj.id, item.obj.whensubscribed_local.strftime('%H:%M:%S %e %B %Y') ) %] [%- END %] <br /> [%- END %] diff --git a/templates/web/default/admin/update_edit.html b/templates/web/default/admin/update_edit.html index 1d5ee80b4..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> @@ -22,8 +25,8 @@ </select></li> <li>[% loc('Name:') %] <input type='text' name='name' id='name' value='[% update.name | html %]'></li> <li>[% loc('Email:') %] <input type='text' id='email' name='email' value='[% update.user.email | html %]'> -[%- IF update.user.from_council && update.user.from_council == update.problem.council %] -[% ' (' _ tprintf(loc('user is from same council as problem - %d'), update.user.from_council ) _')' %] +[%- IF update.user.from_body && update.user.from_body.id == update.problem.bodies_str %] +[% ' (' _ tprintf(loc('user is from same council as problem - %d'), update.user.from_body.id ) _')' %] [% END -%] [%- IF update.user.id == update.problem.user.id %] [% ' (' _ loc('user is problem owner') _')' %] diff --git a/templates/web/default/admin/user-form.html b/templates/web/default/admin/user-form.html new file mode 100644 index 000000000..eec54d447 --- /dev/null +++ b/templates/web/default/admin/user-form.html @@ -0,0 +1,18 @@ +<form method="post" action="[% c.uri_for( 'user_edit', user.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>[% loc('Name:') %] <input type='text' name='name' id='name' value='[% user.name | html %]'></li> + <li>[% loc('Email:') %] <input type='text' id='email' name='email' value='[% user.email | html %]'></li> + <li>[% loc('Body:') %] <select id='body' name='body'> + <option value=''>[% loc('No body') %]</option> + [% FOR body IN bodies %] + <option value="[% body.id %]"[% ' selected' IF body.id == user.from_body.id %]>[% body.name %]</option> + [% END %] + </select> + [% IF c.cobrand.moniker != 'zurich' %] + <li>[% loc('Flagged:') %] <input type="checkbox" id="flagged" name="flagged"[% user.flagged ? ' checked' : '' %]></li> + [% END %] + </ul> + <input type="submit" name="Submit changes" value="[% loc('Submit changes') %]" > +</form> diff --git a/templates/web/default/admin/user_edit.html b/templates/web/default/admin/user_edit.html index a03a4b734..d69c873a3 100644 --- a/templates/web/default/admin/user_edit.html +++ b/templates/web/default/admin/user_edit.html @@ -3,20 +3,6 @@ [% status_message %] -<form method="post" action="[% c.uri_for( 'user_edit', user.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>[% loc('Name:') %] <input type='text' name='name' id='name' value='[% user.name | html %]'></li> -<li>[% loc('Email:') %] <input type='text' id='email' name='email' value='[% user.email | html %]'></li> -<li>[% loc('Council:') %] <select id='council' name='council'> - <option value=''>[% loc('No council') %]</option> -[% FOR council IN council_ids %] - <option value="[% council %]"[% ' selected' IF council == user.from_council %]>[% council_details.$council.name %]</option> -[% END %] -</select> -<li>[% loc('Flagged:') %] <input type="checkbox" id="flagged" name="flagged"[% user.flagged ? ' checked' : '' %]></li> -</ul> -<input type="submit" name="Submit changes" value="[% loc('Submit changes') %]" ></form> +[% INCLUDE 'admin/user-form.html' %] [% INCLUDE 'admin/footer.html' %] diff --git a/templates/web/default/admin/search_users.html b/templates/web/default/admin/users.html index 0b4ba88e7..de0b74746 100644 --- a/templates/web/default/admin/search_users.html +++ b/templates/web/default/admin/users.html @@ -1,31 +1,40 @@ [% INCLUDE 'admin/header.html' title=loc('Search Users') %] [% PROCESS 'admin/report_blocks.html' %] -<form method="get" action="[% c.uri_for('search_users') %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8"> - <label for="search">[% loc('Search:') %]</label> <input type="text" name="search" size="30" id="search"> +<form method="get" action="[% c.uri_for('users') %]" 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" value="[% searched | html %]"> </form> - [% IF searched %] + <table cellspacing="0" cellpadding="2" border="1"> <tr> <th>[% loc('Name') %]</th> <th>[% loc('Email') %]</th> - <th>[% loc('Council') %]</th> + <th>[% loc('Body') %]</th> + [% IF c.cobrand.moniker != 'zurich' %] <th>[% loc('Flagged') %]</th> + [% END %] <th>*</th> </tr> [%- FOREACH user IN users %] <tr> <td>[% PROCESS value_or_nbsp value=user.name %]</td> - <td><a href="[% c.uri_for( 'search_reports', search => user.email ) %]">[% PROCESS value_or_nbsp value=user.email %]</a></td> - <td>[% PROCESS value_or_nbsp value=user.from_council %]</td> + <td><a href="[% c.uri_for( 'reports', search => user.email ) %]">[% PROCESS value_or_nbsp value=user.email %]</a></td> + <td>[% PROCESS value_or_nbsp value=user.from_body.name %]</td> + [% IF c.cobrand.moniker != 'zurich' %] <td>[% user.flagged == 2 ? loc('(Email in abuse table)') : user.flagged ? loc('Yes') : ' ' %]</td> + [% END %] <td>[% IF user.id %]<a href="[% c.uri_for( 'user_edit', user.id ) %]">[% loc('Edit') %]</a>[% END %]</td> </tr> [%- END -%] </table> +[% ELSE %] + +<h2>[% loc('Add user') %]</h2> +[% INCLUDE 'admin/user-form.html' %] + [% END %] [% INCLUDE 'admin/footer.html' %] diff --git a/templates/web/default/around/around_map_list_items.html b/templates/web/default/around/around_map_list_items.html index f598a9ba9..655d8bd25 100644 --- a/templates/web/default/around/around_map_list_items.html +++ b/templates/web/default/around/around_map_list_items.html @@ -5,7 +5,7 @@ <li> <a href="[% c.uri_for('/report', p.problem.id ) %]">[% p.problem.title | html %]</a> - <small>[% prettify_epoch( p.problem.confirmed_local.epoch, 1 ) %], [% dist %]km</small> + <small>[% prettify_dt( p.problem.confirmed_local, 1 ) %], [% dist %]km</small> [% IF p.problem.is_fixed %] <small>[% loc('(fixed)') %]</small> [% ELSIF p.problem.is_closed %] diff --git a/templates/web/default/around/display_location.html b/templates/web/default/around/display_location.html index a9f18b9bd..c8c6935de 100755 --- a/templates/web/default/around/display_location.html +++ b/templates/web/default/around/display_location.html @@ -35,7 +35,7 @@ bodyclass => 'mappage', robots => 'noindex,nofollow'; - allow_creation = !c.cobrand.only_authed_can_create || (c.user && c.user.from_council); + allow_creation = !c.cobrand.only_authed_can_create || (c.user && c.user.from_body); %] [% IF allow_creation %] @@ -53,6 +53,9 @@ [% IF c.cobrand.moniker != 'emptyhomes' %] <p id='sub_map_links'> + [% IF c.cobrand.moniker == 'zurich' %] + <a class="hidden-nojs" id="map_layer_toggle" href="">Stadtplan</a> + [% END %] [% IF c.req.params.no_pins %] <a id='hide_pins_link' rel='nofollow' href='[% c.uri_with( { no_pins => 0 } ) %]'>[% loc('Show pins') %]</a> [% ELSE %] diff --git a/templates/web/default/around/on_map_list_items.html b/templates/web/default/around/on_map_list_items.html index e0f8eea08..1022c88a0 100644 --- a/templates/web/default/around/on_map_list_items.html +++ b/templates/web/default/around/on_map_list_items.html @@ -2,7 +2,7 @@ [% FOREACH p IN on_map %] <li> <a href="[% c.uri_for('/report', p.id ) %]">[% p.title | html %]</a> - <small>[% prettify_epoch( p.confirmed_local.epoch, 1 ) %]</small> + <small>[% prettify_dt( p.confirmed_local, 1 ) %]</small> [% IF p.is_fixed %] <small>[% loc('(fixed)') %]</small> [% ELSIF p.is_closed %] diff --git a/templates/web/default/around/postcode_form.html b/templates/web/default/around/postcode_form.html index 935995cfe..f58d7285d 100644 --- a/templates/web/default/around/postcode_form.html +++ b/templates/web/default/around/postcode_form.html @@ -5,7 +5,7 @@ <form action="[% c.uri_for('/around') %]" method="get" name="postcodeForm" id="postcodeForm"> <label for="pc">[% question %]:</label> <span><input type="text" name="pc" value="[% pc | html %]" id="pc" size="10" maxlength="200"> - <input type="submit" value="[% loc('Go') %]" id="submit"> + <input type="submit" value="[% loc('Go') %]" id="sub"> </span> [% IF partial_token %] <input type="hidden" name="partial" value="[% partial_token.token %]"> diff --git a/templates/web/default/auth/sign_out.html b/templates/web/default/auth/sign_out.html index 23d39aa2d..571e13f9f 100644 --- a/templates/web/default/auth/sign_out.html +++ b/templates/web/default/auth/sign_out.html @@ -2,7 +2,6 @@ <h1>[% loc('You have been signed out') %]</h1> -<p>Please feel free to <a href="[% c.uri_for('/auth') %]">sign in again</a>, or -go back to the <a href="/">FixMyStreet front page</a>.</p> +<p>[% tprintf( loc('Please feel free to <a href="%s">sign in again</a>, or go back to the <a href="/">front page</a>.'), c.uri_for('/auth') ) %]</p> [% INCLUDE 'footer.html' %] diff --git a/templates/web/default/auth/token.html b/templates/web/default/auth/token.html index 0f44d1074..5fa69ab21 100644 --- a/templates/web/default/auth/token.html +++ b/templates/web/default/auth/token.html @@ -18,7 +18,9 @@ <p>[% loc("We have sent you an email containing a link to confirm your account.") %]</p> +[% IF c.cobrand.moniker != 'zurich' %] <p>[% loc("The confirmation email <strong>may</strong> take a few minutes to arrive — <em>please</em> be patient.") %]</p> +[% END %] <p>[% loc("If you use web-based email or have 'junk mail' filters, you may wish to check your bulk/spam mail folders: sometimes, our messages are marked that way.") %]</p> diff --git a/templates/web/default/common_header_tags.html b/templates/web/default/common_header_tags.html index 4839249ac..346d53693 100644 --- a/templates/web/default/common_header_tags.html +++ b/templates/web/default/common_header_tags.html @@ -2,7 +2,7 @@ <meta http-equiv="content-type" content="text/html; charset=utf-8"> <script type="text/javascript" src="/js/validation_rules.js?[% Math.int( date.now / 3600 ) %]"></script> -<script type="text/javascript" src="/js/validation_strings.[% lang_code %].js?[% Math.int( date.now / 3600 ) %]"></script> +<script type="text/javascript" src="/js/translation_strings.[% lang_code %].js?[% Math.int( date.now / 3600 ) %]"></script> <script type="text/javascript" src="/jslib/jquery-1.7.2.min.js"></script> <script src="[% version('/js/jquery.validate.min.js') %]" type="text/javascript" charset="utf-8"></script> diff --git a/templates/web/default/contact/index.html b/templates/web/default/contact/index.html index a644ed952..cb87362ba 100644 --- a/templates/web/default/contact/index.html +++ b/templates/web/default/contact/index.html @@ -18,9 +18,9 @@ <blockquote> <p> [% IF update.anonymous %] - [% tprintf( loc('Update below added anonymously at %s'), prettify_epoch( update.confirmed_local.epoch ) ) %] + [% tprintf( loc('Update below added anonymously at %s'), prettify_dt( update.confirmed_local ) ) %] [% ELSE %] - [% tprintf( loc('Update below added by %s at %s'), update.name, prettify_epoch( update.confirmed_local.epoch ) ) | html %] + [% tprintf( loc('Update below added by %s at %s'), update.name, prettify_dt( update.confirmed_local ) ) | html %] [% END %] </p> @@ -42,9 +42,9 @@ <p> [% IF problem.anonymous %] - [% tprintf( loc('Reported anonymously at %s'), prettify_epoch( problem.confirmed_local.epoch ) ) %] + [% tprintf( loc('Reported anonymously at %s'), prettify_dt( problem.confirmed_local ) ) %] [% ELSE %] - [% tprintf( loc('Reported by %s at %s'), problem.user.name, prettify_epoch( problem.confirmed_local.epoch ) ) | html %] + [% tprintf( loc('Reported by %s at %s'), problem.user.name, prettify_dt( problem.confirmed_local ) ) | html %] [% END %] </p> diff --git a/templates/web/default/email_sent.html b/templates/web/default/email_sent.html index fd947022a..9afddf2bd 100644 --- a/templates/web/default/email_sent.html +++ b/templates/web/default/email_sent.html @@ -1,30 +1,34 @@ -[% INCLUDE 'header.html', title => loc('Create a report') %] - -[% - messages = { - problem => { - action => loc('your problem will not be posted'), - worry => loc("we'll hang on to your problem report while you're checking your email."), - }, - update => { - action => loc('your update will not be posted'), - worry => loc("we'll hang on to your update while you're checking your email."), - }, - alert => { - action => loc('your alert will not be activated'), - worry => loc("we'll hang on to your alert while you're checking your email."), - }, - } -%] +[% INCLUDE 'header.html', title = loc('Create a report') %] <h1>[% loc("Nearly Done! Now check your email...") %]</h1> -<p>[% loc("The confirmation email <strong>may</strong> take a few minutes to arrive — <em>please</em> be patient.") %]</p> +[% IF c.cobrand.moniker != 'zurich' %] + <p>[% loc("The confirmation email <strong>may</strong> take a few minutes to arrive — <em>please</em> be patient.") %]</p> +[% END %] <p>[% loc("If you use web-based email or have 'junk mail' filters, you may wish to check your bulk/spam mail folders: sometimes, our messages are marked that way.") %]</p> -<p>[% tprintf( loc("You must now click the link in the email we've just sent you — if you do not, %s."), messages.$email_type.action ) %].</p> +[% IF c.cobrand.moniker != 'zurich' %] + <p> + [% loc("You must now click the link in the email we've just sent you.") %] + [% IF email_type == 'problem' %] + [% loc("If you do not, your problem will not be posted.") %] + [% ELSIF email_type == 'update' %] + [% loc("If you do not, your update will not be posted.") %] + [% ELSIF email_type == 'alert' %] + [% loc("If you do not, your alert will not be activated.") %] + [% END %] + </p> -<p>[% tprintf( loc("(Don't worry — %s)"), messages.$email_type.worry ) %]</p> + <p> + [% IF email_type == 'problem' %] + [% loc("(Don't worry — we'll hang on to your problem report while you're checking your email.)") %] + [% ELSIF email_type == 'update' %] + [% loc("(Don't worry — we'll hang on to your update while you're checking your email.)") %] + [% ELSIF email_type == 'alert' %] + [% loc("(Don't worry — we'll hang on to your alert while you're checking your email.)") %] + [% END %] + </p> +[% END %] [% INCLUDE 'footer.html' %] diff --git a/templates/web/default/front/stats.html b/templates/web/default/front/stats.html index fd1f253bc..eae66018b 100644 --- a/templates/web/default/front/stats.html +++ b/templates/web/default/front/stats.html @@ -38,6 +38,8 @@ <div>[% tprintf( new_text, stats.new ) | comma %]</div> [% IF c.cobrand.moniker != 'emptyhomes' %] <div>[% tprintf( fixed_text, stats.fixed ) | comma %]</div> + [% IF c.cobrand.moniker != 'zurich' %] <div>[% tprintf( updates_text, stats.updates ) | comma %]</div> [% END %] + [% END %] </div> diff --git a/templates/web/default/index.html b/templates/web/default/index.html index 78e4fbba6..beaeefb20 100644 --- a/templates/web/default/index.html +++ b/templates/web/default/index.html @@ -53,7 +53,7 @@ [% FOREACH p IN probs %] <li> <a href="/report/[% p.id %]">[% p.title | html %]</a> - <small>[% prettify_epoch( p.confirmed_local.epoch, 1 ) %]</small> + <small>[% prettify_dt( p.confirmed_local, 1 ) %]</small> </li> [% END %] </ul> diff --git a/templates/web/default/js/validation_strings.html b/templates/web/default/js/translation_strings.html index c33bd2b81..a0cfc02c9 100644 --- a/templates/web/default/js/validation_strings.html +++ b/templates/web/default/js/translation_strings.html @@ -1,4 +1,4 @@ - validation_strings = { + translation_strings = { update: '[% loc('Please enter a message') | replace("'", "\\'") %]', title: '[% loc('Please enter a subject') | replace("'", "\\'") %]', detail: '[% loc('Please enter some details') | replace("'", "\\'") %]', @@ -19,5 +19,22 @@ first_name: '[% loc('Please enter your first name') | replace("'", "\\'") %]', last_name: '[% loc('Please enter your second name') | replace("'", "\\'") %]', geolocate: '[% loc('or locate me automatically') | replace("'", "\\'") %]', + right_place: '[% loc('Right place?') | replace("'", "\\'") %]', + try_again: '[% loc('Try again') | replace("'", "\\'") %]', + place_pin_on_map: '[% loc('Place pin on map') | replace("'", "\\'") %]', + home: '[% loc('Home') | replace("'", "\\'") %]', + back: '[% loc('Back') | replace("'", "\\'") %]', + how_to_send: '[% loc('How to send successful reports') | replace("'", "\\'") %]', + more_details: '[% loc('Details') | replace("'", "\\'") %]', + + geolocation_declined: '[% loc('You declined; please fill in the box above') | replace("'", "\\'") %]', + geolocation_no_position: '[% loc('Could not look up location') | replace("'", "\\'") %]', + geolocation_no_result: '[% loc('No result returned') | replace("'", "\\'") %]', + geolocation_unknown: '[% loc('Unknown error') | replace("'", "\\'") %]', + + reporting_a_problem: '[% loc('Reporting a problem') | replace("'", "\\'") %]', + ok: '[% loc('OK') | replace("'", "\\'") %]', + map: '[% loc('MAP') | replace("'", "\\'") %]', + report_problem_heading: '[% loc('Click map to report a problem') | replace("'", "\\'") %]' }; diff --git a/templates/web/default/my/my.html b/templates/web/default/my/my.html index 3d418cda7..cb9b0dd99 100644 --- a/templates/web/default/my/my.html +++ b/templates/web/default/my/my.html @@ -53,7 +53,7 @@ END %] <li>“[% u.text | html %]” – <a href="[% c.uri_for( '/report', u.problem_id ) %]#update_[% u.id %]">[% u.problem.title | html %]</a>. <em class="council_sent_info"> - [% tprintf( loc("Added %s"), prettify_epoch( u.confirmed_local.epoch, 'date' ) ) %] + [% tprintf( loc("Added %s"), prettify_dt( u.confirmed_local, 'date' ) ) %] </em> </li> [% "</ul>" IF loop.last %] @@ -69,9 +69,9 @@ END %] <li><a href="[% c.uri_for( '/report', p.id ) %]">[% p.title | html %]</a> <em class="council_sent_info"> – [% IF p.whensent %] - [% tprintf( loc("Reported %s, to %s"), prettify_epoch( p.confirmed_local.epoch, 'date' ), p.body(c) ) %] + [% tprintf( loc("Reported %s, to %s"), prettify_dt( p.confirmed_local, 'date' ), p.body(c) ) %] [% ELSE %] - [% tprintf( loc("Reported %s"), prettify_epoch( p.confirmed_local.epoch, 'date' ) ) %] + [% tprintf( loc("Reported %s"), prettify_dt( p.confirmed_local, 'date' ) ) %] [% END %] </em> </li> diff --git a/templates/web/default/questionnaire/completed.html b/templates/web/default/questionnaire/completed.html index 52c20652c..4d848a63c 100644 --- a/templates/web/default/questionnaire/completed.html +++ b/templates/web/default/questionnaire/completed.html @@ -22,7 +22,7 @@ site and leave an update.</p>') %] [% END %] [% IF advert_outcome %] - [% display_crosssell_advert( problem.user.email, problem.name, 'council', problem.council ) %] + [% display_crosssell_advert( problem.user.email, problem.name, 'council', problem.bodies_str ) %] [% END %] [% INCLUDE 'footer.html' %] diff --git a/templates/web/default/report/_main.html b/templates/web/default/report/_main.html index 6b7c1d271..789f8e43e 100644 --- a/templates/web/default/report/_main.html +++ b/templates/web/default/report/_main.html @@ -4,7 +4,7 @@ <p><em> [% problem.meta_line(c) | html %] [%- IF !problem.used_map AND c.cobrand.moniker != 'emptyhomes' %]; <strong>[% loc('there is no pin shown as the user did not use the map') %]</strong>[% END %] - [% IF problem.council %] + [% IF problem.bodies_str %] [% IF problem.whensent || problem.can_display_external_id %] <small class="council_sent_info"><br> [% problem.processed_summary_string(c) %] diff --git a/templates/web/default/report/_support.html b/templates/web/default/report/_support.html index e8b958940..f4bdb8c20 100644 --- a/templates/web/default/report/_support.html +++ b/templates/web/default/report/_support.html @@ -1,7 +1,7 @@ [% IF c.cobrand.can_support_problems %] <p id="supporter"><small> [% IF !problem.interest_count %][% text=loc('No supporters') %][% ELSIF problem.interest_count == 1 %][% text = loc('1 supporter') %][% ELSE %][% text = tprintf( loc('%d supporters' ), problem.interest_count ) %][% END %] - [% IF c.user && c.user.from_council %]<form action="[% c.uri_for( '/report/support' ) %]"> + [% IF c.user && c.user.from_body %]<form action="[% c.uri_for( '/report/support' ) %]"> [% text %] <input type="hidden" name="id" value="[% problem.id %]"><input type="submit" class="green-btn" value="Add support"> </form> [% ELSE %] diff --git a/templates/web/default/report/new/category.html b/templates/web/default/report/new/category.html index 49be4d25d..a701e0851 100644 --- a/templates/web/default/report/new/category.html +++ b/templates/web/default/report/new/category.html @@ -7,7 +7,8 @@ <select name='category' id='form_category'[% ' onchange="form_category_onchange()"' IF category_extras.size %]> [% FOREACH cat_op IN category_options %] [% cat_op_lc = cat_op | lower %] - <option value='[% cat_op | html %]'[% ' selected' IF report.category == cat_op || category == cat_op_lc %]>[% cat_op | html %]</option> + <option value='[% cat_op | html %]'[% ' selected' IF report.category == cat_op || category == cat_op_lc -%] + >[% IF loop.first %][% cat_op %][% ELSE %][% cat_op | html %][% END %]</option> [% END %] </select> [% END %] diff --git a/templates/web/default/report/new/councils_text.html b/templates/web/default/report/new/councils_text.html index 1da5746c1..f526beb28 100644 --- a/templates/web/default/report/new/councils_text.html +++ b/templates/web/default/report/new/councils_text.html @@ -1,7 +1,7 @@ [% FILTER collapse %] -[% IF area_ids_to_list.size == 0 %] +[% IF bodies_to_list.size == 0 %] [% PROCESS 'report/new/councils_text_none.html' %] -[% ELSIF area_ids_to_list.size == all_councils.size %] +[% ELSIF bodies_to_list.size == bodies.size %] [% PROCESS 'report/new/councils_text_all.html' %] [% ELSE %] [% PROCESS 'report/new/councils_text_some.html' %] diff --git a/templates/web/default/report/new/councils_text_all.html b/templates/web/default/report/new/councils_text_all.html index af5d822b0..e9a008e90 100644 --- a/templates/web/default/report/new/councils_text_all.html +++ b/templates/web/default/report/new/councils_text_all.html @@ -1,23 +1,24 @@ +[%# XXX The below type checking is assuming that a body ID can be used to look up a mapit type. %] <p> -[% IF area_ids_to_list.0 != 2489 && area_ids_to_list.0 != 2482 && all_councils.${area_ids_to_list.0}.type == 'LBO' %] +[% IF bodies_to_list.0 != 2489 && bodies_to_list.0 != 2482 && all_areas.${bodies_to_list.0}.type == 'LBO' %] [% tprintf( loc('All the information you provide here will be sent to <strong>%s</strong> or a relevant local body such as <strong>TfL</strong>, via the London Report-It system.'), - all_council_names.join( '</strong>' _ loc(' or ') _ '<strong>' ) + all_body_names.join( '</strong>' _ loc(' or ') _ '<strong>' ) ); %] -[% ELSIF all_councils.${area_ids_to_list.0}.type == 'LGD' %] +[% ELSIF all_areas.${bodies_to_list.0}.type == 'LGD' %] [% tprintf( loc('All the information you provide here will be sent to <strong>%s</strong> or <strong>Roads Service</strong>.'), - all_council_names.join( '</strong>' _ loc(' or ') _ '<strong>' ) + all_body_names.join( '</strong>' _ loc(' or ') _ '<strong>' ) ); %] [% ELSE %] [% tprintf( loc('All the information you provide here will be sent to <strong>%s</strong>.'), - all_council_names.join( '</strong>' _ loc(' or ') _ '<strong>' ) + all_body_names.join( '</strong>' _ loc(' or ') _ '<strong>' ) ); %] [% END %] diff --git a/templates/web/default/report/new/councils_text_none.html b/templates/web/default/report/new/councils_text_none.html index 06a4bbe49..3c445b085 100644 --- a/templates/web/default/report/new/councils_text_none.html +++ b/templates/web/default/report/new/councils_text_none.html @@ -1,11 +1,8 @@ - - <p>[% - nget( "We do not yet have details for the council that covers this location.", "We do not yet have details for the councils that cover this location.", - all_councils.size + missing_details_bodies.size || all_areas.size ); %] [% @@ -14,7 +11,7 @@ [% tprintf( loc("You can help us by finding a contact email address for local problems for %s and emailing it to us at <a href='mailto:%s'>%s</a>."), - all_council_names.join( loc(' or ') ), + missing_details_body_names.join( loc(' or ') ) || all_area_names.join( loc(' or ') ), c.cobrand.contact_email, c.cobrand.contact_email ); diff --git a/templates/web/default/report/new/councils_text_some.html b/templates/web/default/report/new/councils_text_some.html index 042e89914..8d4768612 100644 --- a/templates/web/default/report/new/councils_text_some.html +++ b/templates/web/default/report/new/councils_text_some.html @@ -1,9 +1,9 @@ <p> [% loc('All the information you provide here will be sent to') %] -[% FOREACH council_id IN area_ids_to_list %] +[% FOREACH body_id IN bodies_to_list %] [% loc( ' or ') IF ! loop.first %] - <strong>[% all_councils.$council_id.name %]</strong> + <strong>[% bodies.$body_id.name %]</strong> [%- '.' IF loop.last %] [% END %] @@ -14,13 +14,13 @@ nget( "We do <strong>not</strong> yet have details for the other council that covers this location.", "We do <strong>not</strong> yet have details for the other councils that cover this location.", - missing_details_councils.size + missing_details_bodies.size ); %] [% tprintf( loc("You can help us by finding a contact email address for local problems for %s and emailing it to us at <a href='mailto:%s'>%s</a>."), - missing_details_council_names.join( loc(' or ') ), + missing_details_body_names.join( loc(' or ') ), c.cobrand.contact_email, c.cobrand.contact_email ); diff --git a/templates/web/default/report/new/fill_in_details_form.html b/templates/web/default/report/new/fill_in_details_form.html index 0befb344e..5eff4e147 100644 --- a/templates/web/default/report/new/fill_in_details_form.html +++ b/templates/web/default/report/new/fill_in_details_form.html @@ -40,8 +40,8 @@ -[% IF field_errors.council %] - <div class='form-error'>[% field_errors.council %]</div> +[% IF field_errors.bodies %] + <div class='form-error'>[% field_errors.bodies %]</div> [% END %] [% IF field_errors.title %] diff --git a/templates/web/default/report/update-form.html b/templates/web/default/report/update-form.html index d993ce28f..50bc2906c 100644 --- a/templates/web/default/report/update-form.html +++ b/templates/web/default/report/update-form.html @@ -23,7 +23,7 @@ <textarea name="update" id="form_update" rows="7" cols="30" required>[% update.text | html %]</textarea> </div> - [% IF c.user && c.user.belongs_to_council( problem.council ) %] + [% IF c.user && c.user.belongs_to_body( problem.bodies_str ) %] <div class="form-field"> <label for="form_state">[% loc( 'State:' ) %]</label> <select name="state" id="form_state"> diff --git a/templates/web/default/report/updates.html b/templates/web/default/report/updates.html index 09c5d4b54..04a8bec33 100644 --- a/templates/web/default/report/updates.html +++ b/templates/web/default/report/updates.html @@ -7,21 +7,21 @@ [% IF update.whenanswered %] [%# A questionnaire update, currently saying report is still open %] - [% tprintf( loc( 'Still open, via questionnaire, %s' ), prettify_epoch( update.whenanswered_local.epoch ) ) %] + [% tprintf( loc( 'Still open, via questionnaire, %s' ), prettify_dt( update.whenanswered_local ) ) %] [% RETURN %] [% END %] [% IF update.anonymous || update.name == '' %] - [% tprintf( loc( 'Posted anonymously at %s' ), prettify_epoch( update.confirmed_local.epoch ) ) -%] - [%- ELSIF update.user.from_council; + [% tprintf( loc( 'Posted anonymously at %s' ), prettify_dt( update.confirmed_local ) ) -%] + [%- ELSIF update.user.from_body; user_name = update.user.name | html; - council = update.user.council; - IF council == 'Bromley Council'; - council = "$council <img src='/cobrands/bromley/favicon.png' alt=''>"; + body = update.user.body; + IF body == 'Bromley Council'; + body = "$body <img src='/cobrands/bromley/favicon.png' alt=''>"; END %] - [% tprintf( loc( 'Posted by %s (<strong>%s</strong>) at %s' ), user_name, council, prettify_epoch( update.confirmed_local.epoch ) ) -%] + [% tprintf( loc( 'Posted by %s (<strong>%s</strong>) at %s' ), user_name, body, prettify_dt( update.confirmed_local ) ) -%] [%- ELSE %] - [% tprintf( loc( 'Posted by %s at %s' ), update.name, prettify_epoch( update.confirmed_local.epoch ) ) | html -%] + [% tprintf( loc( 'Posted by %s at %s' ), update.name, prettify_dt( update.confirmed_local ) ) | html -%] [%- END -%] [%- update_state = '' %] [%- IF update.mark_fixed %][% update_state = ", " _ loc( 'marked as fixed' ) %][% END %] diff --git a/templates/web/default/reports/_list-entry.html b/templates/web/default/reports/_list-entry.html index 14863c4a1..445a5315f 100755 --- a/templates/web/default/reports/_list-entry.html +++ b/templates/web/default/reports/_list-entry.html @@ -1,6 +1,6 @@ <li><a href="[% c.uri_for('/report/' _ problem.id) %]">[% problem.title | html %]</a> - [% IF problem.councils > 1 %] <small>[% loc('(sent to both)') %]</small> [% END %] + [% IF problem.bodies_str_ids.size > 1 %] <small>[% loc('(sent to both)') %]</small> [% END %] [% IF c.cobrand.moniker != 'emptyhomes' %] - [% IF problem.councils == 0 %] <small>[% loc('(not sent to council)') %]</small> [% END %] + [% IF problem.bodies_str_ids.size == 0 %] <small>[% loc('(not sent to council)') %]</small> [% END %] [% END %] </li> diff --git a/templates/web/default/reports/body.html b/templates/web/default/reports/body.html index 40f2fd1f8..cc0ba1a49 100755 --- a/templates/web/default/reports/body.html +++ b/templates/web/default/reports/body.html @@ -1,9 +1,9 @@ [% IF ward %] - [% name = "$ward.name, $council.name" + [% name = "$ward.name, $body.name" thing = loc('ward') %] [% ELSE %] - [% name = council.name + [% name = body.name thing = loc('council') %] [% END %] @@ -31,13 +31,13 @@ <h1 id="reports_heading"> [% IF ward %] - [% ward.name %]<span>, </span><a href="[% council_url %]">[% council.name %]</a> + [% ward.name %]<span>, </span><a href="[% body_url %]">[% body.name %]</a> [% ELSE %] - [% council.name %] + [% body.name %] [% END %] </h1> -[% IF council.generation_high == 10 AND c.cobrand.country == 'GB' %] +[% IF NOT body.areas.size AND c.cobrand.country == 'GB' %] <p id="unknown" class="alert">This council no longer exists. [% IF council.name.match('Penwith|Kerrier|Carrick|Restormel|Caradon|North Cornwall') %] Its area is now covered by <a href="/reports/Cornwall">Cornwall Council</a>. @@ -82,7 +82,7 @@ <section class="full-width"> [% INCLUDE column - problems = problems.${council.id} + problems = problems.${body.id} %] </section> diff --git a/templates/web/default/reports/index.html b/templates/web/default/reports/index.html index 76c2afcd2..e4b4c3033 100755 --- a/templates/web/default/reports/index.html +++ b/templates/web/default/reports/index.html @@ -22,17 +22,17 @@ </thead> <tbody> -[% FOREACH area IN areas_info_sorted %] +[% FOREACH body IN bodies %] <tr align="center" -[%- IF area.generation_high == 10 %] class="gone" +[%- IF NOT body.areas.size %] class="gone" [%- ELSIF ! (loop.count % 2) %] class="a" [%- END %]> -<td class="title"><a href="[% area.url %]">[% area.name %]</a></td> -<td class="data">[% open.${area.id}.new or 0 %]</td> -<td class="data">[% open.${area.id}.older or 0 %]</td> -<td class="data">[% open.${area.id}.unknown or 0 %]</td> -<td class="data">[% fixed.${area.id}.new or 0 %]</td> -<td class="data">[% fixed.${area.id}.old or 0 %]</td> +<td class="title"><a href="[% body.url(c) %]">[% body.name %]</a></td> +<td class="data">[% open.${body.id}.new or 0 %]</td> +<td class="data">[% open.${body.id}.older or 0 %]</td> +<td class="data">[% open.${body.id}.unknown or 0 %]</td> +<td class="data">[% fixed.${body.id}.new or 0 %]</td> +<td class="data">[% fixed.${body.id}.old or 0 %]</td> </tr> [% TRY %][% PROCESS "reports/_extras.html" %][% CATCH file %][% END %] [% END %] diff --git a/templates/web/default/tokens/confirm_problem.html b/templates/web/default/tokens/confirm_problem.html index b6d82968f..723d515e1 100644 --- a/templates/web/default/tokens/confirm_problem.html +++ b/templates/web/default/tokens/confirm_problem.html @@ -13,13 +13,12 @@ You can <a href="[% c.cobrand.base_url_for_report( problem ) %][% problem.url %] [% ELSE %] [% loc('You have successfully confirmed your problem'); - - IF problem.council; + IF problem.bodies_str; loc(' and <strong>we will now send it to the council</strong>'); - END; - + END; %]. +[% tprintf( - loc( '. You can <a href="%s%s">view the problem on this site</a>.' ), + loc( 'You can <a href="%s%s">view the problem on this site</a>.' ), c.cobrand.base_url_for_report( problem ), problem.url ); |