##// END OF EJS Templates
pull-requests: allow forced state change to repo admins too.
pull-requests: allow forced state change to repo admins too.

File last commit:

r4681:7eba96a2 stable
r4710:97a223d9 stable
Show More
pull_request_review.mako
154 lines | 5.6 KiB | application/x-mako | MakoHtmlLexer
project: added all source files and assets
r1 ## -*- coding: utf-8 -*-
<%inherit file="base.mako"/>
emails: added new tags to status sent...
r548 <%namespace name="base" file="base.mako"/>
project: added all source files and assets
r1
dan
emails: updated emails design and data structure they provide....
r4038 ## EMAIL SUBJECT
emails: fixed newlines in email templates that can break email sending code.
r1728 <%def name="subject()" filter="n,trim,whitespace_filter">
emails: added new tags to status sent...
r548 <%
data = {
dan
emails: updated emails design and data structure they provide....
r4038 'user': '@'+h.person(user),
emails: added new tags to status sent...
r548 'pr_id': pull_request.pull_request_id,
pull-requests: fixed a case when template marker was used in description field....
r4631 'pr_title': pull_request.title_safe,
emails: added new tags to status sent...
r548 }
emails: added logic to allow overwriting the default email titles via rcextensions.
r4448
reviewers: added observers as another way to define reviewers....
r4500 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}"')
emails: added new tags to status sent...
r548 %>
emails: added logic to allow overwriting the default email titles via rcextensions.
r4448 ${subject_template.format(**data) |n}
project: added all source files and assets
r1 </%def>
dan
emails: updated emails design and data structure they provide....
r4038 ## PLAINTEXT VERSION OF BODY
project: added all source files and assets
r1 <%def name="body_plaintext()" filter="n,trim">
emails: added new tags to status sent...
r548 <%
data = {
'user': h.person(user),
'pr_id': pull_request.pull_request_id,
pull-requests: fixed a case when template marker was used in description field....
r4631 'pr_title': pull_request.title_safe,
emails: added new tags to status sent...
r548 '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,
dan
emails: updated emails design and data structure they provide....
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,
emails: added new tags to status sent...
r548 }
reviewers: added observers as another way to define reviewers....
r4500
emails: added new tags to status sent...
r548 %>
project: added all source files and assets
r1
dan
notifications/emails: improve notification display and rendered emails structure
r4060 * ${_('Pull Request link')}: ${pull_request_url}
project: added all source files and assets
r1
dan
emails: updated emails design and data structure they provide....
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))}
project: added all source files and assets
r1
* ${_('Title')}: ${pull_request.title}
* ${_('Description')}:
dan
emails: updated emails design and data structure they provide....
r4038 ${pull_request.description | trim}
project: added all source files and assets
r1
translation: unified usage of pluralize function ungettext....
r1945 * ${_ungettext('Commit (%(num)s)', 'Commits (%(num)s)', len(pull_request_commits) ) % {'num': len(pull_request_commits)}}:
project: added all source files and assets
r1
% for commit_id, message in pull_request_commits:
dan
emails: updated emails design and data structure they provide....
r4038 - ${h.short_id(commit_id)}
reviewers: added observers as another way to define reviewers....
r4500 ${h.chop_at_smart(message.lstrip(), '\n', suffix_if_chopped='...')}
project: added all source files and assets
r1
% endfor
dan
emails: updated emails design and data structure they provide....
r4038 ---
notifications: restyling email templates #4087
r508 ${self.plaintext_footer()}
project: added all source files and assets
r1 </%def>
emails: added new tags to status sent...
r548 <%
data = {
'user': h.person(user),
'pr_id': pull_request.pull_request_id,
pull-requests: fixed a case when template marker was used in description field....
r4631 'pr_title': pull_request.title_safe,
emails: added new tags to status sent...
r548 '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,
dan
emails: updated emails design and data structure they provide....
r4038 'source_repo': pull_request_source_repo.repo_name,
'target_repo': pull_request_target_repo.repo_name,
emails: added new tags to status sent...
r548 'source_repo_url': h.link_to(pull_request_source_repo.repo_name, pull_request_source_repo_url),
dan
emails: updated emails design and data structure they provide....
r4038 'target_repo_url': h.link_to(pull_request_target_repo.repo_name, pull_request_target_repo_url),
emails: added new tags to status sent...
r548 }
%>
emails: improved styling, and fixed problems with some email clients...
r4377 ## header
dan
emails: updated emails design and data structure they provide....
r4038 <table style="text-align:left;vertical-align:middle;width: 100%">
<tr>
<td style="width:100%;border-bottom:1px solid #dbd9da;">
emails: improved styling, and fixed problems with some email clients...
r4377 <div style="margin: 0; font-weight: bold">
reviewers: added observers as another way to define reviewers....
r4500 % if user_role == 'observer':
<div class="clear-both" class="clear-both" style="margin-bottom: 4px">
<span style="color:#7E7F7F">@${h.person(user.username)}</span>
${_('added you as observer to')}
<a href="${pull_request_url}" style="${base.link_css()}">pull request</a>.
</div>
% else:
emails: improved styling, and fixed problems with some email clients...
r4377 <div class="clear-both" class="clear-both" style="margin-bottom: 4px">
pull-requests: added update pull-requests email+notifications...
r4120 <span style="color:#7E7F7F">@${h.person(user.username)}</span>
${_('requested a')}
reviewers: added observers as another way to define reviewers....
r4500 <a href="${pull_request_url}" style="${base.link_css()}">pull request</a> review.
dan
emails: updated emails design and data structure they provide....
r4038 </div>
reviewers: added observers as another way to define reviewers....
r4500 % endif
dan
emails: updated emails design and data structure they provide....
r4038 <div style="margin-top: 10px"></div>
${_('Pull request')} <code>!${data['pr_id']}: ${data['pr_title']}</code>
emails: improved styling, and fixed problems with some email clients...
r4377 </div>
dan
emails: updated emails design and data structure they provide....
r4038 </td>
</tr>
</table>
emails: improved styling, and fixed problems with some email clients...
r4377 <div class="clear-both"></div>
## main body
dan
emails: updated emails design and data structure they provide....
r4038 <table style="text-align:left;vertical-align:middle;width: 100%">
## spacing def
<tr>
<td style="width: 130px"></td>
<td></td>
</tr>
<tr>
dan
notifications/emails: improve notification display and rendered emails structure
r4060 <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>
dan
emails: updated emails design and data structure they provide....
r4038 <td style="padding-right:20px;line-height:20px;">${_('Commit Flow')}:</td>
<td style="line-height:20px;">
pull-requests: fixed problems with unicode characters in branches.
r4681 <code>${data['source_ref_type']}:${pull_request.source_ref_parts.name}</code> ${_('of')} ${data['source_repo_url']}
dan
emails: updated emails design and data structure they provide....
r4038 &rarr;
pull-requests: fixed problems with unicode characters in branches.
r4681 <code>${data['target_ref_type']}:${pull_request.target_ref_parts.name}</code> ${_('of')} ${data['target_repo_url']}
dan
emails: updated emails design and data structure they provide....
r4038 </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>
notifications: restyling email templates #4087
r508 </tr>
</table>