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
iv
gitlab-ce
Commits
99bb4a15
Commit
99bb4a15
authored
Jan 12, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
per line comments w/o tests & with dirty code
parent
9da4d06a
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
55391 additions
and
12 deletions
+55391
-12
app/assets/images/add_comment.png
app/assets/images/add_comment.png
+0
-0
app/assets/javascripts/application.js
app/assets/javascripts/application.js
+2
-0
app/assets/stylesheets/commits.css.scss
app/assets/stylesheets/commits.css.scss
+10
-0
app/helpers/commits_helper.rb
app/helpers/commits_helper.rb
+7
-0
app/views/commits/_text_file.html.haml
app/views/commits/_text_file.html.haml
+3
-6
app/views/commits/show.html.haml
app/views/commits/show.html.haml
+12
-0
app/views/notes/_per_line_form.html.haml
app/views/notes/_per_line_form.html.haml
+34
-0
app/views/notes/_per_line_show.html.haml
app/views/notes/_per_line_show.html.haml
+5
-0
app/views/notes/create.js.haml
app/views/notes/create.js.haml
+13
-6
db/test.sqlite3-journal
db/test.sqlite3-journal
+0
-0
nohup.out
nohup.out
+55305
-0
No files found.
app/assets/images/add_comment.png
0 → 100644
View file @
99bb4a15
823 Bytes
app/assets/javascripts/application.js
View file @
99bb4a15
...
@@ -82,3 +82,5 @@ function showMenu() {
...
@@ -82,3 +82,5 @@ function showMenu() {
function
resetMenu
()
{
function
resetMenu
()
{
$
(
this
).
removeClass
(
"
hover
"
);
$
(
this
).
removeClass
(
"
hover
"
);
}
}
app/assets/stylesheets/commits.css.scss
View file @
99bb4a15
...
@@ -96,3 +96,13 @@ ul.bordered-list {
...
@@ -96,3 +96,13 @@ ul.bordered-list {
}
}
ul
.bordered-list
li
:last-child
{
border
:none
}
ul
.bordered-list
li
:last-child
{
border
:none
}
.line_holder
{
cursor
:pointer
;
&
:hover
{
td
{
background
:
#FFFFCF
!
important
;
}
}
}
app/helpers/commits_helper.rb
View file @
99bb4a15
...
@@ -42,4 +42,11 @@ module CommitsHelper
...
@@ -42,4 +42,11 @@ module CommitsHelper
preserve
out
preserve
out
end
end
def
build_line_code
(
line
,
index
,
line_new
,
line_old
)
if
diff_line_class
(
line
)
==
"new"
"NEW_
#{
index
}
_
#{
line_new
}
"
else
"OLD_
#{
index
}
_
#{
line_old
}
"
end
end
end
end
app/views/commits/_text_file.html.haml
View file @
99bb4a15
...
@@ -18,14 +18,11 @@
...
@@ -18,14 +18,11 @@
=
link_to
raw
(
diff_line_class
(
line
)
==
"new"
?
" "
:
line_old
),
"#OLD
#{
index
}
-
#{
line_old
}
"
,
:id
=>
"OLD
#{
index
}
-
#{
line_old
}
"
=
link_to
raw
(
diff_line_class
(
line
)
==
"new"
?
" "
:
line_old
),
"#OLD
#{
index
}
-
#{
line_old
}
"
,
:id
=>
"OLD
#{
index
}
-
#{
line_old
}
"
%td
.new_line
%td
.new_line
=
link_to
raw
(
diff_line_class
(
line
)
==
"old"
?
" "
:
line_new
)
,
"#NEW
#{
index
}
-
#{
line_new
}
"
,
:id
=>
"NEW
#{
index
}
-
#{
line_new
}
"
=
link_to
raw
(
diff_line_class
(
line
)
==
"old"
?
" "
:
line_new
)
,
"#NEW
#{
index
}
-
#{
line_new
}
"
,
:id
=>
"NEW
#{
index
}
-
#{
line_new
}
"
%td
.line_content
{
:class
=>
diff_line_class
(
full_line
)}=
raw
"
#{
full_line
}
"
%td
.line_content
{
:class
=>
"#{diff_line_class(full_line)} #{build_line_code(line, index, line_new, line_old)}"
,
"line_code"
=>
build_line_code
(
line
,
index
,
line_new
,
line_old
)}=
raw
"
#{
full_line
}
"
-
comments
=
@line_notes
.
select
{
|
n
|
n
.
for_line?
(
index
,
line_old
,
line_new
)
}.
sort_by
(
&
:created_at
).
reverse
-
comments
=
@line_notes
.
select
{
|
n
|
n
.
for_line?
(
index
,
line_old
,
line_new
)
}.
sort_by
(
&
:created_at
).
reverse
-
unless
comments
.
empty?
-
unless
comments
.
empty?
%tr
.line_notes_row
-
comments
.
each
do
|
note
|
%td
{
:colspan
=>
3
}
=
render
"notes/per_line_show"
,
:note
=>
note
%ul
-
comments
.
each
do
|
note
|
=
render
:partial
=>
"notes/show"
,
:locals
=>
{
:note
=>
note
}
-
if
line
[
0
]
==
"+"
-
if
line
[
0
]
==
"+"
-
line_new
+=
1
-
line_new
+=
1
-
elsif
line
[
0
]
==
"-"
-
elsif
line
[
0
]
==
"-"
...
...
app/views/commits/show.html.haml
View file @
99bb4a15
...
@@ -24,3 +24,15 @@
...
@@ -24,3 +24,15 @@
=
render
"commits/diff"
=
render
"commits/diff"
=
render
"notes/notes"
=
render
"notes/notes"
=
render
"notes/per_line_form"
:javascript
$
(
document
).
ready
(
function
(){
$
(
"
.line_content
"
).
live
(
"
click
"
,
function
(
e
)
{
var
form
=
$
(
"
.per_line_form
"
);
$
(
this
).
parent
().
after
(
form
);
form
.
find
(
"
#note_line_code
"
).
val
(
$
(
this
).
attr
(
"
line_code
"
));
form
.
show
();
});
});
app/views/notes/_per_line_form.html.haml
0 → 100644
View file @
99bb4a15
%table
{
:style
=>
"display:none;"
}
%tr
.per_line_form
%td
{
:colspan
=>
3
}
%div
=
form_for
[
@project
,
@note
],
:remote
=>
"true"
,
:multipart
=>
true
do
|
f
|
-
if
@note
.
errors
.
any?
.errors.error
-
@note
.
errors
.
full_messages
.
each
do
|
msg
|
%div
=
msg
=
f
.
hidden_field
:noteable_id
=
f
.
hidden_field
:noteable_type
=
f
.
hidden_field
:line_code
%div
=
f
.
label
:note
%cite
.cgray
markdown supported
%br
%br
=
f
.
text_area
:note
,
:size
=>
255
%p
.notify_controls
%span
Notify:
=
check_box_tag
:notify
,
1
,
@note
.
noteable_type
!=
"Commit"
=
label_tag
:notify
,
"Project team"
-
if
@note
.
noteable_type
==
"Commit"
=
check_box_tag
:notify_author
,
1
,
@note
.
noteable_type
==
"Commit"
=
label_tag
:notify_author
,
"Commit author"
.clear
%br
=
f
.
submit
'Add note'
,
:class
=>
"grey-button"
,
:id
=>
"submit_note"
app/views/notes/_per_line_show.html.haml
0 → 100644
View file @
99bb4a15
%tr
.line_notes_row
%td
{
:colspan
=>
3
}
%ul
=
render
:partial
=>
"notes/show"
,
:locals
=>
{
:note
=>
note
}
app/views/notes/create.js.haml
View file @
99bb4a15
-
if
@note
.
valid?
-
if
@note
.
valid?
:plain
-
if
@note
.
line_code
$("#new_note .errors").remove();
:plain
$('#note_note').val("");
$(".per_line_form").hide();
NoteList.prepend(
#{
@note
.
id
}
, "
#{
escape_javascript
(
render
:partial
=>
"notes/show"
,
:locals
=>
{
:note
=>
@note
})
}
");
$('#new_note textarea').val("");
$(".
#{
@note
.
line_code
}
").parent().after("
#{
escape_javascript
(
render
:partial
=>
"notes/per_line_show"
,
:locals
=>
{
:note
=>
@note
})
}
");
-
else
:plain
$("#new_note .errors").remove();
$('#new_note textarea').val("");
NoteList.prepend(
#{
@note
.
id
}
, "
#{
escape_javascript
(
render
:partial
=>
"notes/show"
,
:locals
=>
{
:note
=>
@note
})
}
");
-
else
-
else
:plain
-
unless
@note
.
line_code
$("#new_note").replaceWith("
#{
escape_javascript
(
render
(
'form'
))
}
");
:plain
$("#new_note").replaceWith("
#{
escape_javascript
(
render
(
'form'
))
}
");
:plain
:plain
$("#submit_note").removeAttr("disabled");
$("#submit_note").removeAttr("disabled");
db/test.sqlite3-journal
0 → 100644
View file @
99bb4a15
File added
nohup.out
0 → 100644
View file @
99bb4a15
This diff is collapsed.
Click to expand it.
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