Commit e1ca155c95a41a9adfe984a3e3ba5c777c61acd8

Authored by Riyad Preukschas
1 parent a3dbd990

Extract 'notes/per_line_notes_with_reply' partial

app/views/commits/_text_file.html.haml
@@ -20,7 +20,4 @@ @@ -20,7 +20,4 @@
20 - if @comments_allowed 20 - if @comments_allowed
21 - comments = @line_notes.select { |n| n.line_code == line_code }.sort_by(&:created_at) 21 - comments = @line_notes.select { |n| n.line_code == line_code }.sort_by(&:created_at)
22 - unless comments.empty? 22 - unless comments.empty?
23 - - comments.each_with_index do |note, i|  
24 - = render "notes/per_line_note", note: note  
25 - - @line_notes.reject!{ |n| n == note }  
26 - = render "notes/per_line_reply_button", line_code: line_code 23 + = render "notes/per_line_notes_with_reply", notes: comments
app/views/notes/_per_line_notes_with_reply.html.haml 0 → 100644
@@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
  1 +- notes.each do |note|
  2 + = render "notes/per_line_note", note: note
  3 += render "notes/per_line_reply_button", line_code: notes.first.line_code