use PublicInbox::Hval;
use PublicInbox::GitCatFile;
use constant {
- DATEFMT => '%Y-%m-%dT%H:%M:%SZ',
- MAX_PER_PAGE => 25,
+ DATEFMT => '%Y-%m-%dT%H:%M:%SZ', # atom standard
+ MAX_PER_PAGE => 25, # this needs to be tunable
+ PRE_WRAP => '<pre style="white-space:pre-wrap">',
};
# main function
my $html = "<html><head><title>$title</title>" .
'<link rel="alternate" title="Atom feed" href="' .
$feed_opts->{atomurl} . '" type="application/atom+xml"/>' .
- '</head><body><pre>';
+ '</head><body>' . PRE_WRAP;
# sort by date, most recent at top
$th->order(sub {
Email::Address->purge_cache;
- my $footer = nav_footer($args->{cgi}, $last);
- $footer = "<hr /><pre>$footer</pre>" if $footer;
+ my $footer = nav_footer($args->{cgi}, $last, $feed_opts);
+ my $list_footer = $args->{footer};
+ $footer .= "\n" . $list_footer if ($footer && $list_footer);
+ $footer = "<hr />" . PRE_WRAP . "$footer</pre>" if $footer;
$html . "</pre>$footer</html>";
}
# private subs
sub nav_footer {
- my ($cgi, $last) = @_;
+ my ($cgi, $last, $feed_opts) = @_;
$cgi or return '';
my $old_r = $cgi->param('r');
my $head = ' ';
$head = $cgi->path_info;
$head = qq!<a href="$head">head</a>!;
}
- "$next $head";
+ my $atom = "<a href=\"$feed_opts->{atomurl}\">atom</a>";
+ "$next $head $atom";
}
sub each_recent_blob {