Commit 3bc507e5 authored by Riyad Preukschas's avatar Riyad Preukschas

Rename diff note partials

parent 534bd5a2
= 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
......
...@@ -13,11 +13,11 @@ ...@@ -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
...@@ -21,7 +21,7 @@ ...@@ -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(){
......
...@@ -11,9 +11,9 @@ ...@@ -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)}");
} }
- notes.each do |note|
= render "notes/diff_note", note: note
= render "notes/diff_notes_reply_button", note: notes.first
...@@ -20,5 +20,5 @@ ...@@ -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
- notes.each do |note|
= render "notes/per_line_note", note: note
= render "notes/per_line_reply_button", note: notes.first
- 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
......
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