aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Cobrand/Bromley.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2012-05-03 16:34:20 +0100
committerMatthew Somerville <matthew@mysociety.org>2012-05-03 16:34:20 +0100
commit8970f0be054db825992b0129dd684232dc7b1c5e (patch)
tree15ca0aecb6a16393c53a2926e3920132e62fb835 /perllib/FixMyStreet/Cobrand/Bromley.pm
parent015b5c6a1963a237cb27fab0437b62faabcb474e (diff)
Include new design banner text function.
Diffstat (limited to 'perllib/FixMyStreet/Cobrand/Bromley.pm')
-rw-r--r--perllib/FixMyStreet/Cobrand/Bromley.pm27
1 files changed, 27 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Bromley.pm b/perllib/FixMyStreet/Cobrand/Bromley.pm
index 66dc63606..5bc292306 100644
--- a/perllib/FixMyStreet/Cobrand/Bromley.pm
+++ b/perllib/FixMyStreet/Cobrand/Bromley.pm
@@ -52,6 +52,33 @@ sub pin_colour {
return 'yellow';
}
+# Copy of function from FixMyStreet.pm cobrand as it's not inherited currently
+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;
+}
+
sub process_extras {
my $self = shift;
my $ctx = shift;