diff options
author | Struan Donald <struan@exo.org.uk> | 2018-01-04 16:24:23 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2018-05-09 12:57:58 +0100 |
commit | 2012321cda35654d33708e60404d33742b48ead1 (patch) | |
tree | 5a45f03557e4e4c8b28a57fec20e188591686828 | |
parent | 22f0fed0b1ce6e7effac37e025bd55dc6043a838 (diff) |
Add partial template for update state.
-rw-r--r-- | templates/web/base/report/_update_state.html | 24 | ||||
-rw-r--r-- | templates/web/base/report/update.html | 24 |
2 files changed, 25 insertions, 23 deletions
diff --git a/templates/web/base/report/_update_state.html b/templates/web/base/report/_update_state.html new file mode 100644 index 000000000..0274d7695 --- /dev/null +++ b/templates/web/base/report/_update_state.html @@ -0,0 +1,24 @@ +[% # Small chance of duplicates in the case of fixed - user followed by fixed - council %] +[% SET update_state = update.problem_state %] +[% IF ( update_state AND update_state != global.last_state AND NOT (global.last_state == "" AND update.problem_state == 'confirmed') ) + OR update.mark_fixed + OR update.mark_open +%] + <p class="meta-2">[% loc('State changed to:') %] [% update.problem_state_display(c) %]</p> + [%- global.last_state = update_state %] + [%- IF update_state == "" AND update.mark_fixed %][% global.last_state = 'fixed - user' %][% END %] + [%- IF update_state == "" AND update.mark_open %][% global.last_state = 'confirmed' %][% END %] +[% END %] + +<p class="meta-2"> + [% INCLUDE meta_line %] + [% IF c.user_exists AND c.user.id == update.user_id AND !update.anonymous %] + <small>(<a href="/my/anonymize?update=[% update.id | uri %]" class="js-hide-name">[% loc('Hide your name?') %]</a>)</small> + [% END %] + [% mlog = update.latest_moderation_log_entry(); IF mlog %] + <br />[% tprintf(loc('Moderated by %s at %s'), mlog.admin_user, prettify_dt(mlog.whenedited)) %] + [% END %] + [% IF update.get_extra_metadata('open_from_questionnaire') %] + <br />[% loc('Still open, via questionnaire') %] + [% END %] +</p> diff --git a/templates/web/base/report/update.html b/templates/web/base/report/update.html index 4dd12cf5e..de8699802 100644 --- a/templates/web/base/report/update.html +++ b/templates/web/base/report/update.html @@ -41,29 +41,7 @@ </div> [% END %] - [% # Small chance of duplicates in the case of fixed - user followed by fixed - council %] - [% SET update_state = update.problem_state %] - [% IF ( update_state AND update_state != global.last_state AND NOT (global.last_state == "" AND update.problem_state == 'confirmed') ) OR - update.mark_fixed OR update.mark_open - %] - <p class="meta-2">[% loc('State changed to:') %] [% update.problem_state_display(c) %]</p> - [%- global.last_state = update_state %] - [%- IF update_state == "" AND update.mark_fixed %][% global.last_state = 'fixed - user' %][% END %] - [%- IF update_state == "" AND update.mark_open %][% global.last_state = 'confirmed' %][% END %] - [% END %] - - <p class="meta-2"> - [% INCLUDE meta_line %] - [% IF c.user_exists AND c.user.id == update.user_id AND !update.anonymous %] - <small>(<a href="/my/anonymize?update=[% update.id | uri %]" class="js-hide-name">[% loc('Hide your name?') %]</a>)</small> - [% END %] - [% mlog = update.latest_moderation_log_entry(); IF mlog %] - <br />[% tprintf(loc('Moderated by %s at %s'), mlog.admin_user, prettify_dt(mlog.whenedited)) %] - [% END %] - [% IF update.get_extra_metadata('open_from_questionnaire') %] - <br />[% loc('Still open, via questionnaire') %] - [% END %] - </p> + [% INCLUDE 'report/_update_state.html' %] </div> [% END %] </div> |