# HG changeset patch # User Vincent Tondellier # Date 1407156744 -7200 # Node ID 3e776f1b21d4820f5e3d4425adc0b6b593803f6c # Parent f77c6719c05c5fe52059adbf1f06f81d7f5ec3e0 Fix and improve atom/rss feed diff -r f77c6719c05c -r 3e776f1b21d4 CrashTest.pl --- a/CrashTest.pl Mon Aug 04 14:51:37 2014 +0200 +++ b/CrashTest.pl Mon Aug 04 14:52:24 2014 +0200 @@ -78,6 +78,13 @@ return b($self->t(span => (title => $signature, class => "shortened-signature") => $short_signature)); }; +helper xml_escape_block => sub { + my ($c, $block) = @_; + my $result = $block->(); + $result = xml_escape $result; + return Mojo::ByteStream->new($result); +}; + get '/' => sub { my $self = shift; my $page = 1; diff -r f77c6719c05c -r 3e776f1b21d4 templates/index.atom.ep --- a/templates/index.atom.ep Mon Aug 04 14:51:37 2014 +0200 +++ b/templates/index.atom.ep Mon Aug 04 14:52:24 2014 +0200 @@ -4,19 +4,23 @@ Recent Crashs - <%= POSIX::strftime("%FT%T%z", gmtime(@$files[0]->{date} || 0)) =%> + <%= @$files[0]->{date}->strftime("%FT%TZ") =%> % foreach my $file(@$files) { - tag:crash,2012:uuid::<%= $file->{uuid} =%> + tag:crash,2014:uuid::<%= $file->{uuid} =%> <%= $file->{product} =%>: <%= $file->{signature} =%> - <%= POSIX::strftime("%FT%T%z", gmtime($file->{date})) =%> + <%= $file->{date}->strftime("%FT%TZ") =%> + <%= $file->{date}->strftime("%FT%TZ") =%> - %= t span => POSIX::strftime("%F %T", localtime($file->{date})) + %= xml_escape_block begin + %= t h3 => $file->{date}->strftime("%F %T") + %= t h3 => $file->{product} . " version " . $file->{version} + % end % }