summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2015-06-05 15:24:05 -0700
committerStan Hu <stanhu@gmail.com>2015-06-16 06:11:59 -0700
commita7932fe2fd63da4864afb01bff859f4e1fbe9576 (patch)
treecf217e07d0b4f468e0a3378407d7fddc29bd5310 /app/controllers
parent903132bc079970787333347209f6baebdd48800f (diff)
downloadgitlab-ce-a7932fe2fd63da4864afb01bff859f4e1fbe9576.tar.gz
Support commenting on a diff in side-by-side view
Closes https://github.com/gitlabhq/gitlabhq/issues/9283
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/projects/notes_controller.rb17
1 files changed, 15 insertions, 2 deletions
diff --git a/app/controllers/projects/notes_controller.rb b/app/controllers/projects/notes_controller.rb
index 496b85cb46d..f3e521adb69 100644
--- a/app/controllers/projects/notes_controller.rb
+++ b/app/controllers/projects/notes_controller.rb
@@ -77,11 +77,24 @@ class Projects::NotesController < Projects::ApplicationController
end
def note_to_discussion_html(note)
+ if params[:view] == 'parallel'
+ template = "projects/notes/_diff_notes_with_reply_parallel"
+ locals =
+ if params[:line_type] == 'old'
+ { notes_left: [note], notes_right: [] }
+ else
+ { notes_left: [], notes_right: [note] }
+ end
+ else
+ template = "projects/notes/_diff_notes_with_reply"
+ locals = { notes: [note] }
+ end
+
render_to_string(
- "projects/notes/_diff_notes_with_reply",
+ template,
layout: false,
formats: [:html],
- locals: { notes: [note] }
+ locals: locals
)
end