diff options
Diffstat (limited to 'templates/web/default')
-rw-r--r-- | templates/web/default/alert/list.html | 4 | ||||
-rw-r--r-- | templates/web/default/alert/updates.html | 2 | ||||
-rw-r--r-- | templates/web/default/auth/general.html | 2 | ||||
-rw-r--r-- | templates/web/default/footer.html | 6 | ||||
-rw-r--r-- | templates/web/default/header.html | 9 | ||||
-rw-r--r-- | templates/web/default/my/my.html | 85 | ||||
-rw-r--r-- | templates/web/default/report/display.html | 117 | ||||
-rw-r--r-- | templates/web/default/report/new/fill_in_details.html | 116 |
8 files changed, 274 insertions, 67 deletions
diff --git a/templates/web/default/alert/list.html b/templates/web/default/alert/list.html index 38007ea62..36bfaffd9 100644 --- a/templates/web/default/alert/list.html +++ b/templates/web/default/alert/list.html @@ -116,10 +116,14 @@ for the county council.' ) %] [% loc('or') %] </p> +[% UNLESS c.user_exists %] + <p> [% loc('Your email:') %] <input type="text" id="rznvy" name="rznvy" value="[% rznvy | html %]" size="30"> </p> +[% END %] + <p> <input type="submit" name="alert" value="[% loc('Subscribe me to an email alert') %]"> </p> diff --git a/templates/web/default/alert/updates.html b/templates/web/default/alert/updates.html index 88b014ff6..76b5ef23e 100644 --- a/templates/web/default/alert/updates.html +++ b/templates/web/default/alert/updates.html @@ -11,7 +11,7 @@ <form action="/alert/subscribe" method="post"> <label class="n" for="alert_rznvy">[% loc('Email:') %]</label> -<input type="text" name="rznvy" id="alert_rznvy" value="[% email | html %]" size="30"> +<input type="email" name="rznvy" id="alert_rznvy" value="[% email | html %]" size="30"> <input type="hidden" name="id" value="[% problem_id | html %]"> <input type="hidden" name="type" value="updates"> <input type="submit" value="[% loc('Subscribe') %]"> diff --git a/templates/web/default/auth/general.html b/templates/web/default/auth/general.html index d30fefcee..ffc85b3dc 100644 --- a/templates/web/default/auth/general.html +++ b/templates/web/default/auth/general.html @@ -20,7 +20,7 @@ [% IF loc_email_error %] <div class="form-error">[% loc_email_error %]</div> [% ELSIF sign_in_error %] - <div class="form-error">[% loc('Email or password wrong - please try again.') %]</div> + <div class="form-error">[% loc('There was a problem with your email/password combination. Please try again.') %]</div> [% END %] <div class="form-field"> diff --git a/templates/web/default/footer.html b/templates/web/default/footer.html index 9222436e2..657d9d826 100644 --- a/templates/web/default/footer.html +++ b/templates/web/default/footer.html @@ -4,16 +4,18 @@ <h2 class="v">[% loc('Navigation') %]</h2> <ul id="navigation"> <li><a href="/">[% loc("Report a problem") %]</a></li> +<li id="nav_new"><a href="/my">[% loc("Your reports") %]</a></li> <li><a href="/reports">[% loc("All reports") %]</a></li> <li><a href="/alert[% pc ? '/list?pc=' : '' %][% pc | uri %]">[% loc("Local alerts") %]</a></li> <li><a href="/faq">[% loc("Help") %]</a></li> -<li><a href="/contact">[% loc("Contact") %]</a></li> </ul> [% loc('<a href="http://www.mysociety.org/"><img id="logo" width="133" height="26" src="/i/mysociety-dark.png" alt="View mySociety.org"><span id="logoie"></span></a>') %] <p id="footer"> - [% loc('Built by <a href="http://www.mysociety.org/">mySociety</a>, using some <a href="http://github.com/mysociety/fixmystreet">clever</a> <a href="https://secure.mysociety.org/cvstrac/dir?d=mysociety/services/TilMa">code</a>.') %] + [% loc('Built by <a href="http://www.mysociety.org/">mySociety</a>') %] + | <a href="http://github.com/mysociety/fixmystreet">[% loc('Source code') %]</a> + | <a href="/contact">[% loc("Contact FixMyStreet") %]</a> </p> [% INCLUDE 'tracking_code.html' %] diff --git a/templates/web/default/header.html b/templates/web/default/header.html index 52f066663..67a5fe631 100644 --- a/templates/web/default/header.html +++ b/templates/web/default/header.html @@ -16,6 +16,15 @@ [%- loc('Fix<span id="my">My</span>Street') %] [%- IF NOT title AND NOT c.req.path %]</h1>[% ELSE %]</a></div>[% END %] + <ul id="meta"> + [% IF c.user_exists %] + <li>[% tprintf(loc('Signed in as %s'), c.user.name || c.user.email) %] + <li><a href="/auth/logout">[% loc('Sign out') %]</a></li> + [% ELSE %] + <li> </li> + [% END %] + </ul> + <div id="wrapper"><div id="mysociety"> [% INCLUDE 'debug_header.html' %] diff --git a/templates/web/default/my/my.html b/templates/web/default/my/my.html index 03b180a3a..e7f4ca72d 100644 --- a/templates/web/default/my/my.html +++ b/templates/web/default/my/my.html @@ -1,18 +1,89 @@ -[% INCLUDE 'header.html', title => loc('My Reports') %] +[% + PROCESS "maps/${map.type}.html" IF problems.size; + INCLUDE 'header.html', title = loc('Your Reports') +%] + +[% IF problems.size %] + [% map_html %] + </div> + <div id="side"> +[% ELSE %] + <div id="skipped-map"> +[% END %] <h1>[% loc('Your Reports') %]</h1> -[% FOREACH p = c.user.problems %] - [% "<ul>" IF loop.first %] +[% INCLUDE pagination, pager = problems_pager %] + +[% FOREACH p = problems.confirmed %] + [% IF loop.first %]<h2>[% loc('Open reports') %]</h2>[% END %] + [% INCLUDE problem %] +[% END %] + +[% FOREACH p = problems.fixed %] + [% IF loop.first %]<h2>[% loc('Fixed reports') %]</h2>[% END %] + [% INCLUDE problem %] +[% END %] - <li><a href="[% c.uri_for( '/report', p.id ) %]">[% p.title | html %]</a> ([% loc(p.state) %])</li> +[%# FOREACH p = problems.unconfirmed; + IF loop.first; + '<h2>' _ loc('Unconfirmed reports') _ '</h2>'; + END; + INCLUDE problem; +END %] +[% FOREACH u IN updates %] + [% IF loop.first %] + <h2>[% loc('Your updates') %]</h2> + [% INCLUDE pagination, pager = updates_pager %] + <ul> + [% END %] + + <li>“[% u.text | html %]” + – <a href="[% c.uri_for( '/report', u.problem_id ) %]#update_[% u.id %]">[% u.problem.title | html %]</a>. + <em class="council_sent_info"> + [% tprintf( loc("Added %s"), prettify_epoch( u.confirmed_local.epoch, 'date' ) ) %] + </em> + </li> [% "</ul>" IF loop.last %] [% END %] +</div> + +[% INCLUDE 'footer.html' %] -[%# FIXME - put in blurb here %] +[% BLOCK problem %] + [% "<ul>" IF loop.first %] -<a href="/auth/change_password">change password</a> + <li><a href="[% c.uri_for( '/report', p.id ) %]">[% p.title | html %]</a> + <em class="council_sent_info"> – + [% IF p.whensent %] + [% tprintf( loc("Reported %s, to %s"), prettify_epoch( p.confirmed_local.epoch, 'date' ), p.body(c) ) %] + [% ELSE %] + [% tprintf( loc("Reported %s"), prettify_epoch( p.confirmed_local.epoch, 'date' ) ) %] + [% END %] + </em> + </li> -[% INCLUDE 'footer.html' %]
\ No newline at end of file + [% "</ul>" IF loop.last %] +[% END %] + +[% BLOCK pagination %] + [% IF pager.last_page > 1 %] + <p> + [% IF pager.previous_page %] + <a href="[% c.req.uri_with({'p_page' => pager.previous_page}) %]">← Previous</a> + [% ELSE %] + ← Previous + [% END %] + | + [% pager.first %] to [% pager.last %] of [% pager.total_entries %] + | + [% IF pager.next_page %] + <a href="[% c.req.uri_with({'p_page' => pager.next_page}) %]">Next →</a> + [% ELSE %] + Next → + [% END %] + </p> + [% END %] +[% END %] diff --git a/templates/web/default/report/display.html b/templates/web/default/report/display.html index a8a58ffce..0c0c5e22d 100644 --- a/templates/web/default/report/display.html +++ b/templates/web/default/report/display.html @@ -44,7 +44,7 @@ <form action="[% c.uri_for( '/alert/subscribe' ) %]" method="post" id="email_alert_box"> <p>[% loc('Receive email when updates are left on this problem.' ) %]</p> <label class="n" for="alert_rznvy">[% loc('Email:') %]</label> - <input type="text" name="rznvy" id="alert_rznvy" value="[% email | html %]" size="30"> + <input type="email" name="rznvy" id="alert_rznvy" value="[% email | html %]" size="30"> <input type="hidden" name="id" value="[% problem.id %]"> <input type="hidden" name="type" value="updates"> <input type="submit" value="[% loc('Subscribe') %]"> @@ -96,7 +96,12 @@ [% END %] </select> [% ELSE %] - [% IF !problem.is_fixed %] + [% 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"[% fixed %]> <label for="form_fixed">[% loc('This problem has been fixed') %]</label> @@ -105,12 +110,12 @@ [% END %] [% IF c.cobrand.allow_photo_upload %] - [% IF photo_error %] - <div class='form-error'>[% photo_error %]</div> + [% IF field_errors.photo %] + <div class='form-error'>[% field_errors.photo %]</div> [% END %] <div id="fileupload_normalUI"> [% IF upload_fileid %] - <p>[% loc('You have already attached a photo to this report, attaching another one will replace it.') %]</p> + <p>[% loc('You have already attached a photo to this update, attaching another one will replace it.') %]</p> <input type="hidden" name="upload_fileid" value="[% upload_fileid %]"> [% END %] <label for="form_photo">[% loc('Photo:') %]</label> @@ -118,38 +123,76 @@ </div> [% END %] - <div> - <label for="form_name">[% loc( 'Name:') %]</label> - <input type="text" name="name" id="form_name" value="[% update.name || c.user.name | html %]" size="20"> - </div> +[% IF c.user_exists %] + + [% INCLUDE name %] <div class="checkbox"> - <input type="checkbox" name="may_show_name" id="form_may_show_name" value="1"[% ' checked' UNLESS update.anonymous %]> - <label for="form_may_show_name">[% loc('Show my name publicly') %]</label> - <small>[% loc('(we never show your email)') %]</small> + <input type="submit" id="update_post" value="[% loc('Post') %]"> </div> -[% IF NOT c.user_exists %] +[% ELSE %] + + [% IF field_errors.email %] + <div class='form-error'>[% field_errors.email %]</div> + [% END %] + <div class="form-field"> + <label for="form_rznvy">[% loc('Your email:' ) %]</label> + <input type="email" name="rznvy" id="form_rznvy" value="[% update.user.email | html %]" size="30"> + </div> + +<div id="form_sign_in"> + <h3>[% loc("Now to submit your update… do you have a FixMyStreet password?") %]</h3> - [% IF field_errors.email %] - <div class='form-error'>[% field_errors.email %]</div> + <div id="form_sign_in_yes"> + + [% IF field_errors.password %] + <div class='form-error'>[% field_errors.password %]</div> [% END %] - <div class="form-field"> - <label for="form_rznvy">[% loc('Email' ) %]</label> - <input type="text" name="rznvy" id="form_rznvy" value="[% update.user.email || c.user.email | html %]" size="20"> - </div> -[% END %] + <p> + <label class="n" for="password_sign_in">[% loc('<strong>Yes</strong>, I have a password:') %]</label> + <input type="password" name="password_sign_in" id="password_sign_in" value="" size="25"> + </p> - <div class="checkbox"> - <input type="checkbox" name="add_alert" id="form_add_alert" value="1"[% ' checked' IF add_alert %]> - <label for="form_add_alert">[% loc( 'Alert me to future updates' ) %]</label> - </div> + <p> + <input type="checkbox" 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> - <div class="checkbox"> - <input type="submit" id="update_post" value="[% loc('Post') %]"> + <p> + <input type="submit" name="submit_sign_in" value="[% loc('Post') %]"> + </p> + + </div> + <div id="form_sign_in_no"> + + <p>[% loc('<strong>No</strong>, let me confirm my update by email:') %]</p> + + <div id="fieldset"> + + [% INCLUDE name %] + + <div class="form-field"> + <label for="password_register">[% loc('Enter a new password:') %]</label> + <input type="password" name="password_register" id="password_register" value="" size="25"> + </div> </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('Post') %]"> + </p> + + </div> + +</div> + +[% END %] + [% cobrand_update_fields %] </form> @@ -158,3 +201,25 @@ </div> [% INCLUDE 'footer.html' %] + +[% BLOCK name %] + [% IF field_errors.name %] + <div class='form-error'>[% field_errors.name %]</div> + [% END %] + + <div> + <label for="form_name">[% loc('Your name:') %]</label> + <input type="text" name="name" id="form_name" value="[% update.name || c.user.name | html %]" size="25"> + </div> + + <div class="checkbox"> + <input type="checkbox" name="may_show_name" id="form_may_show_name" value="1"[% ' checked' UNLESS update.anonymous %]> + <label for="form_may_show_name">[% loc('Show my name publicly') %]</label> + <small>[% loc('(we never show your email)') %]</small> + </div> + + <div class="checkbox"> + <input type="checkbox" name="add_alert" id="form_add_alert" value="1"[% ' checked' IF add_alert %]> + <label for="form_add_alert">[% loc( 'Alert me to future updates' ) %]</label> + </div> +[% END %] diff --git a/templates/web/default/report/new/fill_in_details.html b/templates/web/default/report/new/fill_in_details.html index 4a40dd707..68443770d 100644 --- a/templates/web/default/report/new/fill_in_details.html +++ b/templates/web/default/report/new/fill_in_details.html @@ -5,7 +5,6 @@ [% IF report.used_map %] <form action="[% c.uri_for('/report/new') %]" method="post" name="mapForm" id="mapForm"[% IF c.cobrand.allow_photo_upload %] enctype="multipart/form-data"[% END %]> -<input type="hidden" name="submit_map" value="1"> <input type="hidden" name="map" value="[% c.req.params.map | html %]"> <input type="hidden" name="pc" value="[% pc | html %]"> [% c.cobrand.form_elements('mapForm') %] @@ -118,58 +117,90 @@ [% END %] <label for="form_photo">[% loc('Photo:') %]</label> - <input type="file" name="photo" id="form_photo" > + <input type="file" name="photo" id="form_photo" style="width:20em"> </div> [% END %] -[% IF field_errors.name %] - <div class='form-error'>[% field_errors.name %]</div> -[% END %] - -<div class='form-field'> - <label for="form_name">[% loc('Name:') %]</label> - <input type="text" value="[% report.name | html %]" name="name" id="form_name" size="25"> -</div> +[% IF c.user_exists %] + [% INCLUDE name_phone %] -<div class="checkbox"> + [% INCLUDE 'report/new/notes.html' %] - [%# 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> - <small>[% loc('(we never show your email address or phone number)') %]</small> -</div> + <p id="problem_submit"> + <input type="submit" value="[% loc('Submit') %]"> + </p> -[% IF NOT c.user_exists %] +[% ELSE %] [% IF field_errors.email %] <div class='form-error'>[% field_errors.email %]</div> [% END %] <div class="form-field"> - <label for="form_email">[% loc('Email:') %]</label> - <input type="text" value="[% report.user.email | html %]" name="email" id="form_email" size="25"> + <label for="form_email">[% loc('Your email:') %]</label> + <input type="email" value="[% report.user.email | html %]" name="email" id="form_email" size="25"> </div> -[% END %] +[% 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" 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> - <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> -[% INCLUDE 'report/new/notes.html' %] +[% END %] [% IF partial_token %] <input type="hidden" name="partial" value="[% partial_token.token %]"> [% END %] -<p id="problem_submit"> - <input type="hidden" name="submit_problem" value="1"> - <input type="submit" value="[% loc('Submit') %]"> -</p> +<input type="hidden" name="submit_problem" value="1"> </div> </div> @@ -178,3 +209,28 @@ </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 %] + |