1 <%def name="comment_block(comments)">
2 <h1>${len(comments)} comments</h1>
3 <p><a href="${url(controller='comments', action='thread', owner_url=h.get_comment_owner_url(**c.route))}">View all</a></p>
4 <p><a href="${url(controller='comments', action='reply', owner_url=h.get_comment_owner_url(**c.route))}">Reply</a></p>
5 ${comment_thread(comments)}
8 <%def name="comment_thread(comments)">
9 <%! from floof.model.comments import indent_comments %>\
10 % for comment in indent_comments(comments):
11 ${single_comment(comment)}
15 <%def name="single_comment(comment)">
16 % if hasattr(comment, 'indent'):
17 <div class="comment" style="margin-left: ${comment.indent}em;">
22 <div class="user">${comment.user.name}</div>
23 <div class="time">${comment.time}</div>
25 <a href="${url(controller='comments', action='thread', id=comment.id, owner_url=h.get_comment_owner_url(**c.route))}">Link</a>
26 <a href="${url(controller='comments', action='reply', id=comment.id, owner_url=h.get_comment_owner_url(**c.route))}">Reply</a>
28 <a href="${url(controller='comments', action='thread', id=comment.parent.id, owner_url=h.get_comment_owner_url(**c.route))}">Parent</a>
32 <p>${comment.text}</p>