diff options
author | Struan Donald <struan@exo.org.uk> | 2011-08-19 00:08:15 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2011-08-19 00:08:15 +0100 |
commit | a9a4fed583d7467c9c1f1fa56d42bcb75b4b488c (patch) | |
tree | 72941901b1bad732047bc6289139a387b049e6e8 /templates | |
parent | 302f5961f5da13e8124e8d2e91e52a29f141946f (diff) | |
parent | 61e6d5928be1bedb68607f8fa36f0d971711a3f8 (diff) |
Merge branch 'new_statuses'
Diffstat (limited to 'templates')
-rw-r--r-- | templates/web/default/admin/list_updates.html | 4 | ||||
-rw-r--r-- | templates/web/default/admin/report_edit.html | 5 | ||||
-rw-r--r-- | templates/web/default/admin/search_users.html | 29 | ||||
-rw-r--r-- | templates/web/default/admin/update_edit.html | 17 | ||||
-rw-r--r-- | templates/web/default/admin/user_edit.html | 21 | ||||
-rw-r--r-- | templates/web/default/around/around_map_list_items.html | 2 | ||||
-rw-r--r-- | templates/web/default/around/on_map_list_items.html | 2 | ||||
-rw-r--r-- | templates/web/default/my/my.html | 5 | ||||
-rw-r--r-- | templates/web/default/questionnaire/completed.html | 2 | ||||
-rw-r--r-- | templates/web/default/questionnaire/index.html | 2 | ||||
-rw-r--r-- | templates/web/default/report/display.html | 31 | ||||
-rw-r--r-- | templates/web/default/report/updates.html | 4 |
12 files changed, 109 insertions, 15 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/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/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/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 %] |