Commit f554aa38 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Update commentable controllers with new note vars

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 48c682b5
...@@ -24,9 +24,8 @@ class Projects::CommitController < Projects::ApplicationController ...@@ -24,9 +24,8 @@ class Projects::CommitController < Projects::ApplicationController
@line_notes = result[:line_notes] @line_notes = result[:line_notes]
@branches = result[:branches] @branches = result[:branches]
@notes_count = result[:notes_count] @notes_count = result[:notes_count]
@target_type = "Commit"
@notes = project.notes.for_commit_id(@commit.id).not_inline.fresh @notes = project.notes.for_commit_id(@commit.id).not_inline.fresh
@target_id = @commit.id @noteable = @commit
@comments_allowed = @reply_allowed = true @comments_allowed = @reply_allowed = true
@comments_target = { noteable_type: 'Commit', @comments_target = { noteable_type: 'Commit',
......
...@@ -50,8 +50,7 @@ class Projects::IssuesController < Projects::ApplicationController ...@@ -50,8 +50,7 @@ class Projects::IssuesController < Projects::ApplicationController
def show def show
@note = @project.notes.new(noteable: @issue) @note = @project.notes.new(noteable: @issue)
@notes = @issue.notes.inc_author.fresh @notes = @issue.notes.inc_author.fresh
@target_type = 'Issue' @noteable = @issue
@target_id = @issue.id
respond_with(@issue) respond_with(@issue)
end end
......
...@@ -200,8 +200,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController ...@@ -200,8 +200,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
@note = @project.notes.new(noteable: @merge_request) @note = @project.notes.new(noteable: @merge_request)
@notes = @merge_request.mr_and_commit_notes.inc_author.fresh @notes = @merge_request.mr_and_commit_notes.inc_author.fresh
@discussions = Note.discussions_from_notes(@notes) @discussions = Note.discussions_from_notes(@notes)
@target_type = 'MergeRequest' @noteable = @merge_request
@target_id = @merge_request.id
# Get commits from repository # Get commits from repository
# or from cache if already merged # or from cache if already merged
......
...@@ -49,8 +49,7 @@ class Projects::SnippetsController < Projects::ApplicationController ...@@ -49,8 +49,7 @@ class Projects::SnippetsController < Projects::ApplicationController
def show def show
@note = @project.notes.new(noteable: @snippet) @note = @project.notes.new(noteable: @snippet)
@notes = @snippet.notes.fresh @notes = @snippet.notes.fresh
@target_type = 'Snippet' @noteable = @snippet
@target_id = @snippet.id
end end
def destroy def destroy
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment