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
fccc09be
Commit
fccc09be
authored
Apr 06, 2018
by
Shah El-Rahman
Committed by
Tim Zallmann
Apr 06, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement a new SHA partial for commit lists
parent
e5d32c2c
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
70 additions
and
45 deletions
+70
-45
app/assets/stylesheets/pages/commits.scss
app/assets/stylesheets/pages/commits.scss
+44
-21
app/helpers/commits_helper.rb
app/helpers/commits_helper.rb
+10
-17
app/views/projects/commits/_commit.html.haml
app/views/projects/commits/_commit.html.haml
+9
-6
changelogs/unreleased/42448-change-commit-row-actions-and-sha-design-for-project-commit-list.yml
...it-row-actions-and-sha-design-for-project-commit-list.yml
+6
-0
spec/views/projects/merge_requests/_commits.html.haml_spec.rb
.../views/projects/merge_requests/_commits.html.haml_spec.rb
+1
-1
No files found.
app/assets/stylesheets/pages/commits.scss
View file @
fccc09be
...
@@ -107,7 +107,6 @@
...
@@ -107,7 +107,6 @@
}
}
}
}
.commits-compare-switch
{
.commits-compare-switch
{
float
:
left
;
float
:
left
;
margin-right
:
9px
;
margin-right
:
9px
;
...
@@ -179,7 +178,7 @@
...
@@ -179,7 +178,7 @@
.commit-detail
{
.commit-detail
{
display
:
flex
;
display
:
flex
;
justify-content
:
space-between
;
justify-content
:
space-between
;
align-items
:
flex-start
;
align-items
:
center
;
flex-grow
:
1
;
flex-grow
:
1
;
.merge-request-branches
&
{
.merge-request-branches
&
{
...
@@ -200,37 +199,63 @@
...
@@ -200,37 +199,63 @@
}
}
.ci-status-link
{
.ci-status-link
{
display
:
inline-block
;
display
:
inline-flex
;
position
:
relative
;
top
:
2px
;
}
}
.btn-clipboard
,
>
.ci-status-link
,
.btn-transparent
{
>
.btn
,
padding-left
:
0
;
>
.commit-sha-group
{
padding-right
:
0
;
margin-left
:
$gl-padding-8
;
}
}
}
.commit-sha-group
{
display
:
inline-flex
;
.label
,
.btn
{
.btn
{
&
:not
(
:first-child
)
{
padding
:
$gl-vert-padding
$gl-btn-padding
;
margin-left
:
$gl-padding
;
border
:
1px
$border-color
solid
;
font-size
:
$gl-font-size
;
line-height
:
$line-height-base
;
border-radius
:
0
;
display
:
flex
;
align-items
:
center
;
}
}
.label-monospace
{
@extend
.monospace
;
user-select
:
text
;
color
:
$gl-text-color
;
background-color
:
$gray-light
;
}
}
.
commit-sha
{
.
btn
svg
{
font-size
:
14px
;
top
:
auto
;
f
ont-weight
:
$gl-font-weight-bold
;
f
ill
:
$gl-text-color-secondary
;
}
}
.ci-status-icon
{
.fa-clipboard
{
position
:
relative
;
color
:
$gl-text-color-secondary
;
top
:
2px
;
}
:first-child
{
border-bottom-left-radius
:
$border-radius-default
;
border-top-left-radius
:
$border-radius-default
;
}
:not
(
:first-child
)
{
border-left
:
0
;
}
:last-child
{
border-bottom-right-radius
:
$border-radius-default
;
border-top-right-radius
:
$border-radius-default
;
}
}
}
}
.commit
,
.commit
,
.generic_commit_status
{
.generic_commit_status
{
a
,
a
,
button
{
button
{
color
:
$gl-text-color
;
color
:
$gl-text-color
;
...
@@ -303,10 +328,8 @@
...
@@ -303,10 +328,8 @@
}
}
}
}
.gpg-status-box
{
.gpg-status-box
{
padding
:
2px
10px
;
padding
:
2px
10px
;
margin-right
:
$gl-padding
;
&
:empty
{
&
:empty
{
display
:
none
;
display
:
none
;
...
...
app/helpers/commits_helper.rb
View file @
fccc09be
...
@@ -93,25 +93,18 @@ module CommitsHelper
...
@@ -93,25 +93,18 @@ module CommitsHelper
return
unless
current_controller?
(
:commits
)
return
unless
current_controller?
(
:commits
)
if
@path
.
blank?
if
@path
.
blank?
return
link_to
(
url
=
project_tree_path
(
project
,
commit
)
_
(
"Browse Files"
),
tooltip
=
_
(
"Browse Files"
)
project_tree_path
(
project
,
commit
),
class:
"btn btn-default"
)
elsif
@repo
.
blob_at
(
commit
.
id
,
@path
)
elsif
@repo
.
blob_at
(
commit
.
id
,
@path
)
return
link_to
(
url
=
project_blob_path
(
project
,
tree_join
(
commit
.
id
,
@path
))
_
(
"Browse File"
),
tooltip
=
_
(
"Browse File"
)
project_blob_path
(
project
,
tree_join
(
commit
.
id
,
@path
)),
class:
"btn btn-default"
)
elsif
@path
.
present?
elsif
@path
.
present?
return
link_to
(
url
=
project_tree_path
(
project
,
tree_join
(
commit
.
id
,
@path
))
_
(
"Browse Directory"
),
tooltip
=
_
(
"Browse Directory"
)
project_tree_path
(
project
,
end
tree_join
(
commit
.
id
,
@path
)),
class:
"btn btn-default"
link_to
url
,
class:
"btn btn-default has-tooltip"
,
title:
tooltip
,
data:
{
container:
"body"
}
do
)
sprite_icon
(
'folder-open'
)
end
end
end
end
...
...
app/views/projects/commits/_commit.html.haml
View file @
fccc09be
...
@@ -22,6 +22,9 @@
...
@@ -22,6 +22,9 @@
.commit-detail.flex-list
.commit-detail.flex-list
.commit-content
.commit-content
-
if
view_details
&&
merge_request
=
link_to
commit
.
title
,
project_commit_path
(
project
,
commit
.
id
,
merge_request_iid:
merge_request
.
iid
),
class:
"commit-row-message item-title"
-
else
=
link_to_markdown_field
(
commit
,
:title
,
link
,
class:
"commit-row-message item-title"
)
=
link_to_markdown_field
(
commit
,
:title
,
link
,
class:
"commit-row-message item-title"
)
%span
.commit-row-message.visible-xs-inline
%span
.commit-row-message.visible-xs-inline
·
·
...
@@ -52,9 +55,9 @@
...
@@ -52,9 +55,9 @@
=
render_commit_status
(
commit
,
ref:
ref
)
=
render_commit_status
(
commit
,
ref:
ref
)
.js-commit-pipeline-status
{
data:
{
endpoint:
pipelines_project_commit_path
(
project
,
commit
.
id
)
}
}
.js-commit-pipeline-status
{
data:
{
endpoint:
pipelines_project_commit_path
(
project
,
commit
.
id
)
}
}
=
link_to
commit
.
short_id
,
link
,
class:
"commit-sha btn btn-transparent btn-link"
=
clipboard_button
(
text:
commit
.
id
,
title:
_
(
"Copy commit SHA to clipboard"
))
=
link_to_browse_code
(
project
,
commit
)
-
if
view_details
&&
merge_request
.commit-sha-group
=
link_to
"View details"
,
project_commit_path
(
project
,
commit
.
id
,
merge_request_iid:
merge_request
.
iid
),
class:
"btn btn-default"
.label.label-monospace
=
commit
.
short_id
=
clipboard_button
(
text:
commit
.
id
,
title:
_
(
"Copy commit SHA to clipboard"
),
class:
"btn btn-default"
,
container:
"body"
)
=
link_to_browse_code
(
project
,
commit
)
changelogs/unreleased/42448-change-commit-row-actions-and-sha-design-for-project-commit-list.yml
0 → 100644
View file @
fccc09be
---
title
:
Improved visual styles and consistency for commit hash and possible actions
across commit lists
merge_request
:
17406
author
:
type
:
changed
spec/views/projects/merge_requests/_commits.html.haml_spec.rb
View file @
fccc09be
...
@@ -28,6 +28,6 @@ describe 'projects/merge_requests/_commits.html.haml' do
...
@@ -28,6 +28,6 @@ describe 'projects/merge_requests/_commits.html.haml' do
commit
=
merge_request
.
commits
.
first
# HEAD
commit
=
merge_request
.
commits
.
first
# HEAD
href
=
diffs_project_merge_request_path
(
target_project
,
merge_request
,
commit_id:
commit
)
href
=
diffs_project_merge_request_path
(
target_project
,
merge_request
,
commit_id:
commit
)
expect
(
rendered
).
to
have_link
(
Commit
.
truncate_sha
(
commit
.
sha
),
href:
href
)
expect
(
rendered
).
to
have_link
(
href:
href
)
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