%namespace name="components" file="/components.html"/>
<%def name="row(tile, comment)">
${h.user.link(comment.creator, scope=comment.topic)|n}
%if len(comment.revisions) == 1:
· ${_("created %s") % h.datetime_tag(comment.create_time)|n}
%else:
· ${_("edited %s") % h.datetime_tag(comment.latest.create_time)|n}
%endif
%def>
<%def name="list(tile, comments, topic, variant=None, root=None, recurse=True, came_from='')">
<%
_comments = h.comments_sorted(comments, root=root, variant=variant)
%>
<% auth = check.comment.create_on(topic) %>
%if root is None:
%if auth:
<%
hide_form = True
target = 'new_toplevel_comment'
if len(_comments) == 0:
hide_form = False
%>
%if hide_form:
%endif
%elif auth.propose_join():
%elif auth.propose_login():
%elif auth.propose_validate_email():
%endif
%endif
%if root is None:
%if not len(_comments):
%endif
%endif
%if _comments:
%endif
%def>
<%def name="show(tile, comment, came_from='')">
<%
if not tile.show:
return
sentiment = {'css': '', 'msg': ''}
if comment.latest.sentiment == model.Comment.SENT_PRO:
sentiment = {'css': 'pro', 'msg': _(u'is pro')}
elif comment.latest.sentiment == model.Comment.SENT_CON:
sentiment = {'css': 'con', 'msg': _(u'is con')}
%>
%def>
<%def name="edit_form(comment, came_from='')">
<%
sentiment = comment.latest.sentiment
def klass(sentiment_button):
value = 'button_small'
if sentiment_button == sentiment:
value += ' active'
return value
klass_pro = klass(1)
klass_neutral = klass(0)
klass_con = klass(-1)
%>
%def>
<%def name="create_form(parent, topic, wiki=None, arm=False, can_wiki=True, variant=None, came_from='', format=None, show_cancel=True)">
<%
if format is None:
format = ''
else:
format = ".%s" % format
if wiki is None:
wiki = c.instance.editable_comments_default
%>
%def>
<%def name="header(tile, comment, active)">
%if can.comment.edit(comment):
${_("edit")}
%endif
%if can.comment.delete(comment):
${_("delete")}
%endif
${components.watch(comment)}
${(_("Comments on %s") if h.comment.wording() else _("Discussion on %s") \
) % h.delegateable.link(comment.topic)|n}
%def>