diff options
| author | Riyad Preukschas <riyad@informatik.uni-bremen.de> | 2012-11-18 00:41:30 +0100 |
|---|---|---|
| committer | Riyad Preukschas <riyad@informatik.uni-bremen.de> | 2012-12-03 22:51:56 +0100 |
| commit | 39834ec6409163e3339ed23ccdc9682932f45c9e (patch) | |
| tree | 13877ddca66af00044f206cc736667e7bacab382 /app/views | |
| parent | 4d2278e7c64548137e1cfb9e4e56f842f15c29cb (diff) | |
| download | gitlab-ce-39834ec6409163e3339ed23ccdc9682932f45c9e.tar.gz | |
Move diff notes into the actual diff content column
Diffstat (limited to 'app/views')
| -rw-r--r-- | app/views/commits/_text_diff.html.haml | 8 | ||||
| -rw-r--r-- | app/views/notes/_common_form.html.haml | 2 | ||||
| -rw-r--r-- | app/views/notes/_create_diff_note.js.haml | 2 | ||||
| -rw-r--r-- | app/views/notes/_diff_note.html.haml | 5 | ||||
| -rw-r--r-- | app/views/notes/_diff_notes_with_reply.html.haml | 21 | ||||
| -rw-r--r-- | app/views/notes/_notes_with_form.html.haml | 4 | ||||
| -rw-r--r-- | app/views/notes/_reversed_notes_with_form.html.haml | 4 |
7 files changed, 22 insertions, 24 deletions
diff --git a/app/views/commits/_text_diff.html.haml b/app/views/commits/_text_diff.html.haml index 3d9014c3a3f..f5784dea511 100644 --- a/app/views/commits/_text_diff.html.haml +++ b/app/views/commits/_text_diff.html.haml @@ -17,7 +17,7 @@ %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} " - - if @reply_allowed - - comments = @line_notes.select { |n| n.line_code == line_code }.sort_by(&:created_at) - - unless comments.empty? - = render "notes/diff_notes_with_reply", notes: comments + - if @reply_allowed + - comments = @line_notes.select { |n| n.line_code == line_code }.sort_by(&:created_at) + - unless comments.empty? + = render "notes/diff_notes_with_reply", notes: comments diff --git a/app/views/notes/_common_form.html.haml b/app/views/notes/_common_form.html.haml index 0725082d504..a1e87c87d20 100644 --- a/app/views/notes/_common_form.html.haml +++ b/app/views/notes/_common_form.html.haml @@ -16,7 +16,7 @@ .row.note_advanced_opts .span3 - = f.submit 'Add Comment', class: "btn success submit_note grouped", id: "submit_note" + = f.submit 'Add Comment', class: "btn comment-btn submit_note grouped", id: "submit_note" = link_to 'Preview', preview_project_notes_path(@project), class: 'btn grouped', id: 'preview-link' .span4.notify_opts %h6.left Notify via email: diff --git a/app/views/notes/_create_diff_note.js.haml b/app/views/notes/_create_diff_note.js.haml index 462229bfe5d..a0c065ea4f7 100644 --- a/app/views/notes/_create_diff_note.js.haml +++ b/app/views/notes/_create_diff_note.js.haml @@ -6,7 +6,7 @@ // find the reply button for this line // (might not be there if this is the first note) - var trRpl = $("a.line_note_reply_link[data-noteable-type='#{note.noteable_type}'][data-noteable-id='#{note.noteable_id}'][data-line-code='#{note.line_code}']").closest("tr"); + var trRpl = $(".js-note-add-to-diff-line[data-noteable-type='#{note.noteable_type}'][data-noteable-id='#{note.noteable_id}'][data-line-code='#{note.line_code}']").closest("tr"); if (trRpl.size() == 0) { // find the commented line ... var trEl = $(".#{note.line_code}").parent(); diff --git a/app/views/notes/_diff_note.html.haml b/app/views/notes/_diff_note.html.haml deleted file mode 100644 index 28bcd6e0c94..00000000000 --- a/app/views/notes/_diff_note.html.haml +++ /dev/null @@ -1,5 +0,0 @@ -%tr.line_notes_row - %td{colspan: 3} - %ul - = render "notes/note", note: note - diff --git a/app/views/notes/_diff_notes_with_reply.html.haml b/app/views/notes/_diff_notes_with_reply.html.haml index 7ae328b83ed..e3e5b291393 100644 --- a/app/views/notes/_diff_notes_with_reply.html.haml +++ b/app/views/notes/_diff_notes_with_reply.html.haml @@ -1,15 +1,18 @@ -- notes.each do |note| - = render "notes/diff_note", note: note +%tr.notes_holder + %td.notes_line{ colspan: 2 } + %span.btn.disabled + %i.icon-comment + = notes.count + %td.notes_content + %ul.notes + = render notes --# reply button -- note = notes.first # example note -%tr.line_notes_row.reply - %td{colspan: 3} - = link_to "javascript:;", - class: "line_note_reply_link js-note-add-to-diff-line", + -# reply button + - note = notes.first # example note + %button{ class: "btn comment-btn js-note-add-to-diff-line", data: { line_code: note.line_code, noteable_type: note.noteable_type, noteable_id: note.noteable_id }, - title: "Add a comment to this line" do + title: "Add a comment to this line" } %i.icon-comment Reply diff --git a/app/views/notes/_notes_with_form.html.haml b/app/views/notes/_notes_with_form.html.haml index 53716c1d3f4..713f8aac668 100644 --- a/app/views/notes/_notes_with_form.html.haml +++ b/app/views/notes/_notes_with_form.html.haml @@ -1,5 +1,5 @@ -%ul#notes-list -%ul#new-notes-list +%ul#notes-list.notes +%ul#new-notes-list.notes .notes-status - if can? current_user, :write_note, @project diff --git a/app/views/notes/_reversed_notes_with_form.html.haml b/app/views/notes/_reversed_notes_with_form.html.haml index 24d599244b4..9c28d015c72 100644 --- a/app/views/notes/_reversed_notes_with_form.html.haml +++ b/app/views/notes/_reversed_notes_with_form.html.haml @@ -1,8 +1,8 @@ - if can? current_user, :write_note, @project = render "notes/common_form" -%ul.reversed#new-notes-list -%ul.reversed#notes-list +%ul#new-notes-list.reversed.notes +%ul#notes-list.reversed.notes .notes-status :javascript |
