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 18, 2024
1 parent 11cc647 commit c02aed2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
8 changes: 1 addition & 7 deletions templates/web/base/report/_update_state.html
Original file line number Diff line number Diff line change
@@ -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 %]
<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
21 changes: 14 additions & 7 deletions templates/web/base/report/updates.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 %]
Expand Down

0 comments on commit c02aed2

Please sign in to comment.