Merge branch 'master' of git@veekun.com:floof
[zzz-floof.git] / floof / templates / comments / lib.mako
index 0c8ebfb..e822a17 100644 (file)
@@ -13,11 +13,21 @@ ${single_comment(comment)}
 </%def>
 
 <%def name="single_comment(comment)">
 </%def>
 
 <%def name="single_comment(comment)">
+% if hasattr(comment, 'indent'):
 <div class="comment" style="margin-left: ${comment.indent}em;">
 <div class="comment" style="margin-left: ${comment.indent}em;">
+% else:
+<div class="comment">
+% endif
     <div class="header">
         <div class="user">${comment.user.name}</div>
         <div class="time">${comment.time}</div>
     <div class="header">
         <div class="user">${comment.user.name}</div>
         <div class="time">${comment.time}</div>
-        <div class="link"><a href="${url(controller='comments', action='thread', id=comment.id, owner_url=h.get_comment_owner_url(**c.route))}">Link</a></div>
+        <div class="links">
+            <a href="${url(controller='comments', action='thread', id=comment.id, owner_url=h.get_comment_owner_url(**c.route))}">Link</a>
+            <a href="${url(controller='comments', action='reply', id=comment.id, owner_url=h.get_comment_owner_url(**c.route))}">Reply</a>
+            % if comment.parent:
+            <a href="${url(controller='comments', action='thread', id=comment.parent.id, owner_url=h.get_comment_owner_url(**c.route))}">Parent</a>
+            % endif
+        </div>
     </div>
     <p>${comment.text}</p>
 </div>
     </div>
     <p>${comment.text}</p>
 </div>