scribeengine/scribeengine/templates/blog/view.mako

50 lines
2.3 KiB
Mako

<%inherit file="/base.mako"/>
<div class="post">
<%include file="/flash.mako"/>
<h2 class="title"><a href="${h.url_for(year=c.post.created.strftime('%Y'), month=c.post.created.strftime('%m'), day=c.post.created.strftime('%d'), url=c.post.url)}">${c.post.title}</a></h2>
<div class="info">Posted by ${c.post.user.nick} on ${c.post.created.strftime('%B %d, %Y')}</div>
<div class="entry">
${h.literal(c.post.body)}
</div>
<div>&nbsp;</div>
% if len(c.post.comments) == 0:
<h3 id="comments">No Responses</h3>
<p>&nbsp;</p>
% 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}">
<cite>${comment.user.nick}</cite> Says:<br />
<small class="commentmetadata"><a href="#comment-<?php comment_ID() ?>" title="">${comment.created.strftime('%B %d, %Y')} at ${comment.created.strftime('%H:%M')}</a> <a href="edit">edit</a></small>
${comment.body}
</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="/login">logged in</a> to post a comment.</p>
% else:
<div>&nbsp;</div>
<form action="${h.url_for('/comment/edit')}" method="post" id="commentform">
<p>Logged in as <em>${c.current_user.nick}</em>. <a href="/logout" title="Log out of this account">Logout &raquo;</a></p>
<p><textarea name="comment" id="comment" cols="80" rows="10" tabindex="4" style="width: 605px;"></textarea></p>
<p>
<input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" />
<input type="hidden" name="post_id" value="${c.post.id}" />
</p>
</form>
% endif
% endif
</div>