69 lines
2.9 KiB
Mako
69 lines
2.9 KiB
Mako
<%inherit file="/base.mako"/>
|
|
<%include file="/flash.mako"/>
|
|
<div class="post">
|
|
<h2 class="title">${c.post.title}</h2>
|
|
<div class="info">
|
|
Posted by ${c.post.user.nick} on ${c.post.created.strftime('%B %d, %Y')}
|
|
% if c.current_user and c.current_user.id == c.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=c.post.id)}">Edit</a>]
|
|
% endif
|
|
</div>
|
|
<div class="entry">
|
|
${h.literal(c.post.body)}
|
|
</div>
|
|
% if c.post.tags:
|
|
<div class="tags">
|
|
<p>Filed under:</p>
|
|
<ul>
|
|
% for tag in c.post.tags:
|
|
<li><a href="/tag/${tag.url}">${tag.name}</a></li>
|
|
% endfor
|
|
</ul>
|
|
</div>
|
|
% endif
|
|
% if len(c.post.comments) == 0:
|
|
<h3 id="comments">No Responses</h3>
|
|
% elif len(c.post.comments) == 1:
|
|
<h3 id="comments">One Response</h3>
|
|
% else:
|
|
<h3 id="comments">${len(c.post.comments)} Responses</h3>
|
|
% endif
|
|
% if len(c.post.comments) > 0:
|
|
<ol class="commentlist">
|
|
% for num, comment in enumerate(c.post.comments):
|
|
<li id="comment-${comment.id}">
|
|
<div class="comment-title">
|
|
<a href="#comment-${comment.id}" title="${comment.title}">${comment.title}</a>
|
|
</div>
|
|
<div class="comment-meta">
|
|
by <cite>${comment.user.nick}</cite>
|
|
on ${comment.created.strftime('%B %d, %Y')} at ${comment.created.strftime('%H:%M')}
|
|
</div>
|
|
<div class="comment-body">
|
|
<p>${h.comment(comment.body)}</p>
|
|
</div>
|
|
</li>
|
|
% endfor
|
|
</ol>
|
|
% else:
|
|
% if c.post.comment_status != u'open':
|
|
<p class="nocomments">Comments are closed.</p>
|
|
% endif
|
|
% endif
|
|
% if c.post.comment_status == u'open':
|
|
<h3 id="respond">Leave a Reply</h3>
|
|
% if not c.current_user:
|
|
<p>You must be <a href="${h.url_for(controller=u'account', action=u'login')}">logged in</a> to post a comment.</p>
|
|
% else:
|
|
<form action="${h.url_for(controller='blog',action='comment', id= c.post.id)}" method="post" id="commentform">
|
|
<p class="user-details">Logged in as <em>${c.current_user.nick}</em>. <a href="${h.url_for(controller='admin',action='logout')}" title="Log out of this account">Logout »</a></p>
|
|
<p><input type="text" name="title" class="form-text" value="RE: ${c.post.title}" /></p>
|
|
<p><textarea name="body" class="form-textarea" cols="80" rows="10" tabindex="4"></textarea></p>
|
|
<p>
|
|
<input name="submit" type="submit" id="submit" tabindex="5" class="form-button" value="Submit Comment" />
|
|
</p>
|
|
</form>
|
|
% endif
|
|
% endif
|
|
</div>
|
|
|