Rename diff note partials

This commit is contained in:
Riyad Preukschas 2012-11-17 20:24:12 +01:00
parent 534bd5a268
commit 3bc507e5c5
12 changed files with 12 additions and 12 deletions

View file

@ -1,7 +1,7 @@
= render "commits/commit_box" = render "commits/commit_box"
= render "commits/diffs", diffs: @commit.diffs = render "commits/diffs", diffs: @commit.diffs
= render "notes/notes_with_form", tid: @commit.id, tt: "commit" = render "notes/notes_with_form", tid: @commit.id, tt: "commit"
= render "notes/per_line_form" = render "notes/diff_note_form"
:javascript :javascript

View file

@ -13,11 +13,11 @@
%td.old_line %td.old_line
= link_to raw(type == "new" ? " " : line_old), "##{line_code}", id: line_code = link_to raw(type == "new" ? " " : line_old), "##{line_code}", id: line_code
- if @comments_allowed - if @comments_allowed
= render "notes/per_line_note_link", line_code: line_code = render "notes/diff_note_link", line_code: line_code
%td.new_line= link_to raw(type == "old" ? " " : line_new) , "##{line_code}", id: line_code %td.new_line= link_to raw(type == "old" ? " " : line_new) , "##{line_code}", id: line_code
%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 @reply_allowed - if @reply_allowed
- comments = @line_notes.select { |n| n.line_code == line_code }.sort_by(&:created_at) - comments = @line_notes.select { |n| n.line_code == line_code }.sort_by(&:created_at)
- unless comments.empty? - unless comments.empty?
= render "notes/per_line_notes_with_reply", notes: comments = render "notes/diff_notes_with_reply", notes: comments

View file

@ -21,7 +21,7 @@
= render "merge_requests/show/diffs" if @diffs = render "merge_requests/show/diffs" if @diffs
.status .status
= render "notes/per_line_form" = render "notes/diff_note_form"
:javascript :javascript
$(function(){ $(function(){

View file

@ -11,9 +11,9 @@
// find the commented line ... // find the commented line ...
var trEl = $(".#{note.line_code}").parent(); var trEl = $(".#{note.line_code}").parent();
// ... and insert the note and the reply button after it // ... and insert the note and the reply button after it
trEl.after("#{escape_javascript(render "notes/per_line_reply_button", note: note)}"); trEl.after("#{escape_javascript(render "notes/diff_notes_reply_button", note: note)}");
trEl.after("#{escape_javascript(render "notes/per_line_note", note: note)}"); trEl.after("#{escape_javascript(render "notes/diff_note", note: note)}");
} else { } else {
// instert new note before reply button // instert new note before reply button
trRpl.before("#{escape_javascript(render "notes/per_line_note", note: note)}"); trRpl.before("#{escape_javascript(render "notes/diff_note", note: note)}");
} }

View file

@ -0,0 +1,3 @@
- notes.each do |note|
= render "notes/diff_note", note: note
= render "notes/diff_notes_reply_button", note: notes.first

View file

@ -20,5 +20,5 @@
%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 line_code == note.line_code - if line_code == note.line_code
= render "notes/per_line_notes_with_reply", notes: discussion_notes = render "notes/diff_notes_with_reply", notes: discussion_notes
- break # cut off diff after notes - break # cut off diff after notes

View file

@ -1,3 +0,0 @@
- notes.each do |note|
= render "notes/per_line_note", note: note
= render "notes/per_line_reply_button", note: notes.first

View file

@ -1,5 +1,5 @@
- if @note.line_code - if @note.line_code
= render "create_per_line_note", note: @note = render "create_diff_note", note: @note
- else - else
= render "create_common_note", note: @note = render "create_common_note", note: @note