aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Rss.pm
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2012-08-22 10:57:10 +0100
committerStruan Donald <struan@exo.org.uk>2012-08-22 10:57:10 +0100
commit2e0a4e8ec45579e4e5c9cf8aa123d5ab215b9703 (patch)
treec13e3c59b686e01460dc7960547f7e9c53c288bd /perllib/FixMyStreet/App/Controller/Rss.pm
parentb99c5ff97b29a27eeba52ed24385ac30388e875c (diff)
parent88a7d38dffa3dabdf0f85573b254cea9c8ab232b (diff)
Merge remote-tracking branch 'origin/master' into fmb-read-only
Conflicts: .gitignore bin/make_css conf/general.yml-example perllib/FixMyStreet/App/Controller/Council.pm perllib/FixMyStreet/App/Controller/Report/New.pm perllib/FixMyStreet/Cobrand/Default.pm templates/web/default/around/around_index.html templates/web/default/index.html templates/web/emptyhomes/index.html templates/web/fixmystreet/around/around_index.html templates/web/fixmystreet/index.html web/fixmystreet_app_cgi.cgi web/fixmystreet_app_fastcgi.cgi
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Rss.pm')
-rwxr-xr-xperllib/FixMyStreet/App/Controller/Rss.pm18
1 files changed, 7 insertions, 11 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Rss.pm b/perllib/FixMyStreet/App/Controller/Rss.pm
index 4d0b6cb93..fe4b652ed 100755
--- a/perllib/FixMyStreet/App/Controller/Rss.pm
+++ b/perllib/FixMyStreet/App/Controller/Rss.pm
@@ -172,7 +172,6 @@ sub generate : Private {
$c->stash->{rss} = new XML::RSS(
version => '2.0',
encoding => 'UTF-8',
- stylesheet => $c->cobrand->feed_xsl,
encode_output => undef
);
$c->stash->{rss}->add_module(
@@ -205,14 +204,10 @@ sub query_main : Private {
my ( $self, $c ) = @_;
my $alert_type = $c->stash->{alert_type};
- my ( $site_restriction, $site_id ) = $c->cobrand->site_restriction( $c->cobrand->extra_data );
- # Only apply a site restriction if the alert uses the problem table
- $site_restriction = '' unless $alert_type->item_table eq 'problem';
-
# FIXME Do this in a nicer way at some point in the future...
my $query = 'select * from ' . $alert_type->item_table . ' where '
. ($alert_type->head_table ? $alert_type->head_table . '_id=? and ' : '')
- . $alert_type->item_where . $site_restriction . ' order by '
+ . $alert_type->item_where . ' order by '
. $alert_type->item_order;
my $rss_limit = mySociety::Config::get('RSS_LIMIT');
$query .= " limit $rss_limit" unless $c->stash->{type} =~ /^all/;
@@ -250,12 +245,13 @@ sub add_row : Private {
(my $title = _($alert_type->item_title)) =~ s/{{(.*?)}}/$row->{$1}/g;
(my $link = $alert_type->item_link) =~ s/{{(.*?)}}/$row->{$1}/g;
(my $desc = _($alert_type->item_description)) =~ s/{{(.*?)}}/$row->{$1}/g;
- my $url = $c->uri_for( $link );
- if ( $row->{postcode} ) {
- my $pc = $c->cobrand->format_postcode( $row->{postcode} );
- $title .= ", $pc";
+ my $hashref_restriction = $c->cobrand->site_restriction;
+ my $base_url = $c->cobrand->base_url;
+ if ( $hashref_restriction && $hashref_restriction->{council} && $row->{council} && $row->{council} ne $hashref_restriction->{council} ) {
+ $base_url = $c->config->{BASE_URL};
}
+ my $url = $base_url . $link;
my %item = (
title => ent($title),
@@ -268,7 +264,7 @@ sub add_row : Private {
if ($c->cobrand->allow_photo_display && $row->{photo}) {
my $key = $alert_type->item_table eq 'comment' ? 'c/' : '';
- $item{description} .= ent("\n<br><img src=\"". $c->cobrand->base_url . "/photo/$key$row->{id}.jpeg\">");
+ $item{description} .= ent("\n<br><img src=\"". $base_url . "/photo/$key$row->{id}.jpeg\">");
}
if ( $row->{used_map} ) {