aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2020-01-08 15:55:36 +0000
committerStruan Donald <struan@exo.org.uk>2020-01-13 14:44:47 +0000
commitcd265e13d70affcff02a22159a5cafe762b08b1a (patch)
treef7ecd5755d39785cd57e9b5f52c3e07eddc03db0
parent1750fb706ff9a88b3d3ddee78333ecb5f8d66cef (diff)
[UK] do not show unknown banner on fms pro sites
In theory these are never unknown so do not display this in report banner.
-rw-r--r--t/app/controller/report_display.t42
-rw-r--r--templates/web/fixmystreet-uk-councils/report/banner.html22
-rw-r--r--templates/web/fixmystreet.com/report/banner.html2
3 files changed, 64 insertions, 2 deletions
diff --git a/t/app/controller/report_display.t b/t/app/controller/report_display.t
index ddd69f18c..fbb9d7b75 100644
--- a/t/app/controller/report_display.t
+++ b/t/app/controller/report_display.t
@@ -255,6 +255,39 @@ for my $test (
fixed => 0
},
{
+ cobrand => 'fixmystreet',
+ description => 'old open311 report',
+ date => DateTime->new(
+ year => 2009,
+ month => 6,
+ day => 12,
+ hour => 9,
+ minute => 43,
+ second => 12
+ ),
+ state => 'confirmed',
+ send_method => 'Open311',
+ banner_id => undef,
+ banner_text => undef,
+ fixed => 0
+ },
+ {
+ cobrand => 'westminster',
+ description => 'old westminster report',
+ date => DateTime->new(
+ year => 2009,
+ month => 6,
+ day => 12,
+ hour => 9,
+ minute => 43,
+ second => 12
+ ),
+ state => 'confirmed',
+ banner_id => undef,
+ banner_text => undef,
+ fixed => 0
+ },
+ {
description => 'old fixed report',
date => DateTime->new(
year => 2009,
@@ -370,9 +403,16 @@ for my $test (
$report->confirmed( $test->{date}->ymd . ' ' . $test->{date}->hms );
$report->lastupdate( $test->{date}->ymd . ' ' . $test->{date}->hms );
$report->state( $test->{state} );
+ $report->send_method_used( $test->{send_method} || undef );
$report->update;
- $mech->get_ok("/report/$report_id");
+ my $cobrands = $test->{cobrand} ? [ $test->{cobrand} ] : [];
+ FixMyStreet::override_config {
+ ALLOWED_COBRANDS => $cobrands,
+ MAPIT_URL => 'http://mapit.uk/',
+ }, sub {
+ $mech->get_ok("/report/$report_id");
+ };
is $mech->uri->path, "/report/$report_id", "at /report/$report_id";
my $banner = $mech->extract_problem_banner;
if ( $banner->{text} ) {
diff --git a/templates/web/fixmystreet-uk-councils/report/banner.html b/templates/web/fixmystreet-uk-councils/report/banner.html
new file mode 100644
index 000000000..6c917e7ac
--- /dev/null
+++ b/templates/web/fixmystreet-uk-councils/report/banner.html
@@ -0,0 +1,22 @@
+[% USE date %]
+
+[% BLOCK banner %]
+ <div class="banner banner--[% id %]">
+ <p>
+ <img src="[% c.cobrand.path_to_pin_icons _ 'pin-' _ c.cobrand.pin_colour(problem, 'report') _ '.png' %]" alt="" class="pin">
+ [% text %]
+ </p>
+ </div>
+[% END %]
+
+[% IF problem.is_fixed %]
+ [% INCLUDE banner, id = 'fixed', text = loc('Fixed') %]
+[% END %]
+
+[% IF problem.is_closed %]
+ [% INCLUDE banner, id = 'closed', text = loc('Closed') %]
+[% END %]
+
+[% IF problem.is_in_progress %]
+ [% INCLUDE banner, id = 'progress', text = loc('In progress') %]
+[% END %]
diff --git a/templates/web/fixmystreet.com/report/banner.html b/templates/web/fixmystreet.com/report/banner.html
index 8f6ea19c1..620a09c39 100644
--- a/templates/web/fixmystreet.com/report/banner.html
+++ b/templates/web/fixmystreet.com/report/banner.html
@@ -19,7 +19,7 @@
[% IF NOT problem.to_body_named('Bromley') %]
- [% IF problem.is_open AND date.now - problem.lastupdate.epoch > 8 * 7 * 24 * 60 * 60 %]
+ [% IF problem.send_method_used != 'Open311' AND problem.is_open AND date.now - problem.lastupdate.epoch > 8 * 7 * 24 * 60 * 60 %]
[% INCLUDE banner, id = 'unknown', text = loc('Unknown') %]
[% ELSIF problem.is_in_progress %]
[% INCLUDE banner, id = 'progress', text = loc('In progress') %]