<%inherit file="base.mako"/> <%namespace name="base" file="base.mako"/> ## EMAIL SUBJECT <%def name="subject()" filter="n,trim,whitespace_filter"> <% data = { 'user': '@'+h.person(user), 'repo_name': repo_name, 'status': status_change, 'comment_file': comment_file, 'comment_line': comment_line, 'comment_type': comment_type, 'comment_id': comment_id, 'commit_id': h.show_id(commit), 'mention_prefix': '[mention] ' if mention else '', } if comment_file: subject_template = email_comment_file_subject_template or \ _('{mention_prefix}{user} left a {comment_type} on file `{comment_file}` in commit `{commit_id}` in the `{repo_name}` repository').format(**data) else: if status_change: subject_template = email_comment_status_change_subject_template or \ _('{mention_prefix}[status: {status}] {user} left a {comment_type} on commit `{commit_id}` in the `{repo_name}` repository').format(**data) else: subject_template = email_comment_subject_template or \ _('{mention_prefix}{user} left a {comment_type} on commit `{commit_id}` in the `{repo_name}` repository').format(**data) %> ${subject_template.format(**data) |n} ## PLAINTEXT VERSION OF BODY <%def name="body_plaintext()" filter="n,trim"> <% data = { 'user': h.person(user), 'repo_name': repo_name, 'status': status_change, 'comment_file': comment_file, 'comment_line': comment_line, 'comment_type': comment_type, 'comment_id': comment_id, 'commit_id': h.show_id(commit), } %> * ${_('Comment link')}: ${commit_comment_url} %if status_change: * ${_('Commit status')}: ${_('Status was changed to')}: *${status_change}* %endif * ${_('Commit')}: ${h.show_id(commit)} * ${_('Commit message')}: ${commit.message} %if comment_file: * ${_('File: {comment_file} on line {comment_line}').format(**data)} %endif % if comment_type == 'todo': ${('Inline' if comment_file else 'General')} ${_('`TODO` number')} ${comment_id}: % else: ${('Inline' if comment_file else 'General')} ${_('`Note` number')} ${comment_id}: % endif ${comment_body |n, trim} --- ${self.plaintext_footer()} <% data = { 'user': h.person(user), 'comment_file': comment_file, 'comment_line': comment_line, 'comment_type': comment_type, 'comment_id': comment_id, 'renderer_type': renderer_type or 'plain', 'repo': commit_target_repo_url, 'repo_name': repo_name, 'commit_id': h.show_id(commit), } %> ## header
${_('Commit')} ${data['commit_id']} ${_('of repository')}: ${data['repo_name']}
## main body ## spacing def % if status_change: % endif % if comment_file: % endif
${_('Commit Status')}: ${_('Status was changed to')}: ${base.status_text(status_change, tag_type=status_change_type)}
${_('Commit')}: ${h.show_id(commit)}
${_('Commit message')}: ${h.urlify_commit_message(commit.message, repo_name)}
${_('File')}: ${_('`{comment_file}` on line {comment_line}').format(**data)}
% if comment_type == 'todo': ${('Inline' if comment_file else 'General')} ${_('`TODO` number')} ${comment_id}: % else: ${('Inline' if comment_file else 'General')} ${_('`Note` number')} ${comment_id}: % endif
${h.render(comment_body, renderer=data['renderer_type'], mentions=True)}
${_('Reply')}