aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet')
-rwxr-xr-xperllib/FixMyStreet/App/Controller/Rss.pm15
-rw-r--r--perllib/FixMyStreet/Cobrand/UK.pm6
-rw-r--r--perllib/FixMyStreet/Cobrand/UKCouncils.pm4
3 files changed, 20 insertions, 5 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Rss.pm b/perllib/FixMyStreet/App/Controller/Rss.pm
index 443e45b93..cb59689b4 100755
--- a/perllib/FixMyStreet/App/Controller/Rss.pm
+++ b/perllib/FixMyStreet/App/Controller/Rss.pm
@@ -186,6 +186,7 @@ sub generate : Private {
$c->stash->{rss} = new XML::RSS(
version => '2.0',
encoding => 'UTF-8',
+ stylesheet => '/rss/xsl',
encode_output => undef
);
$c->stash->{rss}->add_module(
@@ -377,6 +378,20 @@ sub redirect_lat_lon : Private {
$c->res->redirect( "/rss/l/$lat,$lon" . $d_str . $state_qs );
}
+sub xsl : Path {
+ my ($self, $c) = @_;
+
+ my @include_path = @{ $c->cobrand->path_to_email_templates($c->stash->{lang_code}) };
+ my $vars = {
+ %{ $c->stash },
+ additional_template_paths => \@include_path,
+ };
+ my $body = $c->view('Email')->render($c, 'xsl.xsl', $vars);
+
+ $c->response->header('Content-Type' => 'text/xml; charset=utf-8');
+ $c->response->body($body);
+}
+
=head1 AUTHOR
Matthew Somerville
diff --git a/perllib/FixMyStreet/Cobrand/UK.pm b/perllib/FixMyStreet/Cobrand/UK.pm
index fde5f465a..18bf01476 100644
--- a/perllib/FixMyStreet/Cobrand/UK.pm
+++ b/perllib/FixMyStreet/Cobrand/UK.pm
@@ -107,7 +107,7 @@ sub short_name {
return 'Durham+County' if $name eq 'Durham County Council';
return 'Durham+City' if $name eq 'Durham City Council';
- $name =~ s/^London Borough of //;
+ $name =~ s/^(Royal|London) Borough of //;
$name =~ s/ (Borough|City|District|County) Council$//;
$name =~ s/ Council$//;
$name =~ s/ & / and /;
@@ -140,8 +140,8 @@ sub find_closest {
sub reports_body_check {
my ( $self, $c, $code ) = @_;
- # Deal with Bexley name not starting with short name
- if ($code =~ /bexley/i) {
+ # Deal with Bexley and Greenwich name not starting with short name
+ if ($code =~ /bexley|greenwich/i) {
my $body = $c->model('DB::Body')->search( { name => { -like => "%$code%" } } )->single;
$c->stash->{body} = $body;
return $body;
diff --git a/perllib/FixMyStreet/Cobrand/UKCouncils.pm b/perllib/FixMyStreet/Cobrand/UKCouncils.pm
index 5f45609bb..81e5dd569 100644
--- a/perllib/FixMyStreet/Cobrand/UKCouncils.pm
+++ b/perllib/FixMyStreet/Cobrand/UKCouncils.pm
@@ -171,8 +171,8 @@ sub all_reports_single_body {
sub reports_body_check {
my ( $self, $c, $code ) = @_;
- # Deal with Bexley name not starting with short name
- if ($code =~ /bexley/i) {
+ # Deal with Bexley/Greenwich name not starting with short name
+ if ($code =~ /bexley|greenwich/i) {
my $body = $c->model('DB::Body')->search( { name => { -like => "%$code%" } } )->single;
$c->stash->{body} = $body;
return $body;