Commit 39834ec6 authored by Riyad Preukschas's avatar Riyad Preukschas

Move diff notes into the actual diff content column

parent 4d2278e7
...@@ -176,12 +176,14 @@ ...@@ -176,12 +176,14 @@
} }
} }
} }
.old_line, .new_line { .new_line,
margin: 0px; .old_line,
padding: 0px; .notes_line {
border: none; margin:0px;
background: #EEE; padding:0px;
color: #666; border:none;
background:#EEE;
color:#666;
padding: 0px 5px; padding: 0px 5px;
border-right: 1px solid #ccc; border-right: 1px solid #ccc;
text-align: right; text-align: right;
...@@ -191,6 +193,13 @@ ...@@ -191,6 +193,13 @@
moz-user-select: none; moz-user-select: none;
-khtml-user-select: none; -khtml-user-select: none;
user-select: none; user-select: none;
&.notes_line {
border: 1px solid #ccc;
border-left: none;
text-align: center;
padding: 10px 0;
}
a { a {
float: left; float: left;
width: 35px; width: 35px;
...@@ -218,6 +227,10 @@ ...@@ -218,6 +227,10 @@
background: #fafafa; background: #fafafa;
} }
} }
.notes_content {
border: 1px solid #ccc;
border-width: 1px 0;
}
} }
/** COMMIT BLOCK **/ /** COMMIT BLOCK **/
......
/** /**
* Notes * Notes
*/ */
#notes-list, ul.notes {
#new-notes-list {
display: block; display: block;
list-style: none; list-style: none;
margin: 0px; margin: 0px;
...@@ -81,21 +80,36 @@ ...@@ -81,21 +80,36 @@
padding-bottom: 5px; padding-bottom: 5px;
} }
} }
}
#notes-list:not(.reversed) .note, // paint top or bottom borders depending on notes direction
#notes-list:not(.reversed) .discussion, &:not(.reversed) .note,
#new-notes-list:not(.reversed) .note, &:not(.reversed) .discussion {
#new-notes-list:not(.reversed) .discussion { border-bottom: 1px solid #eee;
border-bottom: 1px solid #eee; }
&.reversed .note,
&.reversed .discussion {
border-top: 1px solid #eee;
}
} }
#notes-list.reversed .note,
#notes-list.reversed .discussion, .comment-btn {
#new-notes-list.reversed .note, @extend .save-btn;
#new-notes-list.reversed .discussion {
border-top: 1px solid #eee;
} }
.diff_file tr.notes_holder {
font-family: $sansFontFamily;
font-size: 13px;
line-height: 18px;
td:last-child {
background-color: $white;
padding-top: 0;
}
.comment-btn {
margin-top: 8px;
}
}
/** /**
* Discussion/Note Actions * Discussion/Note Actions
...@@ -225,36 +239,6 @@ p.notify_controls span{ ...@@ -225,36 +239,6 @@ p.notify_controls span{
font-weight: 700; font-weight: 700;
} }
tr.line_notes_row {
border-bottom: 1px solid #DDD;
border-left: 7px solid #2A79A3;
&.reply {
background: #eee;
border-left: 7px solid #2A79A3;
border-top: 1px solid #ddd;
td {
padding: 7px 10px;
}
a.line_note_reply_link {
border: 1px solid #eaeaea;
@include border-radius(4px);
padding: 3px 10px;
margin-left: 5px;
color: white;
background: #2A79A3;
border-color: #2A79A3;
}
}
ul {
margin: 0;
li {
padding: 0;
border: none;
}
}
}
.line_notes_row, .per_line_form { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; } .line_notes_row, .per_line_form { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; }
.per_line_form { .per_line_form {
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
%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/diff_notes_with_reply", notes: comments = render "notes/diff_notes_with_reply", notes: comments
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
.row.note_advanced_opts .row.note_advanced_opts
.span3 .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' = link_to 'Preview', preview_project_notes_path(@project), class: 'btn grouped', id: 'preview-link'
.span4.notify_opts .span4.notify_opts
%h6.left Notify via email: %h6.left Notify via email:
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
// find the reply button for this line // find the reply button for this line
// (might not be there if this is the first note) // (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) { if (trRpl.size() == 0) {
// find the commented line ... // find the commented line ...
var trEl = $(".#{note.line_code}").parent(); var trEl = $(".#{note.line_code}").parent();
......
%tr.line_notes_row
%td{colspan: 3}
%ul
= render "notes/note", note: note
- notes.each do |note| %tr.notes_holder
= render "notes/diff_note", note: note %td.notes_line{ colspan: 2 }
%span.btn.disabled
%i.icon-comment
= notes.count
%td.notes_content
%ul.notes
= render notes
-# reply button -# reply button
- note = notes.first # example note - note = notes.first # example note
%tr.line_notes_row.reply %button{ class: "btn comment-btn js-note-add-to-diff-line",
%td{colspan: 3}
= link_to "javascript:;",
class: "line_note_reply_link js-note-add-to-diff-line",
data: { line_code: note.line_code, data: { line_code: note.line_code,
noteable_type: note.noteable_type, noteable_type: note.noteable_type,
noteable_id: note.noteable_id }, noteable_id: note.noteable_id },
title: "Add a comment to this line" do title: "Add a comment to this line" }
%i.icon-comment %i.icon-comment
Reply Reply
%ul#notes-list %ul#notes-list.notes
%ul#new-notes-list %ul#new-notes-list.notes
.notes-status .notes-status
- if can? current_user, :write_note, @project - if can? current_user, :write_note, @project
......
- if can? current_user, :write_note, @project - if can? current_user, :write_note, @project
= render "notes/common_form" = render "notes/common_form"
%ul.reversed#new-notes-list %ul#new-notes-list.reversed.notes
%ul.reversed#notes-list %ul#notes-list.reversed.notes
.notes-status .notes-status
:javascript :javascript
......
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