diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-01-12 15:48:18 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-01-12 15:48:18 +0000 |
commit | a65d8b57f3be2585a5b835e18bb0940170d4b448 (patch) | |
tree | e59a6bca9e16665b98d8d04af49b8bf4db1da9a7 /templates | |
parent | 940bd236650b2bf7208d9b06c33ee30ad94492f6 (diff) | |
parent | 831f0addbac7eb3e6641877c936f90279d1bb186 (diff) |
Merge branch 'listshort'
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/reports/_list-filters.html | 3 |
4 files changed, 52 insertions, 10 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/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> |