diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/web/base/my/planned.html | 4 | ||||
-rw-r--r-- | templates/web/base/report/_item.html | 45 | ||||
-rw-r--r-- | templates/web/base/report/_main.html | 10 | ||||
-rw-r--r-- | templates/web/base/report/updates.html | 50 | ||||
-rw-r--r-- | templates/web/base/reports/_list-filters.html | 3 | ||||
-rwxr-xr-x | templates/web/fixmystreet.com/reports/_extras.html | 1 |
6 files changed, 53 insertions, 60 deletions
diff --git a/templates/web/base/my/planned.html b/templates/web/base/my/planned.html index eb67247c4..d1a6b7b1b 100644 --- a/templates/web/base/my/planned.html +++ b/templates/web/base/my/planned.html @@ -22,11 +22,11 @@ [% END %] <section class="full-width"> -[% INCLUDE "reports/_list-filters.html", use_form_wrapper = 1 %] +[% INCLUDE "reports/_list-filters.html", use_form_wrapper = 1 shortlist = 1 %] <div class="js-pagination"> [% INCLUDE 'pagination.html', pager = problems_pager, param = 'p' %] </div> -[% INCLUDE 'my/_problem-list.html' %] +[% INCLUDE 'my/_problem-list.html' shortlist = 1 %] </section> </div> diff --git a/templates/web/base/report/_item.html b/templates/web/base/report/_item.html index 02457e5a0..e233ff09f 100644 --- a/templates/web/base/report/_item.html +++ b/templates/web/base/report/_item.html @@ -2,6 +2,30 @@ [% PROCESS 'admin/report_blocks.html' ~%] [% END ~%] +[% IF c.user.has_permission_to('planned_reports', problem.bodies_str_ids) ~%] + [% item_extra_class = "item-list__item--indented" ~%] + [% item_action = BLOCK ~%] + <input type="submit" value="1" + data-label-remove="[% loc('Remove from shortlist') %]" + data-label-add="[% loc('Add to shortlist') %]" + [% IF c.user.is_planned_report(problem) ~%] + name="shortlist-remove" title="[% loc('Remove from shortlist') %]" class="item-list__item__shortlist-remove" + [%~ ELSE ~%] + name="shortlist-add" title="[% loc('Add to shortlist') %]" class="item-list__item__shortlist-[% IF problem.shortlisted_user %]take[% ELSE %]add[% END %]" + [%~ END ~%] + > + [%~ END %] +[% END %] + +[% IF shortlist %] + [% item_extra_class = "item-list__item--indented item-list__item--act-and-sort" %] + [% item_action = BLOCK %] + [% item_action %] + <input type="submit" name="shortlist-up" value="[% loc('Up one') %]" title="[% loc('Up one') %]" class="item-list__item__shortlist-up" [% IF loop.first %]disabled[% END %]> + <input type="submit" name="shortlist-down" value="[% loc('Down one') %]" title="[% loc('Down one') %]" class="item-list__item__shortlist-down" [% IF loop.last %]disabled[% END %]> + [% END %] +[% END %] + <li class="item-list__item item-list--reports__item [% item_extra_class %]" data-report-id="[% problem.id | html %]" data-lastupdate="[% problem.lastupdate %]"> <a href="[% c.cobrand.base_url_for_report( problem ) %][% problem.url %]"> @@ -13,6 +37,13 @@ <div class="item-list__description">[% problem.detail | html %]</div> [% END %] <small> + [% IF NOT no_fixed AND problem.is_fixed %] + <span class="item-list__item__state">[% loc('Fixed') %]</span> + [% ELSIF NOT no_fixed AND problem.is_closed %] + <span class="item-list__item__state">[% loc('Closed') %]</span> + [% ELSIF problem.response_priority AND (c.user.has_permission_to('report_edit_priority', problem.bodies_str_ids) OR c.user.has_permission_to('report_inspect', problem.bodies_str_ids)) %] + <span class="item-list__item__state">[% problem.response_priority.name %]</span> + [% END %] [%- IF c.cobrand.moniker != 'fixamingata' %] [%# Default: %] [%- prettify_dt( problem.confirmed, 1 ) %] [%- ELSE %] [%# Swedish cobrand fixamingata: %] @@ -29,11 +60,6 @@ [% ELSIF problem.bodies_str_ids.size == 0 %] [% loc('(not sent to council)') %] [% END %] [% END %] - [% IF NOT no_fixed AND problem.is_fixed %] - [% loc('(fixed)') %] - [% ELSIF NOT no_fixed AND problem.is_closed %] - [% loc('(closed)') %] - [% END %] </small> [% IF c.user.has_permission_to('report_inspect', problem.bodies_str_ids) %] @@ -85,4 +111,13 @@ </a> +[% IF item_action AND page != 'around' %] + <form method="post" action="/my/planned/change"> + <input type="hidden" name="id" value="[% problem.id %]"> + <input type="hidden" name="token" value="[% csrf_token %]"> + [% item_action %] + </form> +[% ELSIF item_action ~%] + [% item_action.replace('("shortlist-[^"]*)', '$1-' _ problem.id) %] +[% END ~%] </li> diff --git a/templates/web/base/report/_main.html b/templates/web/base/report/_main.html index d5224f23e..9431ef2ce 100644 --- a/templates/web/base/report/_main.html +++ b/templates/web/base/report/_main.html @@ -11,7 +11,7 @@ <form method="post" action="/my/planned/change" id="planned_form" class="hidden-label-target"> <input type="hidden" name="id" value="[% problem.id %]"> <input type="hidden" name="token" value="[% csrf_token %]"> - <input type="hidden" name="change" value="[% IF c.user.is_planned_report(problem) %]remove[% ELSE %]add[% END %]"> + <input type="hidden" name="[% IF c.user.is_planned_report(problem) %]shortlist-remove[% ELSE %]shortlist-add[% END %]" value="1"> <p><input type="submit" id="shortlist-report" @@ -19,12 +19,16 @@ data-label-add="[% loc('Add to shortlist') %]" data-value-remove="[% loc('Shortlisted') %]" data-value-add="[% loc('Shortlist') %]" + data-class-remove="btn--shortlisted" + data-class-add="btn--shortlist" [%~ IF c.user.is_planned_report(problem) ~%] value="[% loc('Shortlisted') %]" aria-label="[% loc('Remove from shortlist') %]" + class="btn--shortlisted" [%~ ELSE ~%] value="[% loc('Shortlist') %]" aria-label="[% loc('Add to shortlist') %]" + class="btn--shortlist" [%~ END ~%] ></p> </form> @@ -127,9 +131,9 @@ [% END %] [% IF c.user.has_permission_to('planned_reports', problem.bodies_str_ids) %] [%~ IF c.user.is_planned_report(problem) ~%] - <label class="btn" for="shortlist-report" role="menuitem" aria-label="[% loc('Remove from shortlist') %]">[% loc('Shortlisted') %]</label> + <label class="btn btn--shortlisted" for="shortlist-report" role="menuitem" aria-label="[% loc('Remove from shortlist') %]">[% loc('Shortlisted') %]</label> [%~ ELSE ~%] - <label class="btn" for="shortlist-report" role="menuitem" aria-label="[% loc('Add to shortlist') %]">[% loc('Shortlist') %]</label> + <label class="btn btn--shortlist" for="shortlist-report" role="menuitem" aria-label="[% loc('Add to shortlist') %]">[% loc('Shortlist') %]</label> [%~ END ~%] [% END %] </div> diff --git a/templates/web/base/report/updates.html b/templates/web/base/report/updates.html index ff48ecbca..75e94b1d5 100644 --- a/templates/web/base/report/updates.html +++ b/templates/web/base/report/updates.html @@ -11,54 +11,6 @@ [% RETURN %] [% END %] - [% IF update.anonymous || update.name == '' %] - [% tprintf( loc( 'Posted anonymously at %s' ), prettify_dt( update.confirmed ) ) -%] - [%- ELSIF update.user.from_body; - user_name = update.user.name | html; - body = update.user.body; - IF body == 'Bromley Council'; - body = "$body <img src='/cobrands/bromley/favicon.png' alt=''>"; - END %] - [% tprintf( loc( 'Posted by %s (<strong>%s</strong>) at %s' ), user_name, body, prettify_dt( update.confirmed ) ) -%] - [%- ELSE %] - [% tprintf( loc( 'Posted by %s at %s' ), update.name, prettify_dt( update.confirmed ) ) | html -%] - [%- END -%] + [% update.meta_line(c) %] - [%- update_state = '' %] - [%- IF update.mark_fixed %][% update_state = loc( 'marked as fixed' ) %][% END %] - [%- IF update.mark_open %][% update_state = loc( 'reopened' ) %][% END %] - [%- IF !update_state && update.problem_state %] - [%- state = update.problem_state_display %] - [%- IF c.cobrand.moniker == 'bromley' OR problem.bodies_str == '2482' %] - [%- SET update_state = 'marked as no further action' IF state == 'unable to fix' %] - [%- SET update_state = 'marked as third party responsibility' IF state == 'not responsible' %] - [%- END %] - [%- END %] - [%- IF !update_state && update.problem_state %] - [%- IF state == 'confirmed' AND global.last_state != '' %] - [%- update_state = loc( 'reopened' ) %] - [%- ELSIF state == 'investigating' %] - [%- update_state = loc( 'marked as investigating' ) %] - [%- ELSIF state == 'planned' %] - [%- update_state = loc( 'marked as planned' ) %] - [%- ELSIF state == 'in progress' %] - [%- update_state = loc( 'marked as in progress' ) %] - [%- ELSIF state == 'action scheduled' %] - [%- update_state = loc( 'marked as action scheduled' ) %] - [%- ELSIF state == 'closed' %] - [%- update_state = loc( 'marked as closed' ) %] - [%- ELSIF state == 'fixed' %] - [%- update_state = loc( 'marked as fixed' ) %] - [%- ELSIF state == 'unable to fix' %] - [%- update_state = loc( 'marked as unable to fix' ) %] - [%- ELSIF state == 'not responsible' %] - [%- update_state = loc( "marked as not the council's responsibility" ) %] - [%- ELSIF state == 'duplicate' %] - [%- update_state = loc( 'closed as a duplicate report' ) %] - [%- ELSIF state == 'internal referral' %] - [%- update_state = loc( 'marked as an internal referral' ) %] - [%- END %] - [%- END %] - [%- ", " _ update_state IF update_state != global.last_state %] - [%- global.last_state = update_state %] [% END %] diff --git a/templates/web/base/reports/_list-filters.html b/templates/web/base/reports/_list-filters.html index 9c2a74e57..05fe6123b 100644 --- a/templates/web/base/reports/_list-filters.html +++ b/templates/web/base/reports/_list-filters.html @@ -32,6 +32,9 @@ <p class="report-list-filters"> <label for="sort">[% loc('Sort by') %]</label> <select class="form-control" name="sort" id="sort"> + [% IF shortlist %] + <option value="shortlist"[% ' selected' IF sort_key == 'shortlist' %]>[% loc('Manual order') %]</option> + [% END %] <option value="created-desc"[% ' selected' IF sort_key == 'created-desc' %]>[% loc('Newest') %]</option> <option value="created-asc"[% ' selected' IF sort_key == 'created-asc' %]>[% loc('Oldest') %]</option> <option value="updated-desc"[% ' selected' IF sort_key == 'updated-desc' %]>[% loc('Recently updated') %]</option> diff --git a/templates/web/fixmystreet.com/reports/_extras.html b/templates/web/fixmystreet.com/reports/_extras.html index 6fa067d1c..824fec3ec 100755 --- a/templates/web/fixmystreet.com/reports/_extras.html +++ b/templates/web/fixmystreet.com/reports/_extras.html @@ -4,7 +4,6 @@ 'Bromley Council' = 'fix.bromley.gov.uk' 'Bristol City Council' = 'fixmystreet.bristol.gov.uk' 'East Hertfordshire District Council' = 'fixmystreet.eastherts.gov.uk' - 'Harrogate Borough Council' = 'harrogate.fixmystreet.com' 'Hart District Council' = 'hart.fixmystreet.com' 'Oxfordshire County Council' = 'fixmystreet.oxfordshire.gov.uk' 'Stevenage Borough Council' = 'stevenage.fixmystreet.com', |