[Bast-commits] r8847 - in ironman:
IronMan-Web/lib/IronMan/Web/Controller
IronMan-Web/root/archive plagger/lib/IronMan/Schema/ResultSet
fade at dev.catalyst.perl.org
fade at dev.catalyst.perl.org
Tue Mar 2 11:48:31 GMT 2010
Author: fade
Date: 2010-03-02 11:48:31 +0000 (Tue, 02 Mar 2010)
New Revision: 8847
Modified:
ironman/IronMan-Web/lib/IronMan/Web/Controller/Archive.pm
ironman/IronMan-Web/root/archive/day.tt
ironman/plagger/lib/IronMan/Schema/ResultSet/Post.pm
Log:
link to next/previous day on daily archive pages
Modified: ironman/IronMan-Web/lib/IronMan/Web/Controller/Archive.pm
===================================================================
--- ironman/IronMan-Web/lib/IronMan/Web/Controller/Archive.pm 2010-03-02 10:35:18 UTC (rev 8846)
+++ ironman/IronMan-Web/lib/IronMan/Web/Controller/Archive.pm 2010-03-02 11:48:31 UTC (rev 8847)
@@ -84,6 +84,18 @@
my $posts = $c->model('FeedDB::Post')->posts_for_day($dt_day);
$c->stash( 'posts' => $posts );
$c->stash( 'day' => $dt_day );
+
+ my $next_day = $dt_day->clone->subtract( 'days' => 1 );
+ if ($c->model('FeedDB::Post')->posts_for_day($next_day)->count) {
+ my $older_url = $c->uri_for($c->action, $next_day->year, $next_day->month, $next_day->day );
+ $c->stash( 'older_url' => $older_url );
+ }
+
+ my $prev_day = $dt_day->clone->add( 'days' => 1 );
+ if ($c->model('FeedDB::Post')->posts_for_day($prev_day)->count) {
+ my $younger_url = $c->uri_for($c->action, $prev_day->year, $prev_day->month, $prev_day->day );
+ $c->stash( 'younger_url' => $younger_url );
+ }
}
=head1 AUTHOR
Modified: ironman/IronMan-Web/root/archive/day.tt
===================================================================
--- ironman/IronMan-Web/root/archive/day.tt 2010-03-02 10:35:18 UTC (rev 8846)
+++ ironman/IronMan-Web/root/archive/day.tt 2010-03-02 11:48:31 UTC (rev 8847)
@@ -8,3 +8,5 @@
%]
[% END %]
+
+<p>[% IF younger_url %]<a href="[% younger_url %]">< Younger posts</a> | [% END %]<a href="[% older_url %]">Older posts ></a></p>
Modified: ironman/plagger/lib/IronMan/Schema/ResultSet/Post.pm
===================================================================
--- ironman/plagger/lib/IronMan/Schema/ResultSet/Post.pm 2010-03-02 10:35:18 UTC (rev 8846)
+++ ironman/plagger/lib/IronMan/Schema/ResultSet/Post.pm 2010-03-02 11:48:31 UTC (rev 8847)
@@ -43,7 +43,7 @@
return $self->posts_for_daterange($month_start, $month_end);
}
-=head2 posts_for_month
+=head2 posts_for_daterange
posts_for_daterange($datetime_start,$datetime_end)
More information about the Bast-commits
mailing list