## -*- coding: utf-8 -*- ## usage: ## <%namespace name="comment" file="/changeset/changeset_file_comment.html"/> ## ${comment.comment_block(co)} ## <%def name="comment_block(co)">
${co.author.username}
${h.age(co.modified_at)}
%if co.status_change:
${co.status_change[0].status_lbl}
%endif
%if co.pull_request: %if co.status_change: ${_('Status change on pull request #%s') % co.pull_request.pull_request_id} %else: ${_('Comment on pull request #%s') % co.pull_request.pull_request_id} %endif %endif
%if h.HasPermissionAny('hg.admin', 'repository.admin')() or co.author.user_id == c.rhodecode_user.user_id:
${_('Delete')}
%endif
${h.rst_w_mentions(co.text)|n}
<%def name="comment_inline_form()"> ## generates inlines taken from c.comments var <%def name="inlines()">
${ungettext("%d comment", "%d comments", len(c.comments)) % len(c.comments)} ${ungettext("(%d inline)", "(%d inline)", c.inline_cnt) % c.inline_cnt}
%for path, lines in c.inline_comments: % for line,comments in lines.iteritems(): %endfor %endfor ## generate inline comments and the main ones <%def name="generate_comments(include_pr=False)">
## generate inlines for this changeset ${inlines()}
%for co in c.comments:
## only render comments that are not from pull request, or from ## pull request and a status change %if not co.pull_request or (co.pull_request and co.status_change) or include_pr: ${comment_block(co)} %endif
%endfor
## MAIN COMMENT FORM <%def name="comments(post_url, cur_status, close_btn=False, change_status=True)">
%if c.rhodecode_user.username != 'default':
${h.form(post_url)}
${(_('Comments parsed using %s syntax with %s support.') % (('RST' % h.url('rst_help')), '@mention' % _('Use @username inside this text to send notification to this RhodeCode user')))|n} %if change_status: | ${_('Change status')} %endif
%if change_status: %endif
${h.textarea('text')}
${h.submit('save', _('Comment'), class_="ui-btn large")} %if close_btn and change_status: ${h.submit('save_close', _('Comment and close'), class_='ui-btn blue large %s' % ('hidden' if cur_status in ['not_reviewed','under_review'] else ''))} %endif
${h.end_form()}
%endif