Skip to content

Commit

Permalink
Don’t show empty updates in front end.
Browse files Browse the repository at this point in the history
  • Loading branch information
dracos committed Sep 19, 2024
1 parent 11cc647 commit 702d107
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
9 changes: 1 addition & 8 deletions templates/web/base/report/_update_state.html
Original file line number Diff line number Diff line change
@@ -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 %]
<p class="meta-2">[% loc('State changed to:') %] [% update.problem_state_display %]</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">
Expand Down
14 changes: 14 additions & 0 deletions templates/web/base/report/updates.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 %]

Expand Down

0 comments on commit 702d107

Please sign in to comment.