##// END OF EJS Templates
comments: update comments email templates....
marcink -
r3120:646ada6a default
parent child Browse files
Show More
@@ -97,9 +97,10 b' class TestRepoCommitCommentsView(TestCon'
97 comment_id = ChangesetComment.query().first().comment_id
97 comment_id = ChangesetComment.query().first().comment_id
98 assert notification.type_ == Notification.TYPE_CHANGESET_COMMENT
98 assert notification.type_ == Notification.TYPE_CHANGESET_COMMENT
99
99
100 sbj = 'left {0} on commit `{1}` in the {2} repository'.format(
100 author = notification.created_by_user.username_and_name
101 comment_type, h.show_id(commit), backend.repo_name)
101 sbj = '{0} left a {1} on commit `{2}` in the {3} repository'.format(
102 assert sbj in notification.subject
102 author, comment_type, h.show_id(commit), backend.repo_name)
103 assert sbj == notification.subject
103
104
104 lnk = (u'/{0}/changeset/{1}#comment-{2}'.format(
105 lnk = (u'/{0}/changeset/{1}#comment-{2}'.format(
105 backend.repo_name, commit_id, comment_id))
106 backend.repo_name, commit_id, comment_id))
@@ -150,12 +151,12 b' class TestRepoCommitCommentsView(TestCon'
150 assert notification.type_ == Notification.TYPE_CHANGESET_COMMENT
151 assert notification.type_ == Notification.TYPE_CHANGESET_COMMENT
151
152
152 assert comment.revision == commit_id
153 assert comment.revision == commit_id
153 sbj = 'left {comment_type} on commit `{commit}` ' \
154
154 '(file: `{f_path}`) in the {repo} repository'.format(
155 author = notification.created_by_user.username_and_name
155 commit=h.show_id(commit),
156 sbj = '{0} left a {1} on file `{2}` in commit `{3}` in the {4} repository'.format(
156 f_path=f_path, line=line, repo=backend.repo_name,
157 author, comment_type, f_path, h.show_id(commit), backend.repo_name)
157 comment_type=comment_type)
158
158 assert sbj in notification.subject
159 assert sbj == notification.subject
159
160
160 lnk = (u'/{0}/changeset/{1}#comment-{2}'.format(
161 lnk = (u'/{0}/changeset/{1}#comment-{2}'.format(
161 backend.repo_name, commit_id, comment.comment_id))
162 backend.repo_name, commit_id, comment.comment_id))
@@ -222,10 +223,10 b' class TestRepoCommitCommentsView(TestCon'
222 comment_id = ChangesetComment.query().first().comment_id
223 comment_id = ChangesetComment.query().first().comment_id
223 assert notification.type_ == Notification.TYPE_CHANGESET_COMMENT
224 assert notification.type_ == Notification.TYPE_CHANGESET_COMMENT
224
225
225 sbj = 'left note on commit `{0}` (status: Approved) ' \
226 author = notification.created_by_user.username_and_name
226 'in the {1} repository'.format(
227 sbj = '[status: Approved] {0} left a note on commit `{1}` in the {2} repository'.format(
227 h.show_id(commit), backend.repo_name)
228 author, h.show_id(commit), backend.repo_name)
228 assert sbj in notification.subject
229 assert sbj == notification.subject
229
230
230 lnk = (u'/{0}/changeset/{1}#comment-{2}'.format(
231 lnk = (u'/{0}/changeset/{1}#comment-{2}'.format(
231 backend.repo_name, commit_id, comment_id))
232 backend.repo_name, commit_id, comment_id))
@@ -18,12 +18,12 b' data = {'
18 ${_('[mention]') if mention else ''} \
18 ${_('[mention]') if mention else ''} \
19
19
20 % if comment_file:
20 % if comment_file:
21 ${_('%(user)s left %(comment_type)s on commit `%(commit_id)s` (file: `%(comment_file)s`)') % data} ${_('in the %(repo_name)s repository') % data |n}
21 ${_('{user} left a {comment_type} on file `{comment_file}` in commit `{commit_id}`').format(**data)} ${_('in the {repo_name} repository').format(**data) |n}
22 % else:
22 % else:
23 % if status_change:
23 % if status_change:
24 ${_('%(user)s left %(comment_type)s on commit `%(commit_id)s` (status: %(status)s)') % data |n} ${_('in the %(repo_name)s repository') % data |n}
24 ${_('[status: {status}] {user} left a {comment_type} on commit `{commit_id}`').format(**data) |n} ${_('in the {repo_name} repository').format(**data) |n}
25 % else:
25 % else:
26 ${_('%(user)s left %(comment_type)s on commit `%(commit_id)s`') % data |n} ${_('in the %(repo_name)s repository') % data |n}
26 ${_('{user} left a {comment_type} on commit `{commit_id}`').format(**data) |n} ${_('in the {repo_name} repository').format(**data) |n}
27 % endif
27 % endif
28 % endif
28 % endif
29
29
@@ -49,7 +49,7 b' data = {'
49 * ${_('Commit')}: ${h.show_id(commit)}
49 * ${_('Commit')}: ${h.show_id(commit)}
50
50
51 %if comment_file:
51 %if comment_file:
52 * ${_('File: %(comment_file)s on line %(comment_line)s') % data}
52 * ${_('File: {comment_file} on line {comment_line}').format(**data)}
53 %endif
53 %endif
54
54
55 ---
55 ---
@@ -79,9 +79,9 b' data = {'
79 <tr><td colspan="2" style="width:100%;padding-bottom:15px;border-bottom:1px solid #dbd9da;">
79 <tr><td colspan="2" style="width:100%;padding-bottom:15px;border-bottom:1px solid #dbd9da;">
80
80
81 % if comment_file:
81 % if comment_file:
82 <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>
82 <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>
83 % else:
83 % else:
84 <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>
84 <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>
85 % endif
85 % endif
86 </td></tr>
86 </td></tr>
87
87
@@ -89,16 +89,19 b' data = {'
89 <tr><td style="padding-right:20px;">${_('Description')}</td><td style="white-space:pre-wrap">${h.urlify_commit_message(commit.message, repo_name)}</td></tr>
89 <tr><td style="padding-right:20px;">${_('Description')}</td><td style="white-space:pre-wrap">${h.urlify_commit_message(commit.message, repo_name)}</td></tr>
90
90
91 % if status_change:
91 % if status_change:
92 <tr><td style="padding-right:20px;">${_('Status')}</td>
92 <tr>
93 <td>${_('The commit status was changed to')}: ${base.status_text(status_change, tag_type=status_change_type)}</td>
93 <td style="padding-right:20px;">${_('Status')}</td>
94 <td>
95 ${_('The commit status was changed to')}: ${base.status_text(status_change, tag_type=status_change_type)}
96 </td>
94 </tr>
97 </tr>
95 % endif
98 % endif
96 <tr>
99 <tr>
97 <td style="padding-right:20px;">
100 <td style="padding-right:20px;">
98 % if comment_type == 'todo':
101 % if comment_type == 'todo':
99 ${(_('TODO comment on line: %(comment_line)s') if comment_file else _('TODO comment')) % data}
102 ${(_('TODO comment on line: {comment_line}') if comment_file else _('TODO comment')).format(**data)}
100 % else:
103 % else:
101 ${(_('Note comment on line: %(comment_line)s') if comment_file else _('Note comment')) % data}
104 ${(_('Note comment on line: {comment_line}') if comment_file else _('Note comment')).format(**data)}
102 % endif
105 % endif
103 </td>
106 </td>
104 <td style="line-height:1.2em;white-space:pre-wrap">${h.render(comment_body, renderer=renderer_type, mentions=True)}</td></tr>
107 <td style="line-height:1.2em;white-space:pre-wrap">${h.render(comment_body, renderer=renderer_type, mentions=True)}</td></tr>
@@ -16,15 +16,15 b' data = {'
16 }
16 }
17 %>
17 %>
18
18
19 ${_('[mention]') if mention else ''} \
19 ${(_('[mention]') if mention else '')} \
20
20
21 % if comment_file:
21 % if comment_file:
22 ${_('%(user)s left %(comment_type)s on pull request #%(pr_id)s "%(pr_title)s" (file: `%(comment_file)s`)') % data |n}
22 ${_('{user} left a {comment_type} on file `{comment_file}` in pull request #{pr_id} "{pr_title}"').format(**data) |n}
23 % else:
23 % else:
24 % if status_change:
24 % if status_change:
25 ${_('%(user)s left %(comment_type)s on pull request #%(pr_id)s "%(pr_title)s" (status: %(status)s)') % data |n}
25 ${_('[status: {status}] {user} left a {comment_type} on pull request #{pr_id} "{pr_title}"').format(**data) |n}
26 % else:
26 % else:
27 ${_('%(user)s left %(comment_type)s on pull request #%(pr_id)s "%(pr_title)s"') % data |n}
27 ${_('{user} left a {comment_type} on pull request #{pr_id} "{pr_title}"').format(**data) |n}
28 % endif
28 % endif
29 % endif
29 % endif
30 </%def>
30 </%def>
@@ -49,15 +49,15 b' data = {'
49 * ${_('Source repository')}: ${pr_source_repo_url}
49 * ${_('Source repository')}: ${pr_source_repo_url}
50
50
51 %if comment_file:
51 %if comment_file:
52 * ${_('File: %(comment_file)s on line %(comment_line)s') % {'comment_file': comment_file, 'comment_line': comment_line}}
52 * ${_('File: {comment_file} on line {comment_line}').format(comment_file=comment_file, comment_line=comment_line)}
53 %endif
53 %endif
54
54
55 ---
55 ---
56
56
57 %if status_change and not closing_pr:
57 %if status_change and not closing_pr:
58 ${_('%(user)s submitted pull request #%(pr_id)s status: *%(status)s*') % data}
58 ${_('{user} submitted pull request #{pr_id} status: *{status}*').format(**data)}
59 %elif status_change and closing_pr:
59 %elif status_change and closing_pr:
60 ${_('%(user)s submitted pull request #%(pr_id)s status: *%(status)s and closed*') % data}
60 ${_('{user} submitted pull request #{pr_id} status: *{status} and closed*').format(**data)}
61 %endif
61 %endif
62
62
63 ${comment_body|n}
63 ${comment_body |n}
@@ -81,9 +81,9 b' data = {'
81 <tr><td colspan="2" style="width:100%;padding-bottom:15px;border-bottom:1px solid #dbd9da;">
81 <tr><td colspan="2" style="width:100%;padding-bottom:15px;border-bottom:1px solid #dbd9da;">
82
82
83 % if comment_file:
83 % if comment_file:
84 <h4><a href="${pr_comment_url}" style="color:#427cc9;text-decoration:none;cursor:pointer">${_('%(user)s commented on pull request #%(pr_id)s "%(pr_title)s" (file:`%(comment_file)s`)') % data |n}</a></h4>
84 <h4><a href="${pr_comment_url}" style="color:#427cc9;text-decoration:none;cursor:pointer">${_('{user} left a {comment_type} on file `{comment_file}` in pull request #{pr_id} "{pr_title}"').format(**data) |n}</a></h4>
85 % else:
85 % else:
86 <h4><a href="${pr_comment_url}" style="color:#427cc9;text-decoration:none;cursor:pointer">${_('%(user)s commented on pull request #%(pr_id)s "%(pr_title)s"') % data |n}</a></h4>
86 <h4><a href="${pr_comment_url}" style="color:#427cc9;text-decoration:none;cursor:pointer">${_('{user} left a {comment_type} on pull request #{pr_id} "{pr_title}"').format(**data) |n}</a></h4>
87 % endif
87 % endif
88
88
89 </td></tr>
89 </td></tr>
@@ -104,9 +104,9 b' data = {'
104 <tr>
104 <tr>
105 <td style="padding-right:20px;">
105 <td style="padding-right:20px;">
106 % if comment_type == 'todo':
106 % if comment_type == 'todo':
107 ${(_('TODO comment on line: %(comment_line)s') if comment_file else _('TODO comment')) % data}
107 ${(_('TODO comment on line: {comment_line}') if comment_file else _('TODO comment')).format(**data)}
108 % else:
108 % else:
109 ${(_('Note comment on line: %(comment_line)s') if comment_file else _('Note comment')) % data}
109 ${(_('Note comment on line: {comment_line}') if comment_file else _('Note comment')).format(**data)}
110 % endif
110 % endif
111 </td>
111 </td>
112 <td style="line-height:1.2em;white-space:pre-wrap">${h.render(comment_body, renderer=renderer_type, mentions=True)}</td>
112 <td style="line-height:1.2em;white-space:pre-wrap">${h.render(comment_body, renderer=renderer_type, mentions=True)}</td>
General Comments 0
You need to be logged in to leave comments. Login now