diff options
Diffstat (limited to 'templates/web/base')
19 files changed, 120 insertions, 71 deletions
diff --git a/templates/web/base/about/iphone.html b/templates/web/base/about/iphone.html deleted file mode 100755 index 8f7992713..000000000 --- a/templates/web/base/about/iphone.html +++ /dev/null @@ -1,52 +0,0 @@ -[% INCLUDE header.html - title = 'FixMyStreet for iPhone screenshots' -%] - -<h1>iPhone simulator simulator</h1> - -[% - SET screens = [ - [ "iphone-1start.png", 'Click the image to progress through the flow of using the iPhone FixMyStreet application. - <br>When launched, the user’s location automatically gets fetched…' ], - [ "iphone-2locfound.png", 'They want to take a photo.' ], - [ "iphone-pickpicture1.png", 'The simulator doesn’t have a camera, so we’re taken to the photo albums. Let’s pick Hawaii.' ], - [ "iphone-pickpicture2.png", 'That red clouds photo looks nice.' ], - [ "iphone-pickpicture3.png", 'After any moving or scaling we want, we select the photo.' ], - [ "iphone-3picture.png", 'Okay, now we need to edit the summary of the report.' ], - [ "iphone-editsummary.png", 'Enter some text.' ], - [ "iphone-editsummary2.png", 'And done.' ], - [ "iphone-4subject.png", 'I haven’t entered all my details yet, so that’s next.' ], - [ "iphone-5details.png", 'Your details are remembered so you only have to enter them once.' ], - [ "iphone-6emailkeyboard.png", 'The iPhone has different keyboards, this is the email one.' ], - [ "iphone-5details.png", 'Right, we need to enter a name.' ], - [ "iphone-editname.png", 'Slightly different keyboard to the email one.' ], - [ "iphone-detailsdone.png", 'Okay, details entered.' ], - [ "iphone-allready.png", 'That’s everything, hit Report!' ], - [ "iphone-7uploading.png", 'Uploading…' ], - [ "iphone-8response.png", 'The simulator always thinks it’s in the US, which FixMyStreet won’t like very much.' ], - [ "iphone-allready.png", 'Ah well, let’s read the About page instead' ], - [ "iphone-9about.png", 'Donate? :)' ], -]; -%] - -<script type="text/javascript"> -document.write('<style type="text/css">.vv { display: none; }</style>'); -function show(a) { - if (a==[% screens.size %]) b = 1; - else b = a+1; - document.getElementById('d' + a).style.display='none'; - document.getElementById('d' + b).style.display='block'; -} -</script> - -[% FOR screen IN screens %] - - <div id='d[% loop.count %]'[% " class='vv'" IF NOT loop.first %]> - <p>[% screen.1 %]</p> - <p align='center'><a onclick='show([% loop.count %]);return false' href='#d[% loop.count + 1 %]'><img src='[% screen.0 %]' width=414 border=0 height=770></a></p> - </div> - -[% END %] - -[% INCLUDE footer.html %] - diff --git a/templates/web/base/admin/report_edit.html b/templates/web/base/admin/report_edit.html index 48a02593b..96e59d1c4 100644 --- a/templates/web/base/admin/report_edit.html +++ b/templates/web/base/admin/report_edit.html @@ -81,7 +81,7 @@ class="admin-offsite-link">[% problem.latitude %], [% problem.longitude %]</a> ([% problem.send_method_used %]) [% END %] [% IF problem.state == 'confirmed' AND problem.whensent %] - <input onclick="return confirm('[% loc('You really want to resend?') %]')" type="submit" name="resend" value="[% loc('Resend report') %]"> + <input data-confirm="[% loc('Are you sure?') %]" type="submit" name="resend" value="[% loc('Resend report') %]"> [% ELSIF NOT problem.whensent %] <input type="submit" name="mark_sent" value="[% loc('Mark as sent') %]"> [% END %] diff --git a/templates/web/base/admin/response_templates_select.html b/templates/web/base/admin/response_templates_select.html new file mode 100644 index 000000000..664d1d20a --- /dev/null +++ b/templates/web/base/admin/response_templates_select.html @@ -0,0 +1,8 @@ +<div class="response_templates_select"> + <select id="templates_for_[% for %]" class="js-template-name" data-for="[% for %]"> + <option value="">[% loc('--Choose a template--') %]</option> + [% FOR t IN problem.response_templates %] + <option value="[% t.text | html %]"> [% t.title | html %] </option> + [% END %] + </select> +</div> diff --git a/templates/web/base/admin/template_edit.html b/templates/web/base/admin/template_edit.html new file mode 100644 index 000000000..54058a04c --- /dev/null +++ b/templates/web/base/admin/template_edit.html @@ -0,0 +1,50 @@ +[% INCLUDE 'admin/header.html' title=tprintf(loc('Response Template for %s'), body.name) -%] +[% rt = response_template %] + +[% UNLESS rt.id %]<h3>[% loc('New template') %]</h3>[% END %] + +<form method="post" + action="[% c.uri_for('templates', body.id, rt.id || 'new' ) %]" + enctype="application/x-www-form-urlencoded" + accept-charset="utf-8" + class="validate"> + + <p> + <strong>[% loc('Title:') %] </strong> + <input type="text" name="title" class="required" size="30" value="[% rt.title| html %]"> + </p> + <p> + <strong>[% loc('Text:') %] </strong> + <textarea name="text" class="required">[% rt.text |html %]</textarea> + </p> + <p> + <label> + <strong>[% loc('Auto-response:') %]</strong> + <input type="checkbox" name="auto_response" [% 'checked' IF rt.auto_response %] /> + </label> + </p> + <p> + <strong>[% loc('Categories:') %]</strong> + <ul> + [% FOR contact IN contacts %] + <li> + <label> + <input type="checkbox" name="contacts[[% contact.id %]]" [% 'checked' IF contact.active %]/> + [% contact.category %] + </label> + </li> + [% END %] + </ul> + </p> + <p> + <input type="hidden" name="token" value="[% csrf_token %]" > + <input type="submit" name="Edit templates" value="[% rt.id ? loc('Save changes') : loc('Create template') %]" > + </p> + [% IF rt.id %] + <p> + <input class="delete" type="submit" name="delete_template" value="[% loc('Delete template') %]"> + </p> + [% END %] +</form> + +[% INCLUDE 'admin/footer.html' %] diff --git a/templates/web/base/admin/templates.html b/templates/web/base/admin/templates.html new file mode 100644 index 000000000..25cd181aa --- /dev/null +++ b/templates/web/base/admin/templates.html @@ -0,0 +1,30 @@ +[% INCLUDE 'admin/header.html' title=tprintf(loc('Response Templates for %s'), body.name) -%] + +[% IF c.cobrand.moniker == 'zurich' %] + <h2> [% tprintf(loc('Response Templates for %s'), body.name) %] </h2> +[% END %] + +<table> + <thead> + <tr> + <th> [% loc('Title') %] </th> + <th> [% loc('Text') %] </th> + <th> [% loc('Created') %] </th> + <th> </th> + </tr> + </thead> + <tbody> +[% FOR t IN response_templates %] + <tr> + <td> [% t.title %] </td> + <td> [% t.text %] </td> + <td> [% t.created %] </td> + <td> <a href="/admin/templates/[% body.id %]/[% t.id %]" class="btn">[% loc('Edit') %]</a> </td> + </tr> +[% END %] + </tbody> +</table> + +<a href="[% c.uri_for('templates', body.id, 'new') %]" class="btn">[% loc('New template') %]</a> + +[% INCLUDE 'admin/footer.html' %] diff --git a/templates/web/base/admin/templates_index.html b/templates/web/base/admin/templates_index.html new file mode 100644 index 000000000..1f45b84de --- /dev/null +++ b/templates/web/base/admin/templates_index.html @@ -0,0 +1,11 @@ +[% INCLUDE 'admin/header.html' title=loc('Response Templates') -%] + +<ul> + [% FOR body IN bodies %] + <li> + <a href="/admin/templates/[% body.id %]">[% body.name %]</a> + </li> + [% END %] +</ul> + +[% INCLUDE 'admin/footer.html' %] diff --git a/templates/web/base/admin/user-form.html b/templates/web/base/admin/user-form.html index c22480011..b05f15355 100644 --- a/templates/web/base/admin/user-form.html +++ b/templates/web/base/admin/user-form.html @@ -49,7 +49,7 @@ [% loc("Staff users have permission to log in to the admin.") %] </p> </div> - [% loc('Staff:') %] <input type="checkbox" id="body" name="body" value="[% c.user.from_body.id %]" [% user.from_body.id == c.user.from_body.id ? ' checked' : '' %] [% 'disabled' UNLESS c.user.has_permission_to('user_assign_body', c.user.from_body.id) %]> + [% loc('Staff:') %] <input type="checkbox" id="body" name="body" value="[% c.user.from_body.id %]" [% user.from_body.id == c.user.from_body.id ? ' checked' : '' %] [% 'disabled' UNLESS c.user.is_superuser OR c.user.has_body_permission_to('user_assign_body') %]> </li> [% END %] @@ -116,7 +116,7 @@ [% FOREACH permission IN group.value %] <li> <label> - <input type="checkbox" id="perms_[% permission.key %]" name="permissions[[% permission.key %]]" [% "checked" IF user.has_permission_to(permission.key, user.from_body.id) %]> + <input type="checkbox" id="perms_[% permission.key %]" name="permissions[[% permission.key %]]" [% "checked" IF user.has_body_permission_to(permission.key) %]> [% permission.value %] </label> </li> diff --git a/templates/web/base/admin/users.html b/templates/web/base/admin/users.html index 19a3de03c..dfff77ee6 100644 --- a/templates/web/base/admin/users.html +++ b/templates/web/base/admin/users.html @@ -25,7 +25,7 @@ <td>[% PROCESS value_or_nbsp value=user.name %]</td> <td><a href="[% c.uri_for( 'reports', search => user.email ) %]">[% PROCESS value_or_nbsp value=user.email %]</a></td> <td>[% PROCESS value_or_nbsp value=user.from_body.name %] - [% IF user.from_body AND user.has_permission_to('moderate', user.from_body.id) %] * [% END %] + [% IF user.has_body_permission_to('moderate') %] * [% END %] </td> [% IF c.cobrand.moniker != 'zurich' %] <td>[% user.flagged == 2 ? loc('(Email in abuse table)') : user.flagged ? loc('Yes') : ' ' %]</td> diff --git a/templates/web/base/report/_council_sent_info.html b/templates/web/base/report/_council_sent_info.html index affc73414..dca74f994 100644 --- a/templates/web/base/report/_council_sent_info.html +++ b/templates/web/base/report/_council_sent_info.html @@ -1,6 +1,6 @@ -[% IF problem.whensent || problem.can_display_external_id %] +[% SET duration_clause = problem.duration_string(c) %] +[% IF duration_clause || problem.can_display_external_id %] <p class="council_sent_info"> - [% SET duration_clause = problem.duration_string(c) IF problem.whensent %] [%- IF problem.can_display_external_id %] [%- IF duration_clause %] [%- external_ref_clause = tprintf(loc('Council ref: %s'), problem.external_id) %] diff --git a/templates/web/base/report/display_tools.html b/templates/web/base/report/display_tools.html index 590f81593..052ffb8a5 100644 --- a/templates/web/base/report/display_tools.html +++ b/templates/web/base/report/display_tools.html @@ -1,9 +1,9 @@ <div class="shadow-wrap"> <ul id="key-tools"> - [% IF c.user_exists AND c.cobrand.users_can_hide AND c.user.belongs_to_body( c.cobrand.council_id ) %] + [% IF c.user_exists AND c.cobrand.users_can_hide AND c.user.belongs_to_body( problem.bodies_str ) %] <li><form method="post" action="/report/delete/[% problem.id %]" id="remove-from-site-form"> <input type="hidden" name="token" value="[% csrf_token %]"> - <input type="submit" id="key-tool-report-abuse" class="abuse" value="Remove from site"> + <input type="submit" id="key-tool-report-abuse" class="abuse" data-confirm="[% loc('Are you sure?') %]" value="[% loc('Remove from site') %]"> </form></li> [% ELSIF c.cobrand.moniker != 'zurich' %] <li><a rel="nofollow" id="key-tool-report-abuse" class="abuse" href="[% c.uri_for( '/contact', { id => problem.id } ) %]">[% loc('Report abuse' ) %]</a></li> diff --git a/templates/web/base/report/new/extra_name.html b/templates/web/base/report/new/extra_name.html index dede1000c..2838645af 100644 --- a/templates/web/base/report/new/extra_name.html +++ b/templates/web/base/report/new/extra_name.html @@ -6,7 +6,7 @@ [% title = '' %] [% IF fms_extra_title %][% title = fms_extra_title | upper %] [% ELSIF c.user && c.user.title %][% title = c.user.title | upper %][% END %] -<select class="form-focus-trigger required" id="form_fms_extra_title" +<select class="form-focus-trigger required js-form-name" id="form_fms_extra_title" name="fms_extra_title"> <option></option> <option value="MR"[% ' selected' IF title == 'MR' %]>Mr</option> diff --git a/templates/web/base/report/new/form_user_loggedin.html b/templates/web/base/report/new/form_user_loggedin.html index 1f941a6d1..add4fdbd3 100644 --- a/templates/web/base/report/new/form_user_loggedin.html +++ b/templates/web/base/report/new/form_user_loggedin.html @@ -46,7 +46,7 @@ [% IF field_errors.name %] <p class='form-error'>[% field_errors.name %]</p> [% END %] - <input type="text" class="validName" value="[% report.name | html %]" name="name" id="form_name"> + <input type="text" class="validName js-form-name" value="[% report.name | html %]" name="name" id="form_name"> [%# if there is nothing in the name field then set check box as default on form %] <div class="checkbox-group"> @@ -62,6 +62,6 @@ </div> <div class="form-txt-submit-box"> - <input class="green-btn" type="submit" id="submit_register" name="submit_register" value="[% loc('Submit') %]"> + <input class="green-btn js-submit_register" type="submit" name="submit_register" value="[% loc('Submit') %]"> </div> </div> diff --git a/templates/web/base/report/new/form_user_loggedout_by_email.html b/templates/web/base/report/new/form_user_loggedout_by_email.html index 1ad07c540..0b2f3859e 100644 --- a/templates/web/base/report/new/form_user_loggedout_by_email.html +++ b/templates/web/base/report/new/form_user_loggedout_by_email.html @@ -14,7 +14,7 @@ <p class='form-error'>[% field_errors.name %]</p> [% END %] - <input type="text" class="form-focus-trigger validName" value="[% report.name | html %]" name="name" id="form_name" placeholder="[% loc('Your name') %]"> + <input type="text" class="form-focus-trigger validName js-form-name" value="[% report.name | html %]" name="name" id="form_name" placeholder="[% loc('Your name') %]"> [%# if there is nothing in the name field then set check box as default on form %] <div class="checkbox-group"> @@ -36,6 +36,6 @@ <div class="form-txt-submit-box form-focus-hidden"> <input type="password" name="password_register" id="password_register" value="" placeholder="[% loc('Enter a password') %]"> - <input class="green-btn" type="submit" id="submit_register" name="submit_register" value="[% loc('Submit') %]"> + <input class="green-btn js-submit_register" type="submit" name="submit_register" value="[% loc('Submit') %]"> </div> </div> diff --git a/templates/web/base/report/new/form_user_loggedout_password.html b/templates/web/base/report/new/form_user_loggedout_password.html index c9d65e43e..0f234aeba 100644 --- a/templates/web/base/report/new/form_user_loggedout_password.html +++ b/templates/web/base/report/new/form_user_loggedout_password.html @@ -8,7 +8,7 @@ [% END %] <div class="form-txt-submit-box"> <input type="password" name="password_sign_in" id="password_sign_in" placeholder="[% loc('Your password') %]" value=""> - <input class="green-btn" type="submit" id="submit_sign_in" name="submit_sign_in" value="[% loc('Submit') %]"> + <input class="green-btn js-submit_sign_in" type="submit" name="submit_sign_in" value="[% loc('Submit') %]"> </div> <div class="checkbox-group"> diff --git a/templates/web/base/report/update-form.html b/templates/web/base/report/update-form.html index 97e0df779..49d011c0e 100644 --- a/templates/web/base/report/update-form.html +++ b/templates/web/base/report/update-form.html @@ -22,7 +22,7 @@ [% END %] [% IF c.user_exists %] [% INCLUDE 'report/update/form_name.html' %] - <div class="clearfix"><input class="final-submit green-btn" type="submit" id="update_post" value="[% loc('Post') %]"></div> + <div class="clearfix"><input class="final-submit green-btn js-submit_register" type="submit" name="submit_register" value="[% loc('Post') %]"></div> [% ELSIF oauth_need_email %] [% INCLUDE 'report/update/form_user_loggedout_email.html' required = 1 %] <div id="form_sign_in"> diff --git a/templates/web/base/report/update/form_name.html b/templates/web/base/report/update/form_name.html index e65ab1790..ef8efd296 100644 --- a/templates/web/base/report/update/form_name.html +++ b/templates/web/base/report/update/form_name.html @@ -25,8 +25,7 @@ <p class='form-error'>[% field_errors.name %]</p> [% END %] -<input type="text" - [%- IF c.cobrand.moniker.match('fixmystreet|bromley') AND problem.bodies_str == '2482' %]class="validName" [% END -%] +<input type="text" class="validName js-form-name" name="name" id="form_name" value="[% update.name || c.user.name | html %]" placeholder="[% loc('Your name') %]"> <div class="checkbox-group"> diff --git a/templates/web/base/report/update/form_update.html b/templates/web/base/report/update/form_update.html index 007bd68d8..ef87d9de0 100644 --- a/templates/web/base/report/update/form_update.html +++ b/templates/web/base/report/update/form_update.html @@ -25,6 +25,9 @@ [% END %] <label for="form_update">[% loc( 'Update' ) %]</label> +[% IF c.user && c.user.belongs_to_body( problem.bodies_str ) %] + [% INCLUDE 'admin/response_templates_select.html' for='form_update' %] +[% END %] [% IF field_errors.update %] <div class='form-error'>[% field_errors.update %]</div> [% END %] diff --git a/templates/web/base/report/update/form_user_loggedout_by_email.html b/templates/web/base/report/update/form_user_loggedout_by_email.html index 672f76ed9..aae37502b 100644 --- a/templates/web/base/report/update/form_user_loggedout_by_email.html +++ b/templates/web/base/report/update/form_user_loggedout_by_email.html @@ -11,7 +11,7 @@ <div class="form-txt-submit-box"> <input type="password" name="password_register" id="password_register" value="" placeholder="[% loc('Enter a password') %]"> - <input class="green-btn" type="submit" name="submit_register" id="submit_register" value="[% loc('Post') %]"> + <input class="green-btn js-submit_register" type="submit" name="submit_register" value="[% loc('Post') %]"> </div> </div> diff --git a/templates/web/base/report/update/form_user_loggedout_password.html b/templates/web/base/report/update/form_user_loggedout_password.html index 103df1098..593ccf3de 100644 --- a/templates/web/base/report/update/form_user_loggedout_password.html +++ b/templates/web/base/report/update/form_user_loggedout_password.html @@ -7,7 +7,7 @@ [% END %] <div class="form-txt-submit-box"> <input type="password" name="password_sign_in" id="password_sign_in" value="" placeholder="[% loc('Your password') %]"> - <input class="green-btn" type="submit" name="submit_sign_in" id="submit_sign_in" value="[% loc('Post') %]"> + <input class="green-btn js-submit_sign_in" type="submit" name="submit_sign_in" value="[% loc('Post') %]"> </div> <div class="checkbox-group"> |