[% IF updates.size %] [%# We assume internal notes are lowest priority, and thus displayed last. All other updates (eg: "I've done this work, here's what you should tell the citizen") are displayed first. %] [% internal_updates=[]; sdm_notes=[]; FOREACH update IN updates; IF NOT update.extra.is_external_message; IF update.extra.is_internal_note; internal_updates.unshift(update); ELSE; sdm_notes.unshift(update); END; END; END %] [% IF sdm_notes.size %]

[% loc('Notes from SDM to DM') %]

[% FOREACH update IN sdm_notes -%]

[% update.text | html %]

[% update.user.name || update.user.email %] · [% PROCESS format_date this_date=update.created %] [% update.created.hms %]

[% END -%] [% END %] [% IF internal_updates.size %]

[% loc('Internal notes') %]

[% FOREACH update IN internal_updates -%]

[% update.text | html %]

[% update.user.name || update.user.email %] · [% PROCESS format_date this_date=update.created %] [% update.created.hms %]

[% END -%] [% END %] [% END %]