OSDN Git Service

Update diff comments order and rendering
authorRiyad Preukschas <riyad@informatik.uni-bremen.de>
Thu, 13 Sep 2012 23:21:39 +0000 (01:21 +0200)
committerRiyad Preukschas <riyad@informatik.uni-bremen.de>
Fri, 14 Sep 2012 19:41:56 +0000 (21:41 +0200)
app/views/commits/_text_file.html.haml
app/views/notes/_create_common.js.haml
app/views/notes/_per_line_show.html.haml

index 0f6210f..5dc8dbd 100644 (file)
@@ -18,9 +18,9 @@
         %td.line_content{class: "noteable_line #{type} #{line_code}", "line_code" => line_code}= raw "#{line} &nbsp;"
 
         - 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?
             - 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
               - @line_notes.reject!{ |n| n == note }
+            = render "notes/reply_button", line_code: line_code
index ce67858..0a00bd4 100644 (file)
@@ -9,5 +9,5 @@
 
 - else
   :plain
-    $(".note-form-holder").replaceWith("#{escape_javascript(render('form'))}");
+    $(".note-form-holder").replaceWith("#{escape_javascript(render 'form')}");
 
index cf1769c..9d5a31a 100644 (file)
@@ -1,5 +1,5 @@
 %tr.line_notes_row
   %td{colspan: 3}
     %ul
-      = render partial: "notes/show", locals: {note: note}
+      = render "notes/show", note: note