diff options
author | Matthew Somerville <matthew@mysociety.org> | 2013-06-24 12:41:22 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2013-06-24 12:41:22 +0100 |
commit | 4f0f7fa9f77930996e7891b617523dce4364a6d5 (patch) | |
tree | f7907770cbb1359c4e9864971360b0827176c1e3 | |
parent | 74b8d4347342d3b0c5e27531c8a199f053f032f6 (diff) |
EHA needs slightly different short names.
-rw-r--r-- | perllib/FixMyStreet/Cobrand/EmptyHomes.pm | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand/EmptyHomes.pm b/perllib/FixMyStreet/Cobrand/EmptyHomes.pm index 99aec5ac1..47ea023d9 100644 --- a/perllib/FixMyStreet/Cobrand/EmptyHomes.pm +++ b/perllib/FixMyStreet/Cobrand/EmptyHomes.pm @@ -62,6 +62,20 @@ to be resized then return 0; sub default_photo_resize { return '195x'; } +sub short_name { + my $self = shift; + my ($area) = @_; + + my $name = $area->{name} || $area->name; + $name =~ s/ (Borough|City|District|County) Council$//; + $name =~ s/ Council$//; + $name =~ s/ & / and /; + $name =~ s{/}{_}g; + $name = URI::Escape::uri_escape_utf8($name); + $name =~ s/%20/-/g; + return $name; +} + =item council_rss_alert_options Generate a set of options for council rss alerts. |