Update commentable controllers with new note vars

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
Dmitriy Zaporozhets 2013-12-25 22:32:48 +02:00
parent 48c682b52f
commit f554aa38d5
No known key found for this signature in database
GPG Key ID: 627C5F589F467F17
4 changed files with 4 additions and 8 deletions

View File

@ -24,9 +24,8 @@ class Projects::CommitController < Projects::ApplicationController
@line_notes = result[:line_notes]
@branches = result[:branches]
@notes_count = result[:notes_count]
@target_type = "Commit"
@notes = project.notes.for_commit_id(@commit.id).not_inline.fresh
@target_id = @commit.id
@noteable = @commit
@comments_allowed = @reply_allowed = true
@comments_target = { noteable_type: 'Commit',

View File

@ -50,8 +50,7 @@ class Projects::IssuesController < Projects::ApplicationController
def show
@note = @project.notes.new(noteable: @issue)
@notes = @issue.notes.inc_author.fresh
@target_type = 'Issue'
@target_id = @issue.id
@noteable = @issue
respond_with(@issue)
end

View File

@ -200,8 +200,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
@note = @project.notes.new(noteable: @merge_request)
@notes = @merge_request.mr_and_commit_notes.inc_author.fresh
@discussions = Note.discussions_from_notes(@notes)
@target_type = 'MergeRequest'
@target_id = @merge_request.id
@noteable = @merge_request
# Get commits from repository
# or from cache if already merged

View File

@ -49,8 +49,7 @@ class Projects::SnippetsController < Projects::ApplicationController
def show
@note = @project.notes.new(noteable: @snippet)
@notes = @snippet.notes.fresh
@target_type = 'Snippet'
@target_id = @snippet.id
@noteable = @snippet
end
def destroy