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
Boxiang Sun
gitlab-ce
Commits
dab4ac54
Commit
dab4ac54
authored
Apr 01, 2016
by
Annabel Dunstone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Diff design updates
parent
3cfeb375
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
90 additions
and
67 deletions
+90
-67
app/assets/stylesheets/framework/buttons.scss
app/assets/stylesheets/framework/buttons.scss
+27
-2
app/assets/stylesheets/framework/files.scss
app/assets/stylesheets/framework/files.scss
+3
-2
app/assets/stylesheets/framework/timeline.scss
app/assets/stylesheets/framework/timeline.scss
+0
-4
app/assets/stylesheets/framework/variables.scss
app/assets/stylesheets/framework/variables.scss
+13
-5
app/assets/stylesheets/highlight/white.scss
app/assets/stylesheets/highlight/white.scss
+2
-2
app/assets/stylesheets/pages/diff.scss
app/assets/stylesheets/pages/diff.scss
+8
-0
app/assets/stylesheets/pages/note_form.scss
app/assets/stylesheets/pages/note_form.scss
+0
-6
app/assets/stylesheets/pages/notes.scss
app/assets/stylesheets/pages/notes.scss
+18
-26
app/helpers/blob_helper.rb
app/helpers/blob_helper.rb
+3
-3
app/helpers/commits_helper.rb
app/helpers/commits_helper.rb
+1
-1
app/helpers/notes_helper.rb
app/helpers/notes_helper.rb
+4
-4
app/views/projects/diffs/_file.html.haml
app/views/projects/diffs/_file.html.haml
+5
-5
features/project/commits/diff_comments.feature
features/project/commits/diff_comments.feature
+3
-4
features/steps/shared/diff_note.rb
features/steps/shared/diff_note.rb
+2
-2
spec/features/notes_on_merge_requests_spec.rb
spec/features/notes_on_merge_requests_spec.rb
+1
-1
No files found.
app/assets/stylesheets/framework/buttons.scss
View file @
dab4ac54
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
&
:focus
,
&
:focus
,
&
:active
{
&
:active
{
outline
:
none
;
outline
:
none
;
background-color
:
$btn-active-gray
;
@include
box-shadow
(
$gl-btn-active-background
);
@include
box-shadow
(
$gl-btn-active-background
);
}
}
}
}
...
@@ -27,7 +28,8 @@
...
@@ -27,7 +28,8 @@
color
:
$color
;
color
:
$color
;
}
}
&
:active
{
&
:active
,
&
.active
{
@include
box-shadow
(
$gl-btn-active-background
);
@include
box-shadow
(
$gl-btn-active-background
);
background-color
:
$dark
;
background-color
:
$dark
;
...
@@ -61,7 +63,7 @@
...
@@ -61,7 +63,7 @@
}
}
@mixin
btn-white
{
@mixin
btn-white
{
@include
btn-color
(
$white-light
,
$border-
white-light
,
$white-normal
,
$border-white-normal
,
$white-dark
,
$border-white-dark
,
#313236
);
@include
btn-color
(
$white-light
,
$border-
color
,
$white-normal
,
$border-white-normal
,
$white-dark
,
$border-white-dark
,
$btn-white-active
);
}
}
.btn
{
.btn
{
...
@@ -218,3 +220,26 @@
...
@@ -218,3 +220,26 @@
margin-right
:
5px
;
margin-right
:
5px
;
}
}
}
}
.btn-text-field
{
width
:
100%
;
text-align
:
left
;
padding
:
6px
16px
;
border-color
:
$border-color
;
color
:
$btn-placeholder-gray
;
background-color
:
$background-color
;
&
:hover
,
&
:active
,
&
:focus
{
cursor
:
text
;
box-shadow
:
none
;
border-color
:
$border-color
;
color
:
$btn-placeholder-gray
;
background-color
:
$background-color
;
}
}
.btn-file-option
{
background
:
linear-gradient
(
180deg
,
$white-light
25%
,
$gray-light
100%
);
}
app/assets/stylesheets/framework/files.scss
View file @
dab4ac54
...
@@ -15,12 +15,13 @@
...
@@ -15,12 +15,13 @@
.file-title
{
.file-title
{
position
:
relative
;
position
:
relative
;
background
:
$background-color
;
background
-color
:
$background-color
;
border-bottom
:
1px
solid
$border-color
;
border-bottom
:
1px
solid
$border-color
;
margin
:
0
;
margin
:
0
;
text-align
:
left
;
text-align
:
left
;
padding
:
10px
$gl-padding
;
padding
:
10px
$gl-padding
;
word-wrap
:
break-word
;
word-wrap
:
break-word
;
border-radius
:
3px
3px
0px
0px
;
.file-actions
{
.file-actions
{
float
:
right
;
float
:
right
;
...
@@ -49,7 +50,7 @@
...
@@ -49,7 +50,7 @@
}
}
}
}
a
{
a
:not
(
.btn
)
{
color
:
$gl-dark-link-color
;
color
:
$gl-dark-link-color
;
}
}
...
...
app/assets/stylesheets/framework/timeline.scss
View file @
dab4ac54
...
@@ -14,10 +14,6 @@
...
@@ -14,10 +14,6 @@
background
:
$row-hover
;
background
:
$row-hover
;
}
}
&
:last-child
{
border-bottom
:
none
;
}
.avatar
{
.avatar
{
margin-right
:
15px
;
margin-right
:
15px
;
}
}
...
...
app/assets/stylesheets/framework/variables.scss
View file @
dab4ac54
...
@@ -10,10 +10,10 @@ $gutter_inner_width: 258px;
...
@@ -10,10 +10,10 @@ $gutter_inner_width: 258px;
/*
/*
* UI elements
* UI elements
*/
*/
$border-color
:
#e
feff1
;
$border-color
:
#e
5e5e5
;
$focus-border-color
:
#3aabf0
;
$focus-border-color
:
#3aabf0
;
$table-border-color
:
#eef0f2
;
$table-border-color
:
#eef0f2
;
$background-color
:
#faf
9f9
;
$background-color
:
#faf
afa
;
/*
/*
* Text
* Text
...
@@ -81,7 +81,7 @@ $provider-btn-not-active-color: #4688f1;
...
@@ -81,7 +81,7 @@ $provider-btn-not-active-color: #4688f1;
$white-light
:
#fff
;
$white-light
:
#fff
;
$white-normal
:
#ededed
;
$white-normal
:
#ededed
;
$white-dark
:
#
ededed
;
$white-dark
:
#
ECECEC
;
$gray-light
:
#faf9f9
;
$gray-light
:
#faf9f9
;
$gray-normal
:
#f5f5f5
;
$gray-normal
:
#f5f5f5
;
...
@@ -152,8 +152,8 @@ $gl-success: $green-normal;
...
@@ -152,8 +152,8 @@ $gl-success: $green-normal;
$gl-info
:
$blue-normal
;
$gl-info
:
$blue-normal
;
$gl-warning
:
$orange-normal
;
$gl-warning
:
$orange-normal
;
$gl-danger
:
$red-normal
;
$gl-danger
:
$red-normal
;
$gl-btn-active-background
:
rgba
(
0
,
0
,
0
,
0
.1
2
);
$gl-btn-active-background
:
rgba
(
0
,
0
,
0
,
0
.1
6
);
$gl-btn-active-gradient
:
inset
0
0
4
px
$gl-btn-active-background
;
$gl-btn-active-gradient
:
inset
0
2px
3
px
$gl-btn-active-background
;
/*
/*
* Commit Diff Colors
* Commit Diff Colors
...
@@ -167,6 +167,7 @@ $line-removed-dark: #fac5cd;
...
@@ -167,6 +167,7 @@ $line-removed-dark: #fac5cd;
$line-number-old
:
#f9d7dc
;
$line-number-old
:
#f9d7dc
;
$line-number-new
:
#ddfbe6
;
$line-number-new
:
#ddfbe6
;
$match-line
:
#fafafa
;
$match-line
:
#fafafa
;
$table-border-gray
:
#f0f0f0
;
/*
/*
* Fonts
* Fonts
*/
*/
...
@@ -199,6 +200,13 @@ $dropdown-toggle-hover-border-color: darken($dropdown-toggle-border-color, 15%);
...
@@ -199,6 +200,13 @@ $dropdown-toggle-hover-border-color: darken($dropdown-toggle-border-color, 15%);
$dropdown-toggle-icon-color
:
#c4c4c4
;
$dropdown-toggle-icon-color
:
#c4c4c4
;
$dropdown-toggle-hover-icon-color
:
$dropdown-toggle-hover-border-color
;
$dropdown-toggle-hover-icon-color
:
$dropdown-toggle-hover-border-color
;
/*
* Buttons
*/
$btn-active-gray
:
#ECECEC
;
$btn-placeholder-gray
:
#C7C7C7
;
$btn-white-active
:
#848484
;
/*
/*
* Award emoji
* Award emoji
*/
*/
...
...
app/assets/stylesheets/highlight/white.scss
View file @
dab4ac54
...
@@ -6,12 +6,12 @@
...
@@ -6,12 +6,12 @@
}
}
.diff-line-num
,
.diff-line-num
a
{
.diff-line-num
,
.diff-line-num
a
{
color
:
$black-transparent
;
color
:
#8f8f8f
;
}
}
// Code itself
// Code itself
pre
.code
,
.diff-line-num
{
pre
.code
,
.diff-line-num
{
border-color
:
$
border-color
;
border-color
:
$
table-border-gray
;
}
}
&
,
pre
.code
,
.line_holder
.line_content
{
&
,
pre
.code
,
.line_holder
.line_content
{
...
...
app/assets/stylesheets/pages/diff.scss
View file @
dab4ac54
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
.diff-file
{
.diff-file
{
border
:
1px
solid
$border-color
;
border
:
1px
solid
$border-color
;
margin-bottom
:
$gl-padding
;
margin-bottom
:
$gl-padding
;
border-radius
:
3px
;
.diff-header
{
.diff-header
{
position
:
relative
;
position
:
relative
;
...
@@ -31,6 +32,7 @@
...
@@ -31,6 +32,7 @@
overflow-y
:
hidden
;
overflow-y
:
hidden
;
background
:
#fff
;
background
:
#fff
;
color
:
#333
;
color
:
#333
;
border-radius
:
0
0
3px
3px
;
.unfold
{
.unfold
{
cursor
:
pointer
;
cursor
:
pointer
;
...
@@ -325,6 +327,12 @@
...
@@ -325,6 +327,12 @@
float
:
right
;
float
:
right
;
}
}
.diffs
{
.content-block
{
border-bottom
:
none
;
}
}
// Mobile
// Mobile
@media
(
max-width
:
480px
)
{
@media
(
max-width
:
480px
)
{
.diff-title
{
.diff-title
{
...
...
app/assets/stylesheets/pages/note_form.scss
View file @
dab4ac54
/**
/**
* Note Form
* Note Form
*/
*/
.reply-btn
{
@extend
.btn-primary
;
margin
:
10px
$gl-padding
;
}
.comment-btn
{
.comment-btn
{
@extend
.btn-create
;
@extend
.btn-create
;
}
}
...
@@ -118,7 +113,6 @@
...
@@ -118,7 +113,6 @@
.discussion-body
,
.discussion-body
,
.diff-file
{
.diff-file
{
.notes
.note
{
.notes
.note
{
border-color
:
#ddd
;
padding
:
10px
15px
;
padding
:
10px
15px
;
}
}
...
...
app/assets/stylesheets/pages/notes.scss
View file @
dab4ac54
...
@@ -58,6 +58,7 @@ ul.notes {
...
@@ -58,6 +58,7 @@ ul.notes {
.note
{
.note
{
display
:
block
;
display
:
block
;
position
:
relative
;
position
:
relative
;
border-bottom
:
1px
solid
$table-border-gray
;
&
.is-editting
{
&
.is-editting
{
.note-header
,
.note-header
,
...
@@ -117,9 +118,6 @@ ul.notes {
...
@@ -117,9 +118,6 @@ ul.notes {
padding-bottom
:
3px
;
padding-bottom
:
3px
;
}
}
&
:last-child
{
border-bottom
:
1px
solid
$border-color
;
}
}
}
}
}
...
@@ -137,14 +135,14 @@ ul.notes {
...
@@ -137,14 +135,14 @@ ul.notes {
font-family
:
$regular_font
;
font-family
:
$regular_font
;
td
{
td
{
border
:
1px
solid
#ddd
;
border
:
1px
solid
$table-border-gray
;
border-left
:
none
;
border-left
:
none
;
&
.notes_line
{
&
.notes_line
{
vertical-align
:
middle
;
vertical-align
:
middle
;
text-align
:
center
;
text-align
:
center
;
padding
:
10px
0
;
padding
:
10px
0
;
background
:
#fff
;
background
:
$background-color
;
color
:
$text-color
;
color
:
$text-color
;
}
}
&
.notes_line2
{
&
.notes_line2
{
...
@@ -175,9 +173,6 @@ ul.notes {
...
@@ -175,9 +173,6 @@ ul.notes {
}
}
}
}
.author_link
{
font-weight
:
600
;
}
}
}
.note-headline-light
,
.note-headline-light
,
...
@@ -194,21 +189,6 @@ ul.notes {
...
@@ -194,21 +189,6 @@ ul.notes {
float
:
right
;
float
:
right
;
margin-left
:
10px
;
margin-left
:
10px
;
color
:
$notes-action-color
;
color
:
$notes-action-color
;
.js-note-delete
{
&
:hover
{
@extend
.cgray
;
&
.danger
{
@extend
.cred
;
}
}
}
.js-note-edit
{
i
{
&
:hover
{
color
:
$gl-link-color
;
}
}
}
}
}
.note-action-button
,
.note-action-button
,
...
@@ -218,14 +198,26 @@ ul.notes {
...
@@ -218,14 +198,26 @@ ul.notes {
line-height
:
24px
;
line-height
:
24px
;
.fa
{
.fa
{
color
:
$notes-action-color
;
position
:
relative
;
position
:
relative
;
top
:
1px
;
top
:
1px
;
font-size
:
17px
;
font-size
:
17px
;
}
}
.fa-trash-o
{
&
.js-note-delete
{
top
:
0
;
i
{
font-size
:
16px
;
&
:hover
{
color
:
$gl-text-red
;
}
}
}
&
.js-note-edit
{
i
{
&
:hover
{
color
:
$gl-link-color
;
}
}
}
}
}
}
...
...
app/helpers/blob_helper.rb
View file @
dab4ac54
...
@@ -27,9 +27,9 @@ module BlobHelper
...
@@ -27,9 +27,9 @@ module BlobHelper
link_opts
)
link_opts
)
if
!
on_top_of_branch?
(
project
,
ref
)
if
!
on_top_of_branch?
(
project
,
ref
)
button_tag
"Edit"
,
class:
"btn
btn-default disabled has-tooltip
"
,
title:
"You can only edit files when you are on a branch"
,
data:
{
container:
'body'
}
button_tag
"Edit"
,
class:
"btn
disabled has-tooltip btn-file-option
"
,
title:
"You can only edit files when you are on a branch"
,
data:
{
container:
'body'
}
elsif
can_edit_blob?
(
blob
,
project
,
ref
)
elsif
can_edit_blob?
(
blob
,
project
,
ref
)
link_to
"Edit"
,
edit_path
,
class:
'btn'
link_to
"Edit"
,
edit_path
,
class:
'btn
btn-file-option
'
elsif
can?
(
current_user
,
:fork_project
,
project
)
elsif
can?
(
current_user
,
:fork_project
,
project
)
continue_params
=
{
continue_params
=
{
to:
edit_path
,
to:
edit_path
,
...
@@ -38,7 +38,7 @@ module BlobHelper
...
@@ -38,7 +38,7 @@ module BlobHelper
}
}
fork_path
=
namespace_project_forks_path
(
project
.
namespace
,
project
,
namespace_key:
current_user
.
namespace
.
id
,
continue:
continue_params
)
fork_path
=
namespace_project_forks_path
(
project
.
namespace
,
project
,
namespace_key:
current_user
.
namespace
.
id
,
continue:
continue_params
)
link_to
"Edit"
,
fork_path
,
class:
'btn'
,
method: :post
link_to
"Edit"
,
fork_path
,
class:
'btn
btn-file-option
'
,
method: :post
end
end
end
end
...
...
app/helpers/commits_helper.rb
View file @
dab4ac54
...
@@ -197,7 +197,7 @@ module CommitsHelper
...
@@ -197,7 +197,7 @@ module CommitsHelper
link_to
(
link_to
(
namespace_project_blob_path
(
project
.
namespace
,
project
,
namespace_project_blob_path
(
project
.
namespace
,
project
,
tree_join
(
commit_sha
,
diff
.
new_path
)),
tree_join
(
commit_sha
,
diff
.
new_path
)),
class:
'btn view-file js-view-file'
class:
'btn view-file js-view-file
btn-file-option
'
)
do
)
do
raw
(
'View file @'
)
+
content_tag
(
:span
,
commit_sha
[
0
..
6
],
raw
(
'View file @'
)
+
content_tag
(
:span
,
commit_sha
[
0
..
6
],
class:
'commit-short-id'
)
class:
'commit-short-id'
)
...
...
app/helpers/notes_helper.rb
View file @
dab4ac54
...
@@ -69,9 +69,9 @@ module NotesHelper
...
@@ -69,9 +69,9 @@ module NotesHelper
line_type:
line_type
line_type:
line_type
}
}
text_field_tag
'reply-field'
,
nil
,
button_tag
class:
'btn btn-text-field js-discussion-reply-button'
,
placeholder:
'Reply...'
,
data:
data
,
title:
'Add a reply'
do
class:
'form-control note-reply-field js-discussion-reply-button'
,
link_text
=
'Reply...'
data:
data
end
end
end
end
end
app/views/projects/diffs/_file.html.haml
View file @
dab4ac54
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
-
if
diff_file
.
diff
.
submodule?
-
if
diff_file
.
diff
.
submodule?
%span
%span
=
icon
(
'archive fw'
)
=
icon
(
'archive fw'
)
%s
trong
%s
pan
=
submodule_link
(
blob
,
@commit
.
id
,
project
.
repository
)
=
submodule_link
(
blob
,
@commit
.
id
,
project
.
repository
)
-
else
-
else
=
blob_icon
blob
.
mode
,
blob
.
name
=
blob_icon
blob
.
mode
,
blob
.
name
...
@@ -11,13 +11,13 @@
...
@@ -11,13 +11,13 @@
=
link_to
"#diff-
#{
i
}
"
do
=
link_to
"#diff-
#{
i
}
"
do
-
if
diff_file
.
renamed_file
-
if
diff_file
.
renamed_file
-
old_path
,
new_path
=
mark_inline_diffs
(
diff_file
.
old_path
,
diff_file
.
new_path
)
-
old_path
,
new_path
=
mark_inline_diffs
(
diff_file
.
old_path
,
diff_file
.
new_path
)
%strong
.filename.old
.filename.old
=
old_path
=
old_path
→
→
%strong
.filename.new
.filename.new
=
new_path
=
new_path
-
else
-
else
%s
trong
%s
pan
=
diff_file
.
new_path
=
diff_file
.
new_path
-
if
diff_file
.
deleted_file
-
if
diff_file
.
deleted_file
deleted
deleted
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
.file-actions.hidden-xs
.file-actions.hidden-xs
-
if
blob_text_viewable?
(
blob
)
-
if
blob_text_viewable?
(
blob
)
=
link_to
'#'
,
class:
'js-toggle-diff-comments btn active has-tooltip'
,
title:
"Toggle comments for this file"
do
=
link_to
'#'
,
class:
'js-toggle-diff-comments btn active has-tooltip
btn-file-option
'
,
title:
"Toggle comments for this file"
do
=
icon
(
'comment'
)
=
icon
(
'comment'
)
\
\
...
...
features/project/commits/diff_comments.feature
View file @
dab4ac54
...
@@ -57,10 +57,9 @@ Feature: Project Commits Diff Comments
...
@@ -57,10 +57,9 @@ Feature: Project Commits Diff Comments
Then
I should see two separate previews
Then
I should see two separate previews
@javascript
@javascript
Scenario
:
I
have
can reply
in discussions
Scenario
:
I
have
a reply button
in discussions
Given
I leave a diff comment like
"Typo, please fix"
Given
I leave a diff comment like
"Typo, please fix"
Then
I should see a discussion reply text field
Then
I should see a discussion reply button
@javascript
@javascript
Scenario
:
I
can preview with text
Scenario
:
I
can preview with text
Given
I open a diff comment form
Given
I open a diff comment form
...
@@ -83,7 +82,7 @@ Feature: Project Commits Diff Comments
...
@@ -83,7 +82,7 @@ Feature: Project Commits Diff Comments
Given I preview a diff comment text like "Should fix it
:
smile
:
"
Given I preview a diff comment text like "Should fix it
:
smile
:
"
And
I submit the diff comment
And
I submit the diff comment
Then
I should not see the diff comment form
Then
I should not see the diff comment form
And
I should see a discussion reply
text field
And
I should see a discussion reply
button
@javascript
@javascript
Scenario
:
I
can add a comment on a side-by-side commit diff (left side)
Scenario
:
I
can add a comment on a side-by-side commit diff (left side)
...
...
features/steps/shared/diff_note.rb
View file @
dab4ac54
...
@@ -153,9 +153,9 @@ module SharedDiffNote
...
@@ -153,9 +153,9 @@ module SharedDiffNote
end
end
end
end
step
'I should see a discussion reply
text field
'
do
step
'I should see a discussion reply
button
'
do
page
.
within
(
diff_file_selector
)
do
page
.
within
(
diff_file_selector
)
do
expect
(
page
).
to
have_
css
(
'.note-reply-field
'
)
expect
(
page
).
to
have_
button
(
'Reply...
'
)
end
end
end
end
...
...
spec/features/notes_on_merge_requests_spec.rb
View file @
dab4ac54
...
@@ -210,7 +210,7 @@ describe 'Comments', feature: true do
...
@@ -210,7 +210,7 @@ describe 'Comments', feature: true do
is_expected
.
to
have_content
(
'Another comment on line 10'
)
is_expected
.
to
have_content
(
'Another comment on line 10'
)
is_expected
.
to
have_css
(
'.notes_holder'
)
is_expected
.
to
have_css
(
'.notes_holder'
)
is_expected
.
to
have_css
(
'.notes_holder .note'
,
count:
1
)
is_expected
.
to
have_css
(
'.notes_holder .note'
,
count:
1
)
is_expected
.
to
have_
css
(
'.note-reply-field
'
)
is_expected
.
to
have_
button
(
'Reply...
'
)
end
end
end
end
end
end
...
...
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