diff options
Diffstat (limited to 'templates/web/default')
25 files changed, 393 insertions, 264 deletions
diff --git a/templates/web/default/admin/list_updates.html b/templates/web/default/admin/list_updates.html index 92f41f348..4f27b9595 100644 --- a/templates/web/default/admin/list_updates.html +++ b/templates/web/default/admin/list_updates.html @@ -8,6 +8,8 @@ <th>[% loc('Email') %]</th> <th>[% loc('Created') %]</th> <th>[% loc('Anonymous') %]</th> + <th>[% loc('Owner') %]</th> + <th>[% loc('Council') %]</th> <th>[% loc('Cobrand') %]</th> <th>[% loc('Text') %]</th> <th>*</th> @@ -26,6 +28,8 @@ <td>[% update.user.email | html %]</td> <td>[% PROCESS format_time time=update.created %]</td> <td>[% IF update.anonymous %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]</td> + <td>[% IF update.user.id == update.problem.user_id %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]</td> + <td>[% IF update.user.belongs_to_council( update.problem.council ) %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]</td> <td>[% update.cobrand %]<br>[% update.cobrand_data | html %]</td> <td>[% update.text | html %]</td> <td><a href="[% c.uri_for( 'update_edit', update.id ) %]">[% loc('Edit') %]</a></td> diff --git a/templates/web/default/admin/report_edit.html b/templates/web/default/admin/report_edit.html index 69d5d0b11..470ad311a 100644 --- a/templates/web/default/admin/report_edit.html +++ b/templates/web/default/admin/report_edit.html @@ -19,7 +19,10 @@ <option [% 'selected ' IF !problem.anonymous %]value="0">[% loc('No') %]</option> </select></li> <li><label for="state">[% loc('State:') %]</label> <select name="state" id="state"> - [% FOREACH state IN [ ['confirmed', loc('Open')], ['fixed', loc('Fixed')], ['hidden', loc('Hidden')], ['partial', loc('Partial')],['unconfirmed',loc('Unconfirmed')] ] %] + [% FOREACH state IN [ ['confirmed', loc('Open')], ['investigating', + loc('Investigating')], ['planned', loc('Planned')], ['in progress', + loc('In Progress')], ['closed', loc('Closed')], ['fixed', loc('Fixed')], ['fixed - user', + loc('Fixed - User')], ['fixed - council', loc('Fixed - Council')], ['hidden', loc('Hidden')], ['partial', loc('Partial')],['unconfirmed',loc('Unconfirmed')] ] %] <option [% 'selected ' IF state.0 == problem.state %] value="[% state.0 %]">[% state.1 %]</option> [% END %] </select></li> diff --git a/templates/web/default/admin/search_users.html b/templates/web/default/admin/search_users.html new file mode 100644 index 000000000..43fdebf2b --- /dev/null +++ b/templates/web/default/admin/search_users.html @@ -0,0 +1,29 @@ +[% INCLUDE 'admin/header.html' title=loc('Search Users') %] +[% PROCESS 'admin/report_blocks.html' %] + +<form method="get" action="[% c.uri_for('search_users') %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8"> + <label for="search">[% loc('Search:') %]</label> <input type="text" name="search" size="30" id="search"> +</form> + + +[% IF searched %] +<table cellspacing="0" cellpadding="2" border="1"> + <tr> + <th>[% loc('Name') %]</th> + <th>[% loc('Email') %]</th> + <th>[% loc('Council') %]</th> + <th>*</th> + </tr> +[%- FOREACH user IN users %] + <tr> + <td>[% PROCESS value_or_nbsp value=user.name %]</td> + <td>[% PROCESS value_or_nbsp value=user.email %]</td> + <td>[% PROCESS value_or_nbsp value=user.from_council %]</td> + <td><a href="[% c.uri_for( 'user_edit', user.id ) %]">[% loc('Edit') %]</a></td> + </tr> +[%- END -%] +</table> + +[% END %] + +[% INCLUDE 'admin/footer.html' %] diff --git a/templates/web/default/admin/update_edit.html b/templates/web/default/admin/update_edit.html index d4ac1b440..e1783fd7c 100644 --- a/templates/web/default/admin/update_edit.html +++ b/templates/web/default/admin/update_edit.html @@ -21,7 +21,22 @@ [% END %] </select></li> <li>[% loc('Name:') %] <input type='text' name='name' id='name' value='[% update.name | html %]'></li> -<li>[% loc('Email:') %] <input type='text' id='email' name='email' value='[% update.user.email | html %]'> [% PROCESS abuse_button %] [% PROCESS flag_button user=update.user %]</li> +<li>[% loc('Email:') %] <input type='text' id='email' name='email' value='[% update.user.email | html %]'> +[%- IF update.user.from_council && update.user.from_council == update.problem.council %] +[% ' (' _ tprintf(loc('user is from same council as problem - %d'), update.user.from_council ) _')' %] +[% END -%] +[%- IF update.user.id == update.problem.user.id %] +[% ' (' _ loc('user is problem owner') _')' %] +[% END -%] +</li> +[% IF update.problem_state %] +<li>[% tprintf(loc('Update changed problem state to %s'), update.problem_state) %]</li> +[% ELSIF update.mark_fixed %] +<li>[% loc('Update marked problem as fixed') %]</li> +[% ELSIF update.user.id == update.problem.user.id && update.mark_open %] +<li>[% loc('Update reopened problem') %]</li> +[% END %] +[% PROCESS abuse_button %] [% PROCESS flag_button user=update.user %]</li> <li>[% loc('Cobrand:') %] [% update.cobrand %]</li> <li>[% loc('Cobrand data:') %] [% update.cobrand_data %]</li> <li>[% loc('Created:') %] [% PROCESS format_time time=update.created %]</li> diff --git a/templates/web/default/admin/user_edit.html b/templates/web/default/admin/user_edit.html new file mode 100644 index 000000000..7db8f5c63 --- /dev/null +++ b/templates/web/default/admin/user_edit.html @@ -0,0 +1,21 @@ +[% INCLUDE 'admin/header.html' title=tprintf(loc('Editing user %d'), user.id ) -%] +[% PROCESS 'admin/report_blocks.html' %] + +[% status_message %] + +<form method="post" action="[% c.uri_for( 'user_edit', user.id ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8"> + <input type="hidden" name="token" value="[% token %]" > + <input type="hidden" name="submit" value="1" > +<ul> +<li>[% loc('Name:') %] <input type='text' name='name' id='name' value='[% user.name | html %]'></li> +<li>[% loc('Email:') %] <input type='text' id='email' name='email' value='[% user.email | html %]'></li> +<li>[% loc('Council:') %] <select id='council' name='council'> + <option value=''>[% loc('No council') %]</option> +[% FOR council IN council_ids %] + <option value="[% council %]"[% ' selected' IF council == user.from_council %]>[% council_details.$council.name %]</option> +[% END %] +</select> +</ul> +<input type="submit" name="Submit changes" value="[% loc('Submit changes') %]" ></form> + +[% INCLUDE 'admin/footer.html' %] diff --git a/templates/web/default/around/around_map_list_items.html b/templates/web/default/around/around_map_list_items.html index a98f25dbe..e248ce3ed 100644 --- a/templates/web/default/around/around_map_list_items.html +++ b/templates/web/default/around/around_map_list_items.html @@ -6,7 +6,7 @@ <li> <a href="[% c.uri_for('/report', p.problem.id ) %]">[% p.problem.title | html %]</a> <small>[% prettify_epoch( p.problem.confirmed_local.epoch, 1 ) %], [% dist %]km</small> - [% IF p.problem.state == 'fixed' %] + [% IF p.problem.is_fixed %] <small>[% loc('(fixed)') %]</small> [% END %] </li> diff --git a/templates/web/default/around/display_location.html b/templates/web/default/around/display_location.html index 395054645..bef8954ba 100755 --- a/templates/web/default/around/display_location.html +++ b/templates/web/default/around/display_location.html @@ -66,6 +66,17 @@ </div> <div id="side"> +<p id="text_map"> + [% loc( 'To <strong>report a problem</strong>, simply click on the map at the correct location.' ) %] + [% + tprintf( + loc("<small>If you cannot see the map, <a href='%s' rel='nofollow'>skip this step</a>.</small>"), + url_skip + ) + %] + <span id="text_map_arrow"></span> +</p> + <h1>[% loc('Problems in this area') %]</h1> <p id="alert_links_area"> @@ -78,22 +89,6 @@ </a> </p> -[% IF location_error %] - <ul class="error"> - <li>[% location_error | html %]</li> - </ul> -[% END %] - -<p id="text_map"> - [% loc( 'To report a problem, simply <strong>click on the map</strong> at the correct location.' ) %] - [% - tprintf( - loc("<small>If you cannot see the map, <a href='%s' rel='nofollow'>skip this step</a>.</small>"), - url_skip - ) - %] -</p> - <div id="nearby_lists"> <h2>[% loc('Reports on and around the map') %]</h2> @@ -119,6 +114,14 @@ </div> </div> + +<div style="display:none" id="side-form"> +[% INCLUDE "report/new/fill_in_details_form.html" + js = 1, + report.used_map = 1 +%] +</div> + </form> [% INCLUDE 'footer.html' %] diff --git a/templates/web/default/around/on_map_list_items.html b/templates/web/default/around/on_map_list_items.html index 2db7d00d2..245be7190 100644 --- a/templates/web/default/around/on_map_list_items.html +++ b/templates/web/default/around/on_map_list_items.html @@ -3,7 +3,7 @@ <li> <a href="[% c.uri_for('/report', p.id ) %]">[% p.title | html %]</a> <small>[% prettify_epoch( p.confirmed_local.epoch, 1 ) %]</small> - [% IF p.state == 'fixed' %] + [% IF p.is_fixed %] <small>[% loc('(fixed)') %]</small> [% END %] </li> diff --git a/templates/web/default/maps/fms.html b/templates/web/default/maps/fms.html index 172fa9e7f..2b322849b 100644 --- a/templates/web/default/maps/fms.html +++ b/templates/web/default/maps/fms.html @@ -3,6 +3,7 @@ <script type="text/javascript" src="/js/OpenLayers.fixmystreet.js"></script> <script type="text/javascript" src="/js/map-OpenLayers.js"></script> <script type="text/javascript" src="/js/map-bing-ol.js"></script> +<script type="text/javascript" src="/js/jquery.ba-hashchange.min.js"></script> <!--[if lte IE 6]> <link rel="stylesheet" href="/jslib/OpenLayers-2.10/theme/default/ie6-style.css" type="text/css" /> <![endif]--> diff --git a/templates/web/default/maps/openlayers.html b/templates/web/default/maps/openlayers.html index b84799fdd..3cf615306 100644 --- a/templates/web/default/maps/openlayers.html +++ b/templates/web/default/maps/openlayers.html @@ -9,7 +9,7 @@ var fixmystreet = { 'page': '[% page %]', 'area': '[% map.area %]', - 'all_pins': [% all_pins || "''" | html %], + 'all_pins': '[% all_pins %]', 'latitude': [% map.latitude %], 'longitude': [% map.longitude %], [% IF map.any_zoom -%] diff --git a/templates/web/default/maps/osm-streetview.html b/templates/web/default/maps/osm-streetview.html index 3c97af5b9..fd889e6ee 100644 --- a/templates/web/default/maps/osm-streetview.html +++ b/templates/web/default/maps/osm-streetview.html @@ -2,6 +2,7 @@ <script type="text/javascript" src="/js/OpenLayers.fixmystreet.js"></script> <script type="text/javascript" src="/js/map-OpenLayers.js"></script> <script type="text/javascript" src="/js/map-streetview.js"></script> +<script type="text/javascript" src="/js/jquery.ba-hashchange.min.js"></script> <!--[if lte IE 6]> <link rel="stylesheet" href="/jslib/OpenLayers-2.10/theme/default/ie6-style.css" type="text/css" /> <![endif]--> diff --git a/templates/web/default/maps/osm.html b/templates/web/default/maps/osm.html index b0607220f..f583dd227 100644 --- a/templates/web/default/maps/osm.html +++ b/templates/web/default/maps/osm.html @@ -2,6 +2,7 @@ <script type="text/javascript" src="/js/OpenLayers.fixmystreet.js"></script> <script type="text/javascript" src="/js/map-OpenLayers.js"></script> <script type="text/javascript" src="/js/map-OpenStreetMap.js"></script> +<script type="text/javascript" src="/js/jquery.ba-hashchange.min.js"></script> <!--[if lte IE 6]> <link rel="stylesheet" href="/jslib/OpenLayers-2.10/theme/default/ie6-style.css" type="text/css" /> <![endif]--> diff --git a/templates/web/default/my/my.html b/templates/web/default/my/my.html index 2147ef5f2..b96823df2 100644 --- a/templates/web/default/my/my.html +++ b/templates/web/default/my/my.html @@ -28,6 +28,11 @@ [% INCLUDE problem %] [% END %] +[% FOREACH p = problems.closed %] + [% IF loop.first %]<h2>[% loc('Closed reports') %]</h2>[% END %] + [% INCLUDE problem %] +[% END %] + [%# FOREACH p = problems.unconfirmed; IF loop.first; '<h2>' _ loc('Unconfirmed reports') _ '</h2>'; diff --git a/templates/web/default/questionnaire/completed.html b/templates/web/default/questionnaire/completed.html index 3762b25d0..fe896b383 100644 --- a/templates/web/default/questionnaire/completed.html +++ b/templates/web/default/questionnaire/completed.html @@ -10,7 +10,7 @@ get some more information about the status of your problem, please come back to the site and leave an update.</p>') %] -[% ELSIF new_state == 'confirmed' OR (!new_state AND problem.state == 'confirmed') %] +[% ELSIF new_state == 'confirmed' OR (!new_state AND problem.is_open) %] [% tprintf( loc('<p style="font-size:150%%">We’re sorry to hear that. We have two suggestions: why not try <a href="%s">writing direct to your councillor(s)</a> diff --git a/templates/web/default/questionnaire/index.html b/templates/web/default/questionnaire/index.html index d463ff2f9..a7e5ad60c 100644 --- a/templates/web/default/questionnaire/index.html +++ b/templates/web/default/questionnaire/index.html @@ -59,7 +59,7 @@ href="http://www.emptyhomes.com/getinvolved/campaign.html">http://www.emptyhomes [% END %] <p> -[% loc('An update marked this problem as fixed.') IF problem.state == 'fixed' %] +[% loc('An update marked this problem as fixed.') IF problem.is_fixed %] [% loc('Has this problem been fixed?') %] </p> diff --git a/templates/web/default/report/display.html b/templates/web/default/report/display.html index 4948f8808..fe26ec60d 100644 --- a/templates/web/default/report/display.html +++ b/templates/web/default/report/display.html @@ -85,16 +85,29 @@ <textarea name="update" id="form_update" rows="7" cols="30">[% update.text | html %]</textarea> </div> - [% IF problem.state == 'fixed' AND c.user_exists AND c.user.id == problem.user_id %] - <div class="checkbox"> - <input type="checkbox" name="reopen" id="form_reopen" value="1"[% ' checked' IF update.mark_open %]> - <label for="form_reopen">[% loc('This problem has not been fixed') %]</label> - </div> - [% ELSIF problem.state != 'fixed' %] - <div class="checkbox"> - <input type="checkbox" name="fixed" id="form_fixed" value="1"[% ' checked' IF update.mark_fixed %]> - <label for="form_fixed">[% loc('This problem has been fixed') %]</label> + [% IF c.user && c.user.belongs_to_council( problem.council ) %] + <div class="form-field"> + <label for="form_state">[% loc( 'State:' ) %]</label> + <select name="state" id="form_state"> + [% FOREACH state IN [ ['confirmed', loc('Open')], ['investigating', + loc('Investigating')], ['planned', loc('Planned')], ['in progress', + loc('In Progress')], ['closed', loc('Closed')], ['fixed', loc('Fixed')] ] %] + <option [% 'selected ' IF state.0 == problem.state %] value="[% state.0 %]">[% state.1 %]</option> + [% END %] + </select> </div> + [% ELSE %] + [% IF problem.is_fixed AND c.user_exists AND c.user.id == problem.user_id %] + <div class="checkbox"> + <input type="checkbox" name="reopen" id="form_reopen" value="1"[% ' checked' IF update.mark_open %]> + <label for="form_reopen">[% loc('This problem has not been fixed') %]</label> + </div> + [% ELSIF !problem.is_fixed %] + <div class="checkbox"> + <input type="checkbox" name="fixed" id="form_fixed" value="1"[% ' checked' IF update.mark_fixed %]> + <label for="form_fixed">[% loc('This problem has been fixed') %]</label> + </div> + [% END %] [% END %] [% IF c.cobrand.allow_photo_upload %] diff --git a/templates/web/default/report/new/category.html b/templates/web/default/report/new/category.html new file mode 100644 index 000000000..6ec0eb19f --- /dev/null +++ b/templates/web/default/report/new/category.html @@ -0,0 +1,10 @@ +[% FILTER collapse %] +[% IF category_options.size %] + <label for='form_category'>[% category_label | html %]</label> + <select name='category' id='form_category'> + [% FOREACH cat_op IN category_options %] + <option value='[% cat_op | html %]'[% ' selected' IF report.category == cat_op %]>[% cat_op | html %]</option> + [% END %] + </select> +[% END %] +[% END -%] diff --git a/templates/web/default/report/new/councils_text.html b/templates/web/default/report/new/councils_text.html new file mode 100644 index 000000000..1da5746c1 --- /dev/null +++ b/templates/web/default/report/new/councils_text.html @@ -0,0 +1,9 @@ +[% FILTER collapse %] +[% IF area_ids_to_list.size == 0 %] + [% PROCESS 'report/new/councils_text_none.html' %] +[% ELSIF area_ids_to_list.size == all_councils.size %] + [% PROCESS 'report/new/councils_text_all.html' %] +[% ELSE %] + [% PROCESS 'report/new/councils_text_some.html' %] +[% END %] +[% END -%] diff --git a/templates/web/default/report/new/all_councils_text.html b/templates/web/default/report/new/councils_text_all.html index 8514e0b0a..8514e0b0a 100644 --- a/templates/web/default/report/new/all_councils_text.html +++ b/templates/web/default/report/new/councils_text_all.html diff --git a/templates/web/default/report/new/no_councils_text.html b/templates/web/default/report/new/councils_text_none.html index f991e031f..f991e031f 100644 --- a/templates/web/default/report/new/no_councils_text.html +++ b/templates/web/default/report/new/councils_text_none.html diff --git a/templates/web/default/report/new/some_councils_text.html b/templates/web/default/report/new/councils_text_some.html index 042e89914..042e89914 100644 --- a/templates/web/default/report/new/some_councils_text.html +++ b/templates/web/default/report/new/councils_text_some.html diff --git a/templates/web/default/report/new/fill_in_details.html b/templates/web/default/report/new/fill_in_details.html index 874445abd..a9a113283 100644 --- a/templates/web/default/report/new/fill_in_details.html +++ b/templates/web/default/report/new/fill_in_details.html @@ -28,240 +28,10 @@ <div id="skipped-map"> [% END %] -<h1>[% loc('Reporting a problem') %]</h1> - -[% IF report.used_map %] - [% IF partial_token %] - <p id="unknown">[% loc('Please note your report has <strong>not yet been sent</strong>. Choose a category and add further information below, then submit.') %]</p> - [% END %] -<p>[% loc('You have located the problem at the point marked with a purple pin on the map. If this is not the correct location, simply click on the map again. ') %]</p> -[% END %] - -[% IF area_ids_to_list.size == 0 %] - [% INCLUDE 'report/new/no_councils_text.html' %] -[% ELSIF area_ids_to_list.size == all_councils.size %] - [% INCLUDE 'report/new/all_councils_text.html' %] -[% ELSE %] - [% INCLUDE 'report/new/some_councils_text.html' %] -[% END %] - -<p> -[% IF skipped %] - [% loc('Please fill in the form below with details of the problem, and describe the location as precisely as possible in the details box.') %] -[% ELSE %] - [% INCLUDE 'report/new/fill_in_details_text.html' %] -[% END %] -</p> - -[% INCLUDE 'errors.html' %] - -<div id="problem_form"> - -[% INCLUDE 'report/new/form_heading.html' %] - -<div id="fieldset"> - - - - - -[% IF field_errors.council %] - <div class='form-error'>[% field_errors.council %]</div> -[% END %] - -[% IF category_options.size %] - [% IF field_errors.category %] - <div class='form-error'>[% field_errors.category %]</div> - [% END %] - - <div class="form-field"> - <label for="form_category">[% category_label | html %]</label> - <select name="category" id="form_category"> - [%- FOREACH cat_op IN category_options %] - <option value="[% cat_op | html %]"[% ' selected' IF report.category == cat_op %]>[% cat_op | html %]</option> - [%- END %] - </select> - </div> -[% END %] - -[% IF field_errors.title %] - <div class='form-error'>[% field_errors.title %]</div> -[% END %] - -<div class="form-field"> - <label for="form_title">[% loc('Subject:') %]</label> - <input type="text" value="[% report.title | html %]" name="title" id="form_title" size="25"> -</div> - -[% IF field_errors.detail %] - <div class='form-error'>[% field_errors.detail %]</div> -[% END %] - -<div class="form-field"> - <label for="form_detail">[% loc('Details:') %]</label> - <textarea name="detail" id="form_detail" rows="7" cols="26">[% report.detail | html %]</textarea> -</div> - -[%- IF category_extras %] -<div id="category_meta"> - [%- IF report_meta %] - [%- category = report.category %] - <h4>Additional Information</h4> - [%- FOR meta IN category_extras.$category %] - [%- meta_name = meta.code -%] - -[% IF field_errors.$meta_name %] - <div class='form-error'>[% field_errors.$meta_name %]</div> -[% END -%] - - <div class="form-field"> - <label for="form_[% meta_name %]">[% meta.description _ ':' %]</label> - [% IF meta.exists('values') %] - <select name="[% meta_name %]" id="form_[% meta_name %]"> - [% FOR option IN meta.values.value.keys %] - <option value="[% meta.values.value.$option.key %]">[% option %]</option> - [% END %] - </select> - [% ELSE %] - <input type="text" value="[% report_meta.$meta_name | html %]" name="[% meta_name %]" id="form_[% meta_name %]"> - [% END %] - </div> - [%- END %] - [%- END %] -</div> -[%- END %] - -[% IF c.cobrand.allow_photo_upload %] - [% IF field_errors.photo %] - <div class='form-error'>[% field_errors.photo %]</div> - [% END %] - - <div class='form-field'> - [% IF upload_fileid || report.photo %] - <p>[% loc('You have already attached a photo to this report, attaching another one will replace it.') %]</p> - [% IF upload_fileid %] - <input type="hidden" name="upload_fileid" value="[% upload_fileid %]" /> - [% END %] - [% IF report.photo %] - <img align="right" src="/photo?id=[% report.id %]" hspace="5"> - [% END %] - [% END %] - - <label for="form_photo">[% loc('Photo:') %]</label> - <input type="file" name="photo" id="form_photo" style="width:20em"> - </div> -[% END %] - -[% IF c.user_exists %] - - [% INCLUDE name_phone %] - - [% INCLUDE 'report/new/notes.html' %] - - <p id="problem_submit"> - <input type="submit" value="[% loc('Submit') %]"> - </p> - -[% ELSE %] - - [% IF field_errors.email %] - <div class='form-error'>[% field_errors.email %]</div> - [% END %] - - <div class="form-field"> - <label for="form_email">[% loc('Your email:') %]</label> - <input type="email" value="[% report.user.email | html %]" name="email" id="form_email" size="25"> - </div> - -[% INCLUDE 'report/new/notes.html' %] - -<div id="form_sign_in"> - <h3>[% loc("Now to submit your report… do you have a FixMyStreet password?") %]</h3> - - <div id="form_sign_in_yes"> - - [% IF field_errors.password %] - <div class='form-error'>[% field_errors.password %]</div> - [% END %] - - <p> - <label class="n" for="password_sign_in">[% loc('<strong>Yes</strong>, I have a password:') %]</label> - <input type="password" name="password_sign_in" id="password_sign_in" value="" size="25"> - </p> - - <p> - <input type="checkbox" id="remember_me" name="remember_me" value='1'[% ' checked' IF remember_me %]> - <label class="n" for="remember_me"> - [% loc('Keep me signed in on this computer') %] - </label> - </p> - - <p> - <input type="submit" name="submit_sign_in" value="[% loc('Submit') %]"> - </p> - - </div> - <div id="form_sign_in_no"> - - <p>[% loc('<strong>No</strong>, let me confirm my report by email:') %]</p> - - <div id="fieldset"> - - [% INCLUDE name_phone %] - - <div class="form-field"> - <label for="password_register">[% loc('Enter a new password:') %]</label> - <input type="password" name="password_register" id="password_register" value="" size="25"> - </div> - </div> - - <p style="clear:both"><small>[% loc('Providing a password is optional, but doing so will allow you to more easily report problems, leave updates and manage your reports.') %]</small></p> - - <p> - <input type="submit" name="submit_register" value="[% loc('Submit') %]"> - </p> - - </div> - -</div> - -[% END %] - -[% IF partial_token %] - <input type="hidden" name="partial" value="[% partial_token.token %]"> -[% END %] - -<input type="hidden" name="submit_problem" value="1"> - -</div> -</div> +[% PROCESS 'report/new/fill_in_details_form.html' %] </div> </form> [% INCLUDE 'footer.html' %] -[% BLOCK name_phone %] - [% IF field_errors.name %] - <div class='form-error'>[% field_errors.name %]</div> - [% END %] - - <div class="form-field"> - <label for="form_name">[% loc('Your name:') %]</label> - <input type="text" value="[% report.name | html %]" name="name" id="form_name" size="25"> - </div> - - <div class="checkbox"> - [%# if there is nothing in the name field then set check box as default on form %] - <input type="checkbox" name="may_show_name" id="form_may_show_name" value="1"[% ' checked' IF !report.anonymous || !report.name %]> - <label for="form_may_show_name">[% loc('Show my name publicly') %]</label> - <br><small>[% loc('(we never show your email address or phone number)') %]</small> - </div> - - <div> - <label for="form_phone">[% loc('Phone:') %]</label> - <input type="text" value="[% report.user.phone | html %]" name="phone" id="form_phone" size="15"> - <small>[% loc('(optional)') %]</small> - </div> -[% END %] - diff --git a/templates/web/default/report/new/fill_in_details_form.html b/templates/web/default/report/new/fill_in_details_form.html new file mode 100644 index 000000000..a0c50d5af --- /dev/null +++ b/templates/web/default/report/new/fill_in_details_form.html @@ -0,0 +1,240 @@ +<h1>[% loc('Reporting a problem') %]</h1> + +[% IF report.used_map %] + [% IF partial_token %] + <p id="unknown">[% loc('Please note your report has <strong>not yet been sent</strong>. Choose a category and add further information below, then submit.') %]</p> + [% END %] +<p>[% loc('You have located the problem at the point marked with a purple pin on the map. If this is not the correct location, simply click on the map again. ') %]</p> +[% END %] + +[% IF js %] + <p id="councils_text">[% + tprintf( + loc('All the information you provide here will be sent to <strong>%s</strong>.'), + loc('the local council') + ); + %] + [% loc('The subject and details of the problem will be public, plus your name if you give us permission.') %] + </p> +[% ELSE %] + [% PROCESS 'report/new/councils_text.html' %] +[% END %] + +<p> +[% IF report.used_map %] + [% INCLUDE 'report/new/fill_in_details_text.html' %] +[% ELSE %] + [% loc('Please fill in the form below with details of the problem, and describe the location as precisely as possible in the details box.') %] +[% END %] +</p> + +[% INCLUDE 'errors.html' %] + +<div id="problem_form"> + +[% INCLUDE 'report/new/form_heading.html' %] + +<div id="fieldset"> + + + + + +[% IF field_errors.council %] + <div class='form-error'>[% field_errors.council %]</div> +[% END %] + +[% IF field_errors.title %] + <div class='form-error'>[% field_errors.title %]</div> +[% END %] + +<div class="form-field"> + <label for="form_title">[% loc('Subject:') %]</label> + <input type="text" value="[% report.title | html %]" name="title" id="form_title" size="25"> +</div> + +[% IF field_errors.detail %] + <div class='form-error'>[% field_errors.detail %]</div> +[% END %] + +<div class="form-field"> + <label for="form_detail">[% loc('Details:') %]</label> + <textarea name="detail" id="form_detail" rows="7" cols="26">[% report.detail | html %]</textarea> +</div> + +[% IF js %] + <div class="form-field" id="form_category_row"> + <label for="form_category">[% loc('Category:') %]</label> + <select name="category" id="form_category"><option>[% loc('Loading...') %]</option></select> + </div> +[% ELSE %] + [% IF category_options.size %] + [% IF field_errors.category %] + <div class='form-error'>[% field_errors.category %]</div> + [% END %] + + <div class="form-field"> + [% PROCESS "report/new/category.html" %] + </div> + [% END %] +[% END %] + +[%- IF category_extras %] +<div id="category_meta"> + [%- IF report_meta %] + [%- category = report.category %] + <h4>Additional Information</h4> + [%- FOR meta IN category_extras.$category %] + [%- meta_name = meta.code -%] + +[% IF field_errors.$meta_name %] + <div class='form-error'>[% field_errors.$meta_name %]</div> +[% END -%] + + <div class="form-field"> + <label for="form_[% meta_name %]">[% meta.description _ ':' %]</label> + [% IF meta.exists('values') %] + <select name="[% meta_name %]" id="form_[% meta_name %]"> + [% FOR option IN meta.values.value.keys %] + <option value="[% meta.values.value.$option.key %]">[% option %]</option> + [% END %] + </select> + [% ELSE %] + <input type="text" value="[% report_meta.$meta_name | html %]" name="[% meta_name %]" id="form_[% meta_name %]"> + [% END %] + </div> + [%- END %] + [%- END %] +</div> +[%- END %] + +[% IF c.cobrand.allow_photo_upload %] + [% IF field_errors.photo %] + <div class='form-error'>[% field_errors.photo %]</div> + [% END %] + + <div class='form-field'> + [% IF upload_fileid || report.photo %] + <p>[% loc('You have already attached a photo to this report, attaching another one will replace it.') %]</p> + [% IF upload_fileid %] + <input type="hidden" name="upload_fileid" value="[% upload_fileid %]" /> + [% END %] + [% IF report.photo %] + <img align="right" src="/photo?id=[% report.id %]" hspace="5"> + [% END %] + [% END %] + + <label for="form_photo">[% loc('Photo:') %]</label> + <input type="file" name="photo" id="form_photo" style="width:20em"> + </div> +[% END %] + +[% IF c.user_exists %] + + [% INCLUDE name_phone %] + + [% INCLUDE 'report/new/notes.html' %] + + <p id="problem_submit"> + <input type="submit" value="[% loc('Submit') %]"> + </p> + +[% ELSE %] + + [% IF field_errors.email %] + <div class='form-error'>[% field_errors.email %]</div> + [% END %] + + <div class="form-field"> + <label for="form_email">[% loc('Your email:') %]</label> + <input type="email" value="[% report.user.email | html %]" name="email" id="form_email" size="25"> + </div> + +[% INCLUDE 'report/new/notes.html' %] + +<div id="form_sign_in"> + <h3>[% loc("Now to submit your report… do you have a FixMyStreet password?") %]</h3> + + <div id="form_sign_in_yes"> + + [% IF field_errors.password %] + <div class='form-error'>[% field_errors.password %]</div> + [% END %] + + <p> + <label class="n" for="password_sign_in">[% loc('<strong>Yes</strong>, I have a password:') %]</label> + <input type="password" name="password_sign_in" id="password_sign_in" value="" size="25"> + </p> + + <p> + <input type="checkbox" id="remember_me" name="remember_me" value='1'[% ' checked' IF remember_me %]> + <label class="n" for="remember_me"> + [% loc('Keep me signed in on this computer') %] + </label> + </p> + + <p> + <input type="submit" name="submit_sign_in" value="[% loc('Submit') %]"> + </p> + + </div> + <div id="form_sign_in_no"> + + <p>[% loc('<strong>No</strong>, let me confirm my report by email:') %]</p> + + <div id="fieldset"> + + [% INCLUDE name_phone %] + + <div class="form-field"> + <label for="password_register">[% loc('Enter a new password:') %]</label> + <input type="password" name="password_register" id="password_register" value="" size="25"> + </div> + </div> + + <p style="clear:both"><small>[% loc('Providing a password is optional, but doing so will allow you to more easily report problems, leave updates and manage your reports.') %]</small></p> + + <p> + <input type="submit" name="submit_register" value="[% loc('Submit') %]"> + </p> + + </div> + +</div> + +[% END %] + +[% IF partial_token %] + <input type="hidden" name="partial" value="[% partial_token.token %]"> +[% END %] + +<input type="hidden" name="submit_problem" value="1"> + +</div> +</div> + + +[% BLOCK name_phone %] + [% IF field_errors.name %] + <div class='form-error'>[% field_errors.name %]</div> + [% END %] + + <div class="form-field"> + <label for="form_name">[% loc('Your name:') %]</label> + <input type="text" value="[% report.name | html %]" name="name" id="form_name" size="25"> + </div> + + <div class="checkbox"> + [%# if there is nothing in the name field then set check box as default on form %] + <input type="checkbox" name="may_show_name" id="form_may_show_name" value="1"[% ' checked' IF !report.anonymous || !report.name %]> + <label for="form_may_show_name">[% loc('Show my name publicly') %]</label> + <br><small>[% loc('(we never show your email address or phone number)') %]</small> + </div> + + <div> + <label for="form_phone">[% loc('Phone:') %]</label> + <input type="text" value="[% report.user.phone | html %]" name="phone" id="form_phone" size="15"> + <small>[% loc('(optional)') %]</small> + </div> +[% END %] + diff --git a/templates/web/default/report/new/fill_in_details_text.html b/templates/web/default/report/new/fill_in_details_text.html index d55ec5826..5d9716915 100644 --- a/templates/web/default/report/new/fill_in_details_text.html +++ b/templates/web/default/report/new/fill_in_details_text.html @@ -1,5 +1,5 @@ [% - IF details != 'none'; + IF area_ids_to_list.size != 0; loc('Please fill in details of the problem below. The council won\'t be able to help unless you leave as much detail as you can, so please describe the exact location of the problem (e.g. on a wall), what it is, how long it has been there, a description (and a diff --git a/templates/web/default/report/updates.html b/templates/web/default/report/updates.html index 910430114..803ed197e 100644 --- a/templates/web/default/report/updates.html +++ b/templates/web/default/report/updates.html @@ -6,12 +6,16 @@ <div><div class="problem-update"><p><a name="update_[% update.id %]"></a><em> [% IF update.anonymous || update.name == '' %] [% tprintf( loc( 'Posted anonymously at %s' ), prettify_epoch( update.confirmed_local.epoch ) ) -%] + [%- ELSIF update.user.from_council %] + [% user_name = update.user.name | html %] + [% tprintf( loc( 'Posted by %s (<strong>%s</strong>) at %s' ), user_name, update.user.council, prettify_epoch( update.confirmed_local.epoch ) ) -%] [%- ELSE %] [% tprintf( loc( 'Posted by %s at %s' ), update.name, prettify_epoch( update.confirmed_local.epoch ) ) | html -%] [%- END -%] [%- c.cobrand.extra_update_meta_text(update) -%] [%- ", " _ loc( 'marked as fixed' ) IF update.mark_fixed %] [%- ", " _ loc( 'reopened' ) IF update.mark_open %] + [%- ", " _ tprintf(loc( 'marked as %s' ), update.meta_problem_state) IF update.problem_state %] </em></p> [% IF c.cobrand.allow_update_reporting %] |