pull_request_review.mako
144 lines
| 4.9 KiB
| application/x-mako
|
MakoHtmlLexer
r1 | ## -*- coding: utf-8 -*- | |||
<%inherit file="base.mako"/> | ||||
r548 | <%namespace name="base" file="base.mako"/> | |||
r1 | ||||
r4038 | ## EMAIL SUBJECT | |||
r1728 | <%def name="subject()" filter="n,trim,whitespace_filter"> | |||
r548 | <% | |||
data = { | ||||
r4038 | 'user': '@'+h.person(user), | |||
r548 | 'pr_id': pull_request.pull_request_id, | |||
'pr_title': pull_request.title, | ||||
} | ||||
%> | ||||
r4038 | ${_('{user} requested a pull request review. !{pr_id}: "{pr_title}"').format(**data) |n} | |||
r1 | </%def> | |||
r4038 | ## PLAINTEXT VERSION OF BODY | |||
r1 | <%def name="body_plaintext()" filter="n,trim"> | |||
r548 | <% | |||
data = { | ||||
'user': h.person(user), | ||||
'pr_id': pull_request.pull_request_id, | ||||
'pr_title': pull_request.title, | ||||
'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, | ||||
r4038 | '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, | ||||
r548 | } | |||
%> | ||||
r1 | ||||
r4038 | ${h.literal(_('Pull request !{pr_id}: `{pr_title}`').format(**data))} | |||
r1 | ||||
r4038 | * ${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))} | |||
r1 | ||||
r4038 | * ${_('Pull Request link')}: ${pull_request_url} | |||
r1 | ||||
* ${_('Title')}: ${pull_request.title} | ||||
* ${_('Description')}: | ||||
r4038 | ${pull_request.description | trim} | |||
r1 | ||||
r1945 | * ${_ungettext('Commit (%(num)s)', 'Commits (%(num)s)', len(pull_request_commits) ) % {'num': len(pull_request_commits)}}: | |||
r1 | ||||
% for commit_id, message in pull_request_commits: | ||||
r4038 | - ${h.short_id(commit_id)} | |||
${h.chop_at_smart(message, '\n', suffix_if_chopped='...')} | ||||
r1 | ||||
% endfor | ||||
r4038 | --- | |||
r508 | ${self.plaintext_footer()} | |||
r1 | </%def> | |||
r548 | <% | |||
data = { | ||||
'user': h.person(user), | ||||
'pr_id': pull_request.pull_request_id, | ||||
'pr_title': pull_request.title, | ||||
'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, | ||||
r4038 | 'source_repo': pull_request_source_repo.repo_name, | |||
'target_repo': pull_request_target_repo.repo_name, | ||||
r548 | 'source_repo_url': h.link_to(pull_request_source_repo.repo_name, pull_request_source_repo_url), | |||
r4038 | 'target_repo_url': h.link_to(pull_request_target_repo.repo_name, pull_request_target_repo_url), | |||
r548 | } | |||
%> | ||||
r4038 | ||||
<table style="text-align:left;vertical-align:middle;width: 100%"> | ||||
<tr> | ||||
<td style="width:100%;border-bottom:1px solid #dbd9da;"> | ||||
<h4 style="margin: 0"> | ||||
<div style="margin-bottom: 4px; color:#7E7F7F"> | ||||
@${h.person(user.username)} | ||||
</div> | ||||
${_('requested a')} | ||||
<a href="${pull_request_url}" style="${base.link_css()}"> | ||||
${_('pull request review.').format(**data) } | ||||
</a> | ||||
<div style="margin-top: 10px"></div> | ||||
${_('Pull request')} <code>!${data['pr_id']}: ${data['pr_title']}</code> | ||||
</h4> | ||||
</td> | ||||
</tr> | ||||
</table> | ||||
<table style="text-align:left;vertical-align:middle;width: 100%"> | ||||
## spacing def | ||||
<tr> | ||||
<td style="width: 130px"></td> | ||||
<td></td> | ||||
</tr> | ||||
<tr> | ||||
<td style="padding-right:20px;line-height:20px;">${_('Commit Flow')}:</td> | ||||
<td style="line-height:20px;"> | ||||
${base.tag_button('{}:{}'.format(data['source_ref_type'], pull_request.source_ref_parts.name))} ${_('of')} ${data['source_repo_url']} | ||||
→ | ||||
${base.tag_button('{}:{}'.format(data['target_ref_type'], pull_request.target_ref_parts.name))} ${_('of')} ${data['target_repo_url']} | ||||
</td> | ||||
</tr> | ||||
<tr> | ||||
<td style="padding-right:20px;">${_('Pull request')}:</td> | ||||
<td> | ||||
<a href="${pull_request_url}" style="${base.link_css()}"> | ||||
!${pull_request.pull_request_id} | ||||
</a> | ||||
</td> | ||||
</tr> | ||||
<tr> | ||||
<td style="padding-right:20px;">${_('Description')}:</td> | ||||
<td style="white-space:pre-wrap"><code>${pull_request.description | trim}</code></td> | ||||
</tr> | ||||
<tr> | ||||
<td style="padding-right:20px;">${_ungettext('Commit (%(num)s)', 'Commits (%(num)s)', len(pull_request_commits)) % {'num': len(pull_request_commits)}}:</td> | ||||
<td></td> | ||||
</tr> | ||||
<tr> | ||||
<td colspan="2"> | ||||
<ol style="margin:0 0 0 1em;padding:0;text-align:left;"> | ||||
% for commit_id, message in pull_request_commits: | ||||
<li style="margin:0 0 1em;"> | ||||
<pre style="margin:0 0 .5em"><a href="${h.route_path('repo_commit', repo_name=pull_request_source_repo.repo_name, commit_id=commit_id)}" style="${base.link_css()}">${h.short_id(commit_id)}</a></pre> | ||||
${h.chop_at_smart(message, '\n', suffix_if_chopped='...')} | ||||
</li> | ||||
% endfor | ||||
</ol> | ||||
</td> | ||||
r508 | </tr> | |||
</table> | ||||