c0e74e19bb
Added pagination to the default post view. Fixed a bug where the comments were being ordered incorrectly.
24 lines
1021 B
Mako
24 lines
1021 B
Mako
<%inherit file="/base.mako"/>
|
|
<%include file="/flash.mako"/>
|
|
<%include file="/pagination.mako"/>
|
|
% for post in c.posts:
|
|
<div class="post">
|
|
<h2 class="title"><a href="${h.url_for_post(post)}">${post.title}</a></h2>
|
|
<div class="entry">
|
|
${h.literal(h.teaser(post.body))}
|
|
</div>
|
|
<p class="meta">
|
|
<span class="byline">Posted by ${post.user.nick} on ${post.created.strftime('%B %d, %Y')}</span>
|
|
<a href="${h.url_for_post(post)}" class="read-more">Read more</a>
|
|
% if len(post.comments) == 0:
|
|
<a href="${h.url_for_post(post)}#comments" class="comments">No comments</a>
|
|
% elif len(post.comments) == 1:
|
|
<a href="${h.url_for_post(post)}#comments" class="comments">1 comment</a>
|
|
% else:
|
|
<a href="${h.url_for_post(post)}#comments" class="comments">${len(post.comments)} comments</a>
|
|
% endif
|
|
</p>
|
|
</div>
|
|
% endfor
|
|
<%include file="/pagination.mako"/>
|
|
|