From 702d1078e4ac633e785d3bb605950d2004436143 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 | 9 +-------- templates/web/base/report/updates.html | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/templates/web/base/report/_update_state.html b/templates/web/base/report/_update_state.html index d484dcb0514..7f78dc55033 100644 --- a/templates/web/base/report/_update_state.html +++ b/templates/web/base/report/_update_state.html @@ -1,13 +1,6 @@ [% # 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..03a398860a7 100644 --- a/templates/web/base/report/updates.html +++ b/templates/web/base/report/updates.html @@ -9,6 +9,20 @@ [%- 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 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 %]