##// END OF EJS Templates
deps: bumped jinja2==3.1.3 for security fix
deps: bumped jinja2==3.1.3 for security fix

File last commit:

r5037:bd722d6e default
r5627:4bd8cc5f default
Show More
pull_request_comment.mako
204 lines | 6.9 KiB | application/x-mako | MakoHtmlLexer
project: added all source files and assets
r1 <%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
emails: added note types into emails. Fixes #5221
r1453 ## EMAIL SUBJECT
emails: fixed newlines in email templates that can break email sending code.
r1728 <%def name="subject()" filter="n,trim,whitespace_filter">
emails: optimize some labels, and made few i18n fixes....
r532 <%
data = {
dan
emails: updated emails design and data structure they provide....
r4038 'user': '@'+h.person(user),
'repo_name': repo_name,
emails: optimize some labels, and made few i18n fixes....
r532 'status': status_change,
'comment_file': comment_file,
'comment_line': comment_line,
emails: added note types into emails. Fixes #5221
r1453 'comment_type': comment_type,
dan
emails: added reply link to comment type emails...
r4050 'comment_id': comment_id,
dan
emails: updated emails design and data structure they provide....
r4038
pull-requests: fixed a case when template marker was used in description field....
r4631 'pr_title': pull_request.title_safe,
dan
emails: updated emails design and data structure they provide....
r4038 'pr_id': pull_request.pull_request_id,
emails: set References header for threading in mail user agents even with different subjects...
r4447 'mention_prefix': '[mention] ' if mention else '',
emails: optimize some labels, and made few i18n fixes....
r532 }
emails: added logic to allow overwriting the default email titles via rcextensions.
r4448
if comment_file:
subject_template = email_pr_comment_file_subject_template or \
_('{mention_prefix}{user} left a {comment_type} on file `{comment_file}` in pull request !{pr_id}: "{pr_title}"').format(**data)
else:
if status_change:
subject_template = email_pr_comment_status_change_subject_template or \
_('{mention_prefix}[status: {status}] {user} left a {comment_type} on pull request !{pr_id}: "{pr_title}"').format(**data)
else:
subject_template = email_pr_comment_subject_template or \
_('{mention_prefix}{user} left a {comment_type} on pull request !{pr_id}: "{pr_title}"').format(**data)
emails: optimize some labels, and made few i18n fixes....
r532 %>
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>
emails: added note types into emails. Fixes #5221
r1453 ## PLAINTEXT VERSION OF BODY
project: added all source files and assets
r1 <%def name="body_plaintext()" filter="n,trim">
emails: optimize some labels, and made few i18n fixes....
r532 <%
data = {
'user': h.person(user),
dan
emails: updated emails design and data structure they provide....
r4038 'repo_name': repo_name,
emails: optimize some labels, and made few i18n fixes....
r532 'status': status_change,
'comment_file': comment_file,
'comment_line': comment_line,
emails: added note types into emails. Fixes #5221
r1453 'comment_type': comment_type,
dan
emails: added reply link to comment type emails...
r4050 'comment_id': comment_id,
dan
emails: updated emails design and data structure they provide....
r4038
pull-requests: fixed a case when template marker was used in description field....
r4631 'pr_title': pull_request.title_safe,
dan
emails: updated emails design and data structure they provide....
r4038 'pr_id': pull_request.pull_request_id,
'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,
'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: optimize some labels, and made few i18n fixes....
r532 }
%>
dan
emails: updated emails design and data structure they provide....
r4038
dan
notifications/emails: improve notification display and rendered emails structure
r4060 * ${_('Comment link')}: ${pr_comment_url}
* ${_('Pull Request')}: !${pull_request.pull_request_id}
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
dan
emails: updated emails design and data structure they provide....
r4038 %if status_change and not closing_pr:
* ${_('{user} submitted pull request !{pr_id} status: *{status}*').format(**data)}
project: added all source files and assets
r1
dan
emails: updated emails design and data structure they provide....
r4038 %elif status_change and closing_pr:
* ${_('{user} submitted pull request !{pr_id} status: *{status} and closed*').format(**data)}
%endif
project: added all source files and assets
r1 %if comment_file:
dan
emails: updated emails design and data structure they provide....
r4038 * ${_('File: {comment_file} on line {comment_line}').format(**data)}
project: added all source files and assets
r1 %endif
dan
emails: updated emails design and data structure they provide....
r4038 % if comment_type == 'todo':
dan
notifications/emails: improve notification display and rendered emails structure
r4060 ${('Inline' if comment_file else 'General')} ${_('`TODO` number')} ${comment_id}:
dan
emails: updated emails design and data structure they provide....
r4038 % else:
dan
notifications/emails: improve notification display and rendered emails structure
r4060 ${('Inline' if comment_file else 'General')} ${_('`Note` number')} ${comment_id}:
dan
emails: updated emails design and data structure they provide....
r4038 % endif
${comment_body |n, trim}
project: added all source files and assets
r1
---
notifications: restyling email templates #4087
r508 ${self.plaintext_footer()}
project: added all source files and assets
r1 </%def>
emails: optimize some labels, and made few i18n fixes....
r532
<%
data = {
'user': h.person(user),
'comment_file': comment_file,
'comment_line': comment_line,
emails: added note types into emails. Fixes #5221
r1453 'comment_type': comment_type,
dan
emails: added reply link to comment type emails...
r4050 'comment_id': comment_id,
dan
emails: updated emails design and data structure they provide....
r4038 'renderer_type': renderer_type or 'plain',
pull-requests: fixed a case when template marker was used in description field....
r4631 'pr_title': pull_request.title_safe,
dan
emails: updated emails design and data structure they provide....
r4038 'pr_id': pull_request.pull_request_id,
'status': status_change,
'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,
'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),
emails: optimize some labels, and made few i18n fixes....
r532 }
%>
dan
emails: updated emails design and data structure they provide....
r4038
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: optimize some labels, and made few i18n fixes....
r532
emails: improved styling, and fixed problems with some email clients...
r4377 <div style="margin: 0; font-weight: bold">
<div 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>
${_('left a')}
<a href="${pr_comment_url}" style="${base.link_css()}">
% if comment_file:
${_('{comment_type} on file `{comment_file}` in pull request.').format(**data)}
% else:
${_('{comment_type} on pull request.').format(**data) |n}
% endif
</a>
dan
emails: updated emails design and data structure they provide....
r4038 </div>
<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>
emails: added note types into emails. Fixes #5221
r1453
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>
emails: added note types into emails. Fixes #5221
r1453
emails: added new tags to status sent...
r548 % if status_change:
dan
emails: updated emails design and data structure they provide....
r4038 <tr>
<td style="padding-right:20px;">${_('Review Status')}:</td>
<td>
% if closing_pr:
${_('Closed pull request with status')}: ${base.status_text(status_change, tag_type=status_change_type)}
% else:
${_('Submitted review status')}: ${base.status_text(status_change, tag_type=status_change_type)}
% endif
</td>
</tr>
% endif
dan
notifications/emails: improve notification display and rendered emails structure
r4060 <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>
dan
emails: updated emails design and data structure they provide....
r4038
<tr>
<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>
dan
notifications/emails: improve notification display and rendered emails structure
r4060
dan
emails: updated emails design and data structure they provide....
r4038 % if comment_file:
emails: added note types into emails. Fixes #5221
r1453 <tr>
dan
emails: updated emails design and data structure they provide....
r4038 <td style="padding-right:20px;">${_('File')}:</td>
<td><a href="${pr_comment_url}" style="${base.link_css()}">${_('`{comment_file}` on line {comment_line}').format(**data)}</a></td>
emails: added note types into emails. Fixes #5221
r1453 </tr>
emails: added new tags to status sent...
r548 % endif
dan
emails: updated emails design and data structure they provide....
r4038
dan
emails: added reply link to comment type emails...
r4050 <tr style="border-bottom:1px solid #dbd9da;">
dan
emails: updated emails design and data structure they provide....
r4038 <td colspan="2" style="padding-right:20px;">
emails: added note types into emails. Fixes #5221
r1453 % if comment_type == 'todo':
dan
emails: expose inline/general next to comment type.
r4052 ${('Inline' if comment_file else 'General')} ${_('`TODO` number')} ${comment_id}:
emails: added note types into emails. Fixes #5221
r1453 % else:
dan
emails: expose inline/general next to comment type.
r4052 ${('Inline' if comment_file else 'General')} ${_('`Note` number')} ${comment_id}:
emails: added note types into emails. Fixes #5221
r1453 % endif
</td>
dan
emails: updated emails design and data structure they provide....
r4038 </tr>
dan
emails: added reply link to comment type emails...
r4050 <tr>
<td colspan="2" style="background: #F7F7F7">${h.render(comment_body, renderer=data['renderer_type'], mentions=True)}</td>
</tr>
<tr>
<td><a href="${pr_comment_reply_url}">${_('Reply')}</a></td>
<td></td>
emails: added note types into emails. Fixes #5221
r1453 </tr>
notifications: restyling email templates #4087
r508 </table>