aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perllib/FixMyStreet/Cobrand/Hounslow.pm20
-rw-r--r--templates/email/hounslow/other-reported.html31
-rw-r--r--templates/email/hounslow/other-reported.txt29
-rw-r--r--templates/web/hounslow/report/new/councils_text_all.html5
-rw-r--r--templates/web/hounslow/report/new/top_message.html0
-rw-r--r--web/cobrands/hounslow/js.js12
6 files changed, 96 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Hounslow.pm b/perllib/FixMyStreet/Cobrand/Hounslow.pm
index b3cfdedbc..d60b67a88 100644
--- a/perllib/FixMyStreet/Cobrand/Hounslow.pm
+++ b/perllib/FixMyStreet/Cobrand/Hounslow.pm
@@ -6,7 +6,7 @@ use warnings;
sub council_area_id { 2483 }
sub council_area { 'Hounslow' }
-sub council_name { 'Hounslow Borough Council' }
+sub council_name { 'Hounslow Highways' }
sub council_url { 'hounslow' }
sub example_places { ( 'TW3 1SN', "Depot Road" ) }
@@ -47,8 +47,26 @@ sub send_questionnaires { 0 }
sub enable_category_groups { 1 }
+sub categories_restriction {
+ my ($self, $rs) = @_;
+ # Categories covering the Hounslow area have a mixture of Open311 and Email
+ # send methods. Hounslow only want Open311 categories to be visible on their
+ # cobrand, not the email categories from FMS.com. We've set up the
+ # Email categories with a devolved send_method, so can identify Open311
+ # categories as those which have a blank send_method.
+ return $rs->search( { 'me.send_method' => undef, 'body.name' => 'Hounslow Borough Council' } );
+}
+
sub report_sent_confirmation_email { 'external_id' }
+# Used to change the "Sent to" line on report pages
+sub link_to_council_cobrand { "Hounslow Highways" }
+
+# The "all reports" link will default to using council_name, which
+# in our case doesn't correspond to a body and so causes an infinite redirect.
+# Instead, force the borough council name to be used.
+sub all_reports_single_body { { name => "Hounslow Borough Council" } }
+
sub open311_post_send {
my ($self, $row, $h) = @_;
diff --git a/templates/email/hounslow/other-reported.html b/templates/email/hounslow/other-reported.html
new file mode 100644
index 000000000..f715a392c
--- /dev/null
+++ b/templates/email/hounslow/other-reported.html
@@ -0,0 +1,31 @@
+[%
+
+email_summary = "Thanks for logging your report";
+email_columns = 2;
+
+PROCESS '_email_settings.html';
+INCLUDE '_email_top.html';
+
+%]
+
+<th style="[% td_style %][% primary_column_style %]" id="primary_column">
+ [% start_padded_box %]
+ <h1 style="[% h1_style %]">Your report has been&nbsp;logged</h1>
+ <p style="[% p_style %]">Your report to [% cobrand.council_name %] has been logged on [% site_name %].</p>
+[% IF cobrand.is_council && !cobrand.owns_problem( report ) %]
+<p style="[% p_style %]">Please note that [% cobrand.council_name %] is not responsible for this type
+of report, so it will instead be sent to [% report.body %].</p>
+[% ELSE %]
+[% TRY %][% INCLUDE '_council_reference.html' problem=report %][% CATCH file %][% END %]
+[% END %]
+ <p style="margin: 20px auto; text-align: center">
+ <a style="[% button_style %]" href="[% cobrand.base_url_for_report(report) %][% report.url %]">View my report</a>
+ </p>
+ [% end_padded_box %]
+</th>
+[% WRAPPER '_email_sidebar.html' object = report %]
+ <h2 style="[% h2_style %]">[% report.title | html %]</h2>
+ <p style="[% secondary_p_style %]">[% report.detail | html %]</p>
+[% END %]
+
+[% INCLUDE '_email_bottom.html' %]
diff --git a/templates/email/hounslow/other-reported.txt b/templates/email/hounslow/other-reported.txt
new file mode 100644
index 000000000..b976c4edc
--- /dev/null
+++ b/templates/email/hounslow/other-reported.txt
@@ -0,0 +1,29 @@
+Subject: Your report has been logged: [% report.title %]
+
+Hello [% report.name %],
+
+Your report to [% cobrand.council_name %] has been logged on [% site_name %].
+
+[% IF cobrand.is_council && !cobrand.owns_problem( report ) %]
+Please note that [% 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 has the title:
+
+[% report.title %]
+
+And details:
+
+[% report.detail %]
+
+[% signature %]
+
+This email was sent automatically, from an unmonitored email account - so
+please do not reply to it.
diff --git a/templates/web/hounslow/report/new/councils_text_all.html b/templates/web/hounslow/report/new/councils_text_all.html
new file mode 100644
index 000000000..ae2d9191c
--- /dev/null
+++ b/templates/web/hounslow/report/new/councils_text_all.html
@@ -0,0 +1,5 @@
+<p>
+ These will be sent to <strong>Hounslow Highways</strong> and also published
+ online for others to see, in accordance with our
+ <a href="[% c.cobrand.privacy_policy_url %]">privacy policy</a>.
+</p>
diff --git a/templates/web/hounslow/report/new/top_message.html b/templates/web/hounslow/report/new/top_message.html
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/templates/web/hounslow/report/new/top_message.html
diff --git a/web/cobrands/hounslow/js.js b/web/cobrands/hounslow/js.js
index 21bc3b96c..e8772b691 100644
--- a/web/cobrands/hounslow/js.js
+++ b/web/cobrands/hounslow/js.js
@@ -15,4 +15,16 @@ fixmystreet.assets.add($.extend(true, {}, fixmystreet.roadworks.layer_planned, {
body: body
}));
+if (fixmystreet.cobrand == 'hounslow') {
+ // We want the cobranded site to always display "Hounslow Highways"
+ // as the destination for reports in the "Public details" section.
+ // This is OK because the cobranded site only shows categories which
+ // Hounslow Highways actually handle.
+ // Replacing this function with a no-op stops the changes made
+ // to the cobranded councils_text_all.html from being clobbered and
+ // the 'correct' (according to bodies set up within FMS) body names
+ // being shown.
+ fixmystreet.update_public_councils_text = function() {};
+}
+
})();