Commit 20e009a40a4fa5d7e5517833e14c16b32b461720

Authored by Riyad Preukschas
1 parent e802d009

Update diff comments order and rendering

app/views/commits/_text_file.html.haml
@@ -18,9 +18,9 @@ @@ -18,9 +18,9 @@
18 %td.line_content{class: "noteable_line #{type} #{line_code}", "line_code" => line_code}= raw "#{line}  " 18 %td.line_content{class: "noteable_line #{type} #{line_code}", "line_code" => line_code}= raw "#{line}  "
19 19
20 - if @comments_allowed 20 - if @comments_allowed
21 - - comments = @line_notes.select { |n| n.line_code == line_code }.sort_by(&:created_at).reverse 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| 23 - comments.each_with_index do |note, i|
24 - = render "notes/reply_button", line_code: line_code if i.zero?  
25 = render "notes/per_line_show", note: note 24 = render "notes/per_line_show", note: note
26 - @line_notes.reject!{ |n| n == note } 25 - @line_notes.reject!{ |n| n == note }
  26 + = render "notes/reply_button", line_code: line_code
app/views/notes/_create_common.js.haml
@@ -9,5 +9,5 @@ @@ -9,5 +9,5 @@
9 9
10 - else 10 - else
11 :plain 11 :plain
12 - $(".note-form-holder").replaceWith("#{escape_javascript(render('form'))}"); 12 + $(".note-form-holder").replaceWith("#{escape_javascript(render 'form')}");
13 13
app/views/notes/_per_line_show.html.haml
1 %tr.line_notes_row 1 %tr.line_notes_row
2 %td{colspan: 3} 2 %td{colspan: 3}
3 %ul 3 %ul
4 - = render partial: "notes/show", locals: {note: note} 4 + = render "notes/show", note: note
5 5