diff options
author | Matthew Somerville <matthew@mysociety.org> | 2012-05-18 20:48:20 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2012-07-12 17:18:12 +0100 |
commit | bd6ecb98fd3ad6f1602b0ea5593dea0bd96f8193 (patch) | |
tree | a1cce8ad3698756b4eae47c202d514c963bdf6ae /perllib/FixMyStreet/Cobrand/Default.pm | |
parent | e9aa5cbe89f9e37e9adf4e36e2b3a987ebb9147e (diff) |
Factor code so it's only given in one place.
Diffstat (limited to 'perllib/FixMyStreet/Cobrand/Default.pm')
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Default.pm | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm index 2943c9ac4..5e8c9cb53 100644 --- a/perllib/FixMyStreet/Cobrand/Default.pm +++ b/perllib/FixMyStreet/Cobrand/Default.pm @@ -755,6 +755,13 @@ sub short_name { } +=item is_council + +For UK sub-cobrands, to specify various alternations needed for them. + +=cut +sub is_council { 0; } + =item council_rss_alert_options Generate a set of options for council rss alerts. @@ -787,11 +794,18 @@ sub council_rss_alert_options { $council->{name} = 'London Borough of Bromley' if $council->{name} eq 'Bromley Council'; + my $council_text; + if ( $c->cobrand->is_council ) { + $council_text = 'All problems within the council'; + } else { + $council_text = sprintf( _('Problems within %s'), $council->{name}); + } + push @options, { type => 'council', id => sprintf( 'council:%s:%s', $council->{id}, $council->{id_name} ), - text => sprintf( _('Problems within %s'), $council->{name}), + text => $council_text, rss_text => sprintf( _('RSS feed of problems within %s'), $council->{name}), uri => $c->uri_for( '/rss/reports/' . $council->{short_name} ), }; @@ -803,6 +817,7 @@ sub council_rss_alert_options { text => sprintf( _('Problems within %s ward'), $ward->{name}), uri => $c->uri_for( '/rss/reports/' . $council->{short_name} . '/' . $ward->{short_name} ), } if $ward; + } elsif ( $num_councils == 4 ) { # # Two-tier council my ($county, $district, $c_ward, $d_ward); |