-% for comment in comments:
-<div class="comment">
- <div class="user">${comment.user.name}</div>
- <div class="time">${comment.time}</div>
+<%! from floof.model.comments import indent_comments %>\
+% for comment in indent_comments(comments):
+${single_comment(comment)}
+% endfor
+</%def>
+
+<%def name="single_comment(comment)">
+<div class="comment" style="margin-left: ${comment.indent}em;">
+ <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>