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
Jérome Perrin
gitlab-ce
Commits
7030ffb0
Commit
7030ffb0
authored
Apr 08, 2016
by
Annabel Dunstone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Copying and pasting doesn't grab line numbers or +/-
parent
64776ab2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
6 deletions
+27
-6
app/assets/stylesheets/pages/diff.scss
app/assets/stylesheets/pages/diff.scss
+20
-0
app/helpers/diff_helper.rb
app/helpers/diff_helper.rb
+1
-0
app/views/projects/blob/diff.html.haml
app/views/projects/blob/diff.html.haml
+3
-3
app/views/projects/diffs/_line.html.haml
app/views/projects/diffs/_line.html.haml
+3
-3
No files found.
app/assets/stylesheets/pages/diff.scss
View file @
7030ffb0
...
@@ -67,6 +67,14 @@
...
@@ -67,6 +67,14 @@
line-height
:
$code_line_height
;
line-height
:
$code_line_height
;
font-size
:
$code_font_size
;
font-size
:
$code_font_size
;
&
.noteable_line.old
:before
{
content
:
'-'
;
}
&
.noteable_line.new
:before
{
content
:
'+'
;
}
span
{
span
{
white-space
:
pre
;
white-space
:
pre
;
}
}
...
@@ -391,3 +399,15 @@
...
@@ -391,3 +399,15 @@
margin-bottom
:
0
;
margin-bottom
:
0
;
}
}
}
}
.diff-line-num
:not
(
.js-unfold-bottom
)
{
a
{
&
:before
{
content
:
attr
(
data-linenumber
);
}
-moz-user-select
:
none
;
-webkit-user-select
:
none
;
-ms-user-select
:
none
;
user-select
:
none
;
}
}
app/helpers/diff_helper.rb
View file @
7030ffb0
...
@@ -44,6 +44,7 @@ module DiffHelper
...
@@ -44,6 +44,7 @@ module DiffHelper
if
line
.
blank?
if
line
.
blank?
" "
.
html_safe
" "
.
html_safe
else
else
line
[
0
]
=
''
line
line
end
end
end
end
...
...
app/views/projects/blob/diff.html.haml
View file @
7030ffb0
...
@@ -9,9 +9,9 @@
...
@@ -9,9 +9,9 @@
-
line_old
=
line_new
-
@form
.
offset
-
line_old
=
line_new
-
@form
.
offset
%tr
.line_holder
%tr
.line_holder
%td
.old_line.diff-line-num
{
data:
{
linenumber:
line_old
}}
%td
.old_line.diff-line-num
{
data:
{
linenumber:
line_old
}}
=
link_to
raw
(
line_old
),
"#"
/
= link_to raw(line_old), "#"
%td
.new_line.diff-line-num
%td
.new_line.diff-line-num
{
data:
{
linenumber:
line_old
}}
=
link_to
raw
(
line_new
)
,
"#"
/
= link_to raw(line_new) , "#"
%td
.line_content.noteable_line
==
#{
' '
*
@form
.
indent
}#{
line
}
%td
.line_content.noteable_line
==
#{
' '
*
@form
.
indent
}#{
line
}
-
if
@form
.
unfold?
&&
@form
.
bottom?
&&
@form
.
to
<
@blob
.
loc
-
if
@form
.
unfold?
&&
@form
.
bottom?
&&
@form
.
to
<
@blob
.
loc
...
...
app/views/projects/diffs/_line.html.haml
View file @
7030ffb0
...
@@ -9,12 +9,12 @@
...
@@ -9,12 +9,12 @@
%td
.new_line.diff-line-num
%td
.new_line.diff-line-num
%td
.line_content.match
=
line
.
text
%td
.line_content.match
=
line
.
text
-
else
-
else
%td
.old_line.diff-line-num
{
class:
type
}
%td
.old_line.diff-line-num
{
class:
type
,
data:
{
linenumber:
line
.
new_pos
}
}
-
link_text
=
raw
(
type
==
"new"
?
" "
:
line
.
old_pos
)
-
link_text
=
raw
(
type
==
"new"
?
" "
:
line
.
old_pos
)
-
if
defined?
(
plain
)
&&
plain
-
if
defined?
(
plain
)
&&
plain
=
link_text
=
link_text
-
else
-
else
=
link_to
link_text
,
"#
#{
line_code
}
"
,
id:
line_code
=
link_to
""
,
"#
#{
line_code
}
"
,
id:
line_code
,
data:
{
linenumber:
link_text
}
-
if
@comments_allowed
&&
can?
(
current_user
,
:create_note
,
@project
)
-
if
@comments_allowed
&&
can?
(
current_user
,
:create_note
,
@project
)
=
link_to_new_diff_note
(
line_code
)
=
link_to_new_diff_note
(
line_code
)
%td
.new_line.diff-line-num
{
class:
type
,
data:
{
linenumber:
line
.
new_pos
}}
%td
.new_line.diff-line-num
{
class:
type
,
data:
{
linenumber:
line
.
new_pos
}}
...
@@ -22,5 +22,5 @@
...
@@ -22,5 +22,5 @@
-
if
defined?
(
plain
)
&&
plain
-
if
defined?
(
plain
)
&&
plain
=
link_text
=
link_text
-
else
-
else
=
link_to
link_text
,
"#
#{
line_code
}
"
,
id:
line_code
=
link_to
""
,
"#
#{
line_code
}
"
,
id:
line_code
,
data:
{
linenumber:
link_text
}
%td
.line_content
{
class:
"noteable_line #{type} #{line_code}"
,
data:
{
line_code:
line_code
}}=
diff_line_content
(
line
.
text
)
%td
.line_content
{
class:
"noteable_line #{type} #{line_code}"
,
data:
{
line_code:
line_code
}}=
diff_line_content
(
line
.
text
)
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