## -*- coding: utf-8 -*- <%inherit file="base.mako"/> <%namespace name="base" file="base.mako"/> <%def name="subject()" filter="n,trim"> <% data = { 'user': h.person(user), 'pr_title': pull_request.title, 'pr_id': pull_request.pull_request_id, 'status': status_change, 'comment_file': comment_file, 'comment_line': comment_line, } %> ${_('[mention]') if mention else ''} \ % if comment_file: ${_('%(user)s commented on pull request #%(pr_id)s "%(pr_title)s" (file: `%(comment_file)s`)') % data |n} % else: % if status_change: ${_('%(user)s commented on pull request #%(pr_id)s "%(pr_title)s" (status: %(status)s)') % data |n} % else: ${_('%(user)s commented on pull request #%(pr_id)s "%(pr_title)s"') % data |n} % endif % endif <%def name="body_plaintext()" filter="n,trim"> <% data = { 'user': h.person(user), 'pr_title': pull_request.title, 'pr_id': pull_request.pull_request_id, 'status': status_change, 'comment_file': comment_file, 'comment_line': comment_line, } %> ${self.subject()} * ${_('Comment link')}: ${pr_comment_url} * ${_('Source repository')}: ${pr_source_repo_url} %if comment_file: * ${_('File: %(comment_file)s on line %(comment_line)s') % {'comment_file': comment_file, 'comment_line': comment_line}} %endif --- %if status_change and not closing_pr: ${_('%(user)s submitted pull request #%(pr_id)s status: *%(status)s*') % data} %elif status_change and closing_pr: ${_('%(user)s submitted pull request #%(pr_id)s status: *%(status)s and closed*') % data} %endif ${comment_body|n} ${self.plaintext_footer()} <% data = { 'user': h.person(user), 'pr_title': pull_request.title, 'pr_id': pull_request.pull_request_id, 'status': status_change, 'comment_file': comment_file, 'comment_line': comment_line, } %> % if status_change: % endif

% if comment_file: ${_('%(user)s commented on pull request #%(pr_id)s "%(pr_title)s" (file:`%(comment_file)s`)') % data |n} % else: ${_('%(user)s commented on pull request #%(pr_id)s "%(pr_title)s"') % data |n} % endif %if status_change and not closing_pr: , ${_('submitted pull request status: %(status)s') % data} %elif status_change and closing_pr: , ${_('submitted pull request status: %(status)s and closed') % data} %endif

${_('Source')}${pr_source_repo.repo_name}
${_('Submitted status')}${base.status_text(status_change, tag_type=status_change_type)}
${(_('Comment on line: %(comment_line)s') if comment_file else _('Comment')) % data}${h.render(comment_body, renderer=renderer_type, mentions=True)}