From 6d5c29dc2b08531fd82550e2e9e814382f58bb78 Mon Sep 17 00:00:00 2001 From: Riyad Preukschas Date: Sat, 17 Nov 2012 20:34:52 +0100 Subject: [PATCH] Inline diff_notes_reply_button partial --- app/views/notes/_create_diff_note.js.haml | 3 +-- app/views/notes/_diff_notes_reply_button.html.haml | 10 ---------- app/views/notes/_diff_notes_with_reply.html.haml | 14 +++++++++++++- 3 files changed, 14 insertions(+), 13 deletions(-) delete mode 100644 app/views/notes/_diff_notes_reply_button.html.haml diff --git a/app/views/notes/_create_diff_note.js.haml b/app/views/notes/_create_diff_note.js.haml index 453053bd728..462229bfe5d 100644 --- a/app/views/notes/_create_diff_note.js.haml +++ b/app/views/notes/_create_diff_note.js.haml @@ -11,8 +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/diff_notes_reply_button", note: note)}"); - trEl.after("#{escape_javascript(render "notes/diff_note", note: note)}"); + trEl.after("#{escape_javascript(render "notes/diff_notes_with_reply", notes: [note])}"); } else { // instert new note before reply button trRpl.before("#{escape_javascript(render "notes/diff_note", note: note)}"); diff --git a/app/views/notes/_diff_notes_reply_button.html.haml b/app/views/notes/_diff_notes_reply_button.html.haml deleted file mode 100644 index edd84eaef2d..00000000000 --- a/app/views/notes/_diff_notes_reply_button.html.haml +++ /dev/null @@ -1,10 +0,0 @@ -%tr.line_notes_row.reply - %td{colspan: 3} - = link_to "javascript:;", - class: "line_note_reply_link js-note-add-to-diff-line", - data: { line_code: note.line_code, - noteable_type: note.noteable_type, - noteable_id: note.noteable_id }, - title: "Add a comment to this line" do - %i.icon-comment - Reply diff --git a/app/views/notes/_diff_notes_with_reply.html.haml b/app/views/notes/_diff_notes_with_reply.html.haml index 43f954d532f..7ae328b83ed 100644 --- a/app/views/notes/_diff_notes_with_reply.html.haml +++ b/app/views/notes/_diff_notes_with_reply.html.haml @@ -1,3 +1,15 @@ - notes.each do |note| = render "notes/diff_note", note: note -= render "notes/diff_notes_reply_button", note: notes.first + +-# reply button +- note = notes.first # example note +%tr.line_notes_row.reply + %td{colspan: 3} + = link_to "javascript:;", + class: "line_note_reply_link js-note-add-to-diff-line", + data: { line_code: note.line_code, + noteable_type: note.noteable_type, + noteable_id: note.noteable_id }, + title: "Add a comment to this line" do + %i.icon-comment + Reply