# HG changeset patch # User Marcin Kuzminski # Date 2016-08-01 21:14:02 # Node ID 7cb56fd93e20ce4ff484194917a804acf76acf7e # Parent 91bf0444fc75b49d4b68f872b6a6c3cbdb999811 emails: optimize some labels, and made few i18n fixes. - use more consistent messages - use `data` variable for readability - don't show some redundant info on comments - use better titles that reflect action diff --git a/rhodecode/templates/email_templates/commit_comment.mako b/rhodecode/templates/email_templates/commit_comment.mako --- a/rhodecode/templates/email_templates/commit_comment.mako +++ b/rhodecode/templates/email_templates/commit_comment.mako @@ -1,11 +1,25 @@ ## -*- coding: utf-8 -*- <%inherit file="base.mako"/> + <%def name="subject()" filter="n,trim"> -${_('[mention]') if mention else ''} ${_('%(user)s commented on a commit of %(repo_name)s') % { - 'user': h.person(user), - 'repo_name': repo_name - } } +<% +data = { + 'user': h.person(user), + 'comment_file': comment_file, + 'comment_line': comment_line, + 'repo_name': repo_name, + 'commit_id': h.show_id(commit), +} +%> +${_('[mention]') if mention else ''} \ + +% if comment_file: + ${_('%(user)s commented on commit `%(commit_id)s` (file: `%(comment_file)s`)') % data} ${_('in the %(repo_name)s repository') % data} +% else: + ${_('%(user)s commented on commit `%(commit_id)s`') % data |n} ${_('in the %(repo_name)s repository') % data} +% endif + <%def name="body_plaintext()" filter="n,trim"> @@ -31,18 +45,30 @@ ${self.plaintext_footer()} + +<% +data = { + 'user': h.person(user), + 'comment_file': comment_file, + 'comment_line': comment_line, + 'repo': commit_target_repo, + 'repo_name': repo_name, + 'commit_id': h.show_id(commit), +} +%> - + - %if status_change: - - %endif - -

+

% if comment_file: - ${_('%(user)s commented on %(comment_file)s on line %(comment_line)s in the %(repo)s repository') % {'user': h.person(user), 'comment_file': comment_file, 'comment_line': comment_line, 'repo': commit_target_repo} |n} +

${_('%(user)s commented on commit `%(commit_id)s` (file:`%(comment_file)s`)') % data} ${_('in the %(repo)s repository') % data |n}

% else: - ${_('%(user)s commented on a commit in the %(repo)s repository') % {'user': h.person(user), 'repo': commit_target_repo} |n} +

${_('%(user)s commented on commit `%(commit_id)s`') % data |n} ${_('in the %(repo)s repository') % data |n}

% endif -
${_('Commit')}${h.show_id(commit)}
${_('Description')}${h.urlify_commit_message(commit.message, repo_name)}
${_('Status')}${_('The commit status was changed to')} ${status_change}.
${_('Comment')}${h.render(comment_body, renderer=renderer_type, mentions=True)}
\ No newline at end of file + + % if status_change: + ${_('Status')}${_('The commit status was changed to')}: ${status_change}. + % endif + ${(_('Comment on line: %(comment_line)s') if comment_file else _('Comment')) % data}${h.render(comment_body, renderer=renderer_type, mentions=True)} + diff --git a/rhodecode/templates/email_templates/password_reset.mako b/rhodecode/templates/email_templates/password_reset.mako --- a/rhodecode/templates/email_templates/password_reset.mako +++ b/rhodecode/templates/email_templates/password_reset.mako @@ -27,5 +27,5 @@ There was a request to reset your passwo
If you did not request a password reset, please contact your RhodeCode administrator.

-${_('Generate new password here.') % {'url': password_reset_url} |n} -

\ No newline at end of file +${_('Generate new password here')}. +

diff --git a/rhodecode/templates/email_templates/password_reset_confirmation.mako b/rhodecode/templates/email_templates/password_reset_confirmation.mako --- a/rhodecode/templates/email_templates/password_reset_confirmation.mako +++ b/rhodecode/templates/email_templates/password_reset_confirmation.mako @@ -27,4 +27,4 @@ Below is your new access password for Rh
If you didn't request a new password, please contact your RhodeCode administrator.

-

password:

\ No newline at end of file +

password:

diff --git a/rhodecode/templates/email_templates/pull_request_comment.mako b/rhodecode/templates/email_templates/pull_request_comment.mako --- a/rhodecode/templates/email_templates/pull_request_comment.mako +++ b/rhodecode/templates/email_templates/pull_request_comment.mako @@ -1,15 +1,44 @@ ## -*- coding: utf-8 -*- <%inherit file="base.mako"/> + <%def name="subject()" filter="n,trim"> -${_('[mention]') if mention else ''} ${_('%(user)s commented on pull request #%(pr_id)s: "%(pr_title)s"') % { - 'user': h.person(user), - 'pr_title': pull_request.title, - 'pr_id': pull_request.pull_request_id - } |n} +<% +data = { + 'user': h.person(user), + 'pr_title': pull_request.title, + 'pr_id': pull_request.pull_request_id, + 'status': status_change, + 'comment_file': comment_file, + 'comment_line': comment_line, +} +%> + +${_('[mention]') if mention else ''} \ + +% if comment_file: + ${_('%(user)s commented on pull request #%(pr_id)s "%(pr_title)s" (file: `%(comment_file)s`)') % data |n} +% else: + % if status_change: + ${_('%(user)s commented on pull request #%(pr_id)s "%(pr_title)s" (status: %(status)s)') % data |n} + % else: + ${_('%(user)s commented on pull request #%(pr_id)s "%(pr_title)s"') % data |n} + % endif + +% endif <%def name="body_plaintext()" filter="n,trim"> +<% +data = { + 'user': h.person(user), + 'pr_title': pull_request.title, + 'pr_id': pull_request.pull_request_id, + 'status': status_change, + 'comment_file': comment_file, + 'comment_line': comment_line, +} +%> ${self.subject()} * ${_('Comment link')}: ${pr_comment_url} @@ -22,39 +51,46 @@ --- +%if status_change and not closing_pr: + ${_('%(user)s submitted pull request #%(pr_id)s status: *%(status)s*') % data} +%elif status_change and closing_pr: + ${_('%(user)s submitted pull request #%(pr_id)s status: *%(status)s and closed*') % data} +%endif + ${comment_body|n} -%if status_change and not closing_pr: - ${_('Pull request status was changed to')}: *${status_change}* -%elif status_change and closing_pr: - ${_('Pull request was closed with status')}: *${status_change}* -%endif - ${self.plaintext_footer()} + +<% +data = { + 'user': h.person(user), + 'pr_title': pull_request.title, + 'pr_id': pull_request.pull_request_id, + 'status': status_change, + 'comment_file': comment_file, + 'comment_line': comment_line, +} +%> - + - % if comment_file: - - %endif - %if status_change and not closing_pr: - - %elif status_change and closing_pr: - - %endif - +

-% if comment_file: - ${_('%(user)s commented on %(comment_file)s on pull request #%(pr_id)s: "%(pr_title)s".') % {'user': h.person(user), 'comment_file': comment_file, 'pr_title': pull_request.title, 'pr_id': pull_request.pull_request_id} |n} -% elif status_change and not closing_pr: - ${_('%(user)s changed the status of pull request #%(pr_id)s "%(pr_title)s" to %(status)s.') % {'user': h.person(user),'pr_title': pull_request.title,'pr_id': pull_request.pull_request_id, 'status': status_change} |n} -%elif status_change and closing_pr: - ${_('%(user)s closed pull request #%(pr_id)s "%(pr_title)s" with status %(status)s.') % {'user': h.person(user),'pr_title': pull_request.title,'pr_id': pull_request.pull_request_id, 'status': status_change} |n} -%else: - ${_('%(user)s commented in pull request #%(pr_id)s "%(pr_title)s".') % {'user': h.person(user),'pr_title': pull_request.title,'pr_id': pull_request.pull_request_id} |n} -% endif -

+

+ + % if comment_file: + ${_('%(user)s commented on pull request #%(pr_id)s "%(pr_title)s" (file:`%(comment_file)s`)') % data |n} + % else: + ${_('%(user)s commented on pull request #%(pr_id)s "%(pr_title)s"') % data |n} + % endif + + %if status_change and not closing_pr: + , ${_('submitted pull request status: %(status)s') % data} + %elif status_change and closing_pr: + , ${_('submitted pull request status: %(status)s and closed') % data} + %endif +

+
${_('Source')}${pr_source_repo.repo_name}
${_('File')}${_('%(comment_file)s on line %(comment_line)s') % {'comment_file': comment_file, 'comment_line': comment_line}}
${_('Status')}${_('The commit status was changed to')} ${status_change}
${_('Status')}${_('Pull request was closed with status')}: ${status_change}
${_('Comment')}${h.render(comment_body, renderer=renderer_type, mentions=True)}
${(_('Comment on line: %(comment_line)s') if comment_file else _('Comment')) % data}${h.render(comment_body, renderer=renderer_type, mentions=True)}
- diff --git a/rhodecode/templates/password_reset.html b/rhodecode/templates/password_reset.html --- a/rhodecode/templates/password_reset.html +++ b/rhodecode/templates/password_reset.html @@ -57,7 +57,7 @@ %endif ${h.submit('send', _('Send password reset email'), class_="btn sign-in")} -
${_('Password reset link will be send to matching email address')}
+
${_('Password reset link will be sent to matching email address')}
${h.end_form()}