[% global.last_state = '' %]
[% FOREACH update IN updates %]
[% INCLUDE 'report/update.html' %]
[% END %]
[% BLOCK meta_line %]
[% IF update.whenanswered %]
[%# A questionnaire update, currently saying report is still open %]
[% tprintf( loc( 'Still open, via questionnaire, %s' ), prettify_dt( update.whenanswered ) ) %]
[% RETURN %]
[% END %]
[% IF update.anonymous || update.name == '' %]
[% tprintf( loc( 'Posted anonymously at %s' ), prettify_dt( update.confirmed ) ) -%]
[%- ELSIF update.user.from_body;
user_name = update.user.name | html;
body = update.user.body;
IF body == 'Bromley Council';
body = "$body
";
END %]
[% tprintf( loc( 'Posted by %s (%s) at %s' ), user_name, body, prettify_dt( update.confirmed ) ) -%]
[%- ELSE %]
[% tprintf( loc( 'Posted by %s at %s' ), update.name, prettify_dt( update.confirmed ) ) | html -%]
[%- END -%]
[%- update_state = '' %]
[%- IF update.mark_fixed %][% update_state = loc( 'marked as fixed' ) %][% END %]
[%- IF update.mark_open %][% update_state = loc( 'reopened' ) %][% END %]
[%- IF !update_state && update.problem_state %]
[%- state = update.problem_state_display %]
[%- IF c.cobrand.moniker == 'bromley' OR problem.bodies_str == '2482' %]
[%- SET update_state = 'marked as no further action' IF state == 'unable to fix' %]
[%- SET update_state = 'marked as third party responsibility' IF state == 'not responsible' %]
[%- END %]
[%- END %]
[%- IF !update_state && update.problem_state %]
[%- IF state == 'confirmed' AND global.last_state != '' %]
[%- update_state = loc( 'reopened' ) %]
[%- ELSIF state == 'investigating' %]
[%- update_state = loc( 'marked as investigating' ) %]
[%- ELSIF state == 'planned' %]
[%- update_state = loc( 'marked as planned' ) %]
[%- ELSIF state == 'in progress' %]
[%- update_state = loc( 'marked as in progress' ) %]
[%- ELSIF state == 'action scheduled' %]
[%- update_state = loc( 'marked as action scheduled' ) %]
[%- ELSIF state == 'closed' %]
[%- update_state = loc( 'marked as closed' ) %]
[%- ELSIF state == 'fixed' %]
[%- update_state = loc( 'marked as fixed' ) %]
[%- ELSIF state == 'unable to fix' %]
[%- update_state = loc( 'marked as unable to fix' ) %]
[%- ELSIF state == 'not responsible' %]
[%- update_state = loc( "marked as not the council's responsibility" ) %]
[%- ELSIF state == 'duplicate' %]
[%- update_state = loc( 'closed as a duplicate report' ) %]
[%- ELSIF state == 'internal referral' %]
[%- update_state = loc( 'marked as an internal referral' ) %]
[%- END %]
[%- END %]
[%- ", " _ update_state IF update_state != global.last_state %]
[%- global.last_state = update_state %]
[% END %]