summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiyad Preukschas <riyad@informatik.uni-bremen.de>2013-01-02 20:49:27 +0100
committerRiyad Preukschas <riyad@informatik.uni-bremen.de>2013-01-02 20:49:27 +0100
commit7335f366dc952aa371e1e17cfbe2874d51dd6f16 (patch)
treef8a669cc390bccf06dce29ecaeb5ab8dbfeee5b9
parentdb2c15369c365340aeaf4e431e8838714b40396b (diff)
downloadgitlab-ce-7335f366dc952aa371e1e17cfbe2874d51dd6f16.tar.gz
Fix comment and reply buttons
-rw-r--r--app/assets/javascripts/notes.js1
-rw-r--r--app/controllers/commit_controller.rb2
-rw-r--r--app/views/notes/_diff_note_link.html.haml1
-rw-r--r--app/views/notes/_discussion_reply_button.html.haml1
4 files changed, 4 insertions, 1 deletions
diff --git a/app/assets/javascripts/notes.js b/app/assets/javascripts/notes.js
index fa0edd2d1f4..1eac462172b 100644
--- a/app/assets/javascripts/notes.js
+++ b/app/assets/javascripts/notes.js
@@ -244,6 +244,7 @@ var NoteList = {
setupDiscussionNoteForm: function(dataHolder, form) {
// setup note target
form.attr("rel", dataHolder.data("discussionId"));
+ form.find("#note_commit_id").val(dataHolder.data("commitId"));
form.find("#note_line_code").val(dataHolder.data("lineCode"));
form.find("#note_noteable_type").val(dataHolder.data("noteableType"));
form.find("#note_noteable_id").val(dataHolder.data("noteableId"));
diff --git a/app/controllers/commit_controller.rb b/app/controllers/commit_controller.rb
index 4fbfe205d3f..1329410891d 100644
--- a/app/controllers/commit_controller.rb
+++ b/app/controllers/commit_controller.rb
@@ -23,7 +23,7 @@ class CommitController < ProjectResourceController
@comments_allowed = @reply_allowed = true
@comments_target = { noteable_type: 'Commit',
- noteable_id: @commit.id }
+ commit_id: @commit.id }
respond_to do |format|
format.html do
diff --git a/app/views/notes/_diff_note_link.html.haml b/app/views/notes/_diff_note_link.html.haml
index 56eeeb102eb..377c926a204 100644
--- a/app/views/notes/_diff_note_link.html.haml
+++ b/app/views/notes/_diff_note_link.html.haml
@@ -4,6 +4,7 @@
class: "add-diff-note js-add-diff-note-button",
data: { noteable_type: note.noteable_type,
noteable_id: note.noteable_id,
+ commit_id: note.commit_id,
line_code: note.line_code,
discussion_id: note.discussion_id },
title: "Add a comment to this line"
diff --git a/app/views/notes/_discussion_reply_button.html.haml b/app/views/notes/_discussion_reply_button.html.haml
index 15b68560955..d1c5ccc29db 100644
--- a/app/views/notes/_discussion_reply_button.html.haml
+++ b/app/views/notes/_discussion_reply_button.html.haml
@@ -2,6 +2,7 @@
class: "btn reply-btn js-discussion-reply-button",
data: { noteable_type: note.noteable_type,
noteable_id: note.noteable_id,
+ commit_id: note.commit_id,
line_code: note.line_code,
discussion_id: note.discussion_id },
title: "Add a reply" do