scribeengine/scribeengine/templates/blog/archive.mako

30 lines
1.3 KiB
Mako

<%inherit file="/base.mako"/>
<%include file="/flash.mako"/>
<h2 class="title">Archives for ${c.datestring}</h2>
<%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')}
% if c.current_user and c.current_user.id == post.user.id and c.current_user.has_permission(u'Edit My Posts'):
[<a href="${h.url_for(controller=u'post', action=u'edit', id=post.id)}">Edit</a>]
% endif
</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"/>