diff options
Diffstat (limited to 'templates/web/base')
86 files changed, 830 insertions, 390 deletions
diff --git a/templates/web/base/about/faq-en-gb.html b/templates/web/base/about/faq-en-gb.html index fc087a0e6..0ddc1b73d 100755 --- a/templates/web/base/about/faq-en-gb.html +++ b/templates/web/base/about/faq-en-gb.html @@ -99,6 +99,7 @@ to update the address or addresses we use.</dd> you’re from the authority then the emailed version of the problem report might also contain the closest road or postcode to the pin on the map.</dd> +</dl> <h2><a name="organisation"></a>Organisation Questions</h2> diff --git a/templates/web/base/admin/_translations.html b/templates/web/base/admin/_translations.html new file mode 100644 index 000000000..d8f7d52fb --- /dev/null +++ b/templates/web/base/admin/_translations.html @@ -0,0 +1,19 @@ +[% IF languages.size > 1 %] +<h2>[% loc('Translations') %]</h2> + <input type="hidden" name="token" value="[% csrf_token %]" > +<table> + <tr> + <th>[% loc('Language') %]</th> + <th>[% loc('Translation') %]</th> + </tr> + [% FOREACH language IN languages.keys.sort %] + <tr> + <td> + <label for="translation_[% language %]">[% languages.$language.name %] ([% language %])</label> + <input type="hidden" name="translation_id_[% language %]" value="[% translations.$language.id %]"> + </td> + <td><input type="text" name="translation_[% language %]" id="translation_[% language %]" value="[% translations.$language.msgstr %]"></td> + </tr> + [% END %] +</table> +[% END %] diff --git a/templates/web/base/admin/body-form.html b/templates/web/base/admin/body-form.html index 6c750bcaf..55d0e500c 100644 --- a/templates/web/base/admin/body-form.html +++ b/templates/web/base/admin/body-form.html @@ -25,6 +25,8 @@ <input type="text" class="form-control" name="name" id="name" value="[% body.name | html %]" size="50"> </p> + [% INCLUDE 'admin/_translations.html' %] + <div class="admin-hint"> <p> [% loc( diff --git a/templates/web/base/admin/body.html b/templates/web/base/admin/body.html index 5e8c6a164..7fa446f44 100644 --- a/templates/web/base/admin/body.html +++ b/templates/web/base/admin/body.html @@ -70,7 +70,7 @@ <table cellspacing="0" cellpadding="2" border="1"> <tr> <th>[% loc('Category') %]</th> - <th colspan=2>[% loc('State') %]</th> + <th>[% loc('State') %]</th> <th>[% loc('Last editor') %]</th> <th>[% loc('Note') %]</th> [% IF any_not_confirmed %] @@ -78,20 +78,20 @@ [% END %] </tr> [% WHILE ( cat = contacts.next ) %] - <tr [% IF cat.deleted %]class="is-deleted"[% END %]> - <td class="contact-category"><a href="[% c.uri_for( 'body', body_id, cat.category ) %]">[% cat.category | html %]</a> + <tr [% IF cat.state == 'deleted' %]class="is-deleted"[% END %]> + <td class="contact-category"><a href="[% c.uri_for( 'body', body_id, cat.category ) %]">[% cat.category_display | html %]</a> <br>[% cat.email | html %]</td> <td> - [% loc('Confirmed') %]: - [%- IF cat.confirmed %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %] - <br>[% loc('Deleted') %]: - [%- IF cat.deleted %]<strong>[% loc('Yes') %]</strong>[% ELSE %][% loc('No') %][% END %] - </td> - <td> - [% loc('Private') %]: - [%- cat.non_public ? loc('Yes') : loc('No') %] - <br>[% loc('Devolved') %]: - [%- IF body.can_be_devolved AND cat.send_method %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %] + [% cat.state %] + [% IF cat.non_public OR (body.can_be_devolved AND cat.send_method) %] + <br><small> + [% IF cat.non_public %][% loc('Private') %][% END %] + [% IF cat.non_public AND (body.can_be_devolved AND cat.send_method) %] + / + [% END %] + [% IF body.can_be_devolved AND cat.send_method %][% loc('Devolved') %][% END %] + </small> + [% END %] </td> <td>[% cat.editor | html %] <br><small>[% PROCESS format_time time=cat.whenedited %]</small></td> @@ -130,9 +130,10 @@ <div class="fms-admin-warning"> [% errors.values.join('<br>') %] </div> + [% INCLUDE 'admin/contact-form.html' translations=contact_translations %] + [% ELSE %] + [% INCLUDE 'admin/contact-form.html' translations={} %] [% END %] - - [% INCLUDE 'admin/contact-form.html' %] </div> [% IF NOT errors and c.user.is_superuser %] diff --git a/templates/web/base/admin/category_edit.html b/templates/web/base/admin/category_edit.html index 5eb3c943e..7ae4e59b4 100644 --- a/templates/web/base/admin/category_edit.html +++ b/templates/web/base/admin/category_edit.html @@ -21,38 +21,12 @@ [% INCLUDE 'admin/contact-form.html' %] -[% IF contact.extra %] -<h2>[% loc('Extra data:') %] </h2> -<dl> - [% FOR pair IN contact.get_extra_metadata %] - <dt>[% pair.key %]</dt> <dd>[% pair.value %]</dd> - [% END %] -</dl> -<ul> - [% FOR meta IN contact.get_metadata_for_input %] - <li> - [% meta.order %], <code>[% meta.code %]</code>, [% meta.datatype %], - [% meta.required == 'true' ? loc('required') : loc('optional') %] - <br><small>[% meta.description %]</small> - [% IF meta.variable != 'false' AND meta.exists('values') %] - <ul> - [% FOR option IN meta.values %] - <li>[% option.name %] <small>([% option.key %])</small></li> - [% END %] - </ul> - [%- END %] - </li> - [%- END %] -</ul> -[% END %] - <h2>[% loc('History') %]</h2> <table border="1"> <tr> <th>[% loc('When edited') %]</th> <th>[% loc('Email') %]</th> - <th>[% loc('Confirmed') %]</th> - <th>[% loc('Deleted') %]</th> + <th>[% loc('State') %]</th> <th>[% loc('Editor') %]</th> <th>[% loc('Note') %]</th> </tr> @@ -61,8 +35,7 @@ <tr> <td>[% contact.whenedited.ymd _ ' ' _ contact.whenedited.hms %]</td> <td>[% PROCESS highlightchanged old=prev new=contact value='email' %]</td> - <td>[% PROCESS highlightchanged_yesno old=prev new=contact value='confirmed' %]</td> - <td>[% PROCESS highlightchanged_yesno old=prev new=contact value='deleted' %]</td> + <td>[% PROCESS highlightchanged old=prev new=contact value='state' %]</td> <td>[% contact.editor | html %]</td> <td>[% contact.note | html %]</td> </tr> diff --git a/templates/web/base/admin/config_page.html b/templates/web/base/admin/config_page.html index f35cd6adb..87032b0b6 100644 --- a/templates/web/base/admin/config_page.html +++ b/templates/web/base/admin/config_page.html @@ -88,6 +88,9 @@ running version <strong>[% git_version || 'unknown' %]</strong>. [% INCLUDE subsection heading="MapIt" %] [% INCLUDE just_value value="MAPIT_URL" conf = "<a href='" _ c.config.MAPIT_URL _ "'>" _ c.config.MAPIT_URL _ "</a>" %] +[% IF c.config.MAPIT_API_KEY %] + [% INCLUDE just_value value="MAPIT_API_KEY" %] +[% END %] [% INCLUDE with_cobrand value="MAPIT_TYPES" cob = c.cobrand.area_types %] <tr> diff --git a/templates/web/base/admin/contact-form.html b/templates/web/base/admin/contact-form.html index 493d8020f..1157e781e 100644 --- a/templates/web/base/admin/contact-form.html +++ b/templates/web/base/admin/contact-form.html @@ -2,7 +2,7 @@ [% IF contact.in_storage %] <p> - <h1>[% contact.category | html %]</h2> + <h1>[% contact.category_display | html %]</h1> <input type="hidden" name="category" value="[% contact.category | html %]" > </p> [% ELSE %] @@ -20,6 +20,8 @@ </p> [% END %] + [% INCLUDE 'admin/_translations.html' %] + <div class="admin-hint"> <p> [% loc("The <strong>email address</strong> is the destination to which reports about this category will be sent. @@ -38,24 +40,23 @@ <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.") %] + [% +loc("Use <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, use <strong>unconfirmed</strong>. <strong>inactive</strong> will +remove the category from use when reporting problems, but keep it available in +map filters, and <strong>deleted</strong> will remove the category from there +as well.") %] </p> </div> <p> - <input type="checkbox" name="confirmed" value="1" id="confirmed"[% ' checked' IF contact.confirmed OR contact.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"[% ' checked' IF contact.deleted %]> - <label for="deleted" class="inline">[% loc('Deleted') %]</label> + <label for="state">[% loc('State') %]</label> + <select name="state" id="state"> + <option value="unconfirmed"[% ' selected' IF contact.state == 'unconfirmed' %]>[% loc('Unconfirmed') %] + <option value="confirmed"[% ' selected' IF contact.state == 'confirmed' || contact.state == "" %]>[% loc('Confirmed') %] + <option value="inactive"[% ' selected' IF contact.state == 'inactive' %]>[% loc('Inactive') %] + <option value="deleted"[% ' selected' IF contact.state == 'deleted' %]>[% loc('Deleted') %] + </select> </p> <div class="admin-hint"> @@ -136,4 +137,12 @@ <input type="hidden" name="token" value="[% csrf_token %]" > <input type="submit" class="btn" name="Create category" value="[% contact.in_storage ? loc('Save changes') : loc('Create category') %]" > </p> + + <h2>[% loc('Extra data:') %] </h2> + <dl> + [% FOR pair IN contact.get_extra_metadata %] + <dt>[% pair.key %]</dt> <dd>[% pair.value %]</dd> + [% END %] + </dl> + [% INCLUDE 'admin/extra-metadata-form.html' metas=(contact.get_metadata_for_input OR []) %] </form> diff --git a/templates/web/base/admin/council_contacts.txt b/templates/web/base/admin/council_contacts.txt index 2d1e04bfa..f11615789 100644 --- a/templates/web/base/admin/council_contacts.txt +++ b/templates/web/base/admin/council_contacts.txt @@ -1,4 +1,4 @@ [% WHILE ( contact = contacts.next ) -%] -[%- NEXT IF contact.deleted || ! contact.confirmed %] -[% contact.category %] [% contact.email %] +[%- NEXT IF contact.state != 'confirmed' %] +[% contact.category_display %] [% contact.email %] [%- END %] diff --git a/templates/web/base/admin/defecttypes/list.html b/templates/web/base/admin/defecttypes/list.html index 783bd085c..ffff89eff 100644 --- a/templates/web/base/admin/defecttypes/list.html +++ b/templates/web/base/admin/defecttypes/list.html @@ -20,7 +20,7 @@ <em>[% ('All categories') %]</em> [% ELSE %] [% FOR contact IN d.contacts %] - [% contact.category %][% ',' UNLESS loop.last %] + [% contact.category_display %][% ',' UNLESS loop.last %] [% END %] [% END %] </td> diff --git a/templates/web/base/admin/extra-metadata-form.html b/templates/web/base/admin/extra-metadata-form.html new file mode 100644 index 000000000..6a88a3c1e --- /dev/null +++ b/templates/web/base/admin/extra-metadata-form.html @@ -0,0 +1,81 @@ +<ul class="js-metadata-items"> + [% FOR meta IN metas.merge([{}]) %] + <li class="js-metadata-item [% IF loop.last %]hidden-js js-metadata-item-template[% END %]" data-index="[% loop.index %]"> + <button class="btn btn--small js-metadata-item-remove hidden-nojs">[% loc('Remove field') %]</button> + + <div class="admin-hint"><p>[% loc('The ordering of this field on the report page. Fields are shown in ascending order according to this value.') %]</p></div> + <label> + [% loc('Order') %] + <input name="metadata[[% loop.index %]].order" data-field-name="order" type=text value="[% meta.order | html %]"> + </label> + + <div class="admin-hint"><p>[% loc('The code used to store this field value in the database. e.g. <code>address</code> would be available as <code>problem.extra.address</code> in the templates.') %]</p></div> + <label> + [% loc('Code') %] + <input name="metadata[[% loop.index %]].code" data-field-name="code" type=text value="[% meta.code | html %]"> + </label> + + <div class="admin-hint"><p>[% loc('Whether the user is required to provide a value for this field.') %]</p></div> + <label> + [% loc('Required') %] + <input name="metadata[[% loop.index %]].required" data-field-name="required" type=checkbox [% meta.required == 'true' ? 'checked' : '' %]> + </label> + + <div class="admin-hint"><p>[% loc('If ticked the user won’t see an input field, just the ‘Description’ text.') %]</p></div> + <label> + [% loc('Notice') %] + <input name="metadata[[% loop.index %]].notice" data-field-name="notice" type=checkbox [% meta.variable == 'false' ? 'checked' : '' %]> + </label> + + <div class="admin-hint"><p>[% loc('The field name as shown to the user on the report form.') %]</p></div> + <label> + [% loc('Description') %] + <input name="metadata[[% loop.index %]].description" data-field-name="description" type=text value="[% meta.description | html %]"> + </label> + + <div class="admin-hint"><p>[% loc('Can be used to display extra text to the user alongside the field. The default template does not show this (<code>meta.datatype_description</code>), you must add it in <code>category_extras_fields.html</code>') %]</p></div> + <label> + [% loc('Hint') %] + <input name="metadata[[% loop.index %]].datatype_description" data-field-name="datatype_description" type=text value="[% meta.datatype_description | html %]"> + </label> + + <div class="admin-hint"><p>[% loc('The type of input field to show to the user. <strong>Text</strong> is a simple text field, <strong>List</strong> is a drop-down selection.') %]</p></div> + <label> + [% loc('Type') %] + <select name="metadata[[% loop.index %]].datatype" data-field-name="datatype" class="js-metadata-item-type"> + <option value="string" [% meta.datatype == 'string' ? 'selected' : '' %]>[% loc('String') %]</option> + <option value="singlevaluelist" [% meta.datatype == 'singlevaluelist' ? 'selected' : '' %]>[% loc('List') %]</option> + </select> + </label> + + <div class="js-metadata-options"> + <div class="admin-hint"><p>[% loc('For each option, <strong>Key</strong> is the value which is stored in the database for that option and <strong>Name</strong> is the value displayed to the user.') %]</p></div> + [% loc('Options') %]<span class="hidden-js"> [% loc('(ignored if type is "String")') %]</span> + <ul> + [% outer_loop = loop %] + [% values = meta.values OR [] %] + [% FOREACH option IN values.merge([{}]) %] + [%# the .merge() call is so there's an empty one on the end %] + <li class="js-metadata-option [% IF loop.last %]hidden-js js-metadata-option-template[% END %]"> + <label> + [% loc('Key') %] + <input class="js-metadata-option-key" name="metadata[[% outer_loop.index %]].values[[% loop.index %]].key" type="text" value="[% option.key | html %]"> + </label> + <label> + [% loc('Name') %] + <input class="js-metadata-option-name" name="metadata[[% outer_loop.index %]].values[[% loop.index %]].name" type="text" value="[% option.name | html %]"> + </label> + <button class="btn btn--small js-metadata-option-remove hidden-nojs">[% loc('Remove') %]</button> + </li> + [% END %] + <li class="hidden-nojs"> + <button class="btn btn--small js-metadata-option-add">[% loc('Add option') %]</button> + </li> + </ul> + </div> + </li> + [%- END %] + <li class="hidden-nojs"> + <button class="btn btn--small js-metadata-item-add">[% loc('Add field') %]</button> + </li> +</ul> diff --git a/templates/web/base/admin/list_updates.html b/templates/web/base/admin/list_updates.html index 35f7adf66..d759a2354 100644 --- a/templates/web/base/admin/list_updates.html +++ b/templates/web/base/admin/list_updates.html @@ -34,7 +34,7 @@ <td>[% IF update.user.id == update.problem.user_id %][% 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>[% state_pretty.${update.state} %]<br><small> + <td>[% prettify_state(update.state) %]<br><small> [% loc('Created:') %] [% PROCESS format_time time=update.created %] <br>[% loc('Confirmed:') %] [% PROCESS format_time time=update.confirmed %] </small></td> diff --git a/templates/web/base/admin/problem_row.html b/templates/web/base/admin/problem_row.html index 577e36992..446e94d66 100644 --- a/templates/web/base/admin/problem_row.html +++ b/templates/web/base/admin/problem_row.html @@ -20,7 +20,7 @@ <br>[% loc('Anonymous') %]: [% IF problem.anonymous %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %] </td> <td> - [% PROCESS value_or_nbsp value=problem.category %] + [% PROCESS value_or_nbsp value=problem.category_display %] <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> @@ -30,12 +30,12 @@ [%- END -%] <br>[% problem.cobrand %]<br>[% problem.cobrand_data | html %] </td> - <td>[% state_pretty.${problem.state} %]<br><small> + <td>[% prettify_state(problem.state, 1) %]<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_fixed %]<br>[% prettify_state('fixed') %]: [% PROCESS format_time time=problem.lastupdate %][% END -%] + [%- IF problem.is_closed %]<br>[% prettify_state('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> diff --git a/templates/web/base/admin/report-category.html b/templates/web/base/admin/report-category.html index 1e39236d7..a2290089b 100644 --- a/templates/web/base/admin/report-category.html +++ b/templates/web/base/admin/report-category.html @@ -1,13 +1,13 @@ <select class="form-control" name="category" id="category"> [% IF NOT problem.category OR NOT categories_hash.${problem.category} %] <optgroup label="[% loc('Existing category') %]"> - <option selected value="[% problem.category | html %]">[% (problem.category OR '-') | html %]</option> + <option selected value="[% problem.category | html %]">[% (problem.category_display OR '-') | html %]</option> </optgroup> [% END %] - [% IF categories.size %] + [% IF category_options_copy.size %] <optgroup label="[% loc('Available categories') %]"> - [% FOREACH cat IN categories %] - <option[% ' selected' IF problem.category == cat %]>[% cat | html %]</option> + [% FOREACH cat IN category_options_copy %] + <option value="[% cat.name | html %]"[% ' selected' IF problem.category == cat.name %]>[% cat.value | html %]</option> [% END %] </optgroup> [% END %] diff --git a/templates/web/base/admin/report_blocks.html b/templates/web/base/admin/report_blocks.html index 9231dd1c2..f5896b88f 100644 --- a/templates/web/base/admin/report_blocks.html +++ b/templates/web/base/admin/report_blocks.html @@ -1,32 +1,7 @@ [% SET report_blocks_included = 1; - -SET state_pretty = { - 'confirmed' = loc('Open') - 'investigating' = loc('Investigating') - 'planned' = loc('Planned') - 'in progress' = loc('In progress') - 'action scheduled' = loc('Action Scheduled') - 'fixed' = loc('Fixed') - 'fixed - user' = loc('Fixed - User') - 'fixed - council' = loc('Fixed - Council') - 'unable to fix' = loc('No further action') - 'not responsible' = loc('Not Responsible') - 'duplicate' = loc('Duplicate') - 'closed' = loc('Closed') - 'internal referral' = loc('Internal referral') - 'hidden' = loc('Hidden') - 'partial' = loc('Partial') - 'unconfirmed' = loc('Unconfirmed') -}; - -SET state_groups = [ - [ loc('Open'), [ 'confirmed', 'investigating', 'planned', 'in progress', 'action scheduled' ] ], - [ loc('Fixed'), [ 'fixed', 'fixed - user', 'fixed - council' ] ], - [ loc('Closed'), [ 'unable to fix', 'not responsible', 'duplicate', 'closed', 'internal referral' ] ], - [ loc('Hidden'), [ 'hidden', 'partial', 'unconfirmed' ] ] -]; +SET state_groups = c.cobrand.state_groups_admin; %] diff --git a/templates/web/base/admin/reportextrafields/edit.html b/templates/web/base/admin/reportextrafields/edit.html new file mode 100644 index 000000000..bc2f60ab3 --- /dev/null +++ b/templates/web/base/admin/reportextrafields/edit.html @@ -0,0 +1,68 @@ +[% INCLUDE 'admin/header.html' title=loc('Extra Fields') -%] + +<form method=post action="[% c.uri_for('', extra.id || 'new' ) %]"> + <div class="admin-hint"> + <p> + [% loc('Give this collection of fields a name. It is not shown publicly, just here in the admin.') %] + </p> + </div> + <p> + <label> + [% loc('Name') %] + <input type=text name="name" value="[% extra.name | html %]" /> + </label> + </p> + + [% IF cobrands.size > 1 %] + <div class="admin-hint"> + <p> + [% loc('To limit this collection of fields to a single cobrand, select it here.') %] + </p> + </div> + <p> + <label> + [% loc('Cobrand') %] + <select name="cobrand"> + <option value="">[% loc('All cobrands') %]</option> + [% FOREACH cobrand IN cobrands %] + <option value="[% cobrand | html %]" [% IF cobrand == extra.cobrand %]selected[% END %]>[% cobrand | html %]</option> + [% END %] + </select> + </label> + </p> + [% ELSE %] + <input type=hidden name=cobrand value="[% extra.cobrand | html %]" /> + [% END %] + + [% IF languages.size > 1 %] + <div class="admin-hint"> + <p> + [% loc('To limit this collection of fields to a single language, select it here.') %] + </p> + </div> + <p> + <label> + [% loc('Language') %] + <select name="language"> + <option value="">[% loc('All languages') %]</option> + [% FOREACH lang IN languages.pairs %] + <option value="[% lang.key | html %]" [% IF lang.key == extra.language %]selected[% END %]>[% lang.value.name | html %]</option> + [% END %] + </select> + </label> + </p> + [% ELSE %] + <input type=hidden name=language value="[% extra.language | html %]" /> + [% END %] + <p> + <label>[% loc('Fields') %]</label> + [% INCLUDE 'admin/extra-metadata-form.html' metas=extra.get_extra_fields %] + </p> + + <p> + <input type="hidden" name="token" value="[% csrf_token %]" > + <input type="submit" class="btn" name="save" value="[% extra.in_storage ? loc('Save changes') : loc('Save new fields') %]"> + </p> +</form> + +[% INCLUDE 'admin/footer.html' %] diff --git a/templates/web/base/admin/reportextrafields/index.html b/templates/web/base/admin/reportextrafields/index.html new file mode 100644 index 000000000..14d6f60d4 --- /dev/null +++ b/templates/web/base/admin/reportextrafields/index.html @@ -0,0 +1,26 @@ +[% INCLUDE 'admin/header.html' title=loc('Extra Fields') -%] + +<table> + <thead> + <tr> + <th>[% loc('Name') %]</th> + <th>[% loc('Cobrand') %]</th> + <th>[% loc('Languages') %]</th> + <th>[% loc('Fields') %]</th> + </tr> + </thead> + <tbody> + [% FOR f IN extra_fields %] + <tr> + <td><a href="[% c.uri_for('', f.id) %]">[% f.name | html %]</a></td> + <td>[% f.cobrand | html %]</td> + <td>[% f.language | html %]</td> + <td>[% f.get_extra_fields.size %]</td> + </tr> + [% END %] + </tbody> +</table> + +<a href="[% c.uri_for('', 'new') %]" class="btn">[% loc('Add extra fields') %]</a> + +[% INCLUDE 'admin/footer.html' %] diff --git a/templates/web/base/admin/responsepriorities/edit.html b/templates/web/base/admin/responsepriorities/edit.html index 07d6906ba..608f19e74 100644 --- a/templates/web/base/admin/responsepriorities/edit.html +++ b/templates/web/base/admin/responsepriorities/edit.html @@ -30,6 +30,18 @@ <div class="admin-hint"> <p> + [% loc('Select if this is the default priority') %] + </p> + </div> + <p> + <label> + <input type="checkbox" name="is_default" is="is_deleted" value="1"[% ' checked' IF rp.is_default %]> + [% loc('Default priority') %] + </label> + </p> + + <div class="admin-hint"> + <p> [% loc('If you only want this priority to be an option for specific categories, pick them here. By default they will show for all categories.') %] </p> </div> diff --git a/templates/web/base/admin/responsepriorities/list.html b/templates/web/base/admin/responsepriorities/list.html index 4c05ca14d..eedaccfdb 100644 --- a/templates/web/base/admin/responsepriorities/list.html +++ b/templates/web/base/admin/responsepriorities/list.html @@ -6,6 +6,7 @@ <th> [% loc('Name') %] </th> <th> [% loc('Description') %] </th> <th> [% loc('Categories') %] </th> + <th> [% loc('Default') %] </th> <th> </th> </tr> </thead> @@ -19,10 +20,11 @@ <em>[% loc('All categories') %]</em> [% ELSE %] [% FOR contact IN p.contacts %] - [% contact.category %][% ',' UNLESS loop.last %] + [% contact.category_display %][% ',' UNLESS loop.last %] [% END %] [% END %] </td> + <td> [% IF p.is_default %]X[% END %]</td> <td> <a href="[% c.uri_for('', body.id, p.id) %]" class="btn">[% loc('Edit') %]</a> </td> </tr> [% END %] diff --git a/templates/web/base/admin/state_groups_select.html b/templates/web/base/admin/state_groups_select.html index 9a70cd2c9..87674c47d 100644 --- a/templates/web/base/admin/state_groups_select.html +++ b/templates/web/base/admin/state_groups_select.html @@ -1,3 +1,3 @@ [% PROCESS 'admin/report_blocks.html'; # For state_groups %] [% DEFAULT current_state = problem.state %] -[% INCLUDE 'report/_state_select_field.html' %] +[% INCLUDE 'report/_state_select_field.html' single_fixed=0 %] diff --git a/templates/web/base/admin/states/index.html b/templates/web/base/admin/states/index.html new file mode 100644 index 000000000..1b68d4aea --- /dev/null +++ b/templates/web/base/admin/states/index.html @@ -0,0 +1,118 @@ +[% INCLUDE 'admin/header.html' title=loc('States') ~%] + +[% SET rows = languages.size + 1 IF languages.size > 1 ~%] + +<form method="post" accept-charset="utf-8"> + +<table> + <tr> + <th>[% loc('Label') %]</th> + <th>[% loc('Type') %]</th> + <th colspan="2">[% loc('Name') %]</th> + <th> </th> + </tr> + [% FOREACH state IN open_states.merge(closed_states).merge(fixed_states) %] + <tr> + <td rowspan="[% rows %]"> + [% IF state.label == 'confirmed' %] + open + [% ELSE %] + [% state.label %] + [% END %] + </td> + <td rowspan="[% rows %]"> + [% IF state.label == 'confirmed' %] + [% loc('Open') %]<input type="hidden" name="type:confirmed" value="open"> + [% ELSIF state.label == 'closed' %] + [% loc('Closed') %]<input type="hidden" name="type:closed" value="closed"> + [% ELSIF state.label == 'fixed' %] + [% loc('Fixed') %]<input type="hidden" name="type:fixed" value="fixed"> + [% ELSE %] + <select name="type:[% state.label %]"> + <option value="open"[% ' selected' IF state.type == 'open' %]>[% loc('Open') %]</option> + <option value="closed"[% ' selected' IF state.type == 'closed' %]>[% loc('Closed') %]</option> + </select> + [% END %] + </td> + <td colspan="2"> + [% IF state.label != 'confirmed' AND state.label != 'closed' %] + <input type="text" name="name:[% state.label %]" value="[% state.name %]"> + [% ELSIF languages.size == 1 %] + <input type="text" name="name:[% state.label %]" value="[% state.msgstr %]"> + [% ELSE %] + [% state.name %] + [% END %] + </td> + <td style="text-align:center;vertical-align:middle" rowspan="[% rows %]"> + [% IF state.label != 'confirmed' AND state.label != 'closed' %] + <input class="btn btn--small" type="submit" name="delete:[% state.label %]" value="Delete"> + [% END %] + </td> + </tr> + [% IF languages.size > 1 %] + [% FOREACH language IN languages.keys.sort %] + <tr> + <td style="vertical-align:middle; text-align:right;"> + <label style="margin:0" for="translation:[% state.label %]:[% language %]"> + [% languages.$language.name %] ([% language %]) + </label> + </td> + <td> + <input type="hidden" name="translation_id:[% state.label %]:[% language %]" + value="[% state.translated.name.$language.id %]"> + <input type="text" name="translation:[% state.label %]:[% language %]" + id="translation:[% state.label %]:[% language %]" value="[% state.translated.name.$language.msgstr %]"> + </td> + </tr> + [% END %] + [% END %] + </td> + </tr> + [% END %] +</table> + + <p> + <input type="hidden" name="token" value="[% csrf_token %]"> + <input type="submit" class="btn" value="[% loc('Update') %]"> + </p> + +</form> + +[% IF fixed_states.size == 0 %] +<form method="post" accept-charset="utf-8"> + <p> + <input type="hidden" name="token" value="[% csrf_token %]"> + <input type="submit" class="btn" name="new_fixed" value="[% loc('Add fixed state') %]"> + </p> +</form> + +[% END %] + +<h2>[% loc('New state') %]</h2> + +<form method="post" accept-charset="utf-8"> + <p> + <label for="label">[% loc('Label') %] <small>[% loc('(a-z and space only)') %]</small></label> + <input type="text" class="form-control" name="label" id="label" value="" size="20" pattern="[a-z ]+"> + </p> + + <p> + <label for="type">[% loc('Type') %]</label> + <select name="type" id="type"> + <option value="open">[% loc('Open') %]</option> + <option value="closed">[% loc('Closed') %]</option> + </select> + </p> + + <p> + <label for="name">[% loc('Name') %]</label> + <input type="text" class="form-control" name="name" id="name" value="" size="20"> + </p> + + <p> + <input type="hidden" name="token" value="[% csrf_token %]"> + <input type="submit" class="btn" name="new" value="[% loc('Create') %]"> + </p> +</form> + +[% INCLUDE 'admin/footer.html' %] diff --git a/templates/web/base/admin/stats.html b/templates/web/base/admin/stats.html index 535f04d18..150afd619 100644 --- a/templates/web/base/admin/stats.html +++ b/templates/web/base/admin/stats.html @@ -99,7 +99,7 @@ [% END %] <p> - <input type="submit" class="btn" name="getcounts" size="30" id="getcounts" value="Get Count" /> + <input type="submit" class="btn" name="getcounts" size="30" id="getcounts" value="[% loc('Get Count') %]" /> </p> </form> diff --git a/templates/web/base/admin/stats_by_state.html b/templates/web/base/admin/stats_by_state.html index b003d934e..6bcd35f88 100644 --- a/templates/web/base/admin/stats_by_state.html +++ b/templates/web/base/admin/stats_by_state.html @@ -4,7 +4,7 @@ [%- BLOCK states -%] [%- FOREACH state IN list %] [%- '<ul>' IF loop.first %] - <li>[% object.$state %] [% state_pretty.$state %]</li> + <li>[% object.$state %] [% prettify_state(state) %]</li> [%- "\n</ul>" IF loop.last %] [%- END %] [% END -%] diff --git a/templates/web/base/alert/_list.html b/templates/web/base/alert/_list.html index 388e0e9bc..d997a5abb 100644 --- a/templates/web/base/alert/_list.html +++ b/templates/web/base/alert/_list.html @@ -1,94 +1,85 @@ + [% SET name_of_location = pretty_pc || loc('this location') %] + <input type="hidden" name="token" value="[% csrf_token %]"> <input type="hidden" name="type" value="local"> <input type="hidden" name="pc" value="[% pc | html %]"> <input type="hidden" name="latitude" value="[% latitude | html %]"> <input type="hidden" name="longitude" value="[% longitude | html %]"> - <p> - [% IF pretty_pc %] - [% tprintf( loc('Here are the types of local problem alerts for ‘%s’.'), pretty_pc ) %] - [% END %] - [% loc('Select which type of alert you’d like and click the button for an RSS feed, or enter your email address to subscribe to an email alert.') %] - </p> + <h2>[% loc('Which problems do you want alerts about?') %]</h2> [% INCLUDE 'errors.html' %] - <p> - [% loc('The simplest alert is our geographic one:') %] - </p> + [% IF reported_to_options %] + <p> + [% tprintf(loc('Reports near %s are sent to different councils, depending on the type of problem.'), name_of_location) %] + </p> + <p> + [% loc('You can choose to subscribe to all problems reported in an area, or reports based on their destination.') %] + </p> + <div class="alerts__columns"> + <div> + <h3>[% loc('Problems in an area') %]</h3> + [% END %] <p id="rss_local"> - <input type="radio" name="feed" id="[% rss_feed_id %]" value="[% rss_feed_id %]"[% IF rss_feed_id == selected_feed || selected_feed == '' %] checked[% END %]> - <label class="inline" for="[% rss_feed_id %]">[% tprintf( loc('Problems within %.1fkm of this location'), population_radius ) %]</label> <a href="[% rss_feed_uri %]"><img src='/i/feed.png' width='16' height='16' title='[% loc('RSS feed of nearby problems') %]' alt='[% loc('RSS feed') %]' border='0'></a> - <br /> - [% loc('(a default distance which covers roughly 200,000 people)') %] + <label class="label-containing-checkbox" for="[% rss_feed_id %]"> + <input type="radio" name="feed" id="[% rss_feed_id %]" value="[% rss_feed_id %]"[% IF rss_feed_id == selected_feed || selected_feed == '' %] checked[% END %]> + [% tprintf( loc('Problems within %.1fkm of %s'), population_radius, name_of_location ) %] + [% loc('(covers roughly 200,000 people)') %] + </label> </p> <p id="rss_local_alt"> [% SET distance_options = '<a href="' _ rss_feed_2k _ ' ">2km</a> / <a href="' _ rss_feed_5k _ ' ">5km</a> / <a href="' _ rss_feed_10k _ '">10km</a> / <a href="' _ rss_feed_20k _ '">20km</a>' %] - [% tprintf(loc('(alternatively the RSS feed can be customised, within %s)', "%s is a list of distance links, e.g. [2km] / [5km] / [10km] / [20km]"), distance_options) %] + [% tprintf(loc('(we also have RSS feeds for problems within %s)', "%s is a list of distance links, e.g. [2km] / [5km] / [10km] / [20km]"), distance_options) %] </p> - <p> - [% IF c.cobrand.is_council %] - Or you can subscribe to an alert for all council problems or one based upon what ward you’re in: - [% ELSE %] - [% loc("Or you can subscribe to an alert based upon what ward or council you’re in:") %] - [% END %] - </p> - - [% IF reported_to_options %] - <p><strong> - [% loc('Problems within the boundary of:') %] - </strong></p> - <ul class="plain-list"> - [% ELSE %] - <ul id="rss_feed" class="plain-list"> - [% END %] - [% FOREACH option IN options %] - <li[% IF ! (loop.count % 2) %] class="a"[% END %]> - <input type="radio" name="feed" id="[% option.id %]" value="[% option.id %]"[% IF option.id == selected_feed %] checked[% END %]> - <a href="[% option.uri %]"><img src="/i/feed.png" width="16" height="16" + <p> + <a href="[% option.uri %]"><img src="/i/feed.png" width="16" height="16" title="[% option.rss_text %]" alt="RSS feed" border="0"></a> - <label class="inline" for="[% option.id %]">[% option.text %]</label> - </li> - [% END %] -</ul> - [% IF reported_to_options %] - <p><strong> - [% loc('Or problems reported to:') %] - </strong></p> - <ul class="plain-list"> - [% FOREACH option IN reported_to_options %] - <li[% IF ! (loop.count % 2) %] class="a"[% END %]> + <label class="label-containing-checkbox" for="[% option.id %]"> <input type="radio" name="feed" id="[% option.id %]" value="[% option.id %]"[% IF option.id == selected_feed %] checked[% END %]> + [% option.text %] + </label> + </p> + [% END %] + + [% IF reported_to_options %] + </div> + <div> + + <h3>[% loc('Reports by destination') %]</h3> + + [% FOREACH option IN reported_to_options %] + <p> <a href="[% option.uri %]"><img src="/i/feed.png" width="16" height="16" title="[% option.rss_text %]" alt="RSS feed" border="0"></a> - <label class="inline" for="[% option.id %]">[% option.text %]</label> - </li> - [% END %] - </ul> - <p><small> - [% tprintf(loc('%s sends different categories of problem -to the appropriate council, so problems within the boundary of a particular council -might not match the problems sent to that council. For example, a graffiti report -will be sent to the district council, so will appear in both of the district -council’s alerts, but will only appear in the "Within the boundary" alert -for the county council.', "%s is the site name"), site_name) %] - </small></p> + <label class="label-containing-checkbox" for="[% option.id %]"> + <input type="radio" name="feed" id="[% option.id %]" value="[% option.id %]"[% IF option.id == selected_feed %] checked[% END %]> + [% option.text %] + </label> + </p> [% END %] + </div> + </div> + [% END %] - <input id="alert_rss_button" class="green-btn" type="submit" name="rss" value="[% loc('Give me an RSS feed') %]"> - - <p id="alert_or"> - [% loc('or') %] - </p> - [% UNLESS c.user_exists %] - <label for="rznvy">[% loc('Your email') %]</label> - <input class="form-control" type="text" id="rznvy" name="rznvy" value="[% rznvy | html %]"> - [% END %] - <input id="alert_email_button" style="margin-top:1em;" class="green-btn" type="submit" name="alert" value="[% loc('Subscribe me to an email alert') %]"> + <div class="alerts__cta-box"> + <h3>[% loc('Subscribe by email') %]</h3> + [% UNLESS c.user_exists %] + <label for="rznvy">[% loc('Email address') %]</label> + <div class="form-txt-submit-box"> + <input class="form-control" type="text" id="rznvy" name="rznvy" value="[% rznvy | html %]"> + <input id="alert_email_button" class="btn-primary" type="submit" name="alert" value="[% loc('Subscribe') %]"> + </div> + [% ELSE %] + <input id="alert_email_button" class="btn-primary" type="submit" name="alert" value="[% loc('Subscribe') %]"> + [% END %] + </div> + <h3>[% loc('Or subscribe by RSS') %]</h3> + <input id="alert_rss_button" class="btn" type="submit" name="rss" value="[% loc('Give me an RSS feed') %]"> diff --git a/templates/web/base/alert/index.html b/templates/web/base/alert/index.html index 5c61e93d9..acef89a78 100644 --- a/templates/web/base/alert/index.html +++ b/templates/web/base/alert/index.html @@ -27,7 +27,7 @@ within a certain distance of a particular location.', "%s is the site name"), si [% loc('To find out what local alerts we have for you, please enter your postcode or street name and area' ) %] [% END %] </p> -<form method="get" action="/alert/list" class="form-box"> +<form method="get" action="/alert/list" class="form-box js-geolocate"> <fieldset> <div class="form-txt-submit-box"> <input class="form-control" type="text" name="pc" value="[% pc | html %]" placeholder="[% tprintf(loc('e.g. ‘%s’ or ‘%s’'), c.cobrand.example_places) %]"> diff --git a/templates/web/base/around/postcode_form.html b/templates/web/base/around/postcode_form.html index 135a70294..69c95d311 100644 --- a/templates/web/base/around/postcode_form.html +++ b/templates/web/base/around/postcode_form.html @@ -6,7 +6,7 @@ question = c.cobrand.enter_postcode_text || loc('Enter a nearby street name and area'); %] - <form action="[% c.uri_for('/around') %]" method="get" name="postcodeForm" id="postcodeForm"> + <form action="[% c.uri_for('/around') %]" method="get" name="postcodeForm" id="postcodeForm" class="js-geolocate"> <label for="pc">[% question %]:</label> <div> <input type="text" name="pc" value="[% pc | html %]" id="pc" size="10" maxlength="200" placeholder="[% tprintf(loc('e.g. ‘%s’ or ‘%s’'), c.cobrand.example_places) %]"> diff --git a/templates/web/base/around/tabbed_lists.html b/templates/web/base/around/tabbed_lists.html index b0d46444d..5418ef914 100755 --- a/templates/web/base/around/tabbed_lists.html +++ b/templates/web/base/around/tabbed_lists.html @@ -1,5 +1,5 @@ [% INCLUDE "reports/_list-filters.html" %] -<ul id="current" class="item-list item-list--reports"> +<ul id="js-reports-list" class="item-list item-list--reports"> [% INCLUDE "around/on_map_list_items.html" %] </ul> diff --git a/templates/web/base/auth/general.html b/templates/web/base/auth/general.html index 41ff3a2e1..2a8bea402 100644 --- a/templates/web/base/auth/general.html +++ b/templates/web/base/auth/general.html @@ -2,6 +2,8 @@ <h1>[% loc('Sign in') %]</h1> +[% TRY %][% INCLUDE 'auth/_general_top.html' %][% CATCH file %][% END %] + [% IF oauth_need_email %] <p class="form-error">[% loc('We need your email address, please give it below.') %]</p> [% END %] diff --git a/templates/web/base/auth/sign_out.html b/templates/web/base/auth/sign_out.html index c95efacf5..1a468b278 100644 --- a/templates/web/base/auth/sign_out.html +++ b/templates/web/base/auth/sign_out.html @@ -5,6 +5,6 @@ <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> </div> -[% INCLUDE next_steps.html %] +[% INCLUDE next_steps.html utm_content='signed out' %] [% INCLUDE 'footer.html' %] diff --git a/templates/web/base/auth/token.html b/templates/web/base/auth/token.html index a4dedcec3..9a79a5e67 100644 --- a/templates/web/base/auth/token.html +++ b/templates/web/base/auth/token.html @@ -14,8 +14,14 @@ <div class="confirmation-header confirmation-header--inbox"> - <h1>[% loc("Nearly done! Now check your email…") %]</h1> - <p>[% loc("Click the link in our confirmation email to sign in.") %]</p> + [% IF c.config.SIGNUPS_DISABLED %] + <h1>[% loc("Nearly done!") %]</h1> + <p>[% loc("If there's a user associated with the address you entered, we've sent a confirmation email.") %]</p> + <p>[% loc("Click the link in that email to sign in.") %]</p> + [% ELSE %] + <h1>[% loc("Nearly done! Now check your email…") %]</h1> + <p>[% loc("Click the link in our confirmation email to sign in.") %]</p> + [% END %] <p> [% loc("Can’t find our email? Check your spam folder – that’s the solution 99% of the time.") %] diff --git a/templates/web/base/common_footer_tags.html b/templates/web/base/common_footer_tags.html index 01420c37d..915751802 100644 --- a/templates/web/base/common_footer_tags.html +++ b/templates/web/base/common_footer_tags.html @@ -3,7 +3,7 @@ [% PROCESS 'common_scripts.html' %] <!--[if lte IE 9]> - <script src="[% version('/js/history.polyfill.min.js') %]"></script> + <script src="[% version('/vendor/history.polyfill.min.js') %]"></script> <![endif]--> [% FOR script IN scripts ~%] [% script = script.0 ? script : [ script ] ~%] diff --git a/templates/web/base/common_header_tags.html b/templates/web/base/common_header_tags.html index e64722f01..e5a4d25f2 100644 --- a/templates/web/base/common_header_tags.html +++ b/templates/web/base/common_header_tags.html @@ -1,13 +1,17 @@ [% SET start = c.config.ADMIN_BASE_URL IF admin %] -<link rel="stylesheet" href="[% version('/js/OpenLayers/theme/default/style.css') %]"> +<link rel="stylesheet" href="[% version('/vendor/OpenLayers/theme/default/style.css') %]"> <meta http-equiv="content-type" content="text/html; charset=utf-8" id="js-meta-data" data-page="[% page %]" data-cobrand="[% c.cobrand.moniker %]"> +[% IF csrf_token %] + <meta content="[% csrf_token %]" name="csrf-token" /> +[% END %] + <!--[if (lt IE 9)]> - <script src="[% version('/js/html5shiv.js') %]""></script> + <script src="[% version('/vendor/html5shiv.js') %]"></script> <![endif]--> <script nonce="[% csp_nonce %]"> window.Modernizr=function(e,t,n){function r(e){p.cssText=e}function o(e,t){return typeof e===t}var a,i,c,l="2.8.3",s={},u=t.documentElement,d="modernizr",f=t.createElement(d),p=f.style,m=({}.toString,{}),h=[],y=h.slice,v=function(e,n,r,o){var a,i,c,l,s=t.createElement("div"),f=t.body,p=f||t.createElement("body");if(parseInt(r,10))for(;r--;)c=t.createElement("div"),c.id=o?o[r]:d+(r+1),s.appendChild(c);return a=["­",'<style id="s',d,'">',e,"</style>"].join(""),s.id=d,(f?s:p).innerHTML+=a,p.appendChild(s),f||(p.style.background="",p.style.overflow="hidden",l=u.style.overflow,u.style.overflow="hidden",u.appendChild(p)),i=n(s,e),f?s.parentNode.removeChild(s):(p.parentNode.removeChild(p),u.style.overflow=l),!!i},g=function(t){var n=e.matchMedia||e.msMatchMedia;if(n)return n(t)&&n(t).matches||!1;var r;return v("@media "+t+" { #"+d+" { position: absolute; } }",function(t){r="absolute"==(e.getComputedStyle?getComputedStyle(t,null):t.currentStyle).position}),r},b={}.hasOwnProperty;c=o(b,"undefined")||o(b.call,"undefined")?function(e,t){return t in e&&o(e.constructor.prototype[t],"undefined")}:function(e,t){return b.call(e,t)};for(var E in m)c(m,E)&&(i=E.toLowerCase(),s[i]=m[E](),h.push((s[i]?"":"no-")+i));return r(""),f=a=null,s._version=l,s.mq=g,s.testStyles=v,s}(this,this.document); @@ -16,7 +20,7 @@ </script> [% IF admin %] - <link rel="stylesheet" href="[% version('/js/jquery-ui/css/smoothness/jquery-ui-1.10.3.custom.min.css') %]"> + <link rel="stylesheet" href="[% version('/vendor/jquery-ui/css/smoothness/jquery-ui-1.10.3.custom.min.css') %]"> [% END %] [% IF robots %] diff --git a/templates/web/base/common_scripts.html b/templates/web/base/common_scripts.html index 42c04f11f..474edc46e 100644 --- a/templates/web/base/common_scripts.html +++ b/templates/web/base/common_scripts.html @@ -9,10 +9,10 @@ scripts.push( start _ "/js/translation_strings." _ lang_code _ ".js?" _ Math.int( date.now / 3600 ), version('/jslib/jquery-1.7.2.min.js'), version('/js/validation_rules.js'), - version('/js/jquery.validate.min.js'), - version('/js/dropzone.min.js'), + version('/vendor/jquery.validate.min.js'), + version('/vendor/dropzone.min.js'), version('/js/jquery.multi-select.js'), - version('/js/geo.min.js'), + version('/vendor/geo.min.js'), version('/cobrands/fixmystreet/fixmystreet.js'), ); @@ -33,7 +33,7 @@ scripts.push( IF admin; scripts.push( - version('/js/jquery-ui/js/jquery-ui-1.10.3.custom.min.js'), + version('/vendor/jquery-ui/js/jquery-ui-1.10.3.custom.min.js'), version('/cobrands/fixmystreet/admin.js'), ); END; diff --git a/templates/web/base/contact/blurb.html b/templates/web/base/contact/blurb.html index 3f9e88ed0..1142dc874 100644 --- a/templates/web/base/contact/blurb.html +++ b/templates/web/base/contact/blurb.html @@ -1,9 +1,3 @@ -[% IF c.cobrand.moniker == 'fixmystreet' %] -<h3>Send a message to FixMyStreet's technical support team</h3> - -<h4>If you have questions about FixMyStreet</h4> -[% END %] - <p> [% tprintf( loc("It's often quickest to <a href=\"%s\">check our FAQs</a> and see if the answer is there."), c.uri_for('/faq') ) %] </p> diff --git a/templates/web/base/contact/index.html b/templates/web/base/contact/index.html index f24f8afea..dfd3ef6b2 100644 --- a/templates/web/base/contact/index.html +++ b/templates/web/base/contact/index.html @@ -77,13 +77,17 @@ [% END %] <input type="text" class="form-control required" name="name" id="form_name" value="[% form_name | html %]" size="30"> - <label for="form_email">[% loc('Your email') %]</label> [% IF field_errors.em %] <div class="form-error">[% field_errors.em %]</div> [% END %] <input type="text" class="form-control required email" name="em" id="form_email" value="[% em | html %]" size="30"> + <div class="form-group"> + <label for="form_phone">[% loc('Your phone number') %]</label> + <span class="required-text required-text--optional">optional</span> + <input type="text" class="form-control extra.phone" name="extra.phone" id="form_phone" value="" size="30"> + </div> <label for="form_subject">[% loc('Subject') %]</label> [% IF field_errors.subject %] @@ -100,7 +104,7 @@ <textarea class="form-control required" name="message" id="form_message" rows="7" cols="50">[% message | html %]</textarea> - <input class="final-submit green-btn" type="submit" value="[% loc('Post') %]"> + <input class="final-submit green-btn" type="submit" value="[% loc('Send') %]"> </fieldset> </form> diff --git a/templates/web/base/contact/submit.html b/templates/web/base/contact/submit.html index 4bf82dcd6..acb7caad9 100644 --- a/templates/web/base/contact/submit.html +++ b/templates/web/base/contact/submit.html @@ -16,6 +16,6 @@ [% END %] -[% INCLUDE next_steps.html %] +[% INCLUDE next_steps.html utm_content='contact form submitted' %] [% INCLUDE 'footer.html' %] diff --git a/templates/web/base/dashboard/index.html b/templates/web/base/dashboard/index.html index 2a9a2ef42..e47798573 100644 --- a/templates/web/base/dashboard/index.html +++ b/templates/web/base/dashboard/index.html @@ -29,7 +29,7 @@ <label for="category">[% loc('Category:') %]</label> <select class="form-control" name="category"><option value=''>[% loc('All') %]</option> [% FOR cat_op IN category_options %] - <option value='[% cat_op | html %]'[% ' selected' IF category == cat_op %]>[% cat_op | html %]</option> + <option value='[% cat_op.name | html %]'[% ' selected' IF category == cat_op.name %]>[% cat_op.value | html %]</option> [% END %] </select> </p> @@ -136,11 +136,12 @@ </select> <p>[% loc('Report state:') %] <select class="form-control" name="state"> <option value=''>[% loc('All') %]</option> - [% FOREACH state IN [ ['confirmed', loc('Open')], ['investigating', - 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 %] + [% FOR group IN filter_states %] + [% FOR state IN group.1 %] + [% NEXT IF state == 'hidden' %] + <option [% 'selected ' IF state == q_state %] value="[% state %]">[% prettify_state(state, 1) %]</option> + [% END %] + [% END %] </select> <input type="submit" class="btn" value="[% loc('Look up') %]"> <a class="export_as_csv" href="[% c.req.uri_with({ export => 1 }) %]">[% loc('Export as CSV') %]</a> diff --git a/templates/web/base/email_sent.html b/templates/web/base/email_sent.html index 7d38f9d67..2724dabb9 100644 --- a/templates/web/base/email_sent.html +++ b/templates/web/base/email_sent.html @@ -14,6 +14,8 @@ [% END %] </p> + [% TRY %][% INCLUDE '_email_sent_extra.html' %][% CATCH file %][% END %] + <p> [% loc("Can’t find our email? Check your spam folder – that’s the solution 99% of the time.") %] </p> diff --git a/templates/web/base/footer.html b/templates/web/base/footer.html index 9f86f7519..e2bdbb01a 100644 --- a/templates/web/base/footer.html +++ b/templates/web/base/footer.html @@ -8,7 +8,7 @@ </div><!-- .table-cell --> <div class="nav-wrapper"> - <div class="nav-wrapper-2"> + <div class="container"> [% INCLUDE "main_nav.html" %] </div> </div> diff --git a/templates/web/base/front/footer-marketing.html b/templates/web/base/front/footer-marketing.html index c0c9b4168..3fb7a3044 100644 --- a/templates/web/base/front/footer-marketing.html +++ b/templates/web/base/front/footer-marketing.html @@ -1,21 +1,8 @@ - <div class="tablewrapper bordered"> - <div id="footer-mobileapps"> - <!-- - <h4></h4> - <p> - </p> - --> - </div> - - <div id="footer-help"> - <p> - [% loc('Powered by <a class="platform-logo" href="http://fixmystreet.org/">FixMyStreet Platform</a>') %] - </p> - <ul> - <li> - <h4>[% loc('Are you a developer?') %]</h4> - <p>[% loc('Would you like to contribute to FixMyStreet? Our code is open source and <a href="http://fixmystreet.org">available at fixmystreet.org</a>.') %]</p> - </li> - </ul> - </div> + <div class="tablewrapper bordered footer-marketing"> + <p> + [% loc('Would you like to contribute to FixMyStreet? Our code is open source and <a href="http://fixmystreet.org">available at fixmystreet.org</a>.') %] + </p> + <p> + [% loc('Powered by <a class="platform-logo" href="http://fixmystreet.org/">FixMyStreet Platform</a>') %] + </p> </div> diff --git a/templates/web/base/front/javascript.html b/templates/web/base/front/javascript.html index 6b8e2a292..69eb626f7 100644 --- a/templates/web/base/front/javascript.html +++ b/templates/web/base/front/javascript.html @@ -1,10 +1,10 @@ [% # Assume using OpenStreetMap maps map_js = [ - version('/js/yepnope.js'), + version('/vendor/yepnope.js'), [ version('/cobrands/fixmystreet/front.js'), { id = 'script_front', - 'data-scripts' = version('/js/OpenLayers/OpenLayers.fixmystreet.js') _ ',' _ + 'data-scripts' = version('/vendor/OpenLayers/OpenLayers.fixmystreet.js') _ ',' _ version('/js/map-OpenLayers.js') _ ',' _ version('/js/map-OpenStreetMap.js') } ], diff --git a/templates/web/base/front/recent.html b/templates/web/base/front/recent.html index cb83c51b8..1fe6ad2be 100644 --- a/templates/web/base/front/recent.html +++ b/templates/web/base/front/recent.html @@ -13,7 +13,7 @@ </h2> <section class="full-width"> - <ul class="item-list item-list--reports item-list--front-page"> + <ul id="js-reports-list" class="item-list item-list--reports item-list--front-page"> [% FOREACH problem IN recent_photos %] [% INCLUDE 'front/_list-entry.html' %] [% END %] diff --git a/templates/web/base/front/stats.html b/templates/web/base/front/stats.html index eb671137b..41358c869 100644 --- a/templates/web/base/front/stats.html +++ b/templates/web/base/front/stats.html @@ -35,7 +35,9 @@ <div id="front_stats"> <div>[% tprintf( new_text, decode(new_n) ) %]</div> + [% IF has_fixed_state %] <div>[% tprintf( fixed_text, decode(fixed_n) ) %]</div> + [% END %] [% IF c.cobrand.moniker != 'zurich' %] <div>[% tprintf( updates_text, decode(updates_n) ) %]</div> [% END %] diff --git a/templates/web/base/js/translation_strings.html b/templates/web/base/js/translation_strings.html index b90a4d576..bc2f013ff 100644 --- a/templates/web/base/js/translation_strings.html +++ b/templates/web/base/js/translation_strings.html @@ -51,6 +51,9 @@ permalink: '[% loc('Permalink') | replace("'", "\\'") %]', + show_pins: '[% loc('Show pins') | replace("'", "\\'") %]', + hide_pins: '[% loc('Hide pins') | replace("'", "\\'") %]', + upload_max_files_exceeded: '[% loc ('Whoa there Testino! Three photos are enough.') | replace("'", "\\'") %]', upload_default_message: '[% loc ('Drag and drop photos here or <u>click to upload</u>') | replace("'", "\\'") %]', upload_cancel_confirmation: '[% loc ('Are you sure you want to cancel this upload?') | replace("'", "\\'") %]', @@ -66,7 +69,7 @@ are_you_sure: '[% loc('Are you sure?') | replace("'", "\\'") %]', data_cleared: '[% loc('Offline data cleared') | replace("'", "\\'") %]', reports_saved: '[% loc('Reports saved offline.') | replace("'", "\\'") %]', - saving_reports: '[% loc('Saving reports offline', 'This is followed by a progress count, e.g. 3/5') | replace("'", "\\'") %]', + saving_reports: '[% loc('Saving reports offline', "This is followed by a progress count, e.g. 3/5") | replace("'", "\\'") %]', you_are_offline: '[% loc('You are offline') | replace("'", "\\'") %]', N_saved: '[% loc('<span>%s</span> saved.') | replace("'", "\\'") %]', saved_to_submit: '[% loc('You have <a id="oFN" href=""><span>%s</span> saved to submit</a>.') | replace("'", "\\'") %]', diff --git a/templates/web/base/main_nav.html b/templates/web/base/main_nav.html index 31bd61af5..b8a3165a4 100644 --- a/templates/web/base/main_nav.html +++ b/templates/web/base/main_nav.html @@ -20,12 +20,6 @@ <div id="main-nav" role="navigation"> [% END %] - [% UNLESS hide_mysoc_link %] - <ul class="nav-menu nav-menu--mysoc"> - <li><a id="mysoc-logo" href="https://www.mysociety.org/">mySociety</a></li> - </ul> - [% END %] - <ul class="[% ul_class %]"[% " id='" _ ul_id _ "'" IF ul_id %]> [% INCLUDE 'main_nav_items.html' %] </ul> diff --git a/templates/web/base/main_nav_items.html b/templates/web/base/main_nav_items.html index 6b5e09e56..845ef7c65 100644 --- a/templates/web/base/main_nav_items.html +++ b/templates/web/base/main_nav_items.html @@ -1,4 +1,4 @@ -[%~ INCLUDE navitem uri='/' label=loc('Report a problem') attrs='class="report-a-problem-btn"' ~%] +[%~ INCLUDE navitem uri=(homepage_template ? '/report' : '/') label=loc('Report a problem') attrs='class="report-a-problem-btn"' ~%] [%~ IF c.user_exists ~%] [%~ INCLUDE navitem uri='/my' label=loc('Your account') ~%] diff --git a/templates/web/base/maps/bing.html b/templates/web/base/maps/bing.html index 59d012c4f..df45eced5 100644 --- a/templates/web/base/maps/bing.html +++ b/templates/web/base/maps/bing.html @@ -1,6 +1,6 @@ [% map_js = [ - version('/js/OpenLayers/OpenLayers.fixmystreet.js'), + version('/vendor/OpenLayers/OpenLayers.fixmystreet.js'), version('/js/map-OpenLayers.js'), version('/js/map-bing-ol.js'), ]; diff --git a/templates/web/base/maps/fms.html b/templates/web/base/maps/fms.html index e155ff778..ff5b4eab6 100644 --- a/templates/web/base/maps/fms.html +++ b/templates/web/base/maps/fms.html @@ -1,6 +1,6 @@ [% map_js = [ - version('/js/OpenLayers/OpenLayers.fixmystreet.js'), + version('/vendor/OpenLayers/OpenLayers.fixmystreet.js'), version('/js/map-OpenLayers.js'), version('/js/map-bing-ol.js'), version('/js/map-fms.js'), diff --git a/templates/web/base/maps/google-ol.html b/templates/web/base/maps/google-ol.html index 7c7711de9..d88043403 100644 --- a/templates/web/base/maps/google-ol.html +++ b/templates/web/base/maps/google-ol.html @@ -6,7 +6,7 @@ END; map_js = [ google_maps_url, - version('/js/OpenLayers/OpenLayers.google.js'), + version('/vendor/OpenLayers/OpenLayers.google.js'), version('/js/map-OpenLayers.js'), version('/js/map-google-ol.js'), ] diff --git a/templates/web/base/maps/mapquest-attribution.html b/templates/web/base/maps/mapquest-attribution.html index e469901a8..43d6106a5 100644 --- a/templates/web/base/maps/mapquest-attribution.html +++ b/templates/web/base/maps/mapquest-attribution.html @@ -1,6 +1,6 @@ [% map_js = [ - version('/js/OpenLayers/OpenLayers.fixmystreet.js'), + version('/vendor/OpenLayers/OpenLayers.fixmystreet.js'), version('/js/map-OpenLayers.js'), version('/js/map-OpenStreetMap.js'), ]; diff --git a/templates/web/base/maps/openlayers.html b/templates/web/base/maps/openlayers.html index 215b69d26..8f8d527e2 100644 --- a/templates/web/base/maps/openlayers.html +++ b/templates/web/base/maps/openlayers.html @@ -6,7 +6,9 @@ <input type="hidden" name="zoom" value="[% map.zoom %]"> <div id="js-map-data" +[%- UNLESS c.cobrand.call_hook('hide_areas_on_reports') %] data-area="[% map.area.join(',') %]" +[%- END %] data-all_pins='[% all_pins %]' data-latitude=[% map.latitude %] data-longitude=[% map.longitude %] @@ -16,13 +18,14 @@ [% IF map.zoom -%] data-zoom=[% map.zoom %] [%- END %] - data-pin_prefix='[% c.config.ADMIN_BASE_URL IF admin %][% c.cobrand.path_to_pin_icons %]', + data-pin_prefix='[% c.config.ADMIN_BASE_URL IF admin %][% c.cobrand.path_to_pin_icons %]' + data-pin_new_report_colour='[% c.cobrand.pin_new_report_colour %]' data-numZoomLevels=[% map.numZoomLevels %] data-zoomOffset=[% map.zoomOffset %] data-map_type="[% map.map_type %]" [% IF include_key -%] data-key='[% c.config.BING_MAPS_API_KEY %]' -[%- END %] +[%- END -%] > </div> <div id="map_box" aria-hidden="true"> diff --git a/templates/web/base/maps/osm-streetview.html b/templates/web/base/maps/osm-streetview.html index dcf45d3b6..f68f53039 100644 --- a/templates/web/base/maps/osm-streetview.html +++ b/templates/web/base/maps/osm-streetview.html @@ -1,6 +1,6 @@ [% map_js = [ - version('/js/OpenLayers/OpenLayers.fixmystreet.js'), + version('/vendor/OpenLayers/OpenLayers.fixmystreet.js'), version('/js/map-OpenLayers.js'), version('/js/map-streetview.js'), ]; diff --git a/templates/web/base/maps/osm-toner-lite.html b/templates/web/base/maps/osm-toner-lite.html index 6512eaf2c..22b6636c5 100644 --- a/templates/web/base/maps/osm-toner-lite.html +++ b/templates/web/base/maps/osm-toner-lite.html @@ -1,6 +1,6 @@ [% map_js = [ - version('/js/OpenLayers/OpenLayers.fixmystreet.js'), + version('/vendor/OpenLayers/OpenLayers.fixmystreet.js'), "https://stamen-maps.a.ssl.fastly.net/js/tile.stamen.js?v1.3.0", version('/js/map-OpenLayers.js'), version('/js/map-toner-lite.js'), diff --git a/templates/web/base/maps/osm.html b/templates/web/base/maps/osm.html index e469901a8..43d6106a5 100644 --- a/templates/web/base/maps/osm.html +++ b/templates/web/base/maps/osm.html @@ -1,6 +1,6 @@ [% map_js = [ - version('/js/OpenLayers/OpenLayers.fixmystreet.js'), + version('/vendor/OpenLayers/OpenLayers.fixmystreet.js'), version('/js/map-OpenLayers.js'), version('/js/map-OpenStreetMap.js'), ]; diff --git a/templates/web/base/my/anonymize.html b/templates/web/base/my/anonymize.html new file mode 100644 index 000000000..e82a03ce0 --- /dev/null +++ b/templates/web/base/my/anonymize.html @@ -0,0 +1,26 @@ +[% INCLUDE 'header.html', + title = loc('Hide my name'), + bodyclass = 'twothirdswidthpage' %] + +<form method="post" action="/my/anonymize" class="box-warning hide-name-form"> + <input type="hidden" name="token" value="[% csrf_token %]"> + + [% IF update %] + <input type="hidden" name="update" value="[% update.id %]"> + <input class="btn-primary" type="submit" name="hide" value="[% loc('Hide my name in this update') %]"> + [% ELSIF problem %] + [% IF problem.bodies_str %] + <p>[% tprintf(loc('Your name has already been sent to %s, but we can hide it on this page:'), problem.body(c)) %]</p> + [% END %] + <input type="hidden" name="problem" value="[% problem.id %]"> + <input class="btn-primary" type="submit" name="hide" value="[% loc('Hide my name on this report') %]"> + [% END %] + + [% IF NOT c.user.from_body %] + <p>[% loc('Alternatively, we can hide your name on <strong>all of your reports and updates</strong> across the site:') %]</p> + <input class="btn" type="submit" name="hide_everywhere" value="[% loc('Hide my name everywhere') %]"> + [% END %] + +</form> + +[% INCLUDE 'footer.html' %] diff --git a/templates/web/base/my/my.html b/templates/web/base/my/my.html index a61a8ea44..1aaad6dc9 100644 --- a/templates/web/base/my/my.html +++ b/templates/web/base/my/my.html @@ -66,7 +66,7 @@ <p class="meta-2"> [% tprintf( loc("Added %s"), prettify_dt( u.confirmed, 'date' ) ) %] – - <a href="[% c.uri_for( '/report', u.problem_id ) %]#update_[% u.id %]"> + <a href="[% u.url %]"> [% u.problem.title | html %] </a> </p> diff --git a/templates/web/base/open311/index.html b/templates/web/base/open311/index.html index 51e7ef364..2a8044a54 100644 --- a/templates/web/base/open311/index.html +++ b/templates/web/base/open311/index.html @@ -40,8 +40,8 @@ about future-proofing your communication channels in an easy and economical way [% IF c.cobrand.moniker == 'fixmystreet' %] <p>You may be interested to know about <a -href="https://www.fixmystreet.com/about/council">FixMyStreet -for Councils</a>, our hosted service which sits seamlessly on your council +href="https://www.fixmystreet.com/about/professional">FixMyStreet +Professional</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 diff --git a/templates/web/base/pagination.html b/templates/web/base/pagination.html index 448186838..a677b9d58 100644 --- a/templates/web/base/pagination.html +++ b/templates/web/base/pagination.html @@ -1,4 +1,4 @@ -[% IF pager.last_page > 1 %] +[% IF pager.total_entries > 1 %] <p class="pagination"> [% IF pager.previous_page %] <a class="prev" href="[% c.uri_with({ $param => pager.previous_page, ajax => undefined }) %][% '#' _ hash IF hash %]">[% loc('Previous') %]</a> diff --git a/templates/web/base/questionnaire/completed.html b/templates/web/base/questionnaire/completed.html index 32aa8bd68..280cc33b8 100644 --- a/templates/web/base/questionnaire/completed.html +++ b/templates/web/base/questionnaire/completed.html @@ -16,6 +16,6 @@ [% END %] </div> -[% INCLUDE next_steps.html %] +[% INCLUDE next_steps.html utm_content='questionnaire completed' %] [% INCLUDE 'footer.html' %] diff --git a/templates/web/base/questionnaire/index.html b/templates/web/base/questionnaire/index.html index 8639a436f..84a9d7efd 100644 --- a/templates/web/base/questionnaire/index.html +++ b/templates/web/base/questionnaire/index.html @@ -22,8 +22,8 @@ <p class="questionnaire-report-reminder__report-meta">[% problem.meta_line(c) | html %]</p> [% IF updates.size %] <p class="questionnaire-report-reminder__last-update-header"> - <strong>Last update</strong> - <a href="/report/[% problem.id %]">Show all updates</a> + <strong>[% loc('Last update') %]</strong> + <a href="/report/[% problem.id %]">[% loc('Show all updates') %]</a> </p> <p class="questionnaire-report-reminder__last-update">“[% updates.last.text | add_links %]”</p> [% END %] diff --git a/templates/web/base/report/_inspect.html b/templates/web/base/report/_inspect.html index b75394abd..436c89e4a 100644 --- a/templates/web/base/report/_inspect.html +++ b/templates/web/base/report/_inspect.html @@ -1,15 +1,25 @@ [% permissions = c.user.permissions(c, problem.bodies_str) %] [% second_column = BLOCK -%] <div id="side-inspect"> + + <h2 class="inspect-form-heading">[% loc('Inspect report') %]</h2> + [% INCLUDE 'errors.html' %] - <form id="report_inspect_form" method="post" action="[% c.uri_for( '/report', problem.id ) %]"> + <form id="report_inspect_form" method="post" action="[% c.uri_for( '/report', problem.id ) %]" class="validate"> + <input type="hidden" name="js" value=""> <div class="inspect-section"> <p> <strong>[% loc('Report ID:') %]</strong> <span class="js-report-id">[% problem.id %]</span> </p> + [% IF permissions.report_inspect AND problem.user.phone %] + <p> + <strong>[% loc('Phone Reporter:') %]</strong> + <a href="tel:[% problem.user.phone | html %]">[% problem.user.phone | html %]</a> + </p> + [% END %] <p> [% SET local_coords = problem.local_coords; %] [% IF local_coords %] @@ -18,8 +28,8 @@ <span id="problem_northing">[% local_coords.1 %]</span> [% ELSE %] <strong>[% loc('Latitude/Longitude:') %]</strong> - <span id="problem_latitude">[% problem.latitude %]</span> - <span id="problem_longitude">[% problem.longitude %]</span>, + <span id="problem_latitude">[% problem.latitude %]</span>, + <span id="problem_longitude">[% problem.longitude %]</span> [% END %] <input type="hidden" name="longitude" value="[% problem.longitude %]"> <input type="hidden" name="latitude" value="[% problem.latitude %]"> @@ -39,18 +49,21 @@ [% INCLUDE 'admin/report-category.html' %] </p> - [% FOREACH category IN categories %] - [% cat_prefix = category | lower | replace('[^a-z]', '') %] - [% cat_prefix = "category_" _ cat_prefix _ "_" %] - [% IF category == problem.category %] - <p data-category="[% category | html %]" data-priorities="[% priorities_by_category.$category %]"> - [% INCLUDE 'report/new/category_extras_fields.html' %] - </p> - [% ELSE %] - <p data-category="[% category | html %]" class="hidden" data-priorities="[% priorities_by_category.$category %]"> - [% INCLUDE 'report/new/category_extras_fields.html' report_meta='' %] + [% FOREACH category IN category_options_copy %] + [% cat_name = category.name; + cat_prefix = cat_name | lower | replace('[^a-z]', ''); + cat_prefix = "category_" _ cat_prefix _ "_" %] + <p data-category="[% cat_name | html %]" + [%~ IF cat_name != problem.category %] class="hidden"[% END %] + data-priorities='[% priorities_by_category.$cat_name %]' + data-defect-types='[% category_defect_types.$cat_name %]' + data-templates='[% templates_by_category.$cat_name %]'> + [% IF cat_name == problem.category %] + [% INCLUDE 'report/new/category_extras_fields.html' metas=category_extras.$category %] + [% ELSE %] + [% INCLUDE 'report/new/category_extras_fields.html' metas=category_extras.$category report_meta='' %] + [% END %] </p> - [% END %] [% END %] [% IF permissions.report_inspect %] @@ -69,11 +82,22 @@ <label for="state">[% loc('State') %]</label> [% INCLUDE 'report/inspect/state_groups_select.html' %] </p> + [% IF permissions.report_instruct AND NOT problem.get_extra_metadata('inspected') %] + <div id="js-inspect-action-scheduled" class="[% "hidden" UNLESS problem.state == 'action scheduled' %]"> + <p>[% loc('Do you want to automatically raise a defect?') %]</p> + <p class="segmented-control segmented-control--radio"> + <input type="radio" name="raise_defect" id="raise_defect_yes" value="1"> + <label class="btn" for="raise_defect_yes">[% loc('Yes') %]</label> + <input type="radio" name="raise_defect" id="raise_defect_no" value="0"> + <label class="btn" for="raise_defect_no">[% loc('No') %]</label> + </p> + </div> + [% END %] <div id="js-duplicate-reports" class="[% "hidden" UNLESS problem.duplicate_of %]"> <input type="hidden" name="duplicate_of" value="[% problem.duplicate_of.id %]"> <p class="[% "hidden" UNLESS problem.duplicate_of %]"><strong>[% loc('Duplicate of') %]</strong></p> <p class="[% "hidden" IF problem.duplicate_of %]">[% loc('Which report is it a duplicate of?') %]</p> - <ul class="item-list"> + <ul class="item-list item-list--inspect-duplicates"> [% IF problem.duplicate_of %] [% INCLUDE 'report/_item.html' item_extra_class = 'item-list--reports__item--selected' problem = problem.duplicate_of %] <li class="item-list__item"><a class="btn" href="#" id="js-change-duplicate-report">[% loc('Choose another') %]</a></li> @@ -82,7 +106,7 @@ </div> [% IF problem.duplicates.size %] <p><strong>[% loc('Duplicates') %]</strong></p> - <ul class="item-list"> + <ul class="item-list item-list--inspect-duplicates"> [% FOR duplicate IN problem.duplicates %] [% INCLUDE 'report/_item.html' problem = duplicate %] [% END %] @@ -98,9 +122,9 @@ <p> <label for="problem_priority">[% loc('Priority') %]</label> <select name="priority" id="problem_priority" class="form-control"> - <option value="" [% 'selected' UNLESS problem.response_priority_id %]>-</option> + <option value="" [% 'selected' UNLESS problem.response_priority_id OR has_default_priority %]>-</option> [% FOREACH priority IN problem.response_priorities %] - <option value="[% priority.id %]" [% 'selected' IF problem.response_priority_id == priority.id %] [% 'disabled' IF priority.deleted %]>[% priority.name | html %]</option> + <option value="[% priority.id %]" [% 'selected' IF ( problem.response_priority_id == priority.id ) OR priority.is_default %][% 'disabled' IF priority.deleted %]>[% priority.name | html %]</option> [% END %] </select> </p> @@ -147,10 +171,14 @@ [% ELSE %] <p>[% loc("<strong>Note:</strong> This report hasn't yet been sent onwards for action. Any changes made may not be passed on.") %]</p> [% END %] + [% TRY %][% INCLUDE 'report/_inspect_extra_info.html' %][% CATCH file %][% END %] [% END %] <p> - <input type="hidden" name="token" value="[% csrf_token %]"> + <input type="hidden" name="token" value="[% csrf_token %]" /> + [% IF permissions.planned_reports %] + <input type="hidden" name="post_inspect_url" value="[% post_inspect_url | html %]" /> + [% END %] <input class="btn btn-primary" type="submit" value="[% loc('Save changes') %]" data-value-original="[% loc('Save changes') %]" data-value-duplicate="[% loc('Save + close as duplicate') %]" name="save" /> </p> </div> diff --git a/templates/web/base/report/_item.html b/templates/web/base/report/_item.html index e627227d4..9449ca55d 100644 --- a/templates/web/base/report/_item.html +++ b/templates/web/base/report/_item.html @@ -11,7 +11,9 @@ [% IF c.user.is_planned_report(problem) ~%] name="shortlist-remove" title="[% loc('Remove from shortlist') %]" class="item-list__item__shortlist-remove" [%~ ELSE ~%] - name="shortlist-add" title="[% loc('Add to shortlist') %]" class="item-list__item__shortlist-[% IF problem.shortlisted_user %]take[% ELSE %]add[% END %]" + name="shortlist-add" title="[% IF problem.shortlisted_user %] + [%~ tprintf(loc('Shortlisted by %s'), problem.shortlisted_user.name) %]; [% END %] + [%~ loc('Add to shortlist') %]" class="item-list__item__shortlist-[% IF problem.shortlisted_user %]take[% ELSE %]add[% END %]" [%~ END ~%] > [%~ END %] @@ -27,7 +29,7 @@ [% END %] <li class="item-list__item item-list--reports__item [% item_extra_class %]" - data-report-id="[% problem.id | html %]" data-lastupdate="[% problem.lastupdate %]"> + data-report-id="[% problem.id | html %]" data-lastupdate="[% problem.lastupdate %]" id="report-[% problem.id | html %]"> <a href="[% c.cobrand.base_url_for_report( problem ) %][% problem.url %]"> [% IF problem.photo %] <img class="img" height="60" width="90" src="[% problem.photos.first.url_fp %]" alt=""> @@ -38,10 +40,10 @@ [% END %] <small> [% IF NOT no_fixed AND problem.is_fixed %] - <span class="item-list__item__state">[% loc('Fixed') %]</span> + <span class="item-list__item__state">[% prettify_state('fixed') %]</span> [% ELSIF NOT no_fixed AND problem.is_closed %] - <span class="item-list__item__state">[% loc('Closed') %]</span> - [% ELSIF problem.response_priority AND (c.user.has_permission_to('report_edit_priority', problem.bodies_str_ids) OR c.user.has_permission_to('report_inspect', problem.bodies_str_ids)) %] + <span class="item-list__item__state">[% prettify_state('closed') %]</span> + [% ELSIF (c.user.has_permission_to('report_edit_priority', problem.bodies_str_ids) OR c.user.has_permission_to('report_inspect', problem.bodies_str_ids)) AND problem.response_priority %] <span class="item-list__item__state">[% problem.response_priority.name %]</span> [% END %] [%- IF c.cobrand.moniker != 'fixamingata' %] [%# Default: %] @@ -88,11 +90,11 @@ </div> <div> <h4>[% loc('Category') %]</h4> - <p>[% (problem.category OR '-') | html %]</p> + <p>[% (problem.category_display OR '-') | html %]</p> </div> <div> <h4>[% loc('State') %]</h4> - <p>[% state_pretty.${problem.state} %]</p> + <p>[% prettify_state(problem.state, 1) %]</p> </div> <div> <h4>[% loc('Priority') %]</h4> diff --git a/templates/web/base/report/_main.html b/templates/web/base/report/_main.html index 83a3a1109..405cb2118 100644 --- a/templates/web/base/report/_main.html +++ b/templates/web/base/report/_main.html @@ -64,6 +64,10 @@ [% INCLUDE 'report/_report_meta_info.html' %] </p> + [% IF anonymized ~%] + <p class="form-success">[% anonymized %]</p> + [% END ~%] + [% INCLUDE 'report/_main_sent_info.html' %] [% mlog = problem.latest_moderation_log_entry(); IF mlog %] <p>[% tprintf(loc('Moderated by %s at %s'), mlog.admin_user, prettify_dt(mlog.whenedited)) %]</p> diff --git a/templates/web/base/report/_report_meta_info.html b/templates/web/base/report/_report_meta_info.html index da7339c81..e2a6412a3 100644 --- a/templates/web/base/report/_report_meta_info.html +++ b/templates/web/base/report/_report_meta_info.html @@ -1,2 +1,5 @@ [% problem.meta_line(c) | html %] +[% IF c.user_exists AND c.user.id == problem.user_id AND !problem.anonymous %] + <small>(<a href="/my/anonymize?problem=[% problem.id | uri %]" class="js-hide-name">[% loc('Hide your name?') %]</a>)</small> +[% END %] [%- IF !problem.used_map %]; <strong>([% loc('there is no pin shown as the user did not use the map') %])</strong>[% END %] diff --git a/templates/web/base/report/_state_select_field.html b/templates/web/base/report/_state_select_field.html index 9b3ed18df..0f6d8faf6 100644 --- a/templates/web/base/report/_state_select_field.html +++ b/templates/web/base/report/_state_select_field.html @@ -2,10 +2,19 @@ [% IF include_empty %] <option value="">---</option> [% END %] +[% SET found = 0 ~%] +[% FOREACH group IN state_groups ~%] + [% FOREACH state IN group.1 ~%] + [% SET found = 1 IF state == current_state ~%] + [% END ~%] +[% END ~%] +[% IF NOT found ~%] + <option selected value="[% current_state %]">[% prettify_state(current_state, single_fixed) %]</option> +[% END ~%] [% FOREACH group IN state_groups %] <optgroup label="[% group.0 %]"> [% FOREACH state IN group.1 %] - <option [% 'selected ' IF state == current_state %] value="[% state %]">[% state_pretty.$state %]</option> + <option [% 'selected ' IF state == current_state %]value="[% state %]">[% prettify_state(state, single_fixed) %]</option> [% END %] </optgroup> [% END %] diff --git a/templates/web/base/report/banner.html b/templates/web/base/report/banner.html index c80d129eb..ee73d287a 100644 --- a/templates/web/base/report/banner.html +++ b/templates/web/base/report/banner.html @@ -9,11 +9,11 @@ [% INCLUDE banner, id = 'unknown', text = loc('Unknown') %] [% END %] [% IF problem.is_fixed %] - [% INCLUDE banner, id = 'fixed', text = loc('Fixed') %] + [% INCLUDE banner, id = 'fixed', text = prettify_state('fixed') %] [% END %] [% IF problem.is_closed %] - [% INCLUDE banner, id = 'closed', text = loc('Closed') %] + [% INCLUDE banner, id = 'closed', text = prettify_state('closed') %] [% END %] [% IF problem.is_in_progress %] - [% INCLUDE banner, id = 'progress', text = loc('In progress') %] + [% INCLUDE banner, id = 'progress', text = prettify_state(problem.state) %] [% END %] diff --git a/templates/web/base/report/display_tools.html b/templates/web/base/report/display_tools.html index fb337df59..c477fd8dd 100644 --- a/templates/web/base/report/display_tools.html +++ b/templates/web/base/report/display_tools.html @@ -25,7 +25,7 @@ [% IF c.cobrand.moniker == 'fixmystreet' %] <div id="report-share" class="hidden-js" align="center"> - <a class="btn btn--social btn--twitter" href="https://twitter.com/intent/tweet?text=I%20just%20viewed%20this%20report:%20‘[% problem.title_safe | uri %]’&via=fixmystreet&related=mySociety"> + <a class="btn btn--social btn--twitter" href="https://twitter.com/intent/tweet?text=I%20just%20viewed%20this%20report:%20‘[% problem.title_safe | uri %]’&url=[% c.cobrand.base_url | uri %][% c.req.uri.path | uri %]&via=fixmystreet&related=mySociety"> <img alt="" src="/i/twitter-icon-32.png" width="17" height="32"> Tweet </a> diff --git a/templates/web/base/report/duplicate-no-updates.html b/templates/web/base/report/duplicate-no-updates.html index eb9ded728..c8020a107 100644 --- a/templates/web/base/report/duplicate-no-updates.html +++ b/templates/web/base/report/duplicate-no-updates.html @@ -1,5 +1,5 @@ <div> - [% UNLESS hide_header %]<h2>[% loc( 'Provide an update') %]</h2>[% END %] + [% UNLESS hide_header %]<h2 class="update-form-heading">[% loc( 'Provide an update') %]</h2>[% END %] <p>[% loc("This report is a duplicate. Please leave updates on the original report:") %]</p> <ul class="item-list"> [% INCLUDE 'report/_item.html' item_extra_class = 'item-list__item--with-pin item-list--reports__item--selected' problem = problem.duplicate_of %] diff --git a/templates/web/base/report/inspect/state_groups_select.html b/templates/web/base/report/inspect/state_groups_select.html index c4043751b..998b99739 100644 --- a/templates/web/base/report/inspect/state_groups_select.html +++ b/templates/web/base/report/inspect/state_groups_select.html @@ -1,24 +1,7 @@ [% -SET state_pretty = { - 'confirmed' = loc('Open') - 'investigating' = loc('Investigating') - 'in progress' = loc('In progress') - 'action scheduled' = loc('Action Scheduled') - 'fixed - council' = loc('Fixed - Council') - 'unable to fix' = loc('No further action') - 'not responsible' = loc('Not Responsible') - 'duplicate' = loc('Duplicate') - 'internal referral' = loc('Internal referral') - 'hidden' = loc('Hidden') -}; -SET state_groups = [ - [ loc('Open'), [ 'confirmed', 'investigating', 'in progress', 'action scheduled' ] ], - [ loc('Fixed'), [ 'fixed - council' ] ], - [ loc('Closed'), [ 'unable to fix', 'not responsible', 'duplicate', 'internal referral' ] ], - [ loc('Hidden'), [ 'hidden' ] ] -]; +SET state_groups = c.cobrand.state_groups_inspect; %] [% DEFAULT current_state = problem.state %] -[% INCLUDE 'report/_state_select_field.html' %] +[% INCLUDE 'report/_state_select_field.html' single_fixed=1 %] diff --git a/templates/web/base/report/new/category.html b/templates/web/base/report/new/category.html index d63649083..b8ebf1653 100644 --- a/templates/web/base/report/new/category.html +++ b/templates/web/base/report/new/category.html @@ -5,11 +5,11 @@ <label for='form_category' id="form_category_label"> [%~ loc('Category') ~%] </label>[% =%] - <select class="form-control" name='category' id='form_category'> + <select class="form-control" name='category' id='form_category' data-role='[% c.user.has_body_permission_to('planned_reports') ? 'inspector' : 'user' %]' data-body='[% c.user.from_body.name %]'> [%~ FOREACH cat_op IN category_options ~%] - [% cat_op_lc = cat_op | lower =%] - <option value='[% cat_op | html %]'[% ' selected' IF report.category == cat_op || category_lc == cat_op_lc || (category_options.size == 2 AND loop.last) ~%] - >[% IF loop.first %][% cat_op %][% ELSE %][% cat_op | html %][% END %]</option> + [% cat_op_lc = cat_op.name | lower =%] + <option value='[% cat_op.name | html %]'[% ' selected' IF report.category == cat_op.name || category_lc == cat_op_lc || (category_options.size == 2 AND loop.last) ~%] + >[% IF loop.first %][% cat_op.value %][% ELSE %][% cat_op.value | html %][% END %]</option> [%~ END =%] </select> [%~ END ~%] diff --git a/templates/web/base/report/new/category_extras.html b/templates/web/base/report/new/category_extras.html index 084dd2d93..fd2752388 100644 --- a/templates/web/base/report/new/category_extras.html +++ b/templates/web/base/report/new/category_extras.html @@ -15,7 +15,14 @@ list_of_names.join( '</strong>' _ loc(' or ') _ '<strong>' ) ); %] </p> - [% INCLUDE 'report/new/category_extras_fields.html' %] + [% INCLUDE 'report/new/category_extras_fields.html' metas=category_extras.$category %] </div> [%- END %] + + [%- IF report_extra_fields %] + [% FOREACH extras IN report_extra_fields %] + [% cat_prefix = "extra[" _ extras.id _ "]" %] + [% INCLUDE 'report/new/category_extras_fields.html' metas=extras.get_extra_fields %] + [% END %] + [%- END %] </div> diff --git a/templates/web/base/report/new/category_extras_fields.html b/templates/web/base/report/new/category_extras_fields.html index 012007e06..9c2731730 100644 --- a/templates/web/base/report/new/category_extras_fields.html +++ b/templates/web/base/report/new/category_extras_fields.html @@ -1,4 +1,4 @@ -[%- FOR meta IN category_extras.$category %] +[%- FOR meta IN metas %] [%- meta_name = meta.code -%] [% IF c.cobrand.category_extra_hidden(meta_name) %] diff --git a/templates/web/base/report/new/category_wrapper.html b/templates/web/base/report/new/category_wrapper.html index 9f628c44e..291f5e923 100644 --- a/templates/web/base/report/new/category_wrapper.html +++ b/templates/web/base/report/new/category_wrapper.html @@ -1,7 +1,7 @@ <div id="form_category_row"> [% IF js %] <label for="form_category">[% loc('Category') %]</label> - <select class="form-control" name="category" id="form_category" required><option>[% loc('Loading...') %]</option></select> + <select class="form-control" name="category" id="form_category" data-role="[% c.user.has_body_permission_to('planned_reports') ? 'inspector' : 'user' %]" data-body="[% c.user.from_body.name %]" required><option>[% loc('Loading...') %]</option></select> [% ELSE %] [% IF category_options.size %] [% IF field_errors.category %] @@ -12,6 +12,6 @@ [% END %] </div> -[%- IF category_extras %] +[%- IF category_extras OR report_extra_fields %] [% PROCESS "report/new/category_extras.html" %] [%- END %] diff --git a/templates/web/base/report/new/form_report.html b/templates/web/base/report/new/form_report.html index e85d890c9..1d1a0e289 100644 --- a/templates/web/base/report/new/form_report.html +++ b/templates/web/base/report/new/form_report.html @@ -22,6 +22,8 @@ [% END %] <input class="form-control" type="text" value="[% report.title | html %]" name="title" id="form_title" placeholder="[% loc('10 inch pothole on Example St, near post box') %]" required> +[% TRY %][% PROCESS 'report/new/after_title.html' %][% CATCH file %][% END %] + [% IF c.cobrand.allow_photo_upload %] <input type="hidden" name="upload_fileid" value="[% upload_fileid %]"> <label for="form_photo"> diff --git a/templates/web/base/report/new/form_user_loggedin.html b/templates/web/base/report/new/form_user_loggedin.html index 7fc1b1b5f..e841845bf 100644 --- a/templates/web/base/report/new/form_user_loggedin.html +++ b/templates/web/base/report/new/form_user_loggedin.html @@ -6,8 +6,9 @@ </div> [% ELSE %] [% can_contribute_as_another_user = c.user.has_permission_to("contribute_as_another_user", bodies.keys) %] + [% can_contribute_as_anonymous_user = c.user.has_permission_to("contribute_as_anonymous_user", bodies.keys) %] [% can_contribute_as_body = c.user.from_body AND c.user.has_permission_to("contribute_as_body", bodies.keys) %] - [% IF can_contribute_as_another_user OR can_contribute_as_body %] + [% IF can_contribute_as_another_user OR can_contribute_as_anonymous_user OR can_contribute_as_body %] [% INCLUDE form_as %] [% END %] [% END %] @@ -15,21 +16,22 @@ [% BLOCK form_as %] <label for="form_as">[% loc('Report as') %]</label> <select id="form_as" class="form-control js-contribute-as" name="form_as"> - <option value="myself" selected>[% loc('Yourself') %]</option> + <option value="myself" [% c.user.has_body_permission_to('planned_reports') ? '' : 'selected' %]>[% loc('Yourself') %]</option> + [% IF js || can_contribute_as_anonymous_user %] + <option value="anonymous_user">[% loc('Anonymous user') %]</option> + [% END %] [% IF js || can_contribute_as_another_user %] <option value="another_user">[% loc('Another user') %]</option> [% END %] [% IF js || can_contribute_as_body %] - <option value="body">[% c.user.from_body.name %]</option> + <option value="body" [% c.user.has_body_permission_to('planned_reports') ? 'selected' : '' %]>[% c.user.from_body.name %]</option> [% END %] </select> [% END %] <label for="form_email">[% loc('Email address') %]</label> - <input class="form-control" id="form_email" - [%- IF js OR can_contribute_as_another_user OR can_contribute_as_body -%] - name="email" - [%- ELSE -%] + <input class="form-control" id="form_email" name="email" + [%- IF NOT can_contribute_as_another_user -%] disabled [%- END -%] type="text" value="[% c.user.email | html %]"> diff --git a/templates/web/base/report/photo-js.html b/templates/web/base/report/photo-js.html index 91b9930e7..8c8c91669 100644 --- a/templates/web/base/report/photo-js.html +++ b/templates/web/base/report/photo-js.html @@ -1,6 +1,6 @@ [% extra_css = BLOCK %] - <link rel="stylesheet" href="[% version('/js/fancybox/jquery.fancybox-1.3.4.css') %]"> + <link rel="stylesheet" href="[% version('/vendor/fancybox/jquery.fancybox-1.3.4.css') %]"> [% END %] [% extra_js = [ - version('/js/fancybox/jquery.fancybox-1.3.4.pack.js') + version('/vendor/fancybox/jquery.fancybox-1.3.4.pack.js') ] %] diff --git a/templates/web/base/report/update-form.html b/templates/web/base/report/update-form.html index 49d011c0e..ea7b14970 100644 --- a/templates/web/base/report/update-form.html +++ b/templates/web/base/report/update-form.html @@ -3,7 +3,7 @@ <div id="update_form"> [% IF NOT login_success AND NOT oauth_need_email %] - <h2>[% loc( 'Provide an update') %]</h2> + <h2 class="update-form-heading">[% loc( 'Provide an update') %]</h2> [% IF c.cobrand.moniker != 'stevenage' %] <div class="general-notes"> diff --git a/templates/web/base/report/update.html b/templates/web/base/report/update.html index 51c1a9e4f..85624669a 100644 --- a/templates/web/base/report/update.html +++ b/templates/web/base/report/update.html @@ -24,7 +24,7 @@ <div class="item-list__update-wrap"> [% IF update.whenanswered %] <div class="item-list__update-text"> - <p class="meta-2"> [% INCLUDE meta_line %] </p> + <p class="meta-2">[% INCLUDE meta_line %]</p> </div> [% ELSE %] <a name="update_[% update.id %]" class="internal-link-fixed-header"></a> @@ -43,8 +43,17 @@ </div> [% END %] + [% SET update_state = update.problem_state_display(c) %] + [% IF update_state AND update_state != global.last_state AND NOT (global.last_state == "" AND update.problem_state == 'confirmed') %] + <p class="meta-2">[% loc('State changed to:') %] [% update_state %]</p> + [%- global.last_state = update_state %] + [% END %] + <p class="meta-2"> [% INCLUDE meta_line %] + [% IF c.user_exists AND c.user.id == update.user_id AND !update.anonymous %] + <small>(<a href="/my/anonymize?update=[% update.id | uri %]" class="js-hide-name">[% loc('Hide your name?') %]</a>)</small> + [% END %] [% mlog = update.latest_moderation_log_entry(); IF mlog %] <br />[% tprintf(loc('Moderated by %s at %s'), mlog.admin_user, prettify_dt(mlog.whenedited)) %] [% END %] diff --git a/templates/web/base/report/update/form_name.html b/templates/web/base/report/update/form_name.html index 926e16878..e4f7ac60c 100644 --- a/templates/web/base/report/update/form_name.html +++ b/templates/web/base/report/update/form_name.html @@ -3,15 +3,19 @@ [% PROCESS 'user/_anonymity.html' anonymous = update.anonymous %] [% can_contribute_as_another_user = c.user.has_permission_to("contribute_as_another_user", problem.bodies_str_ids) %] + [% can_contribute_as_anonymous_user = c.user.has_permission_to("contribute_as_anonymous_user", problem.bodies_str_ids) %] [% can_contribute_as_body = c.user.from_body AND c.user.has_permission_to("contribute_as_body", problem.bodies_str_ids) %] - [% IF can_contribute_as_another_user OR can_contribute_as_body %] + [% IF can_contribute_as_another_user OR can_contribute_as_body OR can_contribute_as_anonymous_user %] <label for="form_as">[% loc('Provide update as') %]</label> <select id="form_as" class="form-control js-contribute-as" name="form_as"> <option value="myself" selected>[% loc('Yourself') %]</option> [% IF can_contribute_as_another_user %] <option value="another_user">[% loc('Another user') %]</option> [% END %] + [% IF can_contribute_as_anonymous_user %] + <option value="anonymous_user">[% loc('Anonymous user') %]</option> + [% END %] [% IF can_contribute_as_body %] <option value="body">[% c.user.from_body.name %]</option> [% END %] diff --git a/templates/web/base/report/update/form_update.html b/templates/web/base/report/update/form_update.html index f15a1f74b..5a1b3b602 100644 --- a/templates/web/base/report/update/form_update.html +++ b/templates/web/base/report/update/form_update.html @@ -36,18 +36,10 @@ <textarea rows="7" cols="30" name="update" class="form-control" id="form_update" placeholder="[% loc('Please write your update here') %]" required>[% update.text | html %]</textarea> [% IF c.user && c.user.belongs_to_body( problem.bodies_str ) %] - <label for="form_state">[% loc( 'State' ) %]</label> - <select name="state" id="form_state" class="form-control"> - [% 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('No further action')], ['not responsible', loc('Not Responsible')], - ['fixed', loc('Fixed')] ] %] - <option [% 'selected ' IF state.0 == problem.state_display %] value="[% state.0 %]">[% state.1 %]</option> - [% END %] - </select> + <label for="state">[% loc( 'State' ) %]</label> + [% INCLUDE 'report/inspect/state_groups_select.html' %] [% ELSE %] - [% IF (problem.is_fixed OR problem.state == 'closed') AND ((c.user_exists AND c.user.id == problem.user_id) OR alert_to_reporter) %] + [% IF (problem.is_fixed OR problem.is_closed) AND ((c.user_exists AND c.user.id == problem.user_id) OR alert_to_reporter) %] <input type="checkbox" name="reopen" id="form_reopen" value="1"[% ' checked' IF (update.mark_open || c.req.params.reopen) %]> [% IF problem.is_closed %] @@ -56,7 +48,7 @@ <label class="inline" for="form_reopen">[% loc('This problem has not been fixed') %]</label> [% END %] - [% ELSIF !problem.is_fixed %] + [% ELSIF !problem.is_fixed AND has_fixed_state %] <div class="checkbox-group"> <input type="checkbox" name="fixed" id="form_fixed" value="1"[% ' checked' IF update.mark_fixed %]> diff --git a/templates/web/base/reports/_list-filters.html b/templates/web/base/reports/_list-filters.html index e657e0375..50e88857d 100644 --- a/templates/web/base/reports/_list-filters.html +++ b/templates/web/base/reports/_list-filters.html @@ -1,6 +1,6 @@ [% select_status = BLOCK %] <select class="form-control js-multiple" name="status" id="statuses" multiple - data-all="[% loc('All reports') %]" data-all-options='["open","closed","fixed"]' + data-all="[% loc('All') %]" data-all-options='["open","closed","fixed"]' [%~ IF c.cobrand.on_map_default_status == 'open' %] data-none="[% loc('Unfixed reports') %]" [%~ END ~%] @@ -9,9 +9,20 @@ <option value="shortlisted"[% ' selected' IF filter_status.shortlisted %]>[% loc('Shortlisted') %]</option> <option value="unshortlisted"[% ' selected' IF filter_status.unshortlisted %]>[% loc('Unshortlisted') %]</option> [% END %] - <option value="open"[% ' selected' IF filter_status.open %]>[% loc('Unfixed reports') %]</option> - <option value="closed"[% ' selected' IF filter_status.closed %]>[% loc('Closed reports') %]</option> - <option value="fixed"[% ' selected' IF filter_status.fixed %]>[% loc('Fixed reports') %]</option> + [% IF c.user_exists AND c.user.is_superuser OR c.user.belongs_to_body(body.id) %] + [% FOR group IN filter_states %] + [% FOR state IN group.1 %] + [% NEXT IF state == 'hidden' %] + <option value="[% state %]"[% ' selected' IF filter_status.$state %]>[% prettify_state(state, 1) %]</option> + [% END %] + [% END %] + [% ELSE %] + <option value="open"[% ' selected' IF filter_status.open %]>[% prettify_state('confirmed') %]</option> + <option value="closed"[% ' selected' IF filter_status.closed %]>[% prettify_state('closed') %]</option> + [% IF has_fixed_state %] + <option value="fixed"[% ' selected' IF filter_status.fixed %]>[% prettify_state('fixed') %]</option> + [% END %] + [% END %] </select> [% END %] @@ -19,8 +30,8 @@ [% IF filter_categories.size %] <select class="form-control js-multiple" name="filter_category" id="filter_categories" multiple data-all="[% loc('Everything') %]"> [% FOR cat IN filter_categories %] - <option value="[% cat | html %]"[% ' selected' IF filter_category.$cat %]> - [% cat | html %] + <option value="[% cat.name | html %]"[% ' selected' IF filter_category.${cat.name} %]> + [% cat.value | html %] </option> [% END %] </select> @@ -34,7 +45,7 @@ [% END %] <p class="report-list-filters"> - [% tprintf(loc('<label for="statuses">Show</label> %s <label for="filter_categories">about</label> %s', 'The first %s is a dropdown of all/fixed/etc, the second is a dropdown of categories'), select_status, select_category) %] + [% tprintf(loc('<label for="statuses">Show</label> %s reports <label for="filter_categories">about</label> %s', "The first %s is a dropdown of all/fixed/etc, the second is a dropdown of categories"), select_status, select_category) %] <input type="submit" name="filter_update" value="[% loc('Go') %]"> </p> diff --git a/templates/web/base/reports/body.html b/templates/web/base/reports/body.html index 14ecec0f1..b6e6df73b 100755 --- a/templates/web/base/reports/body.html +++ b/templates/web/base/reports/body.html @@ -27,17 +27,26 @@ [% map_html %] +[% IF c.user && c.user.has_body_permission_to('planned_reports') %] + <p id="sub_map_links"> + <a id="fms_shortlist_all" class="hidden">[% loc('Shortlist all visible') %]</a> + </p> +[% END %] + </div> <div id="map_sidebar"> <div id="side"> -<h1 id="reports_heading"> - [% IF ward %] - [% ward.name %]<span>, </span><a href="[% body_url %]">[% body.name %]</a> + [% IF ward %] + <h1 id="reports_heading"> + [% ward.name %] + </h1> + <a href="[% body_url %]">[% body.name %]</a> [% ELSE %] - [% body.name %] - [% END %] -</h1> + <h1 id="reports_heading"> + [% body.name %] + </h1> + [% END %] [% IF c.cobrand.moniker == 'hart' %] [% INCLUDE '_hart_hants_note.html' %] diff --git a/templates/web/base/reports/index.html b/templates/web/base/reports/index.html index b07227144..a653a2686 100755 --- a/templates/web/base/reports/index.html +++ b/templates/web/base/reports/index.html @@ -1,50 +1,113 @@ +[% USE Number.Format -%] [% extra_js = [ - version('/js/jquery.fixedthead.js') + version('/vendor/chart.min.js'), + version('/vendor/accessible-autocomplete.min.js'), + version('/js/dashboard.js') ] -%] -[% INCLUDE 'header.html', title = loc('Summary reports'), bodyclass => 'fullwidthpage' %] +[% + problems_reported = problems_reported_by_period.last | format_number; + problems_fixed = problems_fixed_by_period.last | format_number; + last_seven_reported = last_seven_days.problems_total | format_number; + last_seven_updated = last_seven_days.updated_total | format_number; + last_seven_fixed = last_seven_days.fixed_total | format_number; + other_categories_formatted = other_categories | format_number; +-%] +[% INCLUDE 'header.html', title = loc('Dashboard'), bodyclass => 'dashboard fullwidthpage' %] -<h1>[% loc('All Reports') %]</h1> +<div class="dashboard-header"> + <h1>[% loc('Dashboard') %]</h1> +</div> -<div class="intro"> -<p> - [% loc('This is a summary of all reports on this site.') %] - [% IF bodies.size > 1 %] - [% loc('Select a particular council to see the reports sent there.') %] - [% END %] - [% IF any_empty_bodies %] - [% loc('Greyed-out lines are councils that no longer exist.') %] - [% END %] -</p> +<div class="dashboard-row"> + <div class="dashboard-item dashboard-item--12"> + <h2>[% loc('All time') %]</h2> + <div class="labelled-line-chart"> + <canvas id="chart-all-reports" width="600" height="300" + data-labels="["[% problem_periods.join('","') %]"]" + data-values-reports="[[% problems_reported_by_period.join(',') %]]" + data-values-fixed="[[% problems_fixed_by_period.join(',') %]]" + ></canvas> + <span class="label" data-datasetindex="0"><strong style="color: #F4A140">[% tprintf(nget("%s problem reported", "%s problems reported", problems_reported_by_period.last), decode(problems_reported) _ '</strong>') %]</span> + <span class="label" data-datasetindex="1"><strong style="color: #62B356">[% tprintf(nget("%s report marked as fixed", "%s reports marked as fixed", problems_fixed_by_period.last), decode(problems_fixed) _ '</strong>') %]</span> + </div> + </div> </div> -<table cellpadding="3" cellspacing="1" border="0" class="nicetable"> -<thead> -<tr> -<th class="title">[% loc('Name') %]</th> -<th title="[% loc('Reported within the last four weeks') %]" class="data">[% loc('New <br>problems') %]</th> -<th title="[% loc('Open for more than four weeks, with an update within the past eight weeks') %]" class="data">[% loc('Older <br>problems') %]</th> -<th title="[% loc('Open, but not had any update in eight weeks') %]" class="data">[% loc('Old / unknown <br>problems') %]</th> -<th title="[% loc('Marked fixed/closed in the past eight weeks') %]" class="data">[% loc('Recently <br>fixed') %]</th> -<th title="[% loc('Marked fixed/closed more than eight weeks ago') %]" class="data">[% loc('Older <br>fixed') %]</th> -</tr> -</thead> +<div class="dashboard-row"> + <div class="dashboard-item dashboard-item--6"> + <h2 class="dashboard-subheading">[% loc('Last 7 days') %]</h2> + <div class="dashboard-sparklines"> + <div> + <div class="labelled-sparkline"> + <canvas width="200" height="50" data-color="#F4A140" data-values="[% last_seven_days.problems.join(' ') %]"></canvas> + <span class="label" data-datasetindex="0"><strong style="color: #F4A140;">[% tprintf(nget("%s problem reported", "%s problems reported", last_seven_days.problems_total), decode(last_seven_reported) _ '</strong>') %]</span> + </div> + </div> + <div> + <div class="labelled-sparkline"> + <canvas width="200" height="50" data-color="#4FADED" data-values="[% last_seven_days.updated.join(' ') %]"></canvas> + <span class="label" data-datasetindex="0"><strong style="color: #4FADED;">[% tprintf(nget("%s update on problems", "%s updates on problems", last_seven_days.updated_total), decode(last_seven_updated) _ '</strong>') %]</span> + </div> + </div> + <div> + <div class="labelled-sparkline"> + <canvas width="200" height="50" data-color="#62B356" data-values="[% last_seven_days.fixed.join(' ') %]"></canvas> + <span class="label" data-datasetindex="0"><strong style="color: #62B356;">[% tprintf(nget("%s problem marked as fixed", "%s problems marked as fixed", last_seven_days.fixed_total), decode(last_seven_fixed) _ '</strong>') %]</span> + </div> + </div> + </div> + </div> + <div class="dashboard-item dashboard-item--6"> + <form class="dashboard-search" action="/reports"> + <h2>[% loc('Show reports in your area') %]</h2> + <label for="body">[% loc('Pick your council') %]</label> + <div class="dashboard-search__input"> + <select id="body" name="body" class="js-autocomplete"> + <option value="">[% loc('Pick your council') %]</option> + [% FOR body IN bodies %] + <option value="[% body.id %]">[% body.name | html ~%] + [% IF NOT body.get_column("area_count") %] [% loc('(no longer exists)') %][% END ~%] + </option> + [% END %] + </select> + </div> + <div class="dashboard-search__submit"> + <input type="submit" value="[% loc('Go') %]"> + </div> + </form> + </div> +</div> -<tbody> -[% FOREACH body IN bodies %] -<tr align="center" -[%- IF NOT body.get_column("area_count") %] class="gone" -[%- ELSIF ! (loop.count % 2) %] class="a" -[%- END %]> -<td class="title"><a href="[% body.url(c) %]">[% body.name %]</a></td> -<td class="data">[% IF open.${body.id}.new %]<a href="[% body.url(c, { t => 'new' }) %]">[% open.${body.id}.new %]</a>[% ELSE %]0[% END %]</td> -<td class="data">[% IF open.${body.id}.older %]<a href="[% body.url(c, { t => 'older' }) %]">[% open.${body.id}.older %]</a>[% ELSE %]0[% END %]</td> -<td class="data">[% IF open.${body.id}.unknown %]<a href="[% body.url(c, { t => 'unknown' }) %]">[% open.${body.id}.unknown %]</a>[% ELSE %]0[% END %]</td> -<td class="data">[% IF fixed.${body.id}.new %]<a href="[% body.url(c, { t => 'fixed' }) %]">[% fixed.${body.id}.new %]</a>[% ELSE %]0[% END %]</td> -<td class="data">[% IF fixed.${body.id}.old %]<a href="[% body.url(c, { t => 'older_fixed' }) %]">[% fixed.${body.id}.old %]</a>[% ELSE %]0[% END %]</td> -</tr> -[% TRY %][% PROCESS "reports/_extras.html" %][% CATCH file %][% END %] -[% END %] -</tbody> -</table> +<div class="dashboard-row"> + <div class="dashboard-item dashboard-item--6"> + <h2 class="dashboard-subheading">[% loc('Top 5 responsive councils') %]</h2> + <p>[% loc('Average time between a problem being reported and being fixed, last 100 reports.') %]</p> + <table class="dashboard-ranking-table"> + <tbody> + [% FOR line IN top_five_bodies %] + <tr><td>[% line.name %]</td><td>[% tprintf(nget("%s day", "%s days", line.days), line.days) %]</td></tr> + [% END %] + </tbody> + <tfoot> + <tr><td>[% loc('Overall average') %]</td><td>[% tprintf(nget("%s day", "%s days", average), average) %]</td></tr> + </tfoot> + </table> + </div> + <div class="dashboard-item dashboard-item--6"> + <h2 class="dashboard-subheading">[% loc('Top 5 most used categories') %]</h2> + <p>[% loc('Number of problems reported in each category, in the last 7 days.') %]</p> + <table class="dashboard-ranking-table"> + <tbody> + [% FOR line IN top_five_categories %] + [% line_count = line.count | format_number ~%] + <tr><td>[% line.category %]</td><td>[% tprintf(nget("%s report", "%s reports", line.count), decode(line_count)) %]</td></tr> + [% END %] + </tbody> + <tfoot> + <tr><td>[% loc('Other categories') %]</td><td>[% tprintf(nget("%s report", "%s reports", other_categories), decode(other_categories_formatted)) %]</td></tr> + </tfoot> + </table> + </div> +</div> -[% INCLUDE 'footer.html', pagefooter = 'yes' %] +[% INCLUDE 'footer.html' pagefooter = 'yes' %] diff --git a/templates/web/base/status/stats.html b/templates/web/base/status/stats.html index 0f201920d..02f9de904 100644 --- a/templates/web/base/status/stats.html +++ b/templates/web/base/status/stats.html @@ -10,8 +10,8 @@ questionnaires_1 = questionnaires.1 | format_number; total_bodies = bodies.size | format_number; contacts_total = contacts.total | format_number; - contacts_1 = contacts.1 | format_number; - contacts_0 = contacts.0 | format_number; + contacts_confirmed = contacts.confirmed | format_number; + contacts_unconfirmed = contacts.unconfirmed | format_number; -%] <ul> @@ -24,5 +24,5 @@ <li>[% tprintf( loc('%s confirmed alerts, %s unconfirmed'), decode(alerts_1), decode(alerts_0)) %]</li> <li>[% tprintf( loc('%s questionnaires sent – %s answered (%s%%)'), decode(questionnaires_total), decode(questionnaires_1), questionnaires_pc) %]</li> <li>[% tprintf( loc('%s bodies'), decode(total_bodies)) %], - [% tprintf( loc('%s council contacts – %s confirmed, %s unconfirmed'), decode(contacts_total), decode(contacts_1), decode(contacts_0)) %]</li> + [% tprintf( loc('%s council contacts – %s confirmed, %s unconfirmed'), decode(contacts_total), decode(contacts_confirmed), decode(contacts_unconfirmed)) %]</li> </ul> diff --git a/templates/web/base/tokens/confirm_alert.html b/templates/web/base/tokens/confirm_alert.html index f0ad12ff8..0154f0225 100644 --- a/templates/web/base/tokens/confirm_alert.html +++ b/templates/web/base/tokens/confirm_alert.html @@ -14,6 +14,6 @@ </div> -[% INCLUDE next_steps.html %] +[% INCLUDE next_steps.html utm_content='email alert set up' %] [% INCLUDE 'footer.html' %] diff --git a/templates/web/base/tokens/confirm_problem.html b/templates/web/base/tokens/confirm_problem.html index a4573b5e6..ff9882d4b 100644 --- a/templates/web/base/tokens/confirm_problem.html +++ b/templates/web/base/tokens/confirm_problem.html @@ -36,6 +36,7 @@ [% INCLUDE next_steps.html, just_interacted = 1, + utm_content = 'problem confirmed', share_url = c.cobrand.base_url_for_report(report) _ report.url, twitter_comment = loc('I just reported a problem on @fixmystreet') %] diff --git a/templates/web/base/tokens/confirm_update.html b/templates/web/base/tokens/confirm_update.html index 01ac992ab..6b03308a5 100644 --- a/templates/web/base/tokens/confirm_update.html +++ b/templates/web/base/tokens/confirm_update.html @@ -1,9 +1,10 @@ [% INCLUDE 'header.html', bodyclass = 'fullwidthpage', title = loc('Confirmation'); DEFAULT problem = update.problem; -SET problem_url = c.uri_for('/report', problem.id); IF update; - problem_url = problem_url _ '#update_' _ update.id; + SET problem_url = update.url; +ELSE; + SET problem_url = problem.url; END; %] @@ -19,6 +20,7 @@ END; [% INCLUDE next_steps.html, just_interacted = 1, + utm_content = 'update confirmed', share_url = c.cobrand.base_url_for_report(problem) _ problem.url, twitter_comment = loc('I just updated a problem on @fixmystreet') %] |