From 20e009a40a4fa5d7e5517833e14c16b32b461720 Mon Sep 17 00:00:00 2001 From: Riyad Preukschas Date: Fri, 14 Sep 2012 01:21:39 +0200 Subject: [PATCH] Update diff comments order and rendering --- app/views/commits/_text_file.html.haml | 4 ++-- app/views/notes/_create_common.js.haml | 2 +- app/views/notes/_per_line_show.html.haml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/commits/_text_file.html.haml b/app/views/commits/_text_file.html.haml index 0f6210f2b5a..5dc8dbd33be 100644 --- a/app/views/commits/_text_file.html.haml +++ b/app/views/commits/_text_file.html.haml @@ -18,9 +18,9 @@ %td.line_content{class: "noteable_line #{type} #{line_code}", "line_code" => line_code}= raw "#{line}  " - 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 diff --git a/app/views/notes/_create_common.js.haml b/app/views/notes/_create_common.js.haml index ce678585246..0a00bd40c68 100644 --- a/app/views/notes/_create_common.js.haml +++ b/app/views/notes/_create_common.js.haml @@ -9,5 +9,5 @@ - else :plain - $(".note-form-holder").replaceWith("#{escape_javascript(render('form'))}"); + $(".note-form-holder").replaceWith("#{escape_javascript(render 'form')}"); diff --git a/app/views/notes/_per_line_show.html.haml b/app/views/notes/_per_line_show.html.haml index cf1769c0517..9d5a31a703f 100644 --- a/app/views/notes/_per_line_show.html.haml +++ b/app/views/notes/_per_line_show.html.haml @@ -1,5 +1,5 @@ %tr.line_notes_row %td{colspan: 3} %ul - = render partial: "notes/show", locals: {note: note} + = render "notes/show", note: note -- GitLab