<%namespace name="components" file="/components.html"/> <%def name="row(tile, comment)">

${_("Comment")} ${_("on %s") % h.delegateable.link(comment.topic)|n}

${h.user.link(comment.creator, scope=comment.topic)|n} %if len(comment.revisions) == 1: · ${_("created %s") % h.relative_time(comment.create_time)|n} %else: · ${_("edited %s") % h.relative_time(comment.latest.create_time)|n} %endif
<%def name="list(tile, comments, topic, variant=None, root=None, recurse=True, ret_url='')"> <% _comments = h.comments_sorted(comments, root=root, variant=variant) %> %if root is None: %if can.comment.create():
${create_form(None, topic, variant=variant, ret_url=ret_url)}
%endif %if not len(_comments):
${_("No comments were made yet.")}
%endif %endif %for comment, tile in _comments: ${full(tile, comment, comments, recurse, ret_url=ret_url)} %endfor <%def name="full(tile, comment, comments, recurse, ret_url='')"> <% if not tile.show: return %>
  
%if not comment.is_deleted(): ${h.user.link(comment.creator, scope=comment.topic)|n} %endif
%if can.comment.edit(comment): ${_("edit")} %endif %if can.comment.delete(comment): ${_("delete")} %endif %if can.comment.reply(comment) and recurse: ${_("reply")} %endif ${_("hide")}
%if comment.is_deleted(): ${_("(deleted)")} %else: %if comment.latest.has_title: ${comment.latest.title} %else:   %endif %endif
%if not comment.is_deleted(): ${tile.text|n} %else: ${_("This comment has been deleted.")} %endif
%if comment.is_deleted(): ${_("deleted %s") % h.relative_time(comment.delete_time)|n} %else: %if not comment.is_edited(): ${h.relative_time(comment.create_time)|n} %else: %if comment.latest.user == comment.creator: ${_("edited %s") % h.relative_time(comment.latest.create_time)|n} %else: ${_("edited %s by %s") % (h.relative_time(comment.latest.create_time), h.user.link(comment.latest.user, scope=comment.topic))|n} %endif %endif %if comment.wiki: · ${_("editable") if comment.wiki else ''} %endif %if len(comment.revisions) > 1: · ${_("history")} %endif · ${_("report")} · ${_("link")} %endif  
${self.edit_form(comment, ret_url=ret_url)}
${self.create_form(comment, comment.topic, variant=comment.variant, ret_url=ret_url)}
%if recurse:
${list(None, comments, comment.topic, variant=comment.variant, root=comment, recurse=recurse)}
%endif
<%def name="edit_form(comment, ret_url='')">
${h.field_token()|n} %if comment.is_root: ${_("argumenting:")} ${_("pro")} ${_("neutral")} ${_("con")}
%endif ${components.formatting()} ${components.savebox(h.entity_url(comment.topic))} ${components.form_watch(comment)}
<%def name="create_form(parent, topic, wiki=True, arm=False, can_wiki=True, variant=None, ret_url='')">
${h.field_token()|n} %if variant: %endif %if parent: %endif
%if not parent: <% pos = topic.user_position(c.user) %> ${_("pro")} ${_("neutral")} ${_("con")}
%endif %if arm: %endif
${components.formatting()} ${components.savebox("/d/%s" % parent.topic.id if parent else request.params.get('topic'))} %if can_wiki: ${_("Allow others to edit this comment.")} %endif
<%def name="header(tile, comment, active)">
%if can.comment.edit(comment): ${_("edit")} %endif %if can.comment.delete(comment): ${_("delete")} %endif ${components.watch(comment)}

${_("Discussion on %s") % h.delegateable.link(comment.topic, icon_size=24)|n}