diff options
Diffstat (limited to 'templates/web/base/admin')
-rw-r--r-- | templates/web/base/admin/category_edit.html | 3 | ||||
-rw-r--r-- | templates/web/base/admin/config_page.html | 2 | ||||
-rw-r--r-- | templates/web/base/admin/footer.html | 2 | ||||
-rw-r--r-- | templates/web/base/admin/header.html | 2 | ||||
-rw-r--r-- | templates/web/base/admin/index.html | 33 | ||||
-rw-r--r-- | templates/web/base/admin/list_updates.html | 2 | ||||
-rw-r--r-- | templates/web/base/admin/problem_row.html | 2 | ||||
-rw-r--r-- | templates/web/base/admin/report_blocks.html | 30 | ||||
-rw-r--r-- | templates/web/base/admin/report_edit.html | 22 |
9 files changed, 61 insertions, 37 deletions
diff --git a/templates/web/base/admin/category_edit.html b/templates/web/base/admin/category_edit.html index b827a4b6d..c0bd43ef5 100644 --- a/templates/web/base/admin/category_edit.html +++ b/templates/web/base/admin/category_edit.html @@ -43,6 +43,9 @@ [% IF c.cobrand.moniker != 'zurich' %] <input type="checkbox" name="non_public" value="1" id="non_public"[% ' checked' IF contact.non_public %]> <label class="inline" for="non_public">[% loc('Private') %]</label> + [% ELSE %] + <input type="checkbox" name="photo_required" value="1" id="photo_required"[% ' checked' IF contact.get_extra_metadata('photo_required') %]> + <label class="inline" for="photo_required">[% loc('Photo required') %]</label> [% END %] </p> diff --git a/templates/web/base/admin/config_page.html b/templates/web/base/admin/config_page.html index 7c9b5e317..71c524fb3 100644 --- a/templates/web/base/admin/config_page.html +++ b/templates/web/base/admin/config_page.html @@ -42,7 +42,7 @@ running version <strong>[% git_version || 'unknown' %]</strong>. [% INCLUDE subsection heading="Display" %] <tr> <td>Site title</td> - <td colspan=2>[% PROCESS 'site-name.html' -%]</td> + <td colspan=2>[% site_name %]</td> </tr> [% allowed_conf = FOR k IN c.config.ALLOWED_COBRANDS %] [% IF k.keys %][% k.items.join(':') %][% ELSE %][% k %][% END %] diff --git a/templates/web/base/admin/footer.html b/templates/web/base/admin/footer.html index 4c891c4ff..59ef6a32c 100644 --- a/templates/web/base/admin/footer.html +++ b/templates/web/base/admin/footer.html @@ -1 +1 @@ -[% INCLUDE 'footer.html' %] +[% INCLUDE 'footer.html' admin = 1 %] diff --git a/templates/web/base/admin/header.html b/templates/web/base/admin/header.html index 6282bf383..145bb986d 100644 --- a/templates/web/base/admin/header.html +++ b/templates/web/base/admin/header.html @@ -7,7 +7,7 @@ dd { margin-left: 8em; } select { width: auto; } </style> - <p><strong>[% loc('FixMyStreet admin:') %]</strong> + <p><strong>[% tprintf(loc('%s admin:', "%s here is the site name"), site_name) %]</strong> [%- FOREACH link IN allowed_links %] <a href="[% c.uri_for( link ) %]">[% allowed_pages.$link.0 %]</a> [% IF NOT loop.last %]|[% END %] diff --git a/templates/web/base/admin/index.html b/templates/web/base/admin/index.html index c9d2b8deb..dde6523a3 100644 --- a/templates/web/base/admin/index.html +++ b/templates/web/base/admin/index.html @@ -1,7 +1,8 @@ [% INCLUDE 'admin/header.html' title=loc('Summary') -%] +[% PROCESS 'admin/report_blocks.html' %] <div class="fms-admin-info fms-admin-floated"> -This is the administration interface for [% PROCESS 'site-name.html' -%]. If you +This is the administration interface for [% site_name %]. If you need any help or guidance, there is <a href="http://fixmystreet.org/">plenty of online documentation</a>. The FixMyStreet Platform is <a href="https://github.com/mysociety/fixmystreet">actively supported</a> by @@ -20,11 +21,9 @@ and to receive notices of updates. [% END %] [%- BLOCK states -%] -<h2>[% title %]</h2> - -[%- FOREACH state IN object.keys.sort %] +[%- FOREACH state IN list %] [%- '<ul>' IF loop.first %] - <li>[% object.$state %] [% state %]</li> + <li>[% object.$state %] [% state_pretty.$state %]</li> [%- "\n</ul>" IF loop.last %] [%- END %] [% END -%] @@ -44,18 +43,28 @@ and to receive notices of updates. </p> [% END -%] -[% PROCESS states title=loc('Problem breakdown by state') object=problems %] +<h2>[% loc('Problem breakdown by state') %]</h2> +[% FOREACH group IN state_groups %] +[%- '<ul>' IF loop.first %] + <li><strong>[% group.0 %]</strong> + [% PROCESS states object=problems list=group.1 %] + </li> +[%- "\n</ul>" IF loop.last %] +[%- END %] -[% PROCESS states title=loc('Update breakdown by state') object=comments %] +<h2>[% loc('Update breakdown by state') %]</h2> +[% PROCESS states object=comments list=comments.keys.sort %] -[% FOREACH category IN categories %] - [% IF loop.first %] - <h2>[% loc('Category fix rate for problems > 4 weeks old') %]</h2> +[% IF categories.size %] + <h2 id="category-fix-rate">[% loc('Category fix rate for problems > 4 weeks old') %]</h2> <table> <tr><th>[% loc('Category') %]</th><th>[% loc('Total') %]</th><th>[% loc('Fixed') %]</th></tr> - [% END %] +[% FOREACH category IN categories %] <tr><td>[% category.key %]</td><td>[% category.value.total %]</td><td>[% category.value.fixed / category.value.total * 100 | format('%.1f') %]%</td></tr> - [% '</table>' IF loop.last %] +[% END %] + </table> +[% ELSE %] +<p><a href="?show_categories=1#category-fix-rate">[% loc('Category fix rate for problems > 4 weeks old') %]</a></p> [% END %] [% INCLUDE 'admin/footer.html' %] diff --git a/templates/web/base/admin/list_updates.html b/templates/web/base/admin/list_updates.html index d3701bc1e..35f7adf66 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>[% update.state %]<br><small> + <td>[% state_pretty.${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 2413a6062..577e36992 100644 --- a/templates/web/base/admin/problem_row.html +++ b/templates/web/base/admin/problem_row.html @@ -30,7 +30,7 @@ [%- END -%] <br>[% problem.cobrand %]<br>[% problem.cobrand_data | html %] </td> - <td>[% problem.state %]<br><small> + <td>[% state_pretty.${problem.state} %]<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 -%] diff --git a/templates/web/base/admin/report_blocks.html b/templates/web/base/admin/report_blocks.html index c2cffc352..941bff821 100644 --- a/templates/web/base/admin/report_blocks.html +++ b/templates/web/base/admin/report_blocks.html @@ -1,3 +1,33 @@ +[% + +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('Unable to fix') + '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' ] ] +]; + +%] + [% BLOCK value_or_nbsp -%] [%- IF value %][% value | html %][% ELSE %] [% END %] [%- END %] diff --git a/templates/web/base/admin/report_edit.html b/templates/web/base/admin/report_edit.html index d488dcadc..d04a1a82b 100644 --- a/templates/web/base/admin/report_edit.html +++ b/templates/web/base/admin/report_edit.html @@ -45,28 +45,10 @@ class="admin-offsite-link">[% problem.latitude %], [% problem.longitude %]</a> <li>[% loc('Property address:') %] [% problem.extra.address | html %]</li> [% END %] <li><label class="inline" for="state">[% loc('State:') %]</label> <select name="state" id="state"> -[% FOREACH group IN [ - [ loc('Open'), [ - [ 'confirmed', loc('Open') ], [ 'investigating', loc('Investigating') ], - [ 'planned', loc('Planned') ], [ 'in progress', loc('In progress') ], - [ 'action scheduled', loc('Action Scheduled') ], - ] ], - [ loc('Fixed'), [ - [ 'fixed', loc('Fixed') ], [ 'fixed - user', loc('Fixed - User') ], - [ 'fixed - council', loc('Fixed - Council') ] - ] ], - [ loc('Closed'), [ - [ 'unable to fix', loc('Unable to fix') ], [ 'not responsible', loc('Not Responsible') ], - [ 'duplicate', loc('Duplicate') ], [ 'closed', loc('Closed') ], - [ 'internal referral', loc('Internal referral') ], - ] ], - [ loc('Hidden'), [ - [ 'hidden', loc('Hidden') ], [ 'partial', loc('Partial') ], [ 'unconfirmed',loc('Unconfirmed') ] - ] ] -] %] +[% FOREACH group IN state_groups %] <optgroup label="[% group.0 %]"> [% FOREACH state IN group.1 %] - <option [% 'selected ' IF state.0 == problem.state %] value="[% state.0 %]">[% state.1 %]</option> + <option [% 'selected ' IF state == problem.state %] value="[% state %]">[% state_pretty.$state %]</option> [% END %] </optgroup> [% END %] |