<%namespace name="components" file="/components.html"/> <%def name="row(tile, comment)">
  • ${_("Comment") if h.comment.wording() else _("Argument")} ${_("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.datetime_tag(comment.create_time)|n} %else: · ${_("edited %s") % h.datetime_tag(comment.latest.create_time)|n} %endif
  • <%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:
    ${_('Add comment') if h.comment.wording() else _('Start new discussion')}
    %endif %elif auth.propose_join():
    ${_("Add comment") if h.comment.wording() else _('Start new discussion')}
    %elif auth.propose_login():
    ${_("Add comment") if h.comment.wording() else _('Start new discussion')}
    %elif auth.propose_validate_email():
    ${_("Add comment") if h.comment.wording() else _('Start new discussion')}
    %endif %endif %if root is None: %if not len(_comments):
    ${_("No comments were made yet.") if h.comment.wording() else _("No discussions were started yet.")}
    %endif %endif %if _comments: %endif <%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')} %>
    ## comment title (username / pro/con / deleted) %if not comment.is_deleted(): ${h.user.link(comment.creator, scope=comment.topic)|n} ${sentiment['msg']} %else:
    ${_("(deleted)")}
    %endif %if can.comment.edit(comment): ${_("edit")} %endif %if can.comment.delete(comment): ${_("delete")} %endif
    ${tiles.poll.widget(comment.poll)}
    ## comment text
    %if not comment.is_deleted(): ${tile.text|n} %else: ${_("This comment has been deleted.") if h.comment.wording() else _("This argument has been deleted.")} %endif
    <%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) %>
    ${h.field_token()|n}
    ${components.formatting()}
    <% from adhocracy.model.page import Page %> %if comment.topic.function == Page.DESCRIPTION:
    ${_(u'Comment is...') if h.comment.wording() else _(u'Argument is...')}
    ${_('Pro')} ${_('Neutral')} ${_('Con')}

    %endif
    <%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 %>
    ${h.field_token()|n} %if variant: %endif %if parent: %endif
    ${components.formatting()}
    <% from adhocracy.model.page import Page %> %if topic.function == Page.DESCRIPTION:
    ${_(u'Comment is...') if h.comment.wording() else _(u'Argument is...')}
    ${_('Pro')} ${_('Neutral')} ${_('Con')}

    %endif

      %if show_cancel: ${_("cancel")} %endif
    <%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}