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
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 @@
}
}
.commits-compare-switch
{
float
:
left
;
margin-right
:
9px
;
...
...
@@ -179,7 +178,7 @@
.commit-detail
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
flex-start
;
align-items
:
center
;
flex-grow
:
1
;
.merge-request-branches
&
{
...
...
@@ -200,37 +199,63 @@
}
.ci-status-link
{
display
:
inline-block
;
position
:
relative
;
top
:
2px
;
display
:
inline-flex
;
}
.btn-clipboard
,
.btn-transparent
{
padding-left
:
0
;
padding-right
:
0
;
>
.ci-status-link
,
>
.btn
,
>
.commit-sha-group
{
margin-left
:
$gl-padding-8
;
}
}
.commit-sha-group
{
display
:
inline-flex
;
.label
,
.btn
{
&
:not
(
:first-child
)
{
margin-left
:
$gl-padding
;
padding
:
$gl-vert-padding
$gl-btn-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
{
font-size
:
14px
;
f
ont-weight
:
$gl-font-weight-bold
;
.
btn
svg
{
top
:
auto
;
f
ill
:
$gl-text-color-secondary
;
}
.ci-status-icon
{
position
:
relative
;
top
:
2px
;
.fa-clipboard
{
color
:
$gl-text-color-secondary
;
}
: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
,
.generic_commit_status
{
a
,
button
{
color
:
$gl-text-color
;
...
...
@@ -303,10 +328,8 @@
}
}
.gpg-status-box
{
padding
:
2px
10px
;
margin-right
:
$gl-padding
;
&
:empty
{
display
:
none
;
...
...
app/helpers/commits_helper.rb
View file @
fccc09be
...
...
@@ -93,25 +93,18 @@ module CommitsHelper
return
unless
current_controller?
(
:commits
)
if
@path
.
blank?
return
link_to
(
_
(
"Browse Files"
),
project_tree_path
(
project
,
commit
),
class:
"btn btn-default"
)
url
=
project_tree_path
(
project
,
commit
)
tooltip
=
_
(
"Browse Files"
)
elsif
@repo
.
blob_at
(
commit
.
id
,
@path
)
return
link_to
(
_
(
"Browse File"
),
project_blob_path
(
project
,
tree_join
(
commit
.
id
,
@path
)),
class:
"btn btn-default"
)
url
=
project_blob_path
(
project
,
tree_join
(
commit
.
id
,
@path
))
tooltip
=
_
(
"Browse File"
)
elsif
@path
.
present?
return
link_to
(
_
(
"Browse Directory"
),
project_tree_path
(
project
,
tree_join
(
commit
.
id
,
@path
)),
class:
"btn btn-default"
)
url
=
project_tree_path
(
project
,
tree_join
(
commit
.
id
,
@path
))
tooltip
=
_
(
"Browse Directory"
)
end
link_to
url
,
class:
"btn btn-default has-tooltip"
,
title:
tooltip
,
data:
{
container:
"body"
}
do
sprite_icon
(
'folder-open'
)
end
end
...
...
app/views/projects/commits/_commit.html.haml
View file @
fccc09be
...
...
@@ -22,6 +22,9 @@
.commit-detail.flex-list
.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"
)
%span
.commit-row-message.visible-xs-inline
·
...
...
@@ -52,9 +55,9 @@
=
render_commit_status
(
commit
,
ref:
ref
)
.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
=
link_to
"View details"
,
project_commit_path
(
project
,
commit
.
id
,
merge_request_iid:
merge_request
.
iid
),
class:
"btn btn-default"
.commit-sha-group
.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
commit
=
merge_request
.
commits
.
first
# HEAD
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
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