Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
d41d8ffb
Commit
d41d8ffb
authored
Feb 24, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reply button, Comments for Merge Request diff
parent
215a01f6
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
53 additions
and
15 deletions
+53
-15
app/assets/stylesheets/common.scss
app/assets/stylesheets/common.scss
+7
-0
app/assets/stylesheets/notes.css.scss
app/assets/stylesheets/notes.css.scss
+18
-1
app/controllers/merge_requests_controller.rb
app/controllers/merge_requests_controller.rb
+3
-1
app/views/commits/_text_file.html.haml
app/views/commits/_text_file.html.haml
+2
-1
app/views/commits/show.html.haml
app/views/commits/show.html.haml
+1
-1
app/views/commits/show.js.haml
app/views/commits/show.js.haml
+0
-1
app/views/issues/show.html.haml
app/views/issues/show.html.haml
+0
-1
app/views/merge_requests/show.html.haml
app/views/merge_requests/show.html.haml
+12
-3
app/views/notes/_notes.html.haml
app/views/notes/_notes.html.haml
+2
-0
app/views/notes/_reply_button.html.haml
app/views/notes/_reply_button.html.haml
+3
-0
app/views/notes/_show.html.haml
app/views/notes/_show.html.haml
+1
-1
app/views/notes/create.js.haml
app/views/notes/create.js.haml
+4
-1
app/views/projects/wall.html.haml
app/views/projects/wall.html.haml
+0
-4
No files found.
app/assets/stylesheets/common.scss
View file @
d41d8ffb
...
...
@@ -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
;
}
app/assets/stylesheets/notes.css.scss
View file @
d41d8ffb
...
...
@@ -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
;}
...
...
@@ -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
{
...
...
app/controllers/merge_requests_controller.rb
View file @
d41d8ffb
...
...
@@ -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
...
...
app/views/commits/_text_file.html.haml
View file @
d41d8ffb
...
...
@@ -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
}
app/views/commits/show.html.haml
View file @
d41d8ffb
...
...
@@ -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
"
));
...
...
app/views/commits/show.js.haml
deleted
100644 → 0
View file @
215a01f6
=
render
"notes/load"
app/views/issues/show.html.haml
View file @
d41d8ffb
...
...
@@ -42,4 +42,3 @@
.issue_notes
=
render
"notes/notes"
,
:tid
=>
@issue
.
id
,
:tt
=>
"issue"
app/views/merge_requests/show.html.haml
View file @
d41d8ffb
...
...
@@ -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
...
...
@@ -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
;
});
});
app/views/notes/_notes.html.haml
View file @
d41d8ffb
...
...
@@ -3,6 +3,8 @@
.clear
%hr
%ul
#notes-list
.loading
:javascript
$
(
'
.delete-note
'
).
live
(
'
ajax:success
'
,
function
()
{
...
...
app/views/notes/_reply_button.html.haml
0 → 100644
View file @
d41d8ffb
%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"
app/views/notes/_show.html.haml
View file @
d41d8ffb
...
...
@@ -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
)
...
...
app/views/notes/create.js.haml
View file @
d41d8ffb
...
...
@@ -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();
...
...
app/views/projects/wall.html.haml
View file @
d41d8ffb
%div
.wall_page
=
render
"notes/notes"
,
:tid
=>
nil
,
:tt
=>
"wall"
.loading
{
:style
=>
"display:none;"
}
%center
=
image_tag
"ajax-loader.gif"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment