aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r--perllib/FixMyStreet/App/Controller/Report.pm2
-rw-r--r--perllib/FixMyStreet/Cobrand/Default.pm19
2 files changed, 21 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report.pm b/perllib/FixMyStreet/App/Controller/Report.pm
index 805d2da75..bbfa2c4e2 100644
--- a/perllib/FixMyStreet/App/Controller/Report.pm
+++ b/perllib/FixMyStreet/App/Controller/Report.pm
@@ -79,6 +79,8 @@ sub display : Path('') : Args(1) {
# . "\@$short_lat,$short_lon\">View on Google Maps</a></p>"
# if mySociety::Config::get('COUNTRY') eq 'GB';
+ $c->stash->{banner} = $c->cobrand->generate_problem_banner($c->stash->{problem});
+
# my $banner;
# if ($q->{site} ne 'emptyhomes' && $problem->{state} eq 'confirmed' && $problem->{duration} > 8*7*24*60*60) {
# $banner = $q->p({id => 'unknown'}, _('This problem is old and of unknown status.'));
diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm
index 7d7413405..f667fc15b 100644
--- a/perllib/FixMyStreet/Cobrand/Default.pm
+++ b/perllib/FixMyStreet/Cobrand/Default.pm
@@ -768,5 +768,24 @@ sub council_rss_alert_options {
return ( \@options, @reported_to_options ? \@reported_to_options : undef );
}
+=head2 generate_problem_banner
+
+=cut
+
+sub generate_problem_banner {
+ my ( $self, $problem ) = @_;
+
+ my $banner = {};
+ if ($problem->state eq 'confirmed' && $problem->get_column('time') > 8*7*24*60*60) {
+ $banner->{id} = 'unknown';
+ $banner->{text} = _('This problem is old and of unknown status.');
+ }
+ if ($problem->state eq 'fixed') {
+ $banner->{id} = 'fixed';
+ $banner->{text} = _('This problem has been fixed') . '.';
+ }
+
+ return $banner;
+}
1;