Skip to content
Snippets Groups Projects
Commit d41d8ffb authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Reply button, Comments for Merge Request diff

parent 215a01f6
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -374,3 +374,10 @@ table a code {
.btn.padded {
margin-right:3px;
}
.loading {
margin:20px auto;
background: url(ajax-loader-facebook.gif) no-repeat center center;
width:40px;
height:40px;
}
Loading
Loading
@@ -30,7 +30,10 @@
}
}
 
.note .delete-note { display:none; }
.note .delete-note {
display:none;
float:right;
}
.note:hover .delete-note { display:block; }
.note {padding: 10px 0; border-bottom: 1px solid #eee; overflow: hidden; display: block;}
.note img{float: left; margin-right: 10px;}
Loading
Loading
@@ -53,6 +56,20 @@ p.notify_controls span{
 
tr.line_notes_row {
border-bottom:1px solid #DDD;
&.reply {
background:#eee;
td {
padding:7px 10px;
}
a.line_note_reply_link {
@include round-borders-all(4px);
border-color:#aaa;
background: #bbb;
padding: 3px 20px;
color: white;
}
}
ul {
margin:0;
li {
Loading
Loading
Loading
Loading
@@ -58,7 +58,9 @@ class MergeRequestsController < ApplicationController
def diffs
@diffs = @merge_request.diffs
@commit = @merge_request.last_commit
@line_notes = []
@comments_allowed = true
@line_notes = @merge_request.notes.where("line_code is not null")
end
 
def new
Loading
Loading
Loading
Loading
@@ -16,6 +16,7 @@
- if @comments_allowed
- comments = @line_notes.select { |n| n.line_code == line_code }.sort_by(&:created_at).reverse
- unless comments.empty?
- comments.each do |note|
- 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 }
Loading
Loading
@@ -27,7 +27,7 @@
 
:javascript
$(document).ready(function(){
$(".line_note_link").live("click", function(e) {
$(".line_note_link, .line_note_reply_link").live("click", function(e) {
var form = $(".per_line_form");
$(this).parent().parent().after(form);
form.find("#note_line_code").val($(this).attr("line_code"));
Loading
Loading
= render "notes/load"
Loading
Loading
@@ -42,4 +42,3 @@
 
 
.issue_notes= render "notes/notes", :tid => @issue.id, :tt => "issue"
Loading
Loading
@@ -64,9 +64,6 @@
 
.merge-request-notes
.merge_request_notes= render "notes/notes", :tid => @merge_request.id, :tt => "merge_request"
.loading{ :style => "display:none;"}
%center= image_tag "ajax-loader.gif"
.clear
 
.merge-request-diffs
 
Loading
Loading
@@ -75,3 +72,15 @@
$(function(){
MergeRequest.init();
})
= render "notes/per_line_form"
:javascript
$(document).ready(function(){
$(".line_note_link, .line_note_reply_link").live("click", function(e) {
var form = $(".per_line_form");
$(this).parent().parent().after(form);
form.find("#note_line_code").val($(this).attr("line_code"));
form.show();
return false;
});
});
Loading
Loading
@@ -3,6 +3,8 @@
.clear
%hr
%ul#notes-list
.loading
 
:javascript
$('.delete-note').live('ajax:success', function() {
Loading
Loading
%tr.line_notes_row.reply
%td{:colspan => 3}
= link_to "Reply", "#", :class => "line_note_reply_link", "line_code" => line_code, :title => "Add note for this line"
Loading
Loading
@@ -6,7 +6,7 @@
= time_ago_in_words(note.updated_at)
ago
- if(note.author_id == current_user.id) || can?(current_user, :admin_note, @project)
= link_to "Remove", [@project, note], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "cred delete-note right"
%strong= link_to "Remove", [@project, note], :confirm => 'Are you sure?', :method => :delete, :remote => true, :class => "cred delete-note btn small"
 
%div.note-title
= markdown(note.note)
Loading
Loading
Loading
Loading
@@ -3,7 +3,10 @@
:plain
$(".per_line_form").hide();
$('#new_note textarea').val("");
$(".#{@note.line_code}").parent().after("#{escape_javascript(render :partial => "notes/per_line_show", :locals => {:note => @note})}");
$("a.line_note_reply_link[line_code='#{@note.line_code}']").closest("tr").remove();
var trEl = $(".#{@note.line_code}").parent();
trEl.after("#{escape_javascript(render :partial => "notes/per_line_show", :locals => {:note => @note})}");
trEl.after("#{escape_javascript(render :partial => "notes/reply_button", :locals => {:line_code => @note.line_code})}");
- else
:plain
$("#new_note .errors").remove();
Loading
Loading
%div.wall_page
= render "notes/notes", :tid => nil, :tt => "wall"
.loading{ :style => "display:none;"}
%center= image_tag "ajax-loader.gif"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment