diff options
author | hhoopes <heidih@gmail.com> | 2016-08-17 16:27:01 -0600 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2016-11-25 15:23:49 +0000 |
commit | 38ed96e9b1a47dca5aa2590fa9b0ade908337435 (patch) | |
tree | 17eca90234faa03e95a963b8820659fd03d90560 /app/views/notify | |
parent | 838c1aad68e8c7f81a0b8778f46f0ce4e7c5439d (diff) | |
download | gitlab-ce-38ed96e9b1a47dca5aa2590fa9b0ade908337435.tar.gz |
Add diff hunks to notification emails on MR
Added diff hunks to notification emails of messages on merge requests. This
provides code context to the note. Uses existing template for formatting
a diff for email (from repository push notifications).
Diffstat (limited to 'app/views/notify')
-rw-r--r-- | app/views/notify/note_merge_request_email.html.haml | 8 | ||||
-rw-r--r-- | app/views/notify/repository_push_email.html.haml | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/app/views/notify/note_merge_request_email.html.haml b/app/views/notify/note_merge_request_email.html.haml index ea7e3d199fd..de3f32e6415 100644 --- a/app/views/notify/note_merge_request_email.html.haml +++ b/app/views/notify/note_merge_request_email.html.haml @@ -1,7 +1,15 @@ += content_for :head do + = stylesheet_link_tag 'mailers/highlighted_diff_email' + - if @note.diff_note? && @note.diff_file %p.details New comment on diff for = link_to @note.diff_file.file_path, @target_url \: + .diff-content.code.js-syntax-highlight + %table + - Discussion.new([@note]).truncated_diff_lines.each do |line| + = render "projects/diffs/line", line: line, diff_file: @note.diff_file, plain: true + = render 'note_message' diff --git a/app/views/notify/repository_push_email.html.haml b/app/views/notify/repository_push_email.html.haml index 307c5a11206..25883de257c 100644 --- a/app/views/notify/repository_push_email.html.haml +++ b/app/views/notify/repository_push_email.html.haml @@ -1,5 +1,5 @@ = content_for :head do - = stylesheet_link_tag 'mailers/repository_push_email' + = stylesheet_link_tag 'mailers/highlighted_diff_email' %h3 #{@message.author_name} #{@message.action_name} #{@message.ref_type} #{@message.ref_name} |