diff options
author | Matthew Somerville <matthew@mysociety.org> | 2019-11-13 12:45:11 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2019-11-15 14:09:56 +0000 |
commit | dd05c9ca3f72c3639f6fb2f4261e02531840b908 (patch) | |
tree | b3c3fb311df7e7f62a12462bf0e2df7bcf78aad5 /perllib/FixMyStreet/App/Controller/Rss.pm | |
parent | 19ec44cbdf19f8c5711effff76735f20290e3855 (diff) |
Add cobrand-specific XSL to RSS feeds.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Rss.pm')
-rwxr-xr-x | perllib/FixMyStreet/App/Controller/Rss.pm | 15 |
1 files changed, 15 insertions, 0 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 |