diff options
Diffstat (limited to 'templates/web/default')
82 files changed, 1732 insertions, 849 deletions
diff --git a/templates/web/default/admin/bodies.html b/templates/web/default/admin/bodies.html new file mode 100644 index 000000000..8bf7954f3 --- /dev/null +++ b/templates/web/default/admin/bodies.html @@ -0,0 +1,75 @@ +[% INCLUDE 'admin/header.html' title=loc('Bodies') -%] + +[% INCLUDE 'admin/edit-league.html' %] + +[% IF bodies.size == 0 %] + <p class="fms-admin-info"> + [% loc('Currently no bodies have been created.') %] + <br> + [% loc('You need to add bodies (such as councils or departments) so that you can then add + the categories of problems they can handle (such as potholes or streetlights) and the + contacts (such as an email address) to which reports are sent.') %] + </p> +[% ELSE %] + <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 %] + <th>[% loc('Deleted') %]</th> + </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[% IF body.deleted %] class="adminhidden"[% END %]> + <td> + [% IF c.cobrand.moniker == 'zurich' %] + [% FILTER repeat(4*body.api_key) %] [% END %] + [% IF admin_type == 'super' %] + <a href="[% c.uri_for( 'body', id ) %]">[% body.name %]</a> + [% ELSE %] + [% body.name %] + [% END %] + [% ELSE %] [%# not Zurich: all bodies should be links %] + <a href="[% c.uri_for( 'body', id ) %]">[% body.name %]</a> + [%- ', ' _ 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 %] + <td>[% IF body.deleted %][% loc('Yes') %][% END %]</td> + </tr> + [%- END %] + </table> +[% END %] + +[% IF c.cobrand.moniker == 'zurich' %] + [% IF admin_type == 'super' %] + <h2>[% loc('Add body') %]</h2> + [% INCLUDE 'admin/body-form.html', body='' %] + [% END %] +[% ELSE %] + <div class="admin-box"> + <h2>[% loc('Add body') %]</h2> + [% INCLUDE 'admin/body-form.html', body='' %] + </div> +[% END %] + +[% 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..f2eb505ab --- /dev/null +++ b/templates/web/default/admin/body-form.html @@ -0,0 +1,236 @@ + <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"> + <div class="fms-admin-info"> + [% loc( + "Add a <strong>body</strong> for each administrative body, such as a council or department + to which problem reports can be sent. You can add one or more contacts (for different + categories of problem) to each body." + ) %] + </div> + <div class="admin-hint"> + <p> + [% loc( + "The body's <strong>name</strong> identifies the body (for example, <em>Borsetshire District Council</em>) + and may be displayed publically." + ) %] + </p> + </div> + <p> + <label for="name">[% loc('Name') %]</label> + <input type="text" name="name" id="name" value="[% body.name %]" size="50"> + </p> + + <div class="admin-hint"> + <p> + [% loc( + "Identify a <strong>parent</strong> if this body is itself part of another body. + For basic installations, you don't need to join bodies in this way." + ) %] + </p> + </div> + <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> + + [% IF areas.size == 0 AND c.config.MAPIT_URL AND (NOT c.config.MAPIT_TYPES OR c.config.MAPIT_TYPES.size==O) %] + <p class="fms-admin-warning"> + [% tprintf( loc( + '<code>MAPIT_URL</code> is set (<code>%s</code>) but no <code>MAPIT_TYPES</code>.<br> + This is probably why "area covered" is empty (below).<br> + Maybe add some <code>MAPIT_TYPES</code> to your config file?'), c.config.MAPIT_URL) + %] + </p> + [% END %] + + <div class="admin-hint"> + <p> + [% loc( + "This body will only be sent reports for problems that are located in the <strong>area covered</strong>. + A body will not receive any reports unless it covers at least one area." + ) %] + <br> + [% IF c.config.MAPIT_URL %] + [% tprintf( loc("The list of available areas is being provided by the MapIt service at %s."), c.config.MAPIT_URL) %] + [% ELSE %] + [% loc( + "No specific areas are currently available, because the <code>MAPIT_URL</code> in + your config file is not pointing to a live MapIt service.") %] + [% END %] + <br> + [% loc("For more information, see <a href='http://code.fixmystreet.com/customising/fms_and_mapit' class='admin-offsite-link'>How FixMyStreet uses Mapit</a>.")%] + </p> + </div> + <p> + <label for="area_ids">[% loc('Area covered') %]</label> + <select name="area_ids" id="area_ids" multiple> + <option value=""> -- [% loc('Select an area') %] -- </option> + [% SET body_areas = body.areas %] + [% FOR area IN areas %] + [% SET aid = area.id %] + <option value="[% area.id %]"[% ' selected' IF body_areas.$aid %]>[% area.name %]</option> + [% END %] + </select> + </p> + + <div class="admin-hint"> + <p>[% loc( "You can mark a body as deleted if you do not want it to be active on the site." ) %]</p> + </div> + <p> + <label for="deleted">[% loc('Flag as deleted') %]</label> + <input type="checkbox" name="deleted" id="deleted" value="1"[% ' checked' IF body.deleted %]> + </p> + + <div class="admin-hint"> + <p> + [% loc( + "The <strong>send method</strong> determines how problem reports will be sent to the body. + If you leave this blank, <strong>send method defaults to email</strong>." + ) %] + </p> + </div> + <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> + + <div class="admin-open311-only"> + <p class="fms-admin-info"> + [% loc( + "These settings are for bodies that use Open311 (or other back-end integration) to receive problem reports.<br> + <strong>You don't need to set them if the Send Method is email.</strong>. + For more information on Open311, see + <a href='http://www.mysociety.org/2013/01/17/open311-explained/' class='admin-offsite-link'>this article</a>. + " + ) %] + </p> + + <div class="admin-hint"> + <p> + [% loc( + "The <strong>endpoint</strong> is the URL of the service that FixMyStreet will connect to + when sending reports to this body." + ) %] + </p> + </div> + <p> + <label for="endpoint">[% loc('Endpoint') %]</label> + <input type="text" name="endpoint" id="endpoint" value="[% body.endpoint %]" size="50"> + </p> + + <div class="admin-hint"> + <p> + [% loc( + "The <strong>jurisdiction</strong> is only needed if the endpoint is serving more + than one. If the body is running its own endpoint, you can usually leave this blank." + ) %] + </p> + </div> + <p> + <label for="jurisdiction">Open311 Jurisdiction</label> + <input type="text" name="jurisdiction" id="jurisdiction" value="[% body.jurisdiction %]" size="50"> + </p> + + <div class="admin-hint"> + <p> + [% loc( + "Some endpoints require an <strong>API key</strong> to indicate that the reports are being + sent from your FixMyStreet installation." + ) %] + </p> + </div> + <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> + + <div class="admin-hint"> + <p> + [% loc( + "Enable <strong>Open311 update-sending</strong> if the endpoint will send and receive + updates to existing reports. If you're not sure, it probably does not, so leave this unchecked. + For more information, see + <a href='http://www.mysociety.org/2013/02/20/open311-extended/' class='admin-offsite-link'>this article</a>." + ) %] + </p> + </div> + <p> + <input type="checkbox" id="send_comments" name="send_comments"[% ' checked' IF body.send_comments %]> + <label for="send_comments" class="inline">Use Open311 update-sending extension</label> + </p> + + <div class="admin-hint"> + <p> + [% loc( + "If you've enabled Open311 update-sending above, you must identify which + FixMyStreet <strong>user</strong> will be attributed as the creator of those updates + when they are shown on the site. Enter the ID (number) of that user." + ) %] + </p> + </div> + <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> + + <div class="admin-hint"> + <p> + [% loc( + "If you've enabled Open311 update-sending above, enable <strong>suppression of alerts</strong> + if you do <strong>not</strong> want that user to be notified whenever these updates are created." + ) %] + </p> + </div> + <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> + + <div class="admin-hint"> + <p> + [% loc( + "If you've enabled Open311 update-sending above, Open311 usually only accepts OPEN or CLOSED status in + its updates. Enable <strong>extended Open311 stauses</strong> if you want to allow extra states to be passed. + Check that your cobrand supports this feature before switching it on." + ) %] + </p> + </div> + <p> + <input type="checkbox" id="send_extended_statuses" name="send_extended_statuses"[% ' checked' IF conf.send_extended_statuses %]> + <label for="send_extended_statuses" class="inline">Send extended Open311 statuses with service request updates</label> + </p> + </div> + + <div class="admin-hint"> + <p> + [% loc( + "Enable this <strong>can be devolved</strong> setting if one or more contacts have a + different endpoint (and send method) from the body's. For example, if reports for some categories of + problem must be emailed, while others can be sent over Open311." + ) %] + <br> + [%# NB 'email' is a literal setting, so not translating it in following string? %] + [% tprintf( loc('Leave this blank if all reports to this body should be sent using the same send method (e.g., "%s").'), body.send_method or 'email' ) %] + </p> + </div> + <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">Send method or endpoints can be devolved to contacts (i.e, can be different from the body's)</label> + </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/body.html b/templates/web/default/admin/body.html new file mode 100644 index 000000000..b207d18ca --- /dev/null +++ b/templates/web/default/admin/body.html @@ -0,0 +1,192 @@ +[% INCLUDE 'admin/header.html' title=tprintf(loc('Council contacts for %s'), body.name) -%] + +[% IF updated %] + <p> + <em>[% updated %]</em> + </p> +[% END %] + +<p> + [% IF example_pc %] + <a href="[% c.uri_for_email( '/around', { pc => example_pc } ) %]" class="admin-offsite-link">[% tprintf( loc('Example postcode %s'), example_pc ) | html %]</a> | + [% END %] + [% IF c.cobrand.moniker == 'emptyhomes' %] + <a href="[% c.uri_for( 'reports', search => 'body:' _ body_id ) %]">[% loc('List all reported problems' ) %]</a> | + [% ELSE %] + <a href="[% c.uri_for_email( '/reports/' _ body_id ) %]" class="admin-offsite-link">[% loc('List all reported problems' ) %]</a> | + [% END %] + <a href="[% c.uri_for( 'body', body_id, { text => 1 } ) %]">[% loc('Text only version') %]</a> +</p> + +[% IF body.send_method == 'Open311' %] + <h2> + Council contacts configured via Open311 + </h2> +[% END %] + +[% IF c.cobrand.moniker == 'fixmystreet' %] + <p class="error">Do not give these out except to people at the council.</p> +[% END %] + +[% IF body.areas.size == 0 %] + <p class="fms-admin-warning"> + [% loc("This body covers no area. This means that it has no jurisdiction over problems reported <em>at any location</em>. + Consequently, none of its categories will appear in the drop-down category menu when users report problems. + Currently, users <strong>cannot report problems to this body</strong>.") %] + <br> + [% loc("Fix this by choosing an <strong>area covered</strong> in the <em>Edit body details</em> form below.") %] + </p> +[% END %] + +[% IF live_contacts == 0 %] + <p class="fms-admin-warning"> + [% loc("This body has no contacts. This means that currently problems reported to this body <strong>will not be sent</strong>.") %] + <br> + [% loc("Add a contact using the form below.") %] + </p> +[% END %] + +<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> + <th>[% loc('Category') %]</th> + <th>[% loc('Email') %]</th> + <th>[% loc('Confirmed') %]</th> + <th>[% loc('Deleted') %]</th> + <th>[% loc('Devolved') %]</th> + <th>[% loc('Last editor') %]</th> + <th>[% loc('Note') %]</th> + <th>[% loc('Public') %]</th> + <th>[% loc('When edited') %]</th> + <th>[% loc('Confirm') %]</th> + </tr> + [% WHILE ( contact = contacts.next ) %] + <tr [% IF contact.deleted %]class="is-deleted"[% END %]> + <td class="contact-category"><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 %]<strong>[% loc('Yes') %]</strong>[% 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> + <td>[% contact.whenedited.ymd _ ' ' _ contact.whenedited.hms %]</td> + <td><input type="checkbox" name="confirmed" value="[% contact.category %]"></td> + </tr> + [% END %] + </table> + + <p> + <input type="hidden" name="posted" value="update"> + <input type="hidden" name="token" value="[% token %]"> + <input type="submit" name="Update statuses" value="[% loc('Update statuses') %]"> + </p> +</form> + +<div class="admin-box"> + <h2>[% loc('Add new category') %]</h2> + <p class="fms-admin-info"> + [% loc("Each contact for the body has a category, which is displayed to the public. + Different categories <strong>can have the same contact</strong> (email address). + This means you can add many categories even if you only have one contact for the body. + ") %] + </p> + + <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' %] + <div class="admin-hint"> + <p> + [% loc('Choose a <strong>category</strong> name that makes sense to the public (e.g., "Pothole", "Street lighting") but is helpful + to the body too. These will appear in the drop-down menu on the report-a-problem page.') %] + <br> + [% loc("If two or more bodies serve the same location, FixMyStreet combines identical categories into a single entry in + the menu. Make sure you use the same category name in the bodies if you want this to happen.") %] + </p> + </div> + <p> + <strong>[% loc('Category:') %] </strong><input type="text" name="category" size="30"> + </p> + [% END %] + + <div class="admin-hint"> + <p> + [% loc("The <strong>email address</strong> is the destination to which reports about this category will be sent. + Other categories for this body may have the same email address.") %] + </p> + [% IF (body.send_method AND body.send_method != 'Email') OR body.can_be_devolved %] + <p> + [% loc("If you're using <strong>a send method that is not email</strong>, enter the service ID (Open311) or equivalent identifier here.") %] + </p> + [% END %] + </div> + + <p> + <strong>[% loc('Email address:') %] </strong><input type="text" name="email" size="30"> + </p> + + <div class="admin-hint"> + <p> + [% loc("Check <strong>confirmed</strong> to indicate that this contact has been confirmed as correct. + If you are not sure of the origin or validity of the contact, leave this unchecked.") %] + </p> + </div> + <p> + <input type="checkbox" name="confirmed" value="1" id="confirmed"> + <label for="confirmed" class="inline">[% loc('Confirmed') %]</label> + </p> + + <div class="admin-hint"> + <p> + [% loc("Check <strong>deleted</strong> to remove the category from use. + It will not appear as an available category in the drop-down menu on the report-a-problem page.") %] + </p> + </div> + <p> + <input type="checkbox" name="deleted" value="1" id="deleted"> + <label for="deleted" class="inline">[% loc('Deleted') %]</label> + </p> + + <div class="admin-hint"> + <p> + [% loc("Use the <strong>note</strong> to record details that are only displayed in the admin. Notes are not shown publicly, and are not sent to the body.") %] + </p> + </div> + <p> + <strong>[% loc('Note:') %] </strong> <textarea name="note" rows="3" cols="40"></textarea> + </p> + + <div class="admin-hint"> + <p> + [% loc("Check <strong>private</strong> if reports in this category should <strong>never be displayed on the website</strong>. + <br> + Normally, categories are not private. + <br> + This is suitable for issues that you want to allow users to report to the body, but for which there is no public + interest in displaying the report. In the UK, we've used this for services like requesting an extra rubbish bin + at a specific address.") %] + </p> + </div> + <p> + <input type="checkbox" name="non_public" value="1" id="non_public"> + <label for="non_public" class="inline">[% loc('Private') %]</label> + </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> +</div> +<div class="admin-box"> + <h2>[% loc('Edit body details') %]</h2> + [% INCLUDE 'admin/body-form.html' %] +</div> +[% INCLUDE 'admin/footer.html' %] diff --git a/templates/web/default/admin/council_edit.html b/templates/web/default/admin/body_edit.html index 408466b51..f2bae0c0b 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') %] @@ -15,41 +15,54 @@ <p> [% IF example_pc %] -<a href="[% c.uri_for_email( '/around', { pc => example_pc } ) %]">[% tprintf( loc('Example postcode %s'), example_pc ) | html %]</a> +<a href="[% c.uri_for_email( '/around', { pc => example_pc } ) %]" class="admin-offsite-link">[% tprintf( loc('Example postcode %s'), example_pc ) | html %]</a> [% 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/config_page.html b/templates/web/default/admin/config_page.html new file mode 100644 index 000000000..f198de2af --- /dev/null +++ b/templates/web/default/admin/config_page.html @@ -0,0 +1,145 @@ +[% INCLUDE 'admin/header.html' title=loc('Configuration') -%] + +[% BLOCK subsection %] +<tr><td colspan=3><strong>[% heading %]</strong></td></tr> +[% END %] + +[% BLOCK just_value %] +[% SET conf = c.config.$value IF NOT conf; + conf = conf.join(', ') IF conf.size %] +<tr> + <td>[% value %]</td> + <td colspan=2>[% conf or conf_default %]</td> +</tr> +[% END %] + +[% BLOCK with_cobrand %] +[% SET conf = c.config.$value IF NOT conf; + conf = conf.join(', ') IF conf.size; + cob = cob.join(', ') IF conf.size %] +<tr> + <td>[% value %]</td> + <td>[% conf %]</td> + <td>[% cob IF cob != conf %]</td> +</tr> +[% END %] + +<p>A summary of this site's configuration, +running version <strong>[% git_version || 'unknown' %]</strong>. +</p> + +<table> +<tr><th>Variable</th> + <th>general.yml value</th> + <th>Cobrand module override</th> +</tr> + +[% INCLUDE subsection heading="URLs" %] +[% INCLUDE with_cobrand value="BASE_URL" cob=c.cobrand.base_url %] +[% INCLUDE with_cobrand value="ADMIN_BASE_URL" cob=c.cobrand.admin_base_url %] + +[% INCLUDE subsection heading="Display" %] +[% allowed_conf = FOR k IN c.config.ALLOWED_COBRANDS %] + [% IF k.keys %][% k.items.join(':') %][% ELSE %][% k %][% END %] + [%- ',' IF NOT loop.last %] +[% END %] +[% INCLUDE just_value value="ALLOWED_COBRANDS" conf = allowed_conf %] +<tr> +<td>Web templates</td> +<td colspan=2>[% c.cobrand.path_to_web_templates.join('<br>') %]</td> +</tr> +[% INCLUDE with_cobrand value="MAP_TYPE" cob=c.cobrand.map_type %] +[% INCLUDE with_cobrand value="EXAMPLE_PLACES" + conf = decode(c.config.EXAMPLE_PLACES.join(', ')) + cob = c.cobrand.example_places %] +[% INCLUDE with_cobrand value="LANGUAGES" + cob = c.cobrand.languages %] +<tr><td>Language override</td> + <td>-</td> + <td> + [% 'domain=' _ c.cobrand.language_domain IF c.cobrand.language_domain %] + [% 'language=' _ c.cobrand.language_override IF c.cobrand.language_override %] + </td> +</tr> +[% INCLUDE with_cobrand value="ALL_REPORTS_PER_PAGE" cob=c.cobrand.reports_per_page %] +[% INCLUDE just_value value="RSS_LIMIT" %] +[% INCLUDE just_value value="AREA_LINKS_FROM_PROBLEMS" %] + +[% INCLUDE subsection heading="Geocoder" %] +[% INCLUDE just_value value="GEOCODER" + conf_default = '<em>(None; default Nominatim OSM)</em>' +%] +[% disconf = FOR k IN c.config.GEOCODING_DISAMBIGUATION %] + [% k.key %]=[% k.value %][% ',' IF NOT loop.last %] +[% END %] +[% discob = FOR k IN c.cobrand.disambiguate_location %] + [% k.key %]=[% k.value %][% ',' IF NOT loop.last %] +[% END %] +[% INCLUDE with_cobrand value="GEOCODING_DISAMBIGUATION" + conf = disconf + cob = discob %] + +[% INCLUDE subsection heading="MapIt" %] +[% INCLUDE just_value value="MAPIT_URL" %] +[% INCLUDE with_cobrand value="MAPIT_TYPES" + cob = c.cobrand.area_types %] +[% INCLUDE just_value value="MAPIT_ID_WHITELIST" %] +[% INCLUDE with_cobrand value="MAPIT_TYPES_CHILDREN" + cob = c.cobrand.area_types_children %] + +[% INCLUDE subsection heading="Database" %] +[% INCLUDE just_value value="FMS_DB_HOST" %] +[% INCLUDE just_value value="FMS_DB_PORT" %] +[% INCLUDE just_value value="FMS_DB_NAME" %] +[% INCLUDE just_value value="FMS_DB_USER" %] + +[% INCLUDE subsection heading="Email" %] +[% INCLUDE just_value value="EMAIL_DOMAIN" %] +[% INCLUDE with_cobrand value="CONTACT_NAME" cob=c.cobrand.contact_name %] +[% INCLUDE with_cobrand value="CONTACT_EMAIL" cob=c.cobrand.contact_email %] +[% INCLUDE just_value value="DO_NOT_REPLY_EMAIL" %] + +[% INCLUDE subsection heading="Development" %] +[% INCLUDE just_value value="STAGING_SITE" %] +[% INCLUDE just_value value="SEND_REPORTS_ON_STAGING" %] +[% INCLUDE just_value value="UPLOAD_DIR" %] +[% INCLUDE just_value value="GEO_CACHE" %] +[% INCLUDE just_value value="TESTING_COUNCILS" %] +[% INCLUDE just_value value="SMTP_SMARTHOST" %] +[% INCLUDE just_value value="TIME_ZONE" %] +[% INCLUDE just_value value="GAZE_URL" %] + +</table> + +<h2>Cobrand module</h2> + +Other things can be changed on a cobrand basis by using functions in an +(optional) Cobrand .pm module, as explained in the +<a href="http://fixmystreet.org/customising/" class="admin-offsite-link">customising section of our +documentation</a>. If you wish to add new functionality just for your cobrand +that can't be done simply by changes to your cobrand's templates, you might +need to add a new Cobrand function. + +<p>Examples of cobrand functions are below; this is not exhaustive. +Many were added for one specific cobrand, so didn't need a general +configuration option. Please feel free to discuss on <a +href="http://fixmystreet.org/community/" class="admin-offsite-link">our mailing list</a> if you think +something should be moved to the general.yml file, done differently, +or have any questions.</p> + +<ul style="font-size: 80%"> +<li>allow_photo_upload: [% c.cobrand.allow_photo_upload %], + allow_photo_display: [% c.cobrand.allow_photo_display %]</li> +<li>send_questionnaires: [% c.cobrand.send_questionnaires %], + ask_ever_reported: [% c.cobrand.ask_ever_reported %]</li> +<li>default_map_zoom: [% c.cobrand.default_map_zoom or '-' %]</li> +<li>default_show_name: [% c.cobrand.default_show_name %]</li> +<li>users_can_hide: [% c.cobrand.users_can_hide %]</li> +<li>report_sent_confirmation_email: [% c.cobrand.report_sent_confirmation_email %]</li> +<li>never_confirm_reports: [% c.cobrand.never_confirm_reports %], + allow_anonymous_reports: [% c.cobrand.allow_anonymous_reports %], + show_unconfirmed_reports: [% c.cobrand.show_unconfirmed_reports %]</li> +</ul> + +[% INCLUDE 'admin/footer.html' %] + diff --git a/templates/web/default/admin/council_contacts.html b/templates/web/default/admin/council_contacts.html deleted file mode 100644 index be855cb95..000000000 --- a/templates/web/default/admin/council_contacts.html +++ /dev/null @@ -1,172 +0,0 @@ -[% INCLUDE 'admin/header.html' title=tprintf(loc('Council contacts for %s'), council_name) -%] - -[% conf = open311.next %] - -[% IF updated %] -<p> -<em>[% updated %]</em> -</p> -[% END %] - -<p> -[% IF example_pc %] -<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> -[% ELSE %] -<a href="[% c.uri_for_email( '/reports/' _ area_id ) %]">[% loc('List all reported problems' ) %]</a> -[% END %] -<a href="[% c.uri_for( 'council_contacts', area_id, { text => 1 } ) %]">[% loc('Text only version') %]</a> -</p> - -[% IF open311.count > 0 %] - <h2> - Council contacts configured via Open311 - </h2> -[% END %] - -[% IF c.cobrand.moniker == 'fixmystreet' %] -<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"> - - <table cellspacing="0" cellpadding="2" border="1"> - <tr> - <th>[% loc('Category') %]</th> - <th>[% loc('Email') %]</th> - <th>[% loc('Confirmed') %]</th> - <th>[% loc('Deleted') %]</th> - <th>[% loc('Devolved') %]</th> - <th>[% loc('Last editor') %]</th> - <th>[% loc('Note') %]</th> - <th>[% loc('Public') %]</th> - <th>[% loc('When edited') %]</th> - <th>[% loc('Confirm') %]</th> - </tr> - [% WHILE ( contact = contacts.next ) %] - <tr> - <td><a href="[% c.uri_for( 'council_edit', area_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>[% contact.editor %]</td> - <td>[% contact.note | html %]</td> - <td>[% contact.non_public ? loc('Non Public') : loc('Public') %]</td> - <td>[% contact.whenedited.ymd _ ' ' _ contact.whenedited.hms %]</td> - <td><input type="checkbox" name="confirmed" value="[% contact.category %]"></td> - </tr> - [% END %] - </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') %]"> - </p> - </form> - - <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"> - - [% 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> - - <p> - <input type="checkbox" name="confirmed" value="1" id="confirmed"> - <label for="confirmed" class="inline">[% loc('Confirmed') %]</label> - - <input type="checkbox" name="deleted" value="1" id="deleted"> - <label for="deleted" class="inline">[% loc('Deleted') %]</label> - </p> - - <p> - <strong>[% loc('Note:') %] </strong> <textarea name="note" rows="3" cols="40"></textarea> - </p> - - <p> - <input type="checkbox" name="non_public" value="1" id="non_public"> - <label for="non_public" class="inline">[% loc('Private') %]</label> - </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') %]" > - </p> - - <div> - <input type="hidden" name=".cgifields" value="confirmed" > - <input type="hidden" name=".cgifields" value="deleted" > - </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> - <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> - -[% INCLUDE 'admin/footer.html' %] 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..4f31eeb2e --- /dev/null +++ b/templates/web/default/admin/edit-league.html @@ -0,0 +1,21 @@ +<div class="admin-hint"> + <p> + [% loc( + "The diligency prize league table shows editors' activity (who's been editing the most records)." + ) %] + </p> +</div> +<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/flagged.html b/templates/web/default/admin/flagged.html new file mode 100644 index 000000000..518d1b14e --- /dev/null +++ b/templates/web/default/admin/flagged.html @@ -0,0 +1,62 @@ +[% INCLUDE 'admin/header.html' title=loc('Flagged reports and users') %] +[% PROCESS 'admin/report_blocks.html' %] + +<p class="fms-admin-info"> + [% loc("You can flag any report or user by editing them, and they will be listed on this page. + For example, this can useful if you want to keep an eye on a user who has posted inappropriate + reports in the past.") %] +</p> + +<h2>[% loc( 'Problems' ) %]</h2> +[% IF problems.size > 0 %] +<table cellspacing="0" cellpadding="2" border="1"> + <tr> + <th>[% loc('ID') %]</th> + <th>[% loc('Title') %]</th> + <th>[% loc('Name') %]</th> + <th>[% loc('Body') %]</th> + <th>[% loc('State') %]</th> + <th>*</th> + </tr> + [% INCLUDE 'admin/problem_row.html' %] +</table> +[% ELSE %] + <p class="fms-admin-warning"> + [% loc('No flagged problems found.') %] + </p> +[% END %] + +<h2>[% loc( 'Users' ) %]</h2> +<p class="fms-admin-info"> + [% loc("Flagged users are not restricted in any way. This is just a list of users that have been marked for attention.") %] +</p> + +[% IF users.size %] +<table cellspacing="0" cellpadding="2" border="1"> + <tr> + <th>[% loc('Name') %]</th> + <th>[% loc('Email') %]</th> + <th>[% loc('In abuse table?') %]</th> + <th> </th> + </tr> + [%- FOREACH user IN users %] + <tr [% IF user.flagged == 2 %]class="is-deleted"[% END %]> + <td>[% user.name | html %]</td> + <td>[% user.email | html %]</td> + <td> + [% IF user.flagged == 2 %] <strong>[% loc('Yes') %]</strong> [% ELSE %] [% END %] + </td> + <td> + <a href="[% c.uri_for( 'reports', search => user.email ) %]">list content</a> + [% IF user.id %] | <a href="[% c.uri_for( 'user_edit', user.id ) %]">[% loc('edit user') %]</a>[% END %] + </td> + </tr> + [%- END %] +</table> +[%- ELSE %] +<p class="fms-admin-warning"> + [% loc('No flagged users found.') %] +</p> +[%- END %] + +[% INCLUDE 'admin/footer.html' %] diff --git a/templates/web/default/admin/header.html b/templates/web/default/admin/header.html index 114c96a18..9f3503e20 100644 --- a/templates/web/default/admin/header.html +++ b/templates/web/default/admin/header.html @@ -1,8 +1,8 @@ -[% INCLUDE 'header.html' admin = 1, bodyclass = 'fullwidthpage' %] +[% INCLUDE 'header.html' admin = 1, bodyclass = 'fullwidthpage admin show-admin-notes' %] <style type="text/css"> dt { clear: left; float: left; font-weight: bold; } dd { margin-left: 8em; } -.hidden { color: #666666; } +.adminhidden { color: #666666; } .error { color: red; } select { width: auto; } </style> diff --git a/templates/web/default/admin/index.html b/templates/web/default/admin/index.html index 2c5ee55db..ad5932d97 100644 --- a/templates/web/default/admin/index.html +++ b/templates/web/default/admin/index.html @@ -1,5 +1,13 @@ [% INCLUDE 'admin/header.html' title=loc('Summary') -%] +[% IF total_bodies == 0 %] + <p class="fms-admin-info"> + [% loc('Currently no bodies have been created.') %] + <br> + [% tprintf( loc('You need to <a href="%s">add some bodies</a> (such as councils or departments) before any reports can be sent.'), c.uri_for('bodies')) %] + </p> +[% END %] + [%- BLOCK states -%] <h2>[% title %]</h2> @@ -21,7 +29,7 @@ [% IF c.cobrand.admin_show_creation_graph -%] <p> - <a href="[% c.config.BASE_URL %]/fms-live-creation.png">[% loc('Graph of problem creation by status over time') %]</a> + <a href="[% c.config.BASE_URL %]/fms-live-creation.png" class="admin-offsite-link">[% loc('Graph of problem creation by status over time') %]</a> </p> [% END -%] diff --git a/templates/web/default/admin/list_flagged.html b/templates/web/default/admin/list_flagged.html deleted file mode 100644 index 0b22bccb2..000000000 --- a/templates/web/default/admin/list_flagged.html +++ /dev/null @@ -1,51 +0,0 @@ -[% INCLUDE 'admin/header.html' title=loc('Search Reports') %] -[% PROCESS 'admin/report_blocks.html' %] - - -<h2>[% loc( 'Problems' ) %]</h2> -[% IF problems.size > 0 %] -<table cellspacing="0" cellpadding="2" border="1"> - <tr> - <th>[% loc('ID') %]</th> - <th>[% loc('Title') %]</th> - <th>[% loc('Name') %]</th> - <th>[% loc('Email') %]</th> - <th>[% loc('Council') %]</th> - <th>[% loc('Category') %]</th> - <th>[% loc('Anonymous') %]</th> - <th>[% loc('Cobrand') %]</th> - <th>[% loc('Created') %]</th> - <th>[% loc('State') %]</th> - <th>[% loc('When sent') %]</th> - <th>*</th> - </tr> - [% INCLUDE 'admin/problem_row.html' %] -</table> -[% ELSE %] -<p> -[% loc('No flagged problems found') %] -</p> -[% END %] - -<h2>[% loc( 'Users' ) %]</h2> -[% IF users%] -<table cellspacing="0" cellpadding="2" border="1"> - <tr> - <th>[% loc('Name') %]</th> - <th>[% loc('Email') %]</th> - </tr> -[% WHILE ( user = users.next ) -%] - <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> - </tr> -[%- END %] -</table> -[%- ELSE %] -<p> -[% loc('No flagged users found') %] -</p> -[%- END %] - -[% INCLUDE 'admin/footer.html' %] diff --git a/templates/web/default/admin/list_updates.html b/templates/web/default/admin/list_updates.html index 0a05ba4ac..02845b0ee 100644 --- a/templates/web/default/admin/list_updates.html +++ b/templates/web/default/admin/list_updates.html @@ -1,38 +1,46 @@ +[% IF updates.size %] <h2>[% loc('Updates') %]</h2> <table cellspacing="0" cellpadding="2" border="1"> <tr> <th>[% loc('ID') %]</th> - <th>[% loc('State') %]</th> <th>[% loc('Name') %]</th> - <th>[% loc('Email') %]</th> - <th>[% loc('Created') %]</th> - <th>[% loc('Anonymous') %]</th> <th>[% loc('Owner') %]</th> <th>[% loc('Council') %]</th> <th>[% loc('Cobrand') %]</th> + <th>[% loc('State') %]</th> <th>[% loc('Text') %]</th> <th>*</th> </tr> [% FOREACH update IN updates -%] - <tr[% ' class="hidden"' IF update.state == 'hidden' || update.problem.state == 'hidden' %]> + <tr[% ' class="adminhidden"' IF update.state == 'hidden' || update.problem.state == 'hidden' %]> <td>[%- IF update.state == 'confirmed' && update.problem.state != 'hidden' -%] - [%- cobrand_data = update.cobrand_data %] - [%- cobrand_data = c.data_for_generic_update IF !update.cobrand %] - <a href="[% c.uri_for_email( '/report', update.problem.id, cobrand_data ) %]#update_[% update.id %]">[% update.id %]</a> + [%- cobrand_data = update.cobrand_data; + cobrand_data = c.data_for_generic_update IF !update.cobrand; + IF cobrand_data; + uri = c.uri_for_email( '/report', update.problem.id, cobrand_data ); + ELSE; + uri = c.uri_for_email( '/report', update.problem.id ); + END; + %] + <a href="[% uri %]#update_[% update.id %]" class="admin-offsite-link">[% update.id %]</a> [%- ELSE %] [%- update.id %] [%- END -%]</td> - <td>[% update.state %]</td> - <td>[% update.name | html %]</td> - <td>[% update.user.email | html %]</td> - <td>[% PROCESS format_time time=update.created %]</td> - <td>[% IF update.anonymous %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]</td> + <td>[% PROCESS value_or_nbsp value=update.name %] + <br>[% PROCESS value_or_nbsp value=update.user.email %] + <br>[% loc('Anonymous') %]: [% 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.state %]<br><small> + [% loc('Created:') %] [% PROCESS format_time time=update.created %] + <br>[% loc('Confirmed:') %] [% PROCESS format_time time=update.confirmed %] + </small></td> <td>[% update.text | html %]</td> <td><a href="[% c.uri_for( 'update_edit', update.id ) %]">[% loc('Edit') %]</a></td> - <tr> + </tr> [% END -%] </table> +[% END %] diff --git a/templates/web/default/admin/problem_row.html b/templates/web/default/admin/problem_row.html index 22825429a..2413a6062 100644 --- a/templates/web/default/admin/problem_row.html +++ b/templates/web/default/admin/problem_row.html @@ -1,31 +1,43 @@ [%- FOR problem IN problems %] - <tr[% ' class="hidden"' IF problem.state == 'hidden' %]> - <td>[%- IF problem.is_visible -%] - [%- cobrand_data = problem.cobrand_data %] - [%- cobrand_data = c.data_for_generic_problem IF !problem.cobrand %] - <a href="[% c.uri_for_email( '/report', problem.id, cobrand_data ) %]">[% problem.id %]</a> + <tr[% ' class="adminhidden"' IF problem.state == 'hidden' %]> + <td class="record-id">[%- IF problem.is_visible -%] + [%- cobrand_data = problem.cobrand_data; + cobrand_data = c.data_for_generic_problem IF !problem.cobrand; + IF cobrand_data; + uri = c.uri_for_email( '/report', problem.id, cobrand_data ); + ELSE; + uri = c.uri_for_email( '/report', problem.id ); + END; + %] + <a href="[% uri %]" class="admin-offsite-link">[% problem.id %]</a> [%- ELSE %] [%- problem.id %] [%- END -%]</td> <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> - [%- ELSE -%] - [%- PROCESS value_or_nbsp value=problem.council -%] - [%- END -%]</td> - <td>[% PROCESS value_or_nbsp value=problem.category %]</td> - <td>[% IF problem.anonymous %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]</td> - <td>[% problem.cobrand %]<br>[% problem.cobrand_data | html %]</td> - <td>[% PROCESS format_time time=problem.created %]</td> - <td>[% problem.state %]<small> - [%- IF problem.is_visible %]<br>[% loc('Confirmed:' ) %] [% PROCESS format_time time=problem.confirmed %][% END -%] - [%- IF problem.is_fixed %]<br>[% loc('Fixed:') %] [% PROCESS format_time time=problem.lastupdate %][% END -%] - [%- IF problem.is_closed %]<br>[% loc('Closed:') %] [% PROCESS format_time time=problem.lastupdate %][% END -%] - [%- IF problem.is_open %]<br>[% loc('Last update:') %] [% PROCESS format_time time=problem.lastupdate %][% END -%]</small> - </td> - <td>[% PROCESS format_time time=problem.whensent %]</td> + <td> + [% PROCESS value_or_nbsp value=problem.name %] + <br>[% PROCESS value_or_nbsp value=problem.user.email %] + <br>[% loc('Anonymous') %]: [% IF problem.anonymous %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %] + </td> + <td> + [% PROCESS value_or_nbsp value=problem.category %] + <br>[%- 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.bodies_str -%] + [%- END -%] + <br>[% problem.cobrand %]<br>[% problem.cobrand_data | html %] + </td> + <td>[% problem.state %]<br><small> + [% loc('Created') %]: [% PROCESS format_time time=problem.created %] + <br>[% loc('When sent') %]: [% PROCESS format_time time=problem.whensent %] + [%- IF problem.is_visible %]<br>[% loc('Confirmed:' ) %] [% PROCESS format_time time=problem.confirmed %][% END -%] + [%- IF problem.is_fixed %]<br>[% loc('Fixed:') %] [% PROCESS format_time time=problem.lastupdate %][% END -%] + [%- IF problem.is_closed %]<br>[% loc('Closed:') %] [% PROCESS format_time time=problem.lastupdate %][% END -%] + [%- IF problem.is_open %]<br>[% loc('Last update:') %] [% PROCESS format_time time=problem.lastupdate %][% END -%] + </small></td> <td><a href="[% c.uri_for( 'report_edit', problem.id ) %]">[% loc('Edit') %]</a></td> </tr> [%- END -%] diff --git a/templates/web/default/admin/report_blocks.html b/templates/web/default/admin/report_blocks.html index f08529ce7..c2cffc352 100644 --- a/templates/web/default/admin/report_blocks.html +++ b/templates/web/default/admin/report_blocks.html @@ -15,3 +15,28 @@ [% 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 %] + +[% BLOCK sort_link %][% IF order == choice %][% c.uri_with( d => 1 - dir ) %][% ELSE %][% c.uri_with( { o => choice, d => 0 } ) %][% END %][% END %] + +[% BLOCK sort_arrow %] + [% IF order == choice %] + <span style="font-size:50%"> + [% IF dir %] + ▼ + [% ELSE %] + ▲ + [% END %] + </span> + [% ELSE %] + <span style="font-size:50%; color: #999;"> + ▲ + </span> + [% END %] +[% END %] diff --git a/templates/web/default/admin/report_edit.html b/templates/web/default/admin/report_edit.html index ea98a9be9..12560fdf3 100644 --- a/templates/web/default/admin/report_edit.html +++ b/templates/web/default/admin/report_edit.html @@ -7,23 +7,59 @@ <input type="hidden" name="token" value="[% token %]" > <input type="hidden" name="submit" value="1" > <ul> - [%- cobrand_data = problem.cobrand_data %] - [%- 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> + [%- cobrand_data = problem.cobrand_data; + cobrand_data = c.data_for_generic_problem IF !problem.cobrand; + IF cobrand_data; + uri = c.uri_for_email( '/report', problem.id, cobrand_data ); + ELSE; + uri = c.uri_for_email( '/report', problem.id ); + END; + %] +<li><a href="[% uri %]" class="admin-offsite-link">[% 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"> - [% 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('Fixed - User')], ['fixed - council', loc('Fixed - Council')], ['hidden', loc('Hidden')], ['partial', loc('Partial')],['unconfirmed',loc('Unconfirmed')] ] %] +<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> +[% IF problem.extra.address %] +<li>[% loc('Property address:') %] [% problem.extra.address | html %]</li> +[% END %] +<li><label class="inline" for="state">[% loc('State:') %]</label> <select name="state" id="state"> +[% FOREACH group IN [ + [ loc('Open'), [ + [ 'confirmed', loc('Open') ], [ 'investigating', loc('Investigating') ], + [ 'planned', loc('Planned') ], [ 'in progress', loc('In progress') ], + [ 'action scheduled', loc('Action Scheduled') ], + ] ], + [ loc('Fixed'), [ + [ 'fixed', loc('Fixed') ], [ 'fixed - user', loc('Fixed - User') ], + [ 'fixed - council', loc('Fixed - Council') ] + ] ], + [ loc('Closed'), [ + [ 'unable to fix', loc('Unable to fix') ], [ 'not responsible', loc('Not Responsible') ], + [ 'duplicate', loc('Duplicate') ], [ 'closed', loc('Closed') ], + [ 'internal referral', loc('Internal referral') ], + ] ], + [ loc('Hidden'), [ + [ 'hidden', loc('Hidden') ], [ 'partial', loc('Partial') ], [ 'unconfirmed',loc('Unconfirmed') ] + ] ] +] %] + <optgroup label="[% group.0 %]"> + [% FOREACH state IN group.1 %] <option [% 'selected ' IF state.0 == problem.state %] value="[% state.0 %]">[% state.1 %]</option> [% END %] + </optgroup> +[% 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 +75,23 @@ <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 %]"> +<li><img alt="Photo of this report" height="[% photo.height %]" width="[% photo.width %]" src="[% c.cobrand.base_url %] + [%~ IF problem.photo.length == 40 ~%] + /photo/[% problem.photo %].temp.jpeg + [%~ ELSE ~%] + [% photo.url %] + [%~ END %]"> <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" /> +<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/reports.html b/templates/web/default/admin/reports.html new file mode 100644 index 000000000..7267dd11d --- /dev/null +++ b/templates/web/default/admin/reports.html @@ -0,0 +1,33 @@ +[% 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" value="[% searched | html %]"> +</form> + +[% IF problems.size %] +<table cellspacing="0" cellpadding="2" border="1"> + <tr> + <th>[% loc('ID') %]</th> + <th>[% loc('Title') %]</th> + <th>[% loc('Name') %]</th> + <th>[% loc('Body') %]</th> + <th>[% loc('State') %]</th> + <th>*</th> + </tr> + [% INCLUDE 'admin/problem_row.html' %] +</table> + +[% INCLUDE 'pagination.html', admin = 1, param = 'p' IF pager %] + +[% ELSIF searched %] + +<div class="fms-admin-warning"> + [% loc("Searching found no reports.") %] +</div> + +[% END %] + +[% INCLUDE 'admin/list_updates.html' %] + +[% INCLUDE 'admin/footer.html' %] diff --git a/templates/web/default/admin/search_reports.html b/templates/web/default/admin/search_reports.html deleted file mode 100644 index 9702c16a7..000000000 --- a/templates/web/default/admin/search_reports.html +++ /dev/null @@ -1,32 +0,0 @@ -[% 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> - - -[% IF searched %] -<table cellspacing="0" cellpadding="2" border="1"> - <tr> - <th>[% loc('ID') %]</th> - <th>[% loc('Title') %]</th> - <th>[% loc('Name') %]</th> - <th>[% loc('Email') %]</th> - <th>[% loc('Council') %]</th> - <th>[% loc('Category') %]</th> - <th>[% loc('Anonymous') %]</th> - <th>[% loc('Cobrand') %]</th> - <th>[% loc('Created') %]</th> - <th>[% loc('State') %]</th> - <th>[% loc('When sent') %]</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/default/admin/search_users.html b/templates/web/default/admin/search_users.html deleted file mode 100644 index 0b4ba88e7..000000000 --- a/templates/web/default/admin/search_users.html +++ /dev/null @@ -1,31 +0,0 @@ -[% 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> - - -[% IF searched %] -<table cellspacing="0" cellpadding="2" border="1"> - <tr> - <th>[% loc('Name') %]</th> - <th>[% loc('Email') %]</th> - <th>[% loc('Council') %]</th> - <th>[% loc('Flagged') %]</th> - <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>[% user.flagged == 2 ? loc('(Email in abuse table)') : user.flagged ? loc('Yes') : ' ' %]</td> - <td>[% IF user.id %]<a href="[% c.uri_for( 'user_edit', user.id ) %]">[% loc('Edit') %]</a>[% END %]</td> - </tr> -[%- END -%] -</table> - -[% END %] - -[% INCLUDE 'admin/footer.html' %] diff --git a/templates/web/default/admin/stats.html b/templates/web/default/admin/stats.html index 234600837..d143d9f28 100644 --- a/templates/web/default/admin/stats.html +++ b/templates/web/default/admin/stats.html @@ -61,15 +61,15 @@ <form method="post" action="[% c.uri_for('stats') %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8"> <p> - <label for="start_date_year">[% loc('Start Year:') %]</label><input type="text" name="start_date_year" id="start_date_year" size="5" value="[% start_date ? start_date.year : '' | html %]" /> - <label for="start_date_month">[% loc('Start month:') %]</label><input type="text" name="start_date_month" id="start_date_month" size="3" value="[% start_date ? start_date.month : '' | html %]" /> - <label for="start_date_day">[% loc('Start day:') %]</label><input type="text" name="start_date_day" id="start_date_day" size="3" value="[% start_date ? start_date.day : '' | html %]" /> + <label for="start_date">[% loc('Start Date:') %]</label><input type="text" + placeholder="[% loc('Click here or enter as dd/mm/yyyy') %]" name="start_date" id="start_date" + value="[% start_date ? start_date.strftime( '%d/%m/%Y') : '' | html %]" /> </p> <p> - <label for="end_date_year">[% loc('End Year:') %]</label><input type="text" name="end_date_year" id="end_date_year" size="5" value="[% end_date ? end_date.year : '' | html %]" /> - <label for="end_date_month">[% loc('End month:') %]</label><input type="text" name="end_date_month" id="end_date_month" size="3" value="[% end_date ? end_date.month : '' | html %]" /> - <label for="end_date_day">[% loc('End day:') %]</label><input type="text" name="end_date_day" id="end_date_day" size="3" value="[% end_date ? end_date.day : '' | html %]" /> + <label for="end_date">[% loc('End Date:') %]</label><input type="text" + placeholder="[% loc('Click here or enter as dd/mm/yyyy') %]" name="end_date" id="end_date" size="5" + value="[% end_date ? end_date.strftime( '%d/%m/%Y') : '' | html %]" /> </p> <p> @@ -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..6bf350a58 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> @@ -23,20 +21,20 @@ [% CASE 'problemCreated' %] [%- tprintf(loc('Problem %d created'), item.obj.id) %]; [% PROCESS problem_name problem=item.obj -%] [% 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 -%] + [%- tprintf( loc('Problem %s confirmed'), '<a href="' _ c.uri_for_email( '/report', item.obj.id ) _ '" class="admin-offsite-link">' _ 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 ) _ '" class="admin-offsite-link">' _ 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' %] [% tprintf(loc("Questionnaire %d answered for problem %d, %s to %s"), item.obj.id, item.obj.problem_id, item.obj.old_state, item.obj.new_state ) %] [% CASE 'update' %] [% name = ( item.obj.name || 'anonymous' ) | html %] - [% tprintf(loc("Update %s created for problem %d; by %s"), "<a href='" _ c.uri_for_email( '/report', item.obj.problem_id, c.cobrand_data ) _ "#update_" _ item.obj.id _ "'>" _ item.obj.id _ "</a>", item.obj.problem_id, name) %] <[% item.obj.user.email | html %]> + [% tprintf(loc("Update %s created for problem %d; by %s"), "<a href='" _ c.uri_for_email( '/report', item.obj.problem_id ) _ "#update_" _ item.obj.id _ "' class='admin-offsite-link'>" _ item.obj.id _ "</a>", item.obj.problem_id, name) %] <[% item.obj.user.email | html %]> [% 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.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..5ffce8bc4 100644 --- a/templates/web/default/admin/update_edit.html +++ b/templates/web/default/admin/update_edit.html @@ -7,10 +7,19 @@ <input type="hidden" name="token" value="[% token %]" > <input type="hidden" name="submit" value="1" > <ul> - [%- 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> + [%- cobrand_data = update.cobrand_data; + cobrand_data = c.data_for_generic_update IF !update.cobrand; + IF cobrand_data; + uri = c.uri_for_email( '/report', update.problem_id, cobrand_data ); + ELSE; + uri = c.uri_for_email( '/report', update.problem_id ); + END; + %] +<li><a href="[% uri %]#update_[% update.id %]" class="admin-offsite-link">[% loc('View report on site' )%]</a></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 +31,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') _')' %] @@ -43,7 +52,12 @@ [% IF update.photo %] [% photo = update.get_photo_params %] -<li><img alt="" height="[% photo.height %]" width="[% photo.width %]" src="[% photo.url %]"> +<li><img alt="Photo of this update" height="[% photo.height %]" width="[% photo.width %]" src="[% c.cobrand.base_url %] + [%~ IF update.photo.length == 40 ~%] + /photo/[% update.photo %].temp.jpeg + [%~ ELSE ~%] + [% photo.url %] + [%~ END ~%]"> <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 %] diff --git a/templates/web/default/admin/user-form.html b/templates/web/default/admin/user-form.html new file mode 100644 index 000000000..4a57b05a0 --- /dev/null +++ b/templates/web/default/admin/user-form.html @@ -0,0 +1,56 @@ +<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" > + + [% IF c.cobrand.moniker == 'zurich' AND field_errors.email %] + <p class='error'>[% field_errors.email %]</p> + [% END %] + <ul class="no-bullets"> + <li> + <div class="admin-hint"> + <p> + [% loc( + "The user's <strong>name</strong> is displayed publicly on reports that have not been marked <em>anonymous</em>. + Names are not necessarily unique.") + %] + </p> + </div> + [% 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> + <div class="admin-hint"> + <p> + [% loc( + "Normal (public) users should not be associated with any <strong>body</strong>.<br> + Authorised staff users can be associated with the body they represent.<br> + Depending on the implementation, staff users may have access to the dashboard (summary of + activity across their body), the ability to hide reports or set special report statuses.") + %] + </p> + </div> + [% 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 %] + </li> + </select> + [% IF c.cobrand.moniker != 'zurich' %] + <li> + <div class="admin-hint"> + <p> + [% loc("Mark users whose behaviour you want to keep a check on as <strong>flagged</strong>.") %] + <br> + [% tprintf(loc("Flagged users are listed on the <a href='%s'>flagged</a> page."), c.uri_for( 'flagged' )) %] + <br> + [% loc("You can add an abusive user's email to the abuse list, which automatically hides (and never sends) reports they create.") %] + </p> + </div> + + [% 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/users.html b/templates/web/default/admin/users.html new file mode 100644 index 000000000..db97c7d59 --- /dev/null +++ b/templates/web/default/admin/users.html @@ -0,0 +1,49 @@ +[% INCLUDE 'admin/header.html' title=loc('Search Users') %] +[% PROCESS 'admin/report_blocks.html' %] + +<div class="fms-admin-info"> + [% loc("User search finds matches in users' names and email addresses.") %] +</div> +<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 users.size %] + +<table cellspacing="0" cellpadding="2" border="1"> + <tr> + <th>[% loc('Name') %]</th> + <th>[% loc('Email') %]</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( '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> + +[% ELSIF searched %] + +<div class="fms-admin-warning"> + [% loc("Searching found no users.") %] +</div> + +[% END %] + +[% IF NOT searched %] +<h2>[% loc('Add user') %]</h2> +[% INCLUDE 'admin/user-form.html', user = '' %] +[% END %] + +[% INCLUDE 'admin/footer.html' %] diff --git a/templates/web/default/alert/index.html b/templates/web/default/alert/index.html index 1f0635ae4..36c0daf91 100644 --- a/templates/web/default/alert/index.html +++ b/templates/web/default/alert/index.html @@ -40,9 +40,11 @@ To find out what local alerts we have for you, please enter your [% c.cobrand.co <div class="sticky-sidebar" id="alert_recent"> <aside> <h2>[% loc('Some photos of recent reports') %]</h2> - [% FOREACH p IN photos %] + [% FOREACH p IN photos; + photo = p.get_photo_params; + %] <a href="/report/[% p.id %]"><img border="0" height="100" - src="/photo/[% p.id %].tn.jpeg" alt="[% p.title | html %]" title="[% p.title | html %]"></a> + src="[% photo.url_tn %]" alt="[% p.title | html %]" title="[% p.title | html %]"></a> [% END %] </aside> </div> diff --git a/templates/web/default/alert/list.html b/templates/web/default/alert/list.html index 20ebbf455..447bfcd76 100644 --- a/templates/web/default/alert/list.html +++ b/templates/web/default/alert/list.html @@ -24,9 +24,11 @@ <div id="alert_photos" class="sticky-sidebar"> <aside> <h2>[% loc('Photos of recent nearby reports') %]</h2> - [% FOREACH p IN photos %] + [% FOREACH p IN photos; + photo = p.get_photo_params; + %] <a href="/report/[% p.id %]"><img border="0" height="100" - src="/photo/[% p.id %].tn.jpeg" alt="[% p.title | html %]" title="[% p.title | html %]"></a> + src="[% photo.url_tn %]" alt="[% p.title | html %]" title="[% p.title | html %]"></a> [% END %] </aside> </div> diff --git a/templates/web/default/around/around_index.html b/templates/web/default/around/around_index.html index a143e90a2..087abf65f 100644 --- a/templates/web/default/around/around_index.html +++ b/templates/web/default/around/around_index.html @@ -6,7 +6,7 @@ [% INCLUDE 'around/postcode_form.html' %] [% IF location_error %] - <p class="error">[% location_error %]</p> + [% INCLUDE 'around/location_error.html' %] [% END %] [% IF possible_location_matches %] diff --git a/templates/web/default/around/around_map_list_items.html b/templates/web/default/around/around_map_list_items.html index f598a9ba9..da75561b5 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, 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 d50009299..c8c6935de 100755 --- a/templates/web/default/around/display_location.html +++ b/templates/web/default/around/display_location.html @@ -29,13 +29,13 @@ PROCESS "maps/${map.type}.html"; + SET rss = [ loc('Recent local problems, FixMyStreet'), rss_url ] IF c.cobrand.moniker != 'emptyhomes'; INCLUDE 'header.html', title => loc('Viewing a location') - rss => [ loc('Recent local problems, FixMyStreet'), rss_url ], 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 %] @@ -51,7 +51,11 @@ [% map_html %] + [% 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 %] @@ -66,6 +70,7 @@ [% END %] [% END %] </p> + [% END %] </div> @@ -79,11 +84,13 @@ [% TRY %][% INCLUDE 'around/extra_text.html' %][% CATCH file %][% END %] [% END %] + [% IF c.cobrand.moniker != 'emptyhomes' %] [% INCLUDE 'around/_updates.html' %] <section class="full-width"> [% INCLUDE "around/tabbed_lists.html" %] </section> + [% END %] </div> [% IF allow_creation %] diff --git a/templates/web/default/around/location_error.html b/templates/web/default/around/location_error.html new file mode 100644 index 000000000..9b907b64b --- /dev/null +++ b/templates/web/default/around/location_error.html @@ -0,0 +1 @@ +<p class="error">[% location_error %]</p> diff --git a/templates/web/default/around/on_map_list_items.html b/templates/web/default/around/on_map_list_items.html index e0f8eea08..70a071406 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, 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..361d4fbd5 100644 --- a/templates/web/default/auth/token.html +++ b/templates/web/default/auth/token.html @@ -4,13 +4,10 @@ <h1>[% loc('Error') %]</h1> -<p>We have not been able to confirm your account - sorry. This may be because:</p> - -<ul> - <li>Link too old or already used</li> - <li>URL not copied correctly</li> - [%# FIXME - add more reasons here %] -</ul> +<p> + [% loc('We have not been able to confirm your account - sorry.') %] + [% loc('This may be because the link is too old or already used, or the address was not copied correctly.') %] +</p> [% ELSE %] @@ -18,7 +15,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..cd6b4ab3a 100644 --- a/templates/web/default/common_header_tags.html +++ b/templates/web/default/common_header_tags.html @@ -1,15 +1,23 @@ [% USE date %][% USE Math %] <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> +<meta name="cobrand" content="[% c.cobrand.moniker %]"> -<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> +<script type="text/javascript" src="[% start %]/js/validation_rules.js?[% Math.int( date.now / 3600 ) %]"></script> +<script type="text/javascript" src="[% start %]/js/translation_strings.[% lang_code %].js?[% Math.int( date.now / 3600 ) %]"></script> -<script type="text/javascript" src="[% version('/js/geo.min.js') %]"></script> -<script type="text/javascript" src="[% version('/js/fixmystreet.js') %]"></script> -<script type="text/javascript" src="[% version(js_override || '/js/fixmystreet-old-box.js') %]"></script> +<script type="text/javascript" src="[% start %]/jslib/jquery-1.7.2.min.js"></script> +<script src="[% start %][% version('/js/jquery.validate.min.js') %]" type="text/javascript" charset="utf-8"></script> + +<script type="text/javascript" src="[% start %][% version('/js/geo.min.js') %]"></script> +<script type="text/javascript" src="[% start %][% version('/js/fixmystreet.js') %]"></script> +<script type="text/javascript" src="[% start %][% version(js_override || '/js/fixmystreet-old-box.js') %]"></script> + +[% IF admin %] + <script src="[% start %]/js/jquery-ui/js/jquery-ui-1.10.3.custom.min.js"></script> + <link rel="stylesheet" href="[% start %]/js/jquery-ui/css/smoothness/jquery-ui-1.10.3.custom.min.css" /> + <script type="text/javascript" src="[% start %][% version('/js/fixmystreet-admin.js') %]"></script> +[% END %] [% map_js %] @@ -25,9 +33,7 @@ <meta name="robots" content="noindex,nofollow"> [% END %] -[% IF rss %] - <link rel="alternate" type="application/rss+xml" title="[% rss.0 %]" href="[% rss.1 %]"> -[% END %] +[% INCLUDE 'header_rss.html' %] <title> [% "$title :: " | html IF title %] diff --git a/templates/web/default/contact/index.html b/templates/web/default/contact/index.html index a644ed952..8789fd03e 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 ) ) %] [% 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 ) ) | html %] [% END %] </p> @@ -38,13 +38,13 @@ </p> <blockquote> - <h2>[% problem.title | html %]</h2> + <h2>[% problem.title_safe | html %]</h2> <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 ) ) %] [% 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 ) ) | html %] [% END %] </p> @@ -83,6 +83,8 @@ <label for="form_subject">[% loc('Subject:') %]</label> <input type="text" class="required" name="subject" id="form_subject" value="[% subject | html %]" size="30"></div> +[% INCLUDE 'contact/who.html' %] + [% IF field_errors.message %] <div class="form-error">[% field_errors.message %]</div> [% END %] diff --git a/templates/web/default/contact/who.html b/templates/web/default/contact/who.html new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/templates/web/default/contact/who.html diff --git a/templates/web/default/dashboard/index.html b/templates/web/default/dashboard/index.html index 169d7d3fe..b3e1e8426 100644 --- a/templates/web/default/dashboard/index.html +++ b/templates/web/default/dashboard/index.html @@ -81,7 +81,7 @@ [% rows = { '0' => [ "in progress", "Council has marked as in progress" ] - '1' => [ "planned", "Council has marked as planned" ] + '1' => [ "action scheduled", "Council has marked as planned" ] '2' => [ "investigating", "Council has marked as investigating" ] '3' => [ "closed", "Council has marked as closed" ] }; @@ -98,10 +98,14 @@ <tr class='subtotal' id="marked"> <th scope="row">Total marked</th> - <td>[% problems.wtd.${"in progress"} + problems.wtd.planned + problems.wtd.investigating + problems.wtd.closed %]</td> - <td>[% problems.week.${"in progress"} + problems.week.planned + problems.week.investigating + problems.wtd.closed %]</td> - <td>[% problems.weeks.${"in progress"} + problems.weeks.planned + problems.weeks.investigating + problems.wtd.closed %]</td> - <td>[% problems.ytd.${"in progress"} + problems.ytd.planned + problems.ytd.investigating + problems.wtd.closed %]</td> + <td>[% problems.wtd.${"in progress"} + problems.wtd.${"action scheduled"} + + problems.wtd.investigating + problems.wtd.closed %]</td> + <td>[% problems.week.${"in progress"} + problems.week.${"action scheduled"} + + problems.week.investigating + problems.wtd.closed %]</td> + <td>[% problems.weeks.${"in progress"} + problems.weeks.${"action scheduled"} + + problems.weeks.investigating + problems.wtd.closed %]</td> + <td>[% problems.ytd.${"in progress"} + problems.ytd.${"action scheduled"} + + problems.ytd.investigating + problems.wtd.closed %]</td> </tr> <tr id="avg_fixed"> @@ -136,12 +140,13 @@ <p>Report state: <select name="state"> <option value=''>All</option> [% FOREACH state IN [ ['confirmed', loc('Open')], ['investigating', - loc('Investigating')], ['planned', loc('Planned')], ['in progress', + loc('Investigating')], ['action scheduled', loc('Planned')], ['in progress', loc('In Progress')], ['closed', loc('Closed')], ['fixed', loc('Fixed')] ] %] <option [% 'selected ' IF state.0 == q_state %] value="[% state.0 %]">[% state.1 %]</option> [% END %] </select> <input type="submit" value="Look up"> +<a class="export_as_csv" href="[% c.req.uri_with({ export => 1 }) %]">Export as CSV</a> <table width="100%" id="reports"> <tr> 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/faq/faq-en-gb.html b/templates/web/default/faq/faq-en-gb.html index 26f93afb8..3bfbfb467 100755 --- a/templates/web/default/faq/faq-en-gb.html +++ b/templates/web/default/faq/faq-en-gb.html @@ -18,7 +18,7 @@ or clearing</strong>, such as: <li>Flytipping or litter <li>Streetcleaning, such as broken glass in a cycle lane [% IF c.cobrand.moniker != 'southampton' %] - <li>Unlit lamposts + <li>Unlit lampposts [% END %] <li>Potholes </ul> @@ -62,19 +62,18 @@ href="https://secure.mysociety.org/donate/">please do</a>.</dd> <dt>Can I use FixMyStreet on my mobile?</dt> <dd> - <p>The FixMyStreet website should work on your mobile phone, adapting to - the size of your screen automatically. We plan to release updated native - apps in the near future. - <ul> - <li><em>iPhone:</em> Our basic app from 2008 is available for download - on the App Store: - <a href="http://itunes.apple.com/gb/app/fixmystreet/id297456545">FixMyStreet</a>, - <li><em>Android:</em> A volunteer, Anna Powell-Smith, has written an app - available from the - <a href="https://market.android.com/details?id=com.android.fixmystreet">Android Market</a>. - <li><em>Nokia:</em> A volunteer, Thomas Forth, has written an app available from the - <a href="http://store.ovi.com/content/107557">Ovi Store</a>. - </ul> + <p>The FixMyStreet website will already work on your mobile phone, adapting to + the size of your screen automatically. Using an app has some advantages, though + — for example, you can create a report even when you have no network + connection. + <ul> + <li> + <a href="https://itunes.apple.com/gb/app/fixmystreet/id297456545">FixMyStreet app for iPhone</a> + <li> + <a href="https://play.google.com/store/apps/details?id=org.mysociety.FixMyStreet">FixMyStreet app for Android</a> + <li><em>Nokia:</em> A volunteer, Thomas Forth, has written an app available from the + <a href="http://store.ovi.com/content/107557">Ovi Store</a>. + </ul> </dd> </dl> diff --git a/templates/web/default/front/stats.html b/templates/web/default/front/stats.html index c5d931d08..5367f1118 100644 --- a/templates/web/default/front/stats.html +++ b/templates/web/default/front/stats.html @@ -36,8 +36,8 @@ <div id="front_stats"> <div>[% tprintf( new_text, stats.new ) | comma %]</div> - [% IF c.cobrand.moniker != 'emptyhomes' %] <div>[% tprintf( fixed_text, stats.fixed ) | comma %]</div> - [% END %] + [% IF c.cobrand.moniker != 'zurich' %] <div>[% tprintf( updates_text, stats.updates ) | comma %]</div> + [% END %] </div> diff --git a/templates/web/default/header_logo.html b/templates/web/default/header_logo.html new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/templates/web/default/header_logo.html diff --git a/templates/web/default/header_opengraph.html b/templates/web/default/header_opengraph.html new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/templates/web/default/header_opengraph.html diff --git a/templates/web/default/header_rss.html b/templates/web/default/header_rss.html new file mode 100644 index 000000000..b93a2e7fc --- /dev/null +++ b/templates/web/default/header_rss.html @@ -0,0 +1,3 @@ +[% IF rss %] + <link rel="alternate" type="application/rss+xml" title="[% rss.0 %]" href="[% rss.1 %]"> +[% END %] diff --git a/templates/web/default/index-steps.html b/templates/web/default/index-steps.html index 7129241d2..431791c20 100644 --- a/templates/web/default/index-steps.html +++ b/templates/web/default/index-steps.html @@ -2,8 +2,23 @@ <ol class="big-numbers"> [% IF c.cobrand.moniker == 'fixmybarangay' %] - <li>Text LUZ or BSN followed by your report to 12345</li> - <li>Visit the Barangay Center in person</li> + <li>Text <span class="promo-big">FMB LUZ</span> or <span class="promo-big">FMB BSN</span> followed by your report to + <ul id="promo-list"> + <li> + <span class="promo-bigger">391-FMB</span> (391362) SMART short code + </li> + <li> + <span class="promo-bigger">0908 896 8278</span> for all networks + </li> + </ul> + <div class="promo-example"> + For example:<br/> + <div> + FMB LUZ Busted streetlamp, P. Cabantan St., Pole # 12345, near Sto. Antonio Chapel + </div> + </div> + </li> + <li>Or visit the Barangay Center in person</li> <li>Staff? <a href="/auth">Sign in</a> and click on the map! [% ELSE %] <li>[% question %]</li> @@ -11,14 +26,17 @@ <li>[% loc('Enter details of the problem') %]</li> [% IF c.cobrand.is_council %] <li>Confirm the report and [% c.cobrand.council_name %] will investigate</li> + [% ELSIF c.cobrand.moniker == 'zurich' %] [% ELSE %] <li>[% loc('We send it to the council on your behalf') %]</li> [% END %] [% END %] </ol> +[% IF c.cobrand.moniker != 'emptyhomes' %] <section class="full-width"> [% INCLUDE "front/stats.html" %] [% TRY %][% INCLUDE "front/tips.html" %][% CATCH file %][% END %] </section> +[% END %] diff --git a/templates/web/default/index.html b/templates/web/default/index.html index 3698d6494..37bdd8c1e 100644 --- a/templates/web/default/index.html +++ b/templates/web/default/index.html @@ -8,12 +8,10 @@ [% subhead = c.cobrand.moniker == 'southampton' - ? '(like graffiti, fly tipping, or broken paving slabs)' + ? '' : loc('(like graffiti, fly tipping, broken paving slabs, or street lighting)'); %] - <strong>[% loc('Report, view, or discuss local problems') %]</strong> - [% IF subhead != ' ' %] <small>[% subhead %]</small> [% END %] @@ -37,9 +35,11 @@ <h2>[% loc('Recently reported problems') %]</h2> [% IF recent_photos.size %] <p id="front_photos"> - [% FOREACH p IN recent_photos %] + [% FOREACH p IN recent_photos; + photo = p.get_photo_params; + %] <a href="/report/[% p.id %]"><img border="0" height="100" - src="/photo/[% p.id %].tn.jpeg" alt="[% p.title | html %]" title="[% p.title | html %]"></a> + src="[% photo.url_tn %]" alt="[% p.title | html %]" title="[% p.title | html %]"></a> [% END %] </p> [% END %] @@ -49,7 +49,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, 1 ) %]</small> </li> [% END %] </ul> diff --git a/templates/web/default/js/translation_strings.html b/templates/web/default/js/translation_strings.html new file mode 100644 index 000000000..a14443b71 --- /dev/null +++ b/templates/web/default/js/translation_strings.html @@ -0,0 +1,48 @@ + translation_strings = { + update: '[% loc('Please enter a message') | replace("'", "\\'") %]', + title: '[% loc('Please enter a subject') | replace("'", "\\'") %]', + detail: '[% loc('Please enter some details') | replace("'", "\\'") %]', + name: { + required: '[% loc('Please enter your name') | replace("'", "\\'") %]', + validName: '[% loc('Please enter your full name, councils need this information – if you do not wish your name to be shown on the site, untick the box below') | replace("'", "\\'") %]' + }, + category: '[% loc('Please choose a category') | replace("'", "\\'") %]', + rznvy: { + required: '[% loc('Please enter your email') | replace("'", "\\'") %]', + email: '[% loc('Please enter a valid email') | replace("'", "\\'") %]' + }, + email: { + required: '[% loc('Please enter your email') | replace("'", "\\'") %]', + email: '[% loc('Please enter a valid email') | replace("'", "\\'") %]' + }, + password_sign_in: { + required: '[% loc('Please enter a password') | replace("'", "\\'") %]' + }, + phone: { + required: '[% loc('Please enter your phone number') | replace("'", "\\'") %]' + }, + fms_extra_title: '[% loc('Please enter your title') | replace("'", "\\'") %]', + 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("'", "\\'") %]', + + permalink: '[% loc('Permalink') | replace("'", "\\'") %]', + + report_problem_heading: '[% loc('Click map to report a problem') | replace("'", "\\'") %]' + }; diff --git a/templates/web/default/js/validation_strings.html b/templates/web/default/js/validation_strings.html deleted file mode 100644 index 3148d1993..000000000 --- a/templates/web/default/js/validation_strings.html +++ /dev/null @@ -1,21 +0,0 @@ - validation_strings = { - update: '[% loc('Please enter a message') | replace("'", "\\'") %]', - title: '[% loc('Please enter a subject') | replace("'", "\\'") %]', - detail: '[% loc('Please enter some details') | replace("'", "\\'") %]', - name: { - required: '[% loc('Please enter your name') | replace("'", "\\'") %]', - validName: '[% loc('Please enter your full name, councils need this information – if you do not wish your name to be shown on the site, untick the box below') | replace("'", "\\'") %]' - }, - category: '[% loc('Please choose a category') | replace("'", "\\'") %]', - rznvy: { - required: '[% loc('Please enter your email') | replace("'", "\\'") %]', - email: '[% loc('Please enter a valid email') | replace("'", "\\'") %]' - }, - email: { - required: '[% loc('Please enter your email') | replace("'", "\\'") %]', - email: '[% loc('Please enter a valid email') | replace("'", "\\'") %]' - }, - fms_extra_title: '[% loc('Please enter your title') | replace("'", "\\'") %]', - first_name: '[% loc('Please enter your first name') | replace("'", "\\'") %]', - last_name: '[% loc('Please enter your second name') | replace("'", "\\'") %]' - }; diff --git a/templates/web/default/maps/bing.html b/templates/web/default/maps/bing.html deleted file mode 100644 index 277886cdb..000000000 --- a/templates/web/default/maps/bing.html +++ /dev/null @@ -1,18 +0,0 @@ -[% map_js = BLOCK %] -<script type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0&mkt=en-GB"></script> -<script type="text/javascript" src="[% version('/js/map-bing.js') %]"></script> -[% END %] - -[% map_html = BLOCK %] -<script type="text/javascript"> -var fixmystreet = { - 'key': '[% map.key %]', - 'latitude': [% map.latitude %], - 'longitude': [% map.longitude %], - 'pins': [% INCLUDE maps/pins_js.html %] -} -</script> -<div id="map_box"> - [% pre_map %] - <div id="map"></div> -[% END %] diff --git a/templates/web/default/maps/fms.html b/templates/web/default/maps/fms.html index 956a22e69..1cdfc0b35 100644 --- a/templates/web/default/maps/fms.html +++ b/templates/web/default/maps/fms.html @@ -5,7 +5,7 @@ <script type="text/javascript" src="[% version('/js/map-bing-ol.js') %]"></script> <script type="text/javascript" src="[% version('/js/jquery.ba-hashchange.min.js') %]"></script> <!--[if lte IE 6]> - <link rel="stylesheet" href="/jslib/OpenLayers-2.10/theme/default/ie6-style.css" type="text/css" /> + <link rel="stylesheet" href="/js/OpenLayers-2.13.1/theme/default/ie6-style.css" type="text/css"> <![endif]--> [% END %] diff --git a/templates/web/default/maps/google-ol.html b/templates/web/default/maps/google-ol.html new file mode 100644 index 000000000..35c046b55 --- /dev/null +++ b/templates/web/default/maps/google-ol.html @@ -0,0 +1,15 @@ +[% map_js = BLOCK %] +<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script> +<script type="text/javascript" src="[% version('/js/OpenLayers.fixmystreet.google.js') %]"></script> +<script type="text/javascript" src="[% version('/js/map-OpenLayers.js') %]"></script> +<script type="text/javascript" src="[% version('/js/map-google-ol.js') %]"></script> +<script type="text/javascript" src="[% version('/js/jquery.ba-hashchange.min.js') %]"></script> +<!--[if lte IE 6]> + <link rel="stylesheet" href="/jslib/OpenLayers-2.10/theme/default/ie6-style.css" type="text/css" /> +<![endif]--> +[% END %] + +[% map_html = BLOCK %] +[% INCLUDE maps/openlayers.html %] +[% END %] + diff --git a/templates/web/default/maps/google.html b/templates/web/default/maps/google.html index 69020ea81..741edec40 100644 --- a/templates/web/default/maps/google.html +++ b/templates/web/default/maps/google.html @@ -1,13 +1,31 @@ [% map_js = BLOCK %] -<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> +<style> +#map_box img { + max-width: none; +} +#map_box { + color: #000; +} +</style> +<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script> <script type="text/javascript" src="[% version('/js/map-google.js') %]"></script> +<script type="text/javascript" src="[% version('/js/jquery.ba-hashchange.min.js') %]"></script> [% END %] [% map_html = BLOCK %] <script type="text/javascript"> var fixmystreet = { + 'page': '[% page %]', + 'area': [ [% map.area.join(',') %] ], + 'all_pins': '[% all_pins %]', 'latitude': [% map.latitude %], 'longitude': [% map.longitude %], +[% IF map.any_zoom -%] + 'zoomToBounds': 1, +[%- END %] +[% IF map.zoom -%] + 'zoom': [% map.zoom %], +[%- END %] 'pins': [% INCLUDE maps/pins_js.html %] } </script> diff --git a/templates/web/default/maps/mapquest-attribution.html b/templates/web/default/maps/mapquest-attribution.html new file mode 100644 index 000000000..8ca4ea650 --- /dev/null +++ b/templates/web/default/maps/mapquest-attribution.html @@ -0,0 +1,14 @@ +[% map_js = BLOCK %] +<script type="text/javascript" src="[% version('/js/OpenLayers.fixmystreet.js') %]"></script> +<script type="text/javascript" src="[% version('/js/map-OpenLayers.js') %]"></script> +<script type="text/javascript" src="[% version('/js/map-OpenStreetMap.js') %]"></script> +<script type="text/javascript" src="[% version('/js/jquery.ba-hashchange.min.js') %]"></script> +<!--[if lte IE 6]> + <link rel="stylesheet" href="/jslib/OpenLayers-2.10/theme/default/ie6-style.css" type="text/css" /> +<![endif]--> +[% END %] + +[% map_html = BLOCK %] +[% INCLUDE maps/openlayers.html %] +<div class="olControlAttribution" style="position: absolute; z-index: 1005;">Data, imagery and map information provided by <a href="http://www.mapquest.com/">MapQuest</a> <img src="http://developer.mapquest.com/content/osm/mq_logo.png" />, <a href="http://openstreetmap.org/">Open Street Map</a> and contributors, <a href="http://opendatacommons.org/licenses/odbl/">ODbL</a></div> +[% END %] diff --git a/templates/web/default/maps/openlayers.html b/templates/web/default/maps/openlayers.html index b75e2bbd8..7967d4480 100644 --- a/templates/web/default/maps/openlayers.html +++ b/templates/web/default/maps/openlayers.html @@ -18,6 +18,7 @@ var fixmystreet = { [% IF map.zoom -%] 'zoom': [% map.zoom %], [%- END %] + 'pin_prefix': '[% c.cobrand.path_to_pin_icons %]', 'numZoomLevels': [% map.numZoomLevels %], 'zoomOffset': [% map.zoomOffset %], 'map_type': [% map.map_type %], @@ -65,13 +66,13 @@ var fixmystreet = { SET zoom_out = '#' IF map.zoom <= 0; %] <div style="position: absolute; left: 4px; top: 4px; z-index: 1007;" class="olControlPanZoom olControlNoSelect" unselectable="on"> - <div style="position: absolute; left: 13px; top: 4px; width: 18px; height: 18px;"><a rel="nofollow" href="[% north %]"><img style="position: relative; width: 18px; height: 18px;" src="/jslib/OpenLayers-2.10/img/north-mini.png" border="0"></a></div> - <div style="position: absolute; left: 4px; top: 22px; width: 18px; height: 18px;"><a rel="nofollow" href="[% west %]"><img style="position: relative; width: 18px; height: 18px;" src="/jslib/OpenLayers-2.10/img/west-mini.png" border="0"></a></div> - <div style="position: absolute; left: 22px; top: 22px; width: 18px; height: 18px;"><a rel="nofollow" href="[% east %]"><img style="position: relative; width: 18px; height: 18px;" src="/jslib/OpenLayers-2.10/img/east-mini.png" border="0"></a></div> - <div style="position: absolute; left: 13px; top: 40px; width: 18px; height: 18px;"><a rel="nofollow" href="[% south %]"><img style="position: relative; width: 18px; height: 18px;" src="/jslib/OpenLayers-2.10/img/south-mini.png" border="0"></a></div> - <div style="position: absolute; left: 13px; top: 63px; width: 18px; height: 18px;"><a rel="nofollow" href="[% zoom_in %]"><img style="position: relative; width: 18px; height: 18px;" src="/jslib/OpenLayers-2.10/img/zoom-plus-mini.png" border="0"></a></div> - <div style="position: absolute; left: 13px; top: 81px; width: 18px; height: 18px;"><a rel="nofollow" href="[% world %]"><img style="position: relative; width: 18px; height: 18px;" src="/jslib/OpenLayers-2.10/img/zoom-world-mini.png" border="0"></a></div> - <div style="position: absolute; left: 13px; top: 99px; width: 18px; height: 18px;"><a rel="nofollow" href="[% zoom_out %]"><img style="position: relative; width: 18px; height: 18px;" src="/jslib/OpenLayers-2.10/img/zoom-minus-mini.png" border="0"></a></div> + <div style="position: absolute; left: 13px; top: 4px; width: 18px; height: 18px;"><a rel="nofollow" href="[% north %]"><img style="position: relative; width: 18px; height: 18px;" src="/js/OpenLayers-2.13.1/img/north-mini.png" border="0"></a></div> + <div style="position: absolute; left: 4px; top: 22px; width: 18px; height: 18px;"><a rel="nofollow" href="[% west %]"><img style="position: relative; width: 18px; height: 18px;" src="/js/OpenLayers-2.13.1/img/west-mini.png" border="0"></a></div> + <div style="position: absolute; left: 22px; top: 22px; width: 18px; height: 18px;"><a rel="nofollow" href="[% east %]"><img style="position: relative; width: 18px; height: 18px;" src="/js/OpenLayers-2.13.1/img/east-mini.png" border="0"></a></div> + <div style="position: absolute; left: 13px; top: 40px; width: 18px; height: 18px;"><a rel="nofollow" href="[% south %]"><img style="position: relative; width: 18px; height: 18px;" src="/js/OpenLayers-2.13.1/img/south-mini.png" border="0"></a></div> + <div style="position: absolute; left: 13px; top: 63px; width: 18px; height: 18px;"><a rel="nofollow" href="[% zoom_in %]"><img style="position: relative; width: 18px; height: 18px;" src="/js/OpenLayers-2.13.1/img/zoom-plus-mini.png" border="0"></a></div> + <div style="position: absolute; left: 13px; top: 81px; width: 18px; height: 18px;"><a rel="nofollow" href="[% world %]"><img style="position: relative; width: 18px; height: 18px;" src="/js/OpenLayers-2.13.1/img/zoom-world-mini.png" border="0"></a></div> + <div style="position: absolute; left: 13px; top: 99px; width: 18px; height: 18px;"><a rel="nofollow" href="[% zoom_out %]"><img style="position: relative; width: 18px; height: 18px;" src="/js/OpenLayers-2.13.1/img/zoom-minus-mini.png" border="0"></a></div> </div> [% END %] @@ -81,7 +82,7 @@ var fixmystreet = { [% IF pin.id %] <a title="[% pin.title | html %]" href="[% c.uri_for('/report/' _ pin.id) %]"> [%- END -%] -<img border="0" class="pin" src="[% c.uri_for('/i/pin-' _ pin.colour _ '.png') %]" +<img border="0" class="pin" src="[% c.uri_for( c.cobrand.path_to_pin_icons _ 'pin-' _ pin.colour _ '.png') %]" alt="[% loc('Problem') %]" style="top:[% pin.py - 64 %]px; left:[% pin.px - 24 %]px; position: absolute;"> [%- IF pin.id -%] </a> diff --git a/templates/web/default/maps/osm-streetview.html b/templates/web/default/maps/osm-streetview.html index 3bc4614c6..dff6a0c0f 100644 --- a/templates/web/default/maps/osm-streetview.html +++ b/templates/web/default/maps/osm-streetview.html @@ -4,7 +4,7 @@ <script type="text/javascript" src="[% version('/js/map-streetview.js') %]"></script> <script type="text/javascript" src="[% version('/js/jquery.ba-hashchange.min.js') %]"></script> <!--[if lte IE 6]> - <link rel="stylesheet" href="/jslib/OpenLayers-2.10/theme/default/ie6-style.css" type="text/css" /> + <link rel="stylesheet" href="/js/OpenLayers-2.13.1/theme/default/ie6-style.css" type="text/css"> <![endif]--> [% END %] diff --git a/templates/web/default/maps/osm.html b/templates/web/default/maps/osm.html index 804710ad1..ce08e179a 100644 --- a/templates/web/default/maps/osm.html +++ b/templates/web/default/maps/osm.html @@ -4,10 +4,11 @@ <script type="text/javascript" src="[% version('/js/map-OpenStreetMap.js') %]"></script> <script type="text/javascript" src="[% version('/js/jquery.ba-hashchange.min.js') %]"></script> <!--[if lte IE 6]> - <link rel="stylesheet" href="/jslib/OpenLayers-2.10/theme/default/ie6-style.css" type="text/css" /> + <link rel="stylesheet" href="/js/OpenLayers-2.13.1/theme/default/ie6-style.css" type="text/css"> <![endif]--> [% END %] [% map_html = BLOCK %] [% INCLUDE maps/openlayers.html %] +<div class="olControlAttribution" style="position: absolute; z-index: 1006;">© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors</div> [% END %] diff --git a/templates/web/default/my/my.html b/templates/web/default/my/my.html index 3d418cda7..48a33a1d2 100644 --- a/templates/web/default/my/my.html +++ b/templates/web/default/my/my.html @@ -13,6 +13,11 @@ <h1>[% loc('Your Reports') %]</h1> +[% IF ! has_content %] +[% tprintf( loc('You haven’t created any reports yet. <a href="%s">Report a problem now.</a>'), + c.uri_for('/') ) %] +[% END %] + [% INCLUDE 'pagination.html', pager = problems_pager, param = 'p' @@ -53,7 +58,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, 'date' ) ) %] </em> </li> [% "</ul>" IF loop.last %] @@ -69,9 +74,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, 'date' ), p.body(c) ) %] [% ELSE %] - [% tprintf( loc("Reported %s"), prettify_epoch( p.confirmed_local.epoch, 'date' ) ) %] + [% tprintf( loc("Reported %s"), prettify_dt( p.confirmed, 'date' ) ) %] [% END %] </em> </li> diff --git a/templates/web/default/open311/index.html b/templates/web/default/open311/index.html index 8ce18f68c..aa77a8381 100644 --- a/templates/web/default/open311/index.html +++ b/templates/web/default/open311/index.html @@ -1,6 +1,75 @@ -[% INCLUDE 'header.html', title => 'Open311' %] +[% INCLUDE 'header.html', title = 'Open311', bodyclass = 'twothirdswidthpage' %] + +<div class="sticky-sidebar"> + <aside> + <ul class="plain-list"> + <li><a href="/faq">Frequently Asked Questions</a></li> + <li><a href="/faq#practical">Practical Questions</a></li> + <li><a href="/faq#organisation">Organisation Questions</a></li> + <li><a href="/privacy">Privacy and cookies</a></li> + <li><a href="/contact">Contact FixMyStreet</a></li> + </ul> + </aside> +</div> + +<h1>FixMyStreet support for Open311</h1> + +<p>FixMyStreet supports Open311 both as a <a href="#client">client</a> (sending +reports made on the site to an external service via the Open311 protocol), and +partly as a <a href="#server">server</a> (returning reports made on the site when +queried via the Open311 protocol).</p> + +<dl id="client"> + +<dt>What is Open311?</dt> + +<dd> +<p>In a nutshell, it's an international open standard that allows services to +'talk to' council systems.</p> +<p>As channels of communication diversify, it has become more and more +important that council systems can recognise and accept reports from a variety +of sources. For example, reports may come in via Twitter, SMS, email, services +like FixMyStreet, and the council's own website.</p> +</dd> + +<dt>Where can I find out more?</dt> + +<dd> +<p>Open311 isn't as widely known as it deserves to be, so we wrote a +<a href="http://www.mysociety.org/2013/01/10/open311-introduced/">short +series of blog posts</a> to explain the basics. And you can find out lots more at +<a href="http://open311.org/">open311.org</a>.</p> +</dd> + +<dt>Why does it matter?</dt> + +<dd> +<p>If you oversee problem reports at a council, you will of course be concerned +about future-proofing your communication channels in an easy and economical way +– Open311 gives you that assurance.</p> + +[% IF c.cobrand.moniker == 'fixmystreet' %] +<p>You may be interested to know about <a +href="http://www.google.com/url?q=http%3A%2F%2Fwww.mysociety.org%2Ffor-councils%2Ffixmystreet%2F&sa=D&sntz=1&usg=AFQjCNHo4eT2yOopyZ-39zz16jC-Faa5gQ">FixMyStreet +for Councils</a>, our hosted service which sits seamlessly on your council +website.</p> + +<p>We can integrate it with any council back-end system, but if you use +Open311, we charge less. That's how much we believe it's the sane way forward +for council problem-reporting systems.</p> +[% END %] + +<dt>Any questions?</dt> + +<dd> +<p>We're always happy to talk. Just <a href="/contact">drop us a line</a>.</p> +</dd> + +</dl> + +<hr> -<h1>[% loc('Open311 API for the mySociety FixMyStreet server') %]</h1> +<h2 id="server">[% loc('Open311 API for the mySociety FixMyStreet server') %]</h2> [% IF error %] <p>[% tprintf( loc('Note: <strong>%s</strong>'), error ) %]</p> diff --git a/templates/web/default/pagination.html b/templates/web/default/pagination.html index f5a1192d1..63180b600 100644 --- a/templates/web/default/pagination.html +++ b/templates/web/default/pagination.html @@ -1,17 +1,19 @@ [% IF pager.last_page > 1 %] - <p> +[% IF NOT admin %] +<section class="full-width"> +[% END %] + <p class="pagination"> [% IF pager.previous_page %] - <a href="[% c.req.uri_with({ $param => pager.previous_page }) %]">← Previous</a> - [% ELSE %] - ← Previous + <a class="prev" href="[% c.req.uri_with({ $param => pager.previous_page }) %][% '#' _ hash IF hash %]">[% loc('Previous') %]</a> [% END %] - | - [% pager.first %] to [% pager.last %] of [% pager.total_entries %] - | + + [% tprintf( loc('%d to %d of %d'), pager.first, pager.last, pager.total_entries ) %] + [% IF pager.next_page %] - <a href="[% c.req.uri_with({ $param => pager.next_page }) %]">Next →</a> - [% ELSE %] - Next → + <a class="next" href="[% c.req.uri_with({ $param => pager.next_page }) %][% '#' _ hash IF hash %]">[% loc('Next') %]</a> [% END %] </p> +[% IF NOT admin %] +</section> +[% END %] [% END %] 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/questionnaire/index.html b/templates/web/default/questionnaire/index.html index 5b48f8915..6783bca57 100644 --- a/templates/web/default/questionnaire/index.html +++ b/templates/web/default/questionnaire/index.html @@ -80,9 +80,13 @@ href="http://www.emptyhomes.com/getinvolved/campaign.html">http://www.emptyhomes </p> [% END %] +[% IF c.cobrand.moniker == 'southampton' %] +<p>Add a public update (please note it will not be sent to the council)</p> +[% ELSE %] <p>[% loc('If you wish to leave a public update on the problem, please enter it here (please note it will not be sent to the council). For example, what was your experience of getting the problem fixed?') %]</p> +[% END %] <p><textarea name="update" style="max-width:90%" rows="7" cols="30">[% update | html %]</textarea></p> diff --git a/templates/web/default/report/_council_sent_info.html b/templates/web/default/report/_council_sent_info.html new file mode 100644 index 000000000..958562dc2 --- /dev/null +++ b/templates/web/default/report/_council_sent_info.html @@ -0,0 +1,5 @@ +[% IF problem.whensent || problem.can_display_external_id %] + <small class="council_sent_info"><br> + [% problem.processed_summary_string(c) %] + </small> +[% END %] diff --git a/templates/web/default/report/_main.html b/templates/web/default/report/_main.html index b9779db69..0124052c0 100644 --- a/templates/web/default/report/_main.html +++ b/templates/web/default/report/_main.html @@ -3,13 +3,9 @@ <p><em> [% problem.meta_line(c) | html %] - [%- IF !problem.used_map %]; <strong>[% loc('there is no pin shown as the user did not use the map') %]</strong>[% END %] - [% IF problem.council %] - [% IF problem.whensent || problem.can_display_external_id %] - <small class="council_sent_info"><br> - [% problem.processed_summary_string(c) %] - </small> - [% END %] + [%- 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.bodies_str %] + [% INCLUDE 'report/_council_sent_info.html' %] [% ELSE %] <br><small>[% loc('Not reported to council') %]</small> [% END %] diff --git a/templates/web/default/report/_support.html b/templates/web/default/report/_support.html index e8b958940..3e372ba69 100644 --- a/templates/web/default/report/_support.html +++ b/templates/web/default/report/_support.html @@ -1,11 +1,17 @@ [% 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' ) %]"> - [% text %] <input type="hidden" name="id" value="[% problem.id %]"><input type="submit" class="green-btn" value="Add support"> +[% + IF !problem.interest_count; + SET text = loc('No supporters'); + ELSE; + SET text = tprintf( nget( "%d supporter", "%d supporters", problem.interest_count ), problem.interest_count ); + END; +%] + + [% IF c.user AND c.user.from_body %] + <form action="[% c.uri_for( '/report/support' ) %]"> + <p id="supporter"><small>[% text %] <input type="hidden" name="id" value="[% problem.id %]"><input type="submit" class="green-btn" value="Add support"></small></p> </form> [% ELSE %] - [% text %] + <p id="supporter"><small>[% text %]</small></p> [% END %] -</small></p> [% END %] diff --git a/templates/web/default/report/banner.html b/templates/web/default/report/banner.html index 85aaed82d..bd7798d79 100644 --- a/templates/web/default/report/banner.html +++ b/templates/web/default/report/banner.html @@ -5,7 +5,7 @@ </p> [% END %] -[% IF problem.is_open AND date.now - problem.lastupdate_local.epoch > 8 * 7 * 24 * 60 * 60 %] +[% IF problem.is_open AND date.now - problem.lastupdate.epoch > 8 * 7 * 24 * 60 * 60 %] [% INCLUDE banner, id = 'unknown', text = loc('This problem is old and of unknown status.') %] [% END %] [% IF problem.is_fixed %] @@ -14,7 +14,7 @@ [% IF problem.is_closed %] [% INCLUDE banner, id = 'closed', text = loc('This problem has been closed') %] [% END %] -[% states = [ 'investigating', 'in progress', 'planned' ]; +[% states = [ 'investigating', 'in progress', 'planned', 'action scheduled' ]; IF states.grep(problem.state).size %] [% INCLUDE banner, id = 'progress', text = loc('This problem is in progress') %] [% END %] diff --git a/templates/web/default/report/display.html b/templates/web/default/report/display.html index 6b93539f2..fd7580ac1 100644 --- a/templates/web/default/report/display.html +++ b/templates/web/default/report/display.html @@ -1,16 +1,19 @@ [% PROCESS "maps/${map.type}.html"; - problem_title = problem.title _ ' - ' _ loc('Viewing a problem'); + problem_title = problem.title_safe _ ' - ' _ loc('Viewing a problem'); + SET rss = [ loc('Updates to this problem, FixMyStreet'), "/rss/$problem.id" ] IF c.cobrand.moniker != 'emptyhomes'; + SET robots = 'index, nofollow'; + SET robots = 'noindex, nofollow' IF c.cobrand.moniker == 'emptyhomes'; INCLUDE 'header.html' title = problem_title - rss = [ loc('Updates to this problem, FixMyStreet'), "/rss/$problem.id" ] - robots = 'index, nofollow' %] -[% map_html %] +[% IF c.cobrand.moniker != 'emptyhomes' %] + [% map_html %] + </div> +[% END %] -</div> <div id="side"> [% INCLUDE 'report/banner.html' %] @@ -22,6 +25,7 @@ </small> </p> +[% IF c.cobrand.moniker != 'emptyhomes' %] <p style="padding-bottom: 0.5em; border-bottom: dotted 1px #999999;" align="right"> <a href="[% c.uri_for( '/around', { lat => short_latitude, lon => short_longitude } ) %]">[% loc( 'More problems nearby' ) %]</a> </p> @@ -44,173 +48,9 @@ </div> [% INCLUDE 'report/updates.html' %] - -<div id="update_form"> - - <h2> - [% loc( 'Provide an update') %] - </h2> - - [% IF c.cobrand.moniker != 'emptyhomes' %] - <p> - <small>[% loc( 'Please note that updates are not sent to the council. If you leave your name it will be public. Your information will only be used in accordance with our <a href="/faq#privacy">privacy policy</a>' ) %]</small> - </p> - [% END %] - - [% INCLUDE 'errors.html' %] - - <form method="post" action="[% c.uri_for( '/report/update' ) %]" name="updateForm" class="fieldset validate"[% IF c.cobrand.allow_photo_upload %] enctype="multipart/form-data"[% END %]> - - <input type="hidden" name="submit_update" value="1"> - <input type="hidden" name="id" value="[% problem.id | html %]"> - - [% IF field_errors.update %] - <div class='form-error'>[% field_errors.update %]</div> - [% END %] - <div class="form-field"> - <label for="form_update">[% loc( 'Update:' ) %]</label> - <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 ) %] - <div class="form-field"> - <label for="form_state">[% loc( 'State:' ) %]</label> - <select name="state" id="form_state"> - [% FOREACH state IN [ ['confirmed', loc('Open')], ['investigating', - loc('Investigating')], ['planned', loc('Planned')], ['in progress', - loc('In Progress')], ['closed', loc('Closed')], ['fixed', loc('Fixed')] ] %] - <option [% 'selected ' IF state.0 == problem.state %] value="[% state.0 %]">[% state.1 %]</option> - [% END %] - </select> - </div> - [% ELSE %] - [% IF problem.is_fixed AND c.user_exists AND c.user.id == problem.user_id %] - <div class="checkbox"> - <input type="checkbox" name="reopen" id="form_reopen" value="1"[% ' checked' IF update.mark_open %]> - <label for="form_reopen">[% loc('This problem has not been fixed') %]</label> - </div> - [% ELSIF !problem.is_fixed %] - <div class="checkbox"> - <input type="checkbox" name="fixed" id="form_fixed" value="1"[% ' checked' IF update.mark_fixed %]> - <label for="form_fixed">[% loc('This problem has been fixed') %]</label> - </div> - [% END %] - [% END %] - - [% IF c.cobrand.allow_photo_upload %] - [% IF field_errors.photo %] - <div class='form-error'>[% field_errors.photo %]</div> - [% END %] - <div id="fileupload_normalUI"> - [% IF upload_fileid %] - <p>[% loc('You have already attached a photo to this update, attaching another one will replace it.') %]</p> - <input type="hidden" name="upload_fileid" value="[% upload_fileid %]"> - [% END %] - <label for="form_photo">[% loc('Photo:') %]</label> - <input type="file" name="photo" id="form_photo" style="width:20em"> - </div> - [% END %] - -[% IF c.user_exists %] - - [% INCLUDE name %] - - <div class="checkbox"> - <input type="submit" id="update_post" value="[% loc('Post') %]"> - </div> - -[% ELSE %] - - [% IF field_errors.email %] - <div class='form-error'>[% field_errors.email %]</div> - [% END %] - <div class="form-field"> - <label for="form_rznvy">[% loc('Your email:' ) %]</label> - <input type="email" name="rznvy" id="form_rznvy" value="[% update.user.email | html %]" size="30" required> - </div> - -<div id="form_sign_in"> - <h3>[% loc("Now to submit your update… do you have a FixMyStreet password?") %]</h3> - - <div id="form_sign_in_yes"> - - [% IF field_errors.password %] - <div class='form-error'>[% field_errors.password %]</div> - [% END %] - - <p> - <label class="n" for="password_sign_in">[% loc('<strong>Yes</strong> I have a password') %]</label> - <input type="password" name="password_sign_in" id="password_sign_in" value="" size="25"> - </p> - - <div class="fieldset"> - - <p> - <input type="checkbox" id="remember_me" name="remember_me" value='1'[% ' checked' IF remember_me %]> - <label class="n" for="remember_me"> - [% loc('Keep me signed in on this computer') %] - </label> - </p> - - <p> - <input type="submit" name="submit_sign_in" id="submit_sign_in" value="[% loc('Post') %]"> - </p> - - </div> - - </div> - <div id="form_sign_in_no"> - - <p>[% loc('<strong>No</strong>, let me confirm my update by email:') %]</p> - - <div class="fieldset"> - - [% INCLUDE name %] - - <div class="form-field"> - <label for="password_register">[% loc('Enter a new password:') %]</label> - <input type="password" name="password_register" id="password_register" value="" size="25"> - </div> - - <p style="clear:both"><small>[% loc('Providing a password is optional, but doing so will allow you to more easily report problems, leave updates and manage your reports.') %]</small></p> - - <p> - <input type="submit" name="submit_register" id="submit_register" value="[% loc('Post') %]"> - </p> - - </div> - - </div> - -</div> - +[% INCLUDE 'report/update-form.html' %] [% END %] - </form> -</div> - </div> [% INCLUDE 'footer.html' %] - -[% BLOCK name %] - [% IF field_errors.name %] - <div class='form-error'>[% field_errors.name %]</div> - [% END %] - - <div> - <label for="form_name">[% loc('Your name:') %]</label> - <input type="text" name="name" id="form_name" value="[% update.name || c.user.name | html %]" size="25"> - </div> - - <div class="checkbox"> - <input type="checkbox" name="may_show_name" id="form_may_show_name" value="1"[% ' checked' UNLESS update.anonymous %]> - <label for="form_may_show_name">[% loc('Show my name publicly') %]</label> - <small>[% loc('(we never show your email)') %]</small> - </div> - - <div class="checkbox"> - <input type="checkbox" name="add_alert" id="form_add_alert" value="1"[% ' checked' IF add_alert %]> - <label for="form_add_alert">[% loc( 'Alert me to future updates' ) %]</label> - </div> -[% END %] diff --git a/templates/web/default/report/new/category.html b/templates/web/default/report/new/category.html index 49be4d25d..ee47adc9e 100644 --- a/templates/web/default/report/new/category.html +++ b/templates/web/default/report/new/category.html @@ -3,11 +3,17 @@ [% IF category; category = category | lower; END; %] - <label for='form_category' id="form_category_label">[% category_label | html %]</label> + <label for='form_category' id="form_category_label"> + [%- IF c.cobrand.moniker == 'emptyhomes' %] + [%- loc('Property type:') %] + [%- ELSE %] + [%- loc('Category') %] + [%- END -%]</label> <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 || (category_options.size == 2 AND loop.last) -%] + >[% 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..9293c03a7 100644 --- a/templates/web/default/report/new/councils_text_none.html +++ b/templates/web/default/report/new/councils_text_none.html @@ -1,22 +1,28 @@ - - <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 ); %] [% loc("If you submit a problem here the subject and details of the problem will be public, but the problem will <strong>not</strong> be reported to the council."); %] +[% IF c.cobrand.moniker == 'fixamingata' AND all_body_names.size == 1 %] +[% + tprintf( + "Du kan istället kontakta %s via <a href='%s'>deras webbsida</a>.", + all_body_names.first, all_body_urls.first); +%] +[% ELSE %] [% 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 ); -%]</p> +%] +[% END %] +</p> 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 9c9451914..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 %] @@ -206,7 +206,7 @@ <div class="checkbox"> [%# if there is nothing in the name field then set check box as default on form %] - <input type="checkbox" name="may_show_name" id="form_may_show_name" value="1"[% ' checked' IF !report.anonymous %]> + <input type="checkbox" name="may_show_name" id="form_may_show_name" value="1"[% ' checked' IF report.anonymous==0 OR (c.cobrand.default_show_name AND report.anonymous=='') %]> <label for="form_may_show_name">[% loc('Show my name publicly') %]</label> <br><small>[% loc('(we never show your email address or phone number)') %]</small> </div> diff --git a/templates/web/default/report/new/notes.html b/templates/web/default/report/new/notes.html index be605ddaa..68408acc7 100644 --- a/templates/web/default/report/new/notes.html +++ b/templates/web/default/report/new/notes.html @@ -4,7 +4,7 @@ <li>[% loc("We will only use your personal information in accordance with our <a href=\"/faq#privacy\">privacy policy.</a>") %]</li> <li>[% loc("Please be polite, concise and to the point.") %]</li> - <li>[% loc("Please do not be abusive — abusing your council devalues the service for all users.") %]</li> + <li>[% loc("Please do not be abusive — abusing your council devalues the service for all users.") %]</li> <li>[% loc("Writing your message entirely in block capitals makes it hard to read, as does a lack of punctuation.") %]</li> <li>[% loc("Remember that FixMyStreet is primarily for reporting physical problems that can be fixed. If your problem is not appropriate for submission via this site remember that you can contact your council directly using their own website.") %]</li> diff --git a/templates/web/default/report/photo.html b/templates/web/default/report/photo.html index 02ab9228b..c463c34c4 100644 --- a/templates/web/default/report/photo.html +++ b/templates/web/default/report/photo.html @@ -1,4 +1,4 @@ -[% IF c.cobrand.allow_photo_display && object.photo %] +[% IF c.cobrand.allow_photo_display(object) && object.photo %] [% photo = object.get_photo_params %] <div class="update-img"> [% IF photo.url_full %]<a href="[% photo.url_full %]" rel="fancy">[% END diff --git a/templates/web/default/report/update-form.html b/templates/web/default/report/update-form.html new file mode 100644 index 000000000..50bc2906c --- /dev/null +++ b/templates/web/default/report/update-form.html @@ -0,0 +1,165 @@ +<div id="update_form"> + + <h2>[% loc( 'Provide an update') %]</h2> + + [% IF c.cobrand.moniker != 'emptyhomes' %] + <p> + <small>[% loc( 'Please note that updates are not sent to the council. If you leave your name it will be public. Your information will only be used in accordance with our <a href="/faq#privacy">privacy policy</a>' ) %]</small> + </p> + [% END %] + + [% INCLUDE 'errors.html' %] + + <form method="post" action="[% c.uri_for( '/report/update' ) %]" name="updateForm" class="fieldset validate"[% IF c.cobrand.allow_photo_upload %] enctype="multipart/form-data"[% END %]> + + <input type="hidden" name="submit_update" value="1"> + <input type="hidden" name="id" value="[% problem.id | html %]"> + + [% IF field_errors.update %] + <div class='form-error'>[% field_errors.update %]</div> + [% END %] + <div class="form-field"> + <label for="form_update">[% loc( 'Update:' ) %]</label> + <textarea name="update" id="form_update" rows="7" cols="30" required>[% update.text | html %]</textarea> + </div> + + [% 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"> + [% FOREACH state IN [ ['confirmed', loc('Open')], ['investigating', + loc('Investigating')], ['action scheduled', loc('Action Scheduled')], + ['in progress', loc('In Progress')], ['duplicate', loc('Duplicate')], + ['unable to fix', loc('Unable to fix')], ['not responsible', loc('Not Responsible')], + ['fixed', loc('Fixed')] ] %] + <option [% 'selected ' IF state.0 == problem.state %] value="[% state.0 %]">[% state.1 %]</option> + [% END %] + </select> + </div> + [% ELSE %] + [% IF problem.is_fixed AND c.user_exists AND c.user.id == problem.user_id %] + <div class="checkbox"> + <input type="checkbox" name="reopen" id="form_reopen" value="1"[% ' checked' IF update.mark_open %]> + <label class="inline" for="form_reopen">[% loc('This problem has not been fixed') %]</label> + </div> + [% ELSIF !problem.is_fixed %] + <div class="checkbox"> + <input type="checkbox" name="fixed" id="form_fixed" value="1"[% ' checked' IF update.mark_fixed %]> + <label class="inline" for="form_fixed">[% loc('This problem has been fixed') %]</label> + </div> + [% END %] + [% END %] + + [% IF c.cobrand.allow_photo_upload %] + [% IF field_errors.photo %] + <div class='form-error'>[% field_errors.photo %]</div> + [% END %] + <div id="fileupload_normalUI"> + [% IF upload_fileid %] + <p>[% loc('You have already attached a photo to this update, attaching another one will replace it.') %]</p> + <input type="hidden" name="upload_fileid" value="[% upload_fileid %]"> + [% END %] + <label for="form_photo">[% loc('Photo:') %]</label> + <input type="file" name="photo" id="form_photo" style="width:20em"> + </div> + [% END %] + +[% IF c.user_exists %] + + [% INCLUDE name %] + + <div class="checkbox"> + <input type="submit" id="update_post" value="[% loc('Post') %]"> + </div> + +[% ELSE %] + + [% IF field_errors.email %] + <div class='form-error'>[% field_errors.email %]</div> + [% END %] + <div class="form-field"> + <label for="form_rznvy">[% loc('Your email:' ) %]</label> + <input type="email" name="rznvy" id="form_rznvy" value="[% update.user.email | html %]" size="30" required> + </div> + +<div id="form_sign_in"> + <h3>[% loc("Now to submit your update… do you have a FixMyStreet password?") %]</h3> + + <div id="form_sign_in_yes"> + + [% IF field_errors.password %] + <div class='form-error'>[% field_errors.password %]</div> + [% END %] + + <p> + <label class="n" for="password_sign_in">[% loc('<strong>Yes</strong> I have a password') %]</label> + <input type="password" name="password_sign_in" id="password_sign_in" value="" size="25"> + </p> + + <div class="fieldset"> + + <p> + <input type="checkbox" id="remember_me" name="remember_me" value='1'[% ' checked' IF remember_me %]> + <label class="n" for="remember_me"> + [% loc('Keep me signed in on this computer') %] + </label> + </p> + + <p> + <input type="submit" name="submit_sign_in" id="submit_sign_in" value="[% loc('Post') %]"> + </p> + + </div> + + </div> + <div id="form_sign_in_no"> + + <p>[% loc('<strong>No</strong>, let me confirm my update by email:') %]</p> + + <div class="fieldset"> + + [% INCLUDE name %] + + <div class="form-field"> + <label for="password_register">[% loc('Enter a new password:') %]</label> + <input type="password" name="password_register" id="password_register" value="" size="25"> + </div> + + <p style="clear:both"><small>[% loc('Providing a password is optional, but doing so will allow you to more easily report problems, leave updates and manage your reports.') %]</small></p> + + <p> + <input type="submit" name="submit_register" id="submit_register" value="[% loc('Post') %]"> + </p> + + </div> + + </div> + +</div> + +[% END %] + + </form> +</div> + +[% BLOCK name %] + [% IF field_errors.name %] + <div class='form-error'>[% field_errors.name %]</div> + [% END %] + + <div> + <label for="form_name">[% loc('Your name:') %]</label> + <input type="text" name="name" id="form_name" value="[% update.name || c.user.name | html %]" size="25"> + </div> + + <div class="checkbox"> + <input type="checkbox" name="may_show_name" id="form_may_show_name" value="1"[% ' checked' IF update.anonymous==0 OR (c.cobrand.default_show_name AND update.anonymous=='') %]> + <label for="form_may_show_name">[% loc('Show my name publicly') %]</label> + <small>[% loc('(we never show your email)') %]</small> + </div> + + <div class="checkbox"> + <input type="checkbox" name="add_alert" id="form_add_alert" value="1"[% ' checked' IF add_alert %]> + <label class="inline" for="form_add_alert">[% loc( 'Alert me to future updates' ) %]</label> + </div> +[% END %] diff --git a/templates/web/default/report/updates.html b/templates/web/default/report/updates.html index eaf5209ff..b0a015f03 100644 --- a/templates/web/default/report/updates.html +++ b/templates/web/default/report/updates.html @@ -1,3 +1,4 @@ +[% global.last_state = '' %] [% FOREACH update IN updates %] [% INCLUDE 'report/update.html' %] [% END %] @@ -6,24 +7,58 @@ [% 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 ) ) %] [% 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 ) ) -%] + [%- 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 ) ) -%] [%- 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 ) ) | html -%] [%- END -%] - [%- ", " _ loc( 'marked as fixed' ) IF update.mark_fixed %] - [%- ", " _ loc( 'reopened' ) IF update.mark_open OR update.problem_state == 'confirmed' %] - [%- ", " _ tprintf(loc( 'marked as %s' ), update.meta_problem_state) IF update.problem_state AND update.problem_state != 'confirmed' %] -[% END %] + [%- update_state = '' %] + [%- IF update.mark_fixed %][% update_state = loc( 'marked as fixed' ) %][% END %] + [%- IF update.mark_open %][% update_state = loc( 'reopened' ) %][% END %] + [%- IF !update_state && update.problem_state %] + [%- state = update.meta_problem_state %] + [%- IF c.cobrand.moniker == 'bromley' OR problem.bodies_str == '2482' %] + [%- SET update_state = 'marked as no further action' IF state == 'unable to fix' %] + [%- SET update_state = 'marked as third party responsibility' IF state == 'not responsible' %] + [%- END %] + [%- END %] + [%- IF !update_state && update.problem_state %] + [%- IF state == 'confirmed' AND global.last_state != '' %] + [%- update_state = loc( 'reopened' ) %] + [%- ELSIF state == 'investigating' %] + [%- update_state = loc( 'marked as investigating' ) %] + [%- ELSIF state == 'planned' %] + [%- update_state = loc( 'marked as planned' ) %] + [%- ELSIF state == 'in progress' %] + [%- update_state = loc( 'marked as in progress' ) %] + [%- ELSIF state == 'action scheduled' %] + [%- update_state = loc( 'marked as action scheduled' ) %] + [%- ELSIF state == 'closed' %] + [%- update_state = loc( 'marked as closed' ) %] + [%- ELSIF state == 'fixed' %] + [%- update_state = loc( 'marked as fixed' ) %] + [%- ELSIF state == 'unable to fix' %] + [%- update_state = loc( 'marked as unable to fix' ) %] + [%- ELSIF state == 'not responsible' %] + [%- update_state = loc( "marked as not the council's responsibility" ) %] + [%- ELSIF state == 'duplicate' %] + [%- update_state = loc( 'marked as a duplicate report' ) %] + [%- ELSIF state == 'internal referral' %] + [%- update_state = loc( 'marked as an internal referral' ) %] + [%- END %] + [%- END %] + [%- ", " _ update_state IF update_state != global.last_state %] + [%- global.last_state = update_state %] +[% 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 134c9d4fc..2b19e5735 100755 --- a/templates/web/default/reports/body.html +++ b/templates/web/default/reports/body.html @@ -1,20 +1,16 @@ -[% IF c.cobrand.moniker == 'fixmystreet' OR c.cobrand.moniker == 'bromley'; - style = 'new'; - ELSE; - style = 'old'; - END; -%] [% 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 %] -[% IF c.cobrand.is_council %] +[% IF c.cobrand.moniker == 'oxfordshire' %] + [% ward_text = 'View reports by division' %] +[% ELSIF c.cobrand.is_council %] [% ward_text = loc( 'View reports by ward' ) %] [% ELSE %] [% ward_text = loc( 'Wards of this council' ) %] @@ -24,7 +20,6 @@ PROCESS "maps/${map.type}.html"; INCLUDE 'header.html', title = tprintf(loc('%s - Summary reports'), name) - context = 'reports' bodyclass = 'mappage' rss = [ tprintf(loc('Problems within %s, FixMyStreet'), name), rss_url ] %] @@ -38,13 +33,17 @@ <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 c.cobrand.moniker == 'hart' %] + [% INCLUDE '_hart_hants_note.html' %] +[% END %] + +[% 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>. @@ -89,7 +88,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/static/about.html b/templates/web/default/static/about-en-gb.html index 9c319f051..9c319f051 100644 --- a/templates/web/default/static/about.html +++ b/templates/web/default/static/about-en-gb.html 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 ); |