Commit 20e009a4 authored by Riyad Preukschas's avatar Riyad Preukschas

Update diff comments order and rendering

parent e802d009
...@@ -18,9 +18,9 @@ ...@@ -18,9 +18,9 @@
%td.line_content{class: "noteable_line #{type} #{line_code}", "line_code" => line_code}= raw "#{line}  " %td.line_content{class: "noteable_line #{type} #{line_code}", "line_code" => line_code}= raw "#{line}  "
- if @comments_allowed - if @comments_allowed
- comments = @line_notes.select { |n| n.line_code == line_code }.sort_by(&:created_at).reverse - comments = @line_notes.select { |n| n.line_code == line_code }.sort_by(&:created_at)
- unless comments.empty? - unless comments.empty?
- comments.each_with_index do |note, i| - comments.each_with_index do |note, i|
= render "notes/reply_button", line_code: line_code if i.zero?
= render "notes/per_line_show", note: note = render "notes/per_line_show", note: note
- @line_notes.reject!{ |n| n == note } - @line_notes.reject!{ |n| n == note }
= render "notes/reply_button", line_code: line_code
...@@ -9,5 +9,5 @@ ...@@ -9,5 +9,5 @@
- else - else
:plain :plain
$(".note-form-holder").replaceWith("#{escape_javascript(render('form'))}"); $(".note-form-holder").replaceWith("#{escape_javascript(render 'form')}");
%tr.line_notes_row %tr.line_notes_row
%td{colspan: 3} %td{colspan: 3}
%ul %ul
= render partial: "notes/show", locals: {note: note} = render "notes/show", note: note
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment