commit_comment.mako
161 lines
| 4.6 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 = { | ||||
r4038 | 'user': '@'+h.person(user), | |||
r535 | 'repo_name': repo_name, | |||
'status': status_change, | ||||
r532 | 'comment_file': comment_file, | |||
'comment_line': comment_line, | ||||
r1453 | 'comment_type': comment_type, | |||
r4038 | ||||
'commit_id': h.show_id(commit), | ||||
r532 | } | |||
%> | ||||
r4038 | ||||
r532 | ||||
% if comment_file: | ||||
r4038 | ${(_('[mention]') if mention else '')} ${_('{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: | |||
r4038 | ${(_('[mention]') if mention else '')} ${_('[status: {status}] {user} left a {comment_type} on commit `{commit_id}`').format(**data) |n} ${_('in the `{repo_name}` repository').format(**data) |n} | |||
r535 | % else: | |||
r4038 | ${(_('[mention]') if mention else '')} ${_('{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, | ||||
'status': status_change, | ||||
'comment_file': comment_file, | ||||
'comment_line': comment_line, | ||||
r1453 | 'comment_type': comment_type, | |||
r4038 | ||||
'commit_id': h.show_id(commit), | ||||
r535 | } | |||
%> | ||||
r1 | ||||
* ${_('Comment link')}: ${commit_comment_url} | ||||
r4038 | %if status_change: | |||
* ${_('Commit status')}: ${_('Status was changed to')}: *${status_change}* | ||||
%endif | ||||
r1 | * ${_('Commit')}: ${h.show_id(commit)} | |||
r4038 | * ${_('Commit message')}: ${commit.message} | |||
r1 | %if comment_file: | |||
r3120 | * ${_('File: {comment_file} on line {comment_line}').format(**data)} | |||
r4038 | ||||
r1 | %endif | |||
r4038 | % if comment_type == 'todo': | |||
${_('`TODO` comment')}: | ||||
% else: | ||||
${_('`Note` comment')}: | ||||
% endif | ||||
${comment_body |n, trim} | ||||
r1 | ||||
--- | ||||
r508 | ${self.plaintext_footer()} | |||
r1 | </%def> | |||
r532 | ||||
<% | ||||
data = { | ||||
'user': h.person(user), | ||||
r1453 | 'comment_file': comment_file, | |||
'comment_line': comment_line, | ||||
'comment_type': comment_type, | ||||
r4038 | 'renderer_type': renderer_type or 'plain', | |||
'repo': commit_target_repo_url, | ||||
'repo_name': repo_name, | ||||
'commit_id': h.show_id(commit), | ||||
r532 | } | |||
%> | ||||
r4038 | ||||
<table style="text-align:left;vertical-align:middle;width: 100%"> | ||||
<tr> | ||||
<td style="width:100%;border-bottom:1px solid #dbd9da;"> | ||||
r1453 | ||||
r4038 | <h4 style="margin: 0"> | |||
<div style="margin-bottom: 4px; color:#7E7F7F"> | ||||
@${h.person(user.username)} | ||||
</div> | ||||
${_('left a')} | ||||
<a href="${commit_comment_url}" style="${base.link_css()}"> | ||||
% if comment_file: | ||||
${_('{comment_type} on file `{comment_file}` in commit.').format(**data)} | ||||
% else: | ||||
${_('{comment_type} on commit.').format(**data) |n} | ||||
% endif | ||||
</a> | ||||
<div style="margin-top: 10px"></div> | ||||
${_('Commit')} <code>${data['commit_id']}</code> ${_('of repository')}: ${data['repo_name']} | ||||
</h4> | ||||
r1453 | ||||
r4038 | </td> | |||
</tr> | ||||
</table> | ||||
<table style="text-align:left;vertical-align:middle;width: 100%"> | ||||
## spacing def | ||||
<tr> | ||||
<td style="width: 130px"></td> | ||||
<td></td> | ||||
</tr> | ||||
r532 | ||||
% if status_change: | ||||
r3120 | <tr> | |||
r4038 | <td style="padding-right:20px;">${_('Commit Status')}:</td> | |||
r3120 | <td> | |||
r4038 | ${_('Status was changed to')}: ${base.status_text(status_change, tag_type=status_change_type)} | |||
r3120 | </td> | |||
r1453 | </tr> | |||
r532 | % endif | |||
r4038 | ||||
r1453 | <tr> | |||
r4038 | <td style="padding-right:20px;">${_('Commit')}:</td> | |||
<td> | ||||
<a href="${commit_comment_url}" style="${base.link_css()}">${h.show_id(commit)}</a> | ||||
</td> | ||||
</tr> | ||||
<tr> | ||||
<td style="padding-right:20px;">${_('Commit message')}:</td> | ||||
<td style="white-space:pre-wrap">${h.urlify_commit_message(commit.message, repo_name)}</td> | ||||
</tr> | ||||
% if comment_file: | ||||
<tr> | ||||
<td style="padding-right:20px;">${_('File')}:</td> | ||||
<td><a href="${commit_comment_url}" style="${base.link_css()}">${_('`{comment_file}` on line {comment_line}').format(**data)}</a></td> | ||||
</tr> | ||||
% endif | ||||
<tr style="background-image: linear-gradient(to right, black 33%, rgba(255,255,255,0) 0%);background-position: bottom;background-size: 3px 1px;background-repeat: repeat-x;"> | ||||
<td colspan="2" style="padding-right:20px;"> | ||||
r1453 | % if comment_type == 'todo': | |||
r4038 | ${_('`TODO` comment')}: | |||
r1453 | % else: | |||
r4038 | ${_('`Note` comment')}: | |||
r1453 | % endif | |||
</td> | ||||
r4038 | </tr> | |||
<td colspan="2" style="background: #F7F7F7">${h.render(comment_body, renderer=data['renderer_type'], mentions=True)}</td> | ||||
</tr> | ||||
r532 | </table> | |||