diff options
author | Dave Arter <davea@mysociety.org> | 2017-02-01 12:50:22 +0000 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2017-02-08 09:41:14 +0000 |
commit | 804506834e0ef7c1d6d9ab21dece21a18651295f (patch) | |
tree | 7060cd5bf78b716d8b952465963a40fd374b0e18 /perllib/FixMyStreet | |
parent | f68f2bd46607be6cc141034e66af62bd3f64d9dd (diff) |
[Oxfordshire] Allow cobrand-specific traffic management options
Fixes mysociety/fixmystreetforcouncils#159
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Default.pm | 7 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Oxfordshire.pm | 9 | ||||
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Problem.pm | 13 |
3 files changed, 29 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm index 56e365050..1fdbe9de2 100644 --- a/perllib/FixMyStreet/Cobrand/Default.pm +++ b/perllib/FixMyStreet/Cobrand/Default.pm @@ -1188,4 +1188,11 @@ sub category_extra_hidden { return 0; } +sub traffic_management_options { + return [ + _("Yes"), + _("No"), + ]; +} + 1; diff --git a/perllib/FixMyStreet/Cobrand/Oxfordshire.pm b/perllib/FixMyStreet/Cobrand/Oxfordshire.pm index dca208e98..e58c7f36b 100644 --- a/perllib/FixMyStreet/Cobrand/Oxfordshire.pm +++ b/perllib/FixMyStreet/Cobrand/Oxfordshire.pm @@ -121,4 +121,13 @@ sub contact_email { sub admin_user_domain { 'oxfordshire.gov.uk' } +sub traffic_management_options { + return [ + "Signs and Cones", + "Stop and Go Boards", + "High Speed Roads", + ]; +} + + 1; diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm index e42e7110a..0092dd8b5 100644 --- a/perllib/FixMyStreet/DB/Result/Problem.pm +++ b/perllib/FixMyStreet/DB/Result/Problem.pm @@ -1056,4 +1056,17 @@ has duplicates => ( }, ); +has traffic_management_options => ( + is => 'ro', + lazy => 1, + default => sub { + my $self = shift; + my $cobrand = $self->get_cobrand_logged; + if ( $cobrand->can('get_body_handler_for_problem') ) { + $cobrand = $cobrand->get_body_handler_for_problem( $self ); + } + return $cobrand->traffic_management_options; + }, +); + 1; |