aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Cobrand/FixMyStreet.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/Cobrand/FixMyStreet.pm')
-rw-r--r--perllib/FixMyStreet/Cobrand/FixMyStreet.pm26
1 files changed, 26 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand/FixMyStreet.pm b/perllib/FixMyStreet/Cobrand/FixMyStreet.pm
index 9958e6215..80d57400d 100644
--- a/perllib/FixMyStreet/Cobrand/FixMyStreet.pm
+++ b/perllib/FixMyStreet/Cobrand/FixMyStreet.pm
@@ -19,5 +19,31 @@ sub get_council_sender {
return 'Email';
}
+sub generate_problem_banner {
+ my ( $self, $problem ) = @_;
+
+ my $banner = {};
+ if ( $problem->is_open && time() - $problem->lastupdate_local->epoch > 8 * 7 * 24 * 60 * 60 )
+ {
+ $banner->{id} = 'unknown';
+ $banner->{text} = _('Unknown');
+ }
+ if ($problem->is_fixed) {
+ $banner->{id} = 'fixed';
+ $banner->{text} = _('Fixed');
+ }
+ if ($problem->is_closed) {
+ $banner->{id} = 'closed';
+ $banner->{text} = _('Closed');
+ }
+
+ if ( grep { $problem->state eq $_ } ( 'investigating', 'in progress', 'planned' ) ) {
+ $banner->{id} = 'progress';
+ $banner->{text} = _('In progress');
+ }
+
+ return $banner;
+}
+
1;