Fix parameter passing and wording for per line notes

This commit is contained in:
Riyad Preukschas 2012-10-29 15:55:37 +01:00
parent b91d680257
commit 9b919939a3
9 changed files with 27 additions and 12 deletions

View file

@ -11,7 +11,7 @@
// find the commented line ...
var trEl = $(".#{note.line_code}").parent();
// ... and insert the note and the reply button after it
trEl.after("#{escape_javascript(render "notes/per_line_reply_button", line_code: note.line_code)}");
trEl.after("#{escape_javascript(render "notes/per_line_reply_button", note: note)}");
trEl.after("#{escape_javascript(render "notes/per_line_note", note: note)}");
} else {
// instert new note before reply button

View file

@ -3,7 +3,7 @@
%td{colspan: 3 }
.line-note-form-holder
= form_for [@project, @note], remote: "true", multipart: true do |f|
%h3.page_title Leave a note
%h3.page_title Leave a comment
%div.span10
-if @note.errors.any?
.alert-message.block-message.error
@ -16,7 +16,7 @@
= f.text_area :note, size: 255, class: 'line-note-text js-gfm-input'
.note_actions
.buttons
= f.submit 'Add note', class: "btn save-btn submit_note submit_inline_note", id: "submit_note"
= f.submit 'Add Comment', class: "btn save-btn submit_note submit_inline_note", id: "submit_note"
= link_to "Cancel", "#", class: "btn hide-button"
.options
%h6.left Notify via email:

View file

@ -1 +1,6 @@
= link_to "", "#", class: "line_note_link", data: { line_code: line_code }, title: "Add note for this line"
= link_to "",
"#",
id: "line-note-#{line_code}",
class: "line_note_link",
data: @comments_target.merge({ line_code: line_code }),
title: "Add comment on line #{line_code[/[0-9]+$/]}"

View file

@ -1,3 +1,3 @@
- notes.each do |note|
= render "notes/per_line_note", note: note
= render "notes/per_line_reply_button", line_code: notes.first.line_code
= render "notes/per_line_reply_button", note: notes.first

View file

@ -1,4 +1,10 @@
%tr.line_notes_row.reply
%td{colspan: 3}
%i.icon-comment
= link_to "Reply", "#", class: "line_note_reply_link", data: { line_code: line_code }, title: "Add note for this line"
= link_to "#",
class: "line_note_reply_link",
data: { line_code: note.line_code,
noteable_type: note.noteable_type,
noteable_id: note.noteable_id },
title: "Add note for this line" do
%i.icon-comment
Reply