<%! from django.core.urlresolvers import reverse %> <% def url_for(thread_id): return reverse('django_comment_client.forum.views.single_thread', args=[thread_id]) %>
Discussion ${search_bar}
New Post
% for thread in threads: ${render_thread(thread)} % endfor
<%def name="render_thread(thread, edit_thread=False, show_comments=False)">
${thread['title']}
${thread['body']}
${render_info(thread)} % if edit_thread: ${render_reply('')} ${render_edit('')} % endif
% if show_comments:
${render_comments(thread['children'])}
% endif
<%def name="render_comments(comments)"> % for comment in comments:
${comment['body']}
${render_info(comment)} ${render_reply('')} ${render_edit('')}
${render_comments(comment['children'])}
% endfor <%def name="render_info(content)"> ${time_ago_in_words(parse(content['updated_at']))} ago by user No.${content['user_id']} <%def name="render_reply(url)"> Reply <%def name="render_edit(url)"> Edit