aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Cobrand/Greenwich.pm
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2015-03-31 16:35:28 +0100
committerDave Arter <davea@mysociety.org>2015-06-30 11:00:55 +0100
commitdcea8fdb0fd098cc179e7495842f599bd4a9d316 (patch)
treef7337d57e58f51a23335c09602eb744e977e0da4 /perllib/FixMyStreet/Cobrand/Greenwich.pm
parentb2c41d9b9ac0444565cdc8b6dbbaeedf759185ba (diff)
[Greenwich] Royal Borough of Greenwich front end
Diffstat (limited to 'perllib/FixMyStreet/Cobrand/Greenwich.pm')
-rw-r--r--perllib/FixMyStreet/Cobrand/Greenwich.pm47
1 files changed, 47 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Greenwich.pm b/perllib/FixMyStreet/Cobrand/Greenwich.pm
new file mode 100644
index 000000000..96baf021e
--- /dev/null
+++ b/perllib/FixMyStreet/Cobrand/Greenwich.pm
@@ -0,0 +1,47 @@
+package FixMyStreet::Cobrand::Greenwich;
+use parent 'FixMyStreet::Cobrand::UKCouncils';
+
+use strict;
+use warnings;
+
+sub council_id { return 2493; }
+sub council_area { return 'Greenwich'; }
+sub council_name { return 'Greenwich Borough Council'; }
+sub council_url { return 'greenwich'; }
+
+sub example_places {
+ return ( 'SE18 6HQ', "Woolwich Road" );
+}
+
+sub enter_postcode_text {
+ my ($self) = @_;
+ return 'Enter a Royal Greenwich postcode, or street name and area';
+}
+
+sub disambiguate_location {
+ my $self = shift;
+ my $string = shift;
+
+ my $town = 'Greenwich';
+
+ # as it's the requested example location, try to avoid a disambiguation page
+ $town .= ', SE10 0EF' if $string =~ /^\s*woolwich\s+r(?:oa)?d\s*(?:,\s*green\w+\s*)?$/i;
+
+ return {
+ %{ $self->SUPER::disambiguate_location() },
+ town => $town,
+ centre => '51.4743770385684,0.0555696523982184',
+ span => '0.089851200483885,0.150572372434415',
+ bounds => [ 51.423679096602, -0.0263872255863898, 51.5135302970859, 0.124185146848025 ],
+ };
+}
+
+sub pin_colour {
+ my ( $self, $p, $context ) = @_;
+ return 'grey' if $p->state eq 'not responsible';
+ return 'green' if $p->is_fixed || $p->is_closed;
+ return 'red' if $p->state eq 'confirmed';
+ return 'yellow';
+}
+
+1;