diff options
author | Struan Donald <struan@exo.org.uk> | 2011-05-09 13:12:02 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2011-05-09 13:12:02 +0100 |
commit | d3db27275ccecfe196fc9036f03288a3e5d675e3 (patch) | |
tree | d13d6de6905e5c5de23f52e9a50d02954871f22d /perllib/FixMyStreet/Cobrand/FiksGataMi.pm | |
parent | 717a87caaeab4d76f30359360be9c620edab0abb (diff) |
moved short_name to cobrands
Diffstat (limited to 'perllib/FixMyStreet/Cobrand/FiksGataMi.pm')
-rw-r--r-- | perllib/FixMyStreet/Cobrand/FiksGataMi.pm | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand/FiksGataMi.pm b/perllib/FixMyStreet/Cobrand/FiksGataMi.pm index d733ba8f0..3981192c8 100644 --- a/perllib/FixMyStreet/Cobrand/FiksGataMi.pm +++ b/perllib/FixMyStreet/Cobrand/FiksGataMi.pm @@ -60,4 +60,21 @@ sub remove_redundant_councils { if $all_councils->{3}; } +sub short_name { + my $self = shift; + my ($area, $info) = @_; + + if ($area->{name} =~ /^(Os|Nes|V\xe5ler|Sande|B\xf8|Her\xf8y)$/) { + my $parent = $info->{$area->{parent_area}}->{name}; + return URI::Escape::uri_escape_utf8("$area->{name}, $parent"); + } + + my $name = $area->{name}; + $name =~ s/ & / and /; + $name = URI::Escape::uri_escape_utf8($name); + $name =~ s/%20/+/g; + return $name; + +} + 1; |