From 3db4f64cfcc0dc75204b4faaa0aa4a5c0725229e Mon Sep 17 00:00:00 2001 From: Dave Arter Date: Fri, 27 Apr 2018 15:55:00 +0100 Subject: [Buckinghamshire] Display problem category in lists & email subject Fixes mysociety/FixMyStreet-Commercial#1024. --- templates/email/buckinghamshire/other-reported.txt | 29 +++++ templates/web/buckinghamshire/report/_item.html | 139 +++++++++++++++++++++ 2 files changed, 168 insertions(+) create mode 100644 templates/email/buckinghamshire/other-reported.txt create mode 100644 templates/web/buckinghamshire/report/_item.html (limited to 'templates') diff --git a/templates/email/buckinghamshire/other-reported.txt b/templates/email/buckinghamshire/other-reported.txt new file mode 100644 index 000000000..8f5a3654f --- /dev/null +++ b/templates/email/buckinghamshire/other-reported.txt @@ -0,0 +1,29 @@ +Subject: Your [% report.category | lower %] report has been logged + +Hello [% report.name %], + +Your report to [% report.body %] has been logged on [% site_name %]. + +[% IF c.cobrand.is_council && !c.cobrand.owns_problem( report ) %] +Please note that [% c.cobrand.council_name %] is not responsible for this type +of report, so it will instead be sent to [% report.body %]. +[% ELSE %] +[% TRY %][% INCLUDE '_council_reference.txt' problem=report %][% CATCH file %][% END %] +[% END %] + +It is available to view at: + +[% cobrand.base_url_for_report(report) %][% report.url %] + +Your report is at the following location: + +[% report.title %] + +And details: + +[% report.detail %] + +[% INCLUDE 'signature.txt' %] + +This email was sent automatically, from an unmonitored email account - so +please do not reply to it. diff --git a/templates/web/buckinghamshire/report/_item.html b/templates/web/buckinghamshire/report/_item.html new file mode 100644 index 000000000..b87363a6a --- /dev/null +++ b/templates/web/buckinghamshire/report/_item.html @@ -0,0 +1,139 @@ +[% IF NOT report_blocks_included ~%] +[% PROCESS 'admin/report_blocks.html' ~%] +[% END ~%] + +[% IF c.user.has_permission_to('planned_reports', problem.bodies_str_ids) OR c.user.is_planned_report(problem) ~%] + [% item_extra_class = "item-list__item--indented" ~%] + [% item_action = BLOCK ~%] + + [%~ END %] +[% END %] + +[% IF shortlist %] + [% item_extra_class = "item-list__item--indented item-list__item--act-and-sort" %] + [% item_action = BLOCK %] + [% item_action %] + + + [% END %] +[% END %] + +
  • + + [% IF problem.photo %] + + [% END %] +

    [% problem.category | html %]: [% problem.title | html %]

    + [% IF c.user.has_permission_to('report_inspect', problem.bodies_str_ids) %] +
    [% problem.detail | html %]
    + [% END %] + + [% IF NOT no_fixed AND problem.is_fixed %] + [% prettify_state('fixed') %] + [% ELSIF NOT no_fixed AND problem.is_closed %] + [% prettify_state('closed') %] + [% ELSIF (c.user.has_permission_to('report_edit_priority', problem.bodies_str_ids) OR c.user.has_permission_to('report_inspect', problem.bodies_str_ids)) AND problem.response_priority %] + [% problem.response_priority.name %] + [% END %] + [%- IF c.cobrand.moniker != 'fixamingata' %] [%# Default: %] + [%- IF problem.days_ago > 0 AND problem.days_ago <= c.cobrand.display_days_ago_threshold %] + [% tprintf( nget('Reported %d day ago', 'Reported %d days ago', problem.days_ago), problem.days_ago ) %] + [%- ELSE %] + [% prettify_dt( problem.confirmed, 1 ) %] + [%- END %] + [%- ELSE %] [%# Swedish cobrand fixamingata: %] + [%- prettify_dt( problem.confirmed) %] + [%- END %] + [%- IF dist %], [% dist %]km[% END %] + [%- IF problem.confirmed != problem.lastupdate AND problem.whensent != problem.lastupdate %], + [%- IF problem.days_ago('lastupdate') > 0 AND problem.days_ago('lastupdate') <= c.cobrand.display_days_ago_threshold %] + [% tprintf( nget('last updated %d day ago', 'last updated %d days ago', problem.days_ago('lastupdate') ), problem.days_ago('lastupdate') ) %] + [%- ELSE %] + [% tprintf(loc('last updated %s'), prettify_dt( problem.lastupdate, 1 ) ) %] + [%- END %] + [%- END %] + [% IF include_sentinfo %] + [% IF c.cobrand.is_council && !c.cobrand.owns_problem( problem ) %] + (sent to [% problem.body %]) + [% ELSIF problem.bodies_str_ids.size > 2 %] [% loc('(sent to all)') %] + [% ELSIF problem.bodies_str_ids.size == 2 %] [% loc('(sent to both)') %] + [% ELSIF problem.bodies_str_ids.size == 0 %] [% loc('(not sent to council)') %] + [% END %] + [% END %] + + + [% IF c.user.has_permission_to('report_inspect', problem.bodies_str_ids) %] + + [% END %] + + +
    +[% IF item_action ~%] + [% IF page == 'report' ~%] + [%# We don't want to output shortlist on report page (in duplicate list) %] + [% ELSIF page == 'around' ~%] + [%# The around page list is already contained within the new report form %] + [% item_action.replace('("shortlist-[^"]*)', '$1-' _ problem.id) %] + [% ELSE ~%] +
    + + + [% item_action %] +
    + [% END ~%] +[% END %] +
  • -- cgit v1.2.3