diff options
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Admin.pm | 3 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Default.pm | 12 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/FiksGataMi.pm | 8 |
3 files changed, 21 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm index b9ee90dcb..99a7a962b 100644 --- a/perllib/FixMyStreet/App/Controller/Admin.pm +++ b/perllib/FixMyStreet/App/Controller/Admin.pm @@ -167,8 +167,7 @@ sub council_list : Path('council_list') : Args(0) { my $areas = mySociety::MaPit::call('areas', \@area_types); my @councils_ids = sort { strcoll($areas->{$a}->{name}, $areas->{$b}->{name}) } keys %$areas; - # this is for norway only - put in cobrand - @councils_ids = grep { $_ ne 301 } @councils_ids; + @councils_ids = $c->cobrand->filter_all_council_ids_list( @councils_ids ); my $contacts = $c->model('DB::Contact')->search( undef, diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm index c20dbf6a3..022aff833 100644 --- a/perllib/FixMyStreet/Cobrand/Default.pm +++ b/perllib/FixMyStreet/Cobrand/Default.pm @@ -640,6 +640,18 @@ sub remove_redundant_councils { if $all_councils->{2391}; } +=item filter_all_council_ids_list + +Removes any council IDs that we don't need from an array and returns the +filtered array + +=cut + +sub filter_all_council_ids_list { + my $self = shift; + return @_; +} + =item short_name Remove extra information from council names for tidy URIs diff --git a/perllib/FixMyStreet/Cobrand/FiksGataMi.pm b/perllib/FixMyStreet/Cobrand/FiksGataMi.pm index 448f2e2a6..267be6958 100644 --- a/perllib/FixMyStreet/Cobrand/FiksGataMi.pm +++ b/perllib/FixMyStreet/Cobrand/FiksGataMi.pm @@ -70,6 +70,14 @@ sub remove_redundant_councils { if $all_councils->{3}; } +sub filter_all_council_ids_list { + my $self = shift; + my @all_councils_ids = @_; + + # as above we only want to show Oslo once + return grep { $_ != 301 } @all_councils_ids; +} + sub short_name { my $self = shift; my ($area, $info) = @_; |