##// END OF EJS Templates
emails: updated comment template header to be exactly like other email templates.
marcink -
r4121:e643003b default
parent child Browse files
Show More
@@ -1,170 +1,170 b''
1 1 ## -*- coding: utf-8 -*-
2 2 <%inherit file="base.mako"/>
3 3 <%namespace name="base" file="base.mako"/>
4 4
5 5 ## EMAIL SUBJECT
6 6 <%def name="subject()" filter="n,trim,whitespace_filter">
7 7 <%
8 8 data = {
9 9 'user': '@'+h.person(user),
10 10 'repo_name': repo_name,
11 11 'status': status_change,
12 12 'comment_file': comment_file,
13 13 'comment_line': comment_line,
14 14 'comment_type': comment_type,
15 15 'comment_id': comment_id,
16 16
17 17 'commit_id': h.show_id(commit),
18 18 }
19 19 %>
20 20
21 21
22 22 % if comment_file:
23 23 ${(_('[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}
24 24 % else:
25 25 % if status_change:
26 26 ${(_('[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}
27 27 % else:
28 28 ${(_('[mention]') if mention else '')} ${_('{user} left a {comment_type} on commit `{commit_id}`').format(**data) |n} ${_('in the `{repo_name}` repository').format(**data) |n}
29 29 % endif
30 30 % endif
31 31
32 32 </%def>
33 33
34 34 ## PLAINTEXT VERSION OF BODY
35 35 <%def name="body_plaintext()" filter="n,trim">
36 36 <%
37 37 data = {
38 38 'user': h.person(user),
39 39 'repo_name': repo_name,
40 40 'status': status_change,
41 41 'comment_file': comment_file,
42 42 'comment_line': comment_line,
43 43 'comment_type': comment_type,
44 44 'comment_id': comment_id,
45 45
46 46 'commit_id': h.show_id(commit),
47 47 }
48 48 %>
49 49
50 50 * ${_('Comment link')}: ${commit_comment_url}
51 51
52 52 %if status_change:
53 53 * ${_('Commit status')}: ${_('Status was changed to')}: *${status_change}*
54 54
55 55 %endif
56 56 * ${_('Commit')}: ${h.show_id(commit)}
57 57
58 58 * ${_('Commit message')}: ${commit.message}
59 59
60 60 %if comment_file:
61 61 * ${_('File: {comment_file} on line {comment_line}').format(**data)}
62 62
63 63 %endif
64 64 % if comment_type == 'todo':
65 65 ${('Inline' if comment_file else 'General')} ${_('`TODO` number')} ${comment_id}:
66 66 % else:
67 67 ${('Inline' if comment_file else 'General')} ${_('`Note` number')} ${comment_id}:
68 68 % endif
69 69
70 70 ${comment_body |n, trim}
71 71
72 72 ---
73 73 ${self.plaintext_footer()}
74 74 </%def>
75 75
76 76
77 77 <%
78 78 data = {
79 79 'user': h.person(user),
80 80 'comment_file': comment_file,
81 81 'comment_line': comment_line,
82 82 'comment_type': comment_type,
83 83 'comment_id': comment_id,
84 84 'renderer_type': renderer_type or 'plain',
85 85
86 86 'repo': commit_target_repo_url,
87 87 'repo_name': repo_name,
88 88 'commit_id': h.show_id(commit),
89 89 }
90 90 %>
91 91
92 92 <table style="text-align:left;vertical-align:middle;width: 100%">
93 93 <tr>
94 94 <td style="width:100%;border-bottom:1px solid #dbd9da;">
95 95
96 96 <h4 style="margin: 0">
97 <div style="margin-bottom: 4px; color:#7E7F7F">
98 @${h.person(user.username)}
97 <div style="margin-bottom: 4px">
98 <span style="color:#7E7F7F">@${h.person(user.username)}</span>
99 ${_('left a')}
100 <a href="${commit_comment_url}" style="${base.link_css()}">
101 % if comment_file:
102 ${_('{comment_type} on file `{comment_file}` in commit.').format(**data)}
103 % else:
104 ${_('{comment_type} on commit.').format(**data) |n}
105 % endif
106 </a>
99 107 </div>
100 ${_('left a')}
101 <a href="${commit_comment_url}" style="${base.link_css()}">
102 % if comment_file:
103 ${_('{comment_type} on file `{comment_file}` in commit.').format(**data)}
104 % else:
105 ${_('{comment_type} on commit.').format(**data) |n}
106 % endif
107 </a>
108 108 <div style="margin-top: 10px"></div>
109 109 ${_('Commit')} <code>${data['commit_id']}</code> ${_('of repository')}: ${data['repo_name']}
110 110 </h4>
111 111
112 112 </td>
113 113 </tr>
114 114
115 115 </table>
116 116
117 117 <table style="text-align:left;vertical-align:middle;width: 100%">
118 118
119 119 ## spacing def
120 120 <tr>
121 121 <td style="width: 130px"></td>
122 122 <td></td>
123 123 </tr>
124 124
125 125 % if status_change:
126 126 <tr>
127 127 <td style="padding-right:20px;">${_('Commit Status')}:</td>
128 128 <td>
129 129 ${_('Status was changed to')}: ${base.status_text(status_change, tag_type=status_change_type)}
130 130 </td>
131 131 </tr>
132 132 % endif
133 133
134 134 <tr>
135 135 <td style="padding-right:20px;">${_('Commit')}:</td>
136 136 <td>
137 137 <a href="${commit_comment_url}" style="${base.link_css()}">${h.show_id(commit)}</a>
138 138 </td>
139 139 </tr>
140 140 <tr>
141 141 <td style="padding-right:20px;">${_('Commit message')}:</td>
142 142 <td style="white-space:pre-wrap">${h.urlify_commit_message(commit.message, repo_name)}</td>
143 143 </tr>
144 144
145 145 % if comment_file:
146 146 <tr>
147 147 <td style="padding-right:20px;">${_('File')}:</td>
148 148 <td><a href="${commit_comment_url}" style="${base.link_css()}">${_('`{comment_file}` on line {comment_line}').format(**data)}</a></td>
149 149 </tr>
150 150 % endif
151 151
152 152 <tr style="border-bottom:1px solid #dbd9da;">
153 153 <td colspan="2" style="padding-right:20px;">
154 154 % if comment_type == 'todo':
155 155 ${('Inline' if comment_file else 'General')} ${_('`TODO` number')} ${comment_id}:
156 156 % else:
157 157 ${('Inline' if comment_file else 'General')} ${_('`Note` number')} ${comment_id}:
158 158 % endif
159 159 </td>
160 160 </tr>
161 161
162 162 <tr>
163 163 <td colspan="2" style="background: #F7F7F7">${h.render(comment_body, renderer=data['renderer_type'], mentions=True)}</td>
164 164 </tr>
165 165
166 166 <tr>
167 167 <td><a href="${commit_comment_reply_url}">${_('Reply')}</a></td>
168 168 <td></td>
169 169 </tr>
170 170 </table>
General Comments 0
You need to be logged in to leave comments. Login now