## -*- coding: utf-8 -*- <%inherit file="base.mako"/> <%namespace name="base" file="base.mako"/> ## EMAIL SUBJECT <%def name="subject()" filter="n,trim,whitespace_filter"> <% data = { 'user': '@'+h.person(user), 'pr_id': pull_request.pull_request_id, 'pr_title': pull_request.title_safe, } if user_role == 'observer': subject_template = email_pr_review_subject_template or _('{user} added you as observer to pull request. !{pr_id}: "{pr_title}"') else: subject_template = email_pr_review_subject_template or _('{user} requested a pull request review. !{pr_id}: "{pr_title}"') %> ${subject_template.format(**data) |n} %def> ## PLAINTEXT VERSION OF BODY <%def name="body_plaintext()" filter="n,trim"> <% data = { 'user': h.person(user), 'pr_id': pull_request.pull_request_id, 'pr_title': pull_request.title_safe, 'source_ref_type': pull_request.source_ref_parts.type, 'source_ref_name': pull_request.source_ref_parts.name, 'target_ref_type': pull_request.target_ref_parts.type, 'target_ref_name': pull_request.target_ref_parts.name, 'repo_url': pull_request_source_repo_url, 'source_repo': pull_request_source_repo.repo_name, 'target_repo': pull_request_target_repo.repo_name, 'source_repo_url': pull_request_source_repo_url, 'target_repo_url': pull_request_target_repo_url, } %> * ${_('Pull Request link')}: ${pull_request_url} * ${h.literal(_('Commit flow: {source_ref_type}:{source_ref_name} of {source_repo_url} into {target_ref_type}:{target_ref_name} of {target_repo_url}').format(**data))} * ${_('Title')}: ${pull_request.title} * ${_('Description')}: ${pull_request.description | trim} * ${_ungettext('Commit (%(num)s)', 'Commits (%(num)s)', len(pull_request_commits) ) % {'num': len(pull_request_commits)}}: % for commit_id, message in pull_request_commits: - ${h.short_id(commit_id)} ${h.chop_at_smart(message.lstrip(), '\n', suffix_if_chopped='...')} % endfor --- ${self.plaintext_footer()} %def> <% data = { 'user': h.person(user), 'pr_id': pull_request.pull_request_id, 'pr_title': pull_request.title_safe, 'source_ref_type': pull_request.source_ref_parts.type, 'source_ref_name': pull_request.source_ref_parts.name, 'target_ref_type': pull_request.target_ref_parts.type, 'target_ref_name': pull_request.target_ref_parts.name, 'repo_url': pull_request_source_repo_url, 'source_repo': pull_request_source_repo.repo_name, 'target_repo': pull_request_target_repo.repo_name, 'source_repo_url': h.link_to(pull_request_source_repo.repo_name, pull_request_source_repo_url), 'target_repo_url': h.link_to(pull_request_target_repo.repo_name, pull_request_target_repo_url), } %> ## header
% if user_role == 'observer':
@${h.person(user.username)}
${_('added you as observer to')}
pull request.
% else:
@${h.person(user.username)}
${_('requested a')}
pull request review.
% endif
${_('Pull request')} !${data['pr_id']}: ${data['pr_title']}
|
${_('Pull request')}: | !${pull_request.pull_request_id} |
${_('Commit Flow')}: |
${'{}:{}'.format(data['source_ref_type'], pull_request.source_ref_parts.name)} ${_('of')} ${data['source_repo_url']}
→
${'{}:{}'.format(data['target_ref_type'], pull_request.target_ref_parts.name)} ${_('of')} ${data['target_repo_url']}
|
${_('Description')}: | ${pull_request.description | trim} |
${_ungettext('Commit (%(num)s)', 'Commits (%(num)s)', len(pull_request_commits)) % {'num': len(pull_request_commits)}}: | |
|