##// END OF EJS Templates
notifications: adding pre-wrap to descriptions in emails
lisaq -
r549:a7fac4dd default
parent child Browse files
Show More
@@ -1,88 +1,88 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <%inherit file="base.mako"/>
2 <%inherit file="base.mako"/>
3 <%namespace name="base" file="base.mako"/>
3 <%namespace name="base" file="base.mako"/>
4
4
5 <%def name="subject()" filter="n,trim">
5 <%def name="subject()" filter="n,trim">
6 <%
6 <%
7 data = {
7 data = {
8 'user': h.person(user),
8 'user': h.person(user),
9 'repo_name': repo_name,
9 'repo_name': repo_name,
10 'commit_id': h.show_id(commit),
10 'commit_id': h.show_id(commit),
11 'status': status_change,
11 'status': status_change,
12 'comment_file': comment_file,
12 'comment_file': comment_file,
13 'comment_line': comment_line,
13 'comment_line': comment_line,
14 }
14 }
15 %>
15 %>
16 ${_('[mention]') if mention else ''} \
16 ${_('[mention]') if mention else ''} \
17
17
18 % if comment_file:
18 % if comment_file:
19 ${_('%(user)s commented on commit `%(commit_id)s` (file: `%(comment_file)s`)') % data} ${_('in the %(repo_name)s repository') % data |n}
19 ${_('%(user)s commented on commit `%(commit_id)s` (file: `%(comment_file)s`)') % data} ${_('in the %(repo_name)s repository') % data |n}
20 % else:
20 % else:
21 % if status_change:
21 % if status_change:
22 ${_('%(user)s commented on commit `%(commit_id)s` (status: %(status)s)') % data |n} ${_('in the %(repo_name)s repository') % data |n}
22 ${_('%(user)s commented on commit `%(commit_id)s` (status: %(status)s)') % data |n} ${_('in the %(repo_name)s repository') % data |n}
23 % else:
23 % else:
24 ${_('%(user)s commented on commit `%(commit_id)s`') % data |n} ${_('in the %(repo_name)s repository') % data |n}
24 ${_('%(user)s commented on commit `%(commit_id)s`') % data |n} ${_('in the %(repo_name)s repository') % data |n}
25 % endif
25 % endif
26 % endif
26 % endif
27
27
28 </%def>
28 </%def>
29
29
30 <%def name="body_plaintext()" filter="n,trim">
30 <%def name="body_plaintext()" filter="n,trim">
31 <%
31 <%
32 data = {
32 data = {
33 'user': h.person(user),
33 'user': h.person(user),
34 'repo_name': repo_name,
34 'repo_name': repo_name,
35 'commit_id': h.show_id(commit),
35 'commit_id': h.show_id(commit),
36 'status': status_change,
36 'status': status_change,
37 'comment_file': comment_file,
37 'comment_file': comment_file,
38 'comment_line': comment_line,
38 'comment_line': comment_line,
39 }
39 }
40 %>
40 %>
41 ${self.subject()}
41 ${self.subject()}
42
42
43 * ${_('Comment link')}: ${commit_comment_url}
43 * ${_('Comment link')}: ${commit_comment_url}
44
44
45 * ${_('Commit')}: ${h.show_id(commit)}
45 * ${_('Commit')}: ${h.show_id(commit)}
46
46
47 %if comment_file:
47 %if comment_file:
48 * ${_('File: %(comment_file)s on line %(comment_line)s') % {'comment_file': comment_file, 'comment_line': comment_line}}
48 * ${_('File: %(comment_file)s on line %(comment_line)s') % {'comment_file': comment_file, 'comment_line': comment_line}}
49 %endif
49 %endif
50
50
51 ---
51 ---
52
52
53 %if status_change:
53 %if status_change:
54 ${_('Commit status was changed to')}: *${status_change}*
54 ${_('Commit status was changed to')}: *${status_change}*
55 %endif
55 %endif
56
56
57 ${comment_body|n}
57 ${comment_body|n}
58
58
59 ${self.plaintext_footer()}
59 ${self.plaintext_footer()}
60 </%def>
60 </%def>
61
61
62
62
63 <%
63 <%
64 data = {
64 data = {
65 'user': h.person(user),
65 'user': h.person(user),
66 'comment_file': comment_file,
66 'comment_file': comment_file,
67 'comment_line': comment_line,
67 'comment_line': comment_line,
68 'repo': commit_target_repo,
68 'repo': commit_target_repo,
69 'repo_name': repo_name,
69 'repo_name': repo_name,
70 'commit_id': h.show_id(commit),
70 'commit_id': h.show_id(commit),
71 }
71 }
72 %>
72 %>
73 <table style="text-align:left;vertical-align:middle;">
73 <table style="text-align:left;vertical-align:middle;">
74 <tr><td colspan="2" style="width:100%;padding-bottom:15px;border-bottom:1px solid #dbd9da;">
74 <tr><td colspan="2" style="width:100%;padding-bottom:15px;border-bottom:1px solid #dbd9da;">
75 % if comment_file:
75 % if comment_file:
76 <h4><a href="${commit_comment_url}" style="color:#427cc9;text-decoration:none;cursor:pointer">${_('%(user)s commented on commit `%(commit_id)s` (file:`%(comment_file)s`)') % data}</a> ${_('in the %(repo)s repository') % data |n}</h4>
76 <h4><a href="${commit_comment_url}" style="color:#427cc9;text-decoration:none;cursor:pointer">${_('%(user)s commented on commit `%(commit_id)s` (file:`%(comment_file)s`)') % data}</a> ${_('in the %(repo)s repository') % data |n}</h4>
77 % else:
77 % else:
78 <h4><a href="${commit_comment_url}" style="color:#427cc9;text-decoration:none;cursor:pointer">${_('%(user)s commented on commit `%(commit_id)s`') % data |n}</a> ${_('in the %(repo)s repository') % data |n}</h4>
78 <h4><a href="${commit_comment_url}" style="color:#427cc9;text-decoration:none;cursor:pointer">${_('%(user)s commented on commit `%(commit_id)s`') % data |n}</a> ${_('in the %(repo)s repository') % data |n}</h4>
79 % endif
79 % endif
80 </td></tr>
80 </td></tr>
81 <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>
81 <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>
82 <tr><td style="padding-right:20px;">${_('Description')}</td><td>${h.urlify_commit_message(commit.message, repo_name)}</td></tr>
82 <tr><td style="padding-right:20px;">${_('Description')}</td><td style="white-space:pre-wrap">${h.urlify_commit_message(commit.message, repo_name)}</td></tr>
83
83
84 % if status_change:
84 % if status_change:
85 <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></tr>
85 <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></tr>
86 % endif
86 % endif
87 <tr><td style="padding-right:20px;">${(_('Comment on line: %(comment_line)s') if comment_file else _('Comment')) % data}</td><td style="line-height:1.2em;">${h.render(comment_body, renderer=renderer_type, mentions=True)}</td></tr>
87 <tr><td style="padding-right:20px;">${(_('Comment on line: %(comment_line)s') if comment_file else _('Comment')) % data}</td><td style="line-height:1.2em;white-space:pre-wrap">${h.render(comment_body, renderer=renderer_type, mentions=True)}</td></tr>
88 </table>
88 </table>
@@ -1,98 +1,98 b''
1 ## -*- coding: utf-8 -*-
1 ## -*- coding: utf-8 -*-
2 <%inherit file="base.mako"/>
2 <%inherit file="base.mako"/>
3 <%namespace name="base" file="base.mako"/>
3 <%namespace name="base" file="base.mako"/>
4
4
5
5
6 <%def name="subject()" filter="n,trim">
6 <%def name="subject()" filter="n,trim">
7 <%
7 <%
8 data = {
8 data = {
9 'user': h.person(user),
9 'user': h.person(user),
10 'pr_title': pull_request.title,
10 'pr_title': pull_request.title,
11 'pr_id': pull_request.pull_request_id,
11 'pr_id': pull_request.pull_request_id,
12 'status': status_change,
12 'status': status_change,
13 'comment_file': comment_file,
13 'comment_file': comment_file,
14 'comment_line': comment_line,
14 'comment_line': comment_line,
15 }
15 }
16 %>
16 %>
17
17
18 ${_('[mention]') if mention else ''} \
18 ${_('[mention]') if mention else ''} \
19
19
20 % if comment_file:
20 % if comment_file:
21 ${_('%(user)s commented on pull request #%(pr_id)s "%(pr_title)s" (file: `%(comment_file)s`)') % data |n}
21 ${_('%(user)s commented on pull request #%(pr_id)s "%(pr_title)s" (file: `%(comment_file)s`)') % data |n}
22 % else:
22 % else:
23 % if status_change:
23 % if status_change:
24 ${_('%(user)s commented on pull request #%(pr_id)s "%(pr_title)s" (status: %(status)s)') % data |n}
24 ${_('%(user)s commented on pull request #%(pr_id)s "%(pr_title)s" (status: %(status)s)') % data |n}
25 % else:
25 % else:
26 ${_('%(user)s commented on pull request #%(pr_id)s "%(pr_title)s"') % data |n}
26 ${_('%(user)s commented on pull request #%(pr_id)s "%(pr_title)s"') % data |n}
27 % endif
27 % endif
28 % endif
28 % endif
29 </%def>
29 </%def>
30
30
31 <%def name="body_plaintext()" filter="n,trim">
31 <%def name="body_plaintext()" filter="n,trim">
32 <%
32 <%
33 data = {
33 data = {
34 'user': h.person(user),
34 'user': h.person(user),
35 'pr_title': pull_request.title,
35 'pr_title': pull_request.title,
36 'pr_id': pull_request.pull_request_id,
36 'pr_id': pull_request.pull_request_id,
37 'status': status_change,
37 'status': status_change,
38 'comment_file': comment_file,
38 'comment_file': comment_file,
39 'comment_line': comment_line,
39 'comment_line': comment_line,
40 }
40 }
41 %>
41 %>
42 ${self.subject()}
42 ${self.subject()}
43
43
44 * ${_('Comment link')}: ${pr_comment_url}
44 * ${_('Comment link')}: ${pr_comment_url}
45
45
46 * ${_('Source repository')}: ${pr_source_repo_url}
46 * ${_('Source repository')}: ${pr_source_repo_url}
47
47
48 %if comment_file:
48 %if comment_file:
49 * ${_('File: %(comment_file)s on line %(comment_line)s') % {'comment_file': comment_file, 'comment_line': comment_line}}
49 * ${_('File: %(comment_file)s on line %(comment_line)s') % {'comment_file': comment_file, 'comment_line': comment_line}}
50 %endif
50 %endif
51
51
52 ---
52 ---
53
53
54 %if status_change and not closing_pr:
54 %if status_change and not closing_pr:
55 ${_('%(user)s submitted pull request #%(pr_id)s status: *%(status)s*') % data}
55 ${_('%(user)s submitted pull request #%(pr_id)s status: *%(status)s*') % data}
56 %elif status_change and closing_pr:
56 %elif status_change and closing_pr:
57 ${_('%(user)s submitted pull request #%(pr_id)s status: *%(status)s and closed*') % data}
57 ${_('%(user)s submitted pull request #%(pr_id)s status: *%(status)s and closed*') % data}
58 %endif
58 %endif
59
59
60 ${comment_body|n}
60 ${comment_body|n}
61
61
62 ${self.plaintext_footer()}
62 ${self.plaintext_footer()}
63 </%def>
63 </%def>
64
64
65
65
66 <%
66 <%
67 data = {
67 data = {
68 'user': h.person(user),
68 'user': h.person(user),
69 'pr_title': pull_request.title,
69 'pr_title': pull_request.title,
70 'pr_id': pull_request.pull_request_id,
70 'pr_id': pull_request.pull_request_id,
71 'status': status_change,
71 'status': status_change,
72 'comment_file': comment_file,
72 'comment_file': comment_file,
73 'comment_line': comment_line,
73 'comment_line': comment_line,
74 }
74 }
75 %>
75 %>
76 <table style="text-align:left;vertical-align:middle;">
76 <table style="text-align:left;vertical-align:middle;">
77 <tr><td colspan="2" style="width:100%;padding-bottom:15px;border-bottom:1px solid #dbd9da;">
77 <tr><td colspan="2" style="width:100%;padding-bottom:15px;border-bottom:1px solid #dbd9da;">
78 <h4><a href="${pr_comment_url}" style="color:#427cc9;text-decoration:none;cursor:pointer">
78 <h4><a href="${pr_comment_url}" style="color:#427cc9;text-decoration:none;cursor:pointer">
79
79
80 % if comment_file:
80 % if comment_file:
81 ${_('%(user)s commented on pull request #%(pr_id)s "%(pr_title)s" (file:`%(comment_file)s`)') % data |n}
81 ${_('%(user)s commented on pull request #%(pr_id)s "%(pr_title)s" (file:`%(comment_file)s`)') % data |n}
82 % else:
82 % else:
83 ${_('%(user)s commented on pull request #%(pr_id)s "%(pr_title)s"') % data |n}
83 ${_('%(user)s commented on pull request #%(pr_id)s "%(pr_title)s"') % data |n}
84 % endif
84 % endif
85 </a>
85 </a>
86 %if status_change and not closing_pr:
86 %if status_change and not closing_pr:
87 , ${_('submitted pull request status: %(status)s') % data}
87 , ${_('submitted pull request status: %(status)s') % data}
88 %elif status_change and closing_pr:
88 %elif status_change and closing_pr:
89 , ${_('submitted pull request status: %(status)s and closed') % data}
89 , ${_('submitted pull request status: %(status)s and closed') % data}
90 %endif
90 %endif
91 </h4>
91 </h4>
92 </td></tr>
92 </td></tr>
93 <tr><td style="padding-right:20px;padding-top:15px;">${_('Source')}</td><td style="padding-top:15px;"><a style="color:#427cc9;text-decoration:none;cursor:pointer" href="${pr_source_repo_url}">${pr_source_repo.repo_name}</a></td></tr>
93 <tr><td style="padding-right:20px;padding-top:15px;">${_('Source')}</td><td style="padding-top:15px;"><a style="color:#427cc9;text-decoration:none;cursor:pointer" href="${pr_source_repo_url}">${pr_source_repo.repo_name}</a></td></tr>
94 % if status_change:
94 % if status_change:
95 <tr><td style="padding-right:20px;">${_('Submitted status')}</td><td>${base.status_text(status_change, tag_type=status_change_type)}</td></tr>
95 <tr><td style="padding-right:20px;">${_('Submitted status')}</td><td>${base.status_text(status_change, tag_type=status_change_type)}</td></tr>
96 % endif
96 % endif
97 <tr><td style="padding-right:20px;">${(_('Comment on line: %(comment_line)s') if comment_file else _('Comment')) % data}</td><td style="line-height:1.2em;">${h.render(comment_body, renderer=renderer_type, mentions=True)}</td></tr>
97 <tr><td style="padding-right:20px;">${(_('Comment on line: %(comment_line)s') if comment_file else _('Comment')) % data}</td><td style="line-height:1.2em;white-space:pre-wrap">${h.render(comment_body, renderer=renderer_type, mentions=True)}</td></tr>
98 </table>
98 </table>
General Comments 0
You need to be logged in to leave comments. Login now