X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FGitalist%2FController%2FOPML.pm;h=ece56f3ba221619197fab50ff5680259e566e091;hb=f539912a48fceb909e771cbcbccabb447b748024;hp=bd7670f61b59c0b21420b866a8128581f0b64470;hpb=65afba8d8c18df361b4ee0223aff342bc0d46ae2;p=catagits%2FGitalist.git diff --git a/lib/Gitalist/Controller/OPML.pm b/lib/Gitalist/Controller/OPML.pm index bd7670f..ece56f3 100644 --- a/lib/Gitalist/Controller/OPML.pm +++ b/lib/Gitalist/Controller/OPML.pm @@ -2,7 +2,7 @@ package Gitalist::Controller::OPML; use Moose; use Moose::Autobox; - +use DateTime; use Sys::Hostname qw/hostname/; use XML::OPML::SimpleGen; @@ -15,16 +15,14 @@ sub opml : Chained('/base') Args(0) { my $opml = XML::OPML::SimpleGen->new(); - $opml->head(title => lc(hostname()) . ' - ' . blessed($c)->config->{name}); - - for my $repos ( $c->model()->repositories->flatten ) { - $opml->insert_outline( - text => $repos->name. ' - '. $repos->description, - xmlUrl => $c->uri_for_action('/repository/rss', [$repos->name])->as_string, - ); - } + $c->stash( + title => lc(hostname()) . ' - ' . blessed($c)->config->{name}, + Repositories => $c->model()->repositories, + now => DateTime->now, + template => 'opml.tt2', + no_wrapper => 1, + ); - $c->response->body($opml->as_string); $c->response->content_type('application/rss'); }