From c02aed2bebd1f5b406e3d1cca23dc7d6a7188435 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Wed, 18 Sep 2024 15:26:55 +0100 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20show=20empty=20updates=20in=20f?= =?UTF-8?q?ront=20end.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/web/base/report/_update_state.html | 8 +------- templates/web/base/report/updates.html | 21 +++++++++++++------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/templates/web/base/report/_update_state.html b/templates/web/base/report/_update_state.html index d484dcb0514..c828a4cc5d1 100644 --- a/templates/web/base/report/_update_state.html +++ b/templates/web/base/report/_update_state.html @@ -1,13 +1,7 @@ [% # Small chance of duplicates in the case of fixed - user followed by fixed - council %] [% SET update_state = update.problem_state_processed %] -[% IF ( update_state AND update_state != global.last_state AND NOT (global.last_state == "" AND update.problem_state_processed == 'confirmed') ) - OR update.mark_fixed - OR update.mark_open -%] +[% IF state_change %]

[% loc('State changed to:') %] [% update.problem_state_display %]

- [%- 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 %]

diff --git a/templates/web/base/report/updates.html b/templates/web/base/report/updates.html index d65f1a28720..fcc152929fa 100644 --- a/templates/web/base/report/updates.html +++ b/templates/web/base/report/updates.html @@ -9,19 +9,26 @@ [%- IF update.get_extra_metadata('triage_report') == 1 AND ( NOT c.user OR ( NOT c.user.from_body AND NOT c.user.is_superuser ) ) %] [%- NEXT %] [%- END %] + +[%- IF NOT update.whenanswered AND NOT update.type == 'moderation' %] + [%- SET update_state = update.problem_state_processed %] + [%- SET state_change = ( update_state AND update_state != global.last_state AND NOT (global.last_state == "" AND update.problem_state_processed == 'confirmed') ) OR update.mark_fixed OR update.mark_open %] + [%- IF NOT update.photo AND NOT update.text AND NOT state_change %] + [%- NEXT %] + [%- END %] + [%- IF state_change %] + [%- 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 %] +[%- END %] + [% INCLUDE 'report/update.html' %] [% END %] [% BLOCK meta_line %] [% IF update.whenanswered %] - [% IF update.marks_fixed %] - [%# A questionnaire update that marked the report fixed %] - [% loc("Questionnaire filled in by problem reporter") %]; - [% loc('State changed to:') %] [% prettify_state('fixed') %], - [% prettify_dt( update.whenanswered ) %] - [% ELSE %] - [%# A questionnaire update, currently saying report is still open %] [% loc('Still open, via questionnaire') %], [% prettify_dt( update.whenanswered ) %] [% END %] [% RETURN %]