diff options
author | Sean McGivern <sean@gitlab.com> | 2016-11-23 16:25:37 +0000 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2016-11-28 19:40:48 +0000 |
commit | 87665170eccfc423fc3f7fe2cadd208d808a6847 (patch) | |
tree | 4efa4d40139eacdfebe8e69d624e7bd62b20d03c | |
parent | b8917eb75e94cb13b02534c920ee926c9e97174e (diff) | |
download | gitlab-ce-hoopes/gitlab-ce-21027-add-diff-hunks-to-notification-emails.tar.gz |
Use assigned variables betterhoopes/gitlab-ce-21027-add-diff-hunks-to-notification-emails
-rw-r--r-- | app/views/discussions/_diff_with_notes.html.haml | 2 | ||||
-rw-r--r-- | app/views/notify/_note_mr_or_commit_email.html.haml | 6 | ||||
-rw-r--r-- | lib/gitlab/diff/file.rb | 2 |
3 files changed, 4 insertions, 6 deletions
diff --git a/app/views/discussions/_diff_with_notes.html.haml b/app/views/discussions/_diff_with_notes.html.haml index 5c667e4842b..3a95a652810 100644 --- a/app/views/discussions/_diff_with_notes.html.haml +++ b/app/views/discussions/_diff_with_notes.html.haml @@ -9,7 +9,7 @@ %table - discussions = { discussion.original_line_code => discussion } = render partial: "projects/diffs/line", - collection: discussion.highlighted_diff_lines, + collection: discussion.truncated_diff_lines, as: :line, locals: { diff_file: diff_file, discussions: discussions, diff --git a/app/views/notify/_note_mr_or_commit_email.html.haml b/app/views/notify/_note_mr_or_commit_email.html.haml index 15e92c42b14..edf8dfe7e9e 100644 --- a/app/views/notify/_note_mr_or_commit_email.html.haml +++ b/app/views/notify/_note_mr_or_commit_email.html.haml @@ -3,12 +3,10 @@ New comment -- if @note.diff_note? && @note.diff_file +- if @discussion && @discussion.diff_file on = link_to @note.diff_file.file_path, @target_url, class: 'details' -\: - -- if @discussion + \: %table = render partial: "projects/diffs/line", collection: @discussion.truncated_diff_lines, diff --git a/lib/gitlab/diff/file.rb b/lib/gitlab/diff/file.rb index 84784aaf2fd..c6bf25b5874 100644 --- a/lib/gitlab/diff/file.rb +++ b/lib/gitlab/diff/file.rb @@ -69,7 +69,7 @@ module Gitlab diff_refs.try(:head_sha) end - attr_writer :highlighted_diff_lines, :text_parsed_diff_lines + attr_writer :highlighted_diff_lines # Array of Gitlab::Diff::Line objects def diff_lines |