Show More
commit_comment.mako
108 lines
| 3.7 KiB
| application/x-mako
|
MakoHtmlLexer
r1 | ## -*- coding: utf-8 -*- | |||
<%inherit file="base.mako"/> | ||||
r548 | <%namespace name="base" file="base.mako"/> | |||
r532 | ||||
r1453 | ## EMAIL SUBJECT | |||
r1728 | <%def name="subject()" filter="n,trim,whitespace_filter"> | |||
r532 | <% | |||
data = { | ||||
'user': h.person(user), | ||||
r535 | 'repo_name': repo_name, | |||
'commit_id': h.show_id(commit), | ||||
'status': status_change, | ||||
r532 | 'comment_file': comment_file, | |||
'comment_line': comment_line, | ||||
r1453 | 'comment_type': comment_type, | |||
r532 | } | |||
%> | ||||
${_('[mention]') if mention else ''} \ | ||||
% if comment_file: | ||||
r3120 | ${_('{user} left a {comment_type} on file `{comment_file}` in commit `{commit_id}`').format(**data)} ${_('in the {repo_name} repository').format(**data) |n} | |||
r532 | % else: | |||
r535 | % if status_change: | |||
r3120 | ${_('[status: {status}] {user} left a {comment_type} on commit `{commit_id}`').format(**data) |n} ${_('in the {repo_name} repository').format(**data) |n} | |||
r535 | % else: | |||
r3120 | ${_('{user} left a {comment_type} on commit `{commit_id}`').format(**data) |n} ${_('in the {repo_name} repository').format(**data) |n} | |||
r535 | % endif | |||
r532 | % endif | |||
r1 | </%def> | |||
r1453 | ## PLAINTEXT VERSION OF BODY | |||
r1 | <%def name="body_plaintext()" filter="n,trim"> | |||
r535 | <% | |||
data = { | ||||
'user': h.person(user), | ||||
'repo_name': repo_name, | ||||
'commit_id': h.show_id(commit), | ||||
'status': status_change, | ||||
'comment_file': comment_file, | ||||
'comment_line': comment_line, | ||||
r1453 | 'comment_type': comment_type, | |||
r535 | } | |||
%> | ||||
r1 | ${self.subject()} | |||
* ${_('Comment link')}: ${commit_comment_url} | ||||
* ${_('Commit')}: ${h.show_id(commit)} | ||||
%if comment_file: | ||||
r3120 | * ${_('File: {comment_file} on line {comment_line}').format(**data)} | |||
r1 | %endif | |||
--- | ||||
%if status_change: | ||||
${_('Commit status was changed to')}: *${status_change}* | ||||
%endif | ||||
r535 | ${comment_body|n} | |||
r508 | ${self.plaintext_footer()} | |||
r1 | </%def> | |||
r532 | ||||
<% | ||||
data = { | ||||
'user': h.person(user), | ||||
'repo': commit_target_repo, | ||||
'repo_name': repo_name, | ||||
'commit_id': h.show_id(commit), | ||||
r1453 | 'comment_file': comment_file, | |||
'comment_line': comment_line, | ||||
'comment_type': comment_type, | ||||
r532 | } | |||
%> | ||||
r508 | <table style="text-align:left;vertical-align:middle;"> | |||
r532 | <tr><td colspan="2" style="width:100%;padding-bottom:15px;border-bottom:1px solid #dbd9da;"> | |||
r1453 | ||||
r535 | % if comment_file: | |||
r3120 | <h4><a href="${commit_comment_url}" style="color:#427cc9;text-decoration:none;cursor:pointer">${_('{user} left a {comment_type} on file `{comment_file}` in commit `{commit_id}`').format(**data)}</a> ${_('in the {repo} repository').format(**data) |n}</h4> | |||
r535 | % else: | |||
r3120 | <h4><a href="${commit_comment_url}" style="color:#427cc9;text-decoration:none;cursor:pointer">${_('{user} left a {comment_type} on commit `{commit_id}`').format(**data) |n}</a> ${_('in the {repo} repository').format(**data) |n}</h4> | |||
r535 | % endif | |||
r532 | </td></tr> | |||
r1453 | ||||
r508 | <tr><td style="padding-right:20px;padding-top:15px;">${_('Commit')}</td><td style="padding-top:15px;"><a href="${commit_comment_url}" style="color:#427cc9;text-decoration:none;cursor:pointer">${h.show_id(commit)}</a></td></tr> | |||
r549 | <tr><td style="padding-right:20px;">${_('Description')}</td><td style="white-space:pre-wrap">${h.urlify_commit_message(commit.message, repo_name)}</td></tr> | |||
r532 | ||||
% if status_change: | ||||
r3120 | <tr> | |||
<td style="padding-right:20px;">${_('Status')}</td> | ||||
<td> | ||||
${_('The commit status was changed to')}: ${base.status_text(status_change, tag_type=status_change_type)} | ||||
</td> | ||||
r1453 | </tr> | |||
r532 | % endif | |||
r1453 | <tr> | |||
<td style="padding-right:20px;"> | ||||
% if comment_type == 'todo': | ||||
r3120 | ${(_('TODO comment on line: {comment_line}') if comment_file else _('TODO comment')).format(**data)} | |||
r1453 | % else: | |||
r3120 | ${(_('Note comment on line: {comment_line}') if comment_file else _('Note comment')).format(**data)} | |||
r1453 | % endif | |||
</td> | ||||
<td style="line-height:1.2em;white-space:pre-wrap">${h.render(comment_body, renderer=renderer_type, mentions=True)}</td></tr> | ||||
r532 | </table> | |||