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
Tatuya Kamada
gitlab-ce
Commits
01f577bb
Commit
01f577bb
authored
Jun 15, 2016
by
Jacob Schatz
Committed by
Robert Speicher
Jun 15, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge branch 'commits-ui' into 'master'
Updated commits UI Closes #14633 See merge request !4271
parent
7c9d77f9
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
140 additions
and
106 deletions
+140
-106
app/assets/stylesheets/pages/commits.scss
app/assets/stylesheets/pages/commits.scss
+79
-56
app/assets/stylesheets/pages/tree.scss
app/assets/stylesheets/pages/tree.scss
+1
-1
app/helpers/button_helper.rb
app/helpers/button_helper.rb
+9
-1
app/helpers/ci_status_helper.rb
app/helpers/ci_status_helper.rb
+4
-4
app/helpers/commits_helper.rb
app/helpers/commits_helper.rb
+16
-8
app/views/projects/commits/_commit.html.haml
app/views/projects/commits/_commit.html.haml
+17
-13
app/views/projects/commits/_commits.html.haml
app/views/projects/commits/_commits.html.haml
+5
-12
app/views/projects/commits/show.html.haml
app/views/projects/commits/show.html.haml
+4
-7
app/views/projects/merge_requests/show/_commits.html.haml
app/views/projects/merge_requests/show/_commits.html.haml
+2
-1
features/steps/project/source/browse_files.rb
features/steps/project/source/browse_files.rb
+3
-3
No files found.
app/assets/stylesheets/pages/commits.scss
View file @
01f577bb
...
...
@@ -7,84 +7,111 @@
margin-right
:
9px
;
}
.lists-separator
{
margin
:
10px
0
;
border-color
:
#ddd
;
}
.commits-row
{
ul
{
margin
:
0
;
li
.commit
{
padding
:
8px
0
;
}
}
.commit-header
{
padding
:
5px
10px
;
background-color
:
$background-color
;
border-top
:
1px
solid
#eee
;
border-bottom
:
1px
solid
#eee
;
font-size
:
14px
;
.commits-row-date
{
font-size
:
15px
;
line-height
:
20px
;
margin-bottom
:
5px
;
&
:first-child
{
border-top-width
:
0
;
}
}
li
.commit
{
list-style
:
none
;
.commit-row-title
{
font-size
:
$list-font-size
;
line-height
:
20px
;
margin-bottom
:
2px
;
.btn-clipboard
{
margin-top
:
-1px
;
}
.commit-row-title
{
line-height
:
1
;
margin-bottom
:
7px
;
.notes_count
{
float
:
right
;
margin-right
:
10px
;
}
.commit_short_id
{
min-width
:
65px
;
color
:
$gl-dark-link-color
;
font-family
:
$monospace_font
;
}
.str-truncated
{
max-width
:
70%
;
}
.commit-row-message
{
color
:
$gl-dark-link-color
;
&
:hover
{
text-decoration
:
underline
;
}
}
.text-expander
{
background
:
#eee
;
color
:
#555
;
display
:
inline-block
;
background
:
$gray-light
;
color
:
$gl-placeholder-color
;
padding
:
0
5px
;
cursor
:
pointer
;
margin-left
:
4px
;
border
:
1px
solid
$border-gray-dark
;
border-radius
:
$border-radius-default
;
margin-left
:
5px
;
&
:hover
{
background-color
:
#ddd
;
background-color
:
darken
(
$gray-light
,
10%
);
text-decoration
:
none
;
}
}
}
.commit-actions
{
@media
(
min-width
:
$screen-sm-min
)
{
float
:
right
;
margin-left
:
$gl-padding
;
margin-top
:
2px
;
font-size
:
0
;
}
.btn-transparent
{
padding-left
:
0
;
padding-right
:
0
;
}
.btn
{
&
:not
(
:first-child
)
{
margin-left
:
$gl-padding
;
}
}
}
.commit-short-id
{
font-family
:
$monospace_font
;
font-weight
:
600
;
}
.commit
{
padding
:
10px
0
;
@media
(
min-width
:
$screen-sm-min
)
{
padding-left
:
46px
;
}
&
:not
(
:last-child
)
{
border-bottom
:
1px
solid
#eee
;
}
a
,
button
{
color
:
$gl-dark-link-color
;
vertical-align
:
baseline
;
}
.avatar
{
margin-left
:
-46px
;
}
.item-title
{
display
:
inline-block
;
@media
(
min-width
:
$screen-sm-min
)
{
max-width
:
70%
;
}
}
.commit-row-description
{
font-size
:
14px
;
border-left
:
1px
solid
#eee
;
padding
:
10px
15px
;
margin
:
5px
0
10px
5px
;
margin
:
10px
0
;
background
:
#f9f9f9
;
display
:
none
;
...
...
@@ -102,7 +129,7 @@ li.commit {
.commit-row-info
{
color
:
$gl-gray
;
line-height
:
24px
;
line-height
:
1
;
a
{
color
:
$gl-gray
;
...
...
@@ -111,10 +138,6 @@ li.commit {
.avatar
{
margin-right
:
8px
;
}
.committed_ago
{
display
:
inline-block
;
}
}
&
.inline-commit
{
...
...
app/assets/stylesheets/pages/tree.scss
View file @
01f577bb
...
...
@@ -101,7 +101,7 @@
margin
:
0
;
.commit
{
padding
:
0
;
padding
:
0
0
0
55px
;
.commit-row-title
{
.commit-row-message
{
...
...
app/helpers/button_helper.rb
View file @
01f577bb
...
...
@@ -17,7 +17,15 @@ module ButtonHelper
def
clipboard_button
(
data
=
{})
content_tag
:button
,
icon
(
'clipboard'
),
class:
'btn btn-clipboard'
,
class:
"btn"
,
data:
data
,
type: :button
end
def
clipboard_button_with_class
(
data
=
{},
css_class:
'btn-clipboard'
)
content_tag
:button
,
icon
(
'clipboard'
),
class:
"btn
#{
css_class
}
"
,
data:
data
,
type: :button
end
...
...
app/helpers/ci_status_helper.rb
View file @
01f577bb
...
...
@@ -38,10 +38,10 @@ module CiStatusHelper
icon
(
icon_name
+
' fw'
)
end
def
render_commit_status
(
commit
,
tooltip_placement:
'auto left'
)
def
render_commit_status
(
commit
,
tooltip_placement:
'auto left'
,
cssclass:
''
)
project
=
commit
.
project
path
=
builds_namespace_project_commit_path
(
project
.
namespace
,
project
,
commit
)
render_status_with_link
(
'commit'
,
commit
.
status
,
path
,
tooltip_placement
)
render_status_with_link
(
'commit'
,
commit
.
status
,
path
,
tooltip_placement
,
cssclass:
cssclass
)
end
def
render_pipeline_status
(
pipeline
,
tooltip_placement:
'auto left'
)
...
...
@@ -57,10 +57,10 @@ module CiStatusHelper
private
def
render_status_with_link
(
type
,
status
,
path
,
tooltip_placement
)
def
render_status_with_link
(
type
,
status
,
path
,
tooltip_placement
,
cssclass:
''
)
link_to
ci_icon_for_status
(
status
),
path
,
class:
"ci-status-link ci-status-icon-
#{
status
.
dasherize
}
"
,
class:
"ci-status-link ci-status-icon-
#{
status
.
dasherize
}
#{
cssclass
}
"
,
title:
"
#{
type
.
titleize
}
:
#{
ci_label_for_status
(
status
)
}
"
,
data:
{
toggle:
'tooltip'
,
placement:
tooltip_placement
}
end
...
...
app/helpers/commits_helper.rb
View file @
01f577bb
...
...
@@ -16,6 +16,16 @@ module CommitsHelper
commit_person_link
(
commit
,
options
.
merge
(
source: :committer
))
end
def
commit_author_avatar
(
commit
,
options
=
{})
options
=
options
.
merge
(
source: :author
)
user
=
commit
.
send
(
options
[
:source
])
source_email
=
clean
(
commit
.
send
"
#{
options
[
:source
]
}
_email"
.
to_sym
)
person_email
=
user
.
try
(
:email
)
||
source_email
image_tag
(
avatar_icon
(
person_email
,
options
[
:size
]),
class:
"avatar
#{
"s
#{
options
[
:size
]
}
"
if
options
[
:size
]
}
hidden-xs"
,
width:
options
[
:size
],
alt:
""
)
end
def
image_diff_class
(
diff
)
if
diff
.
deleted_file
"deleted"
...
...
@@ -102,24 +112,24 @@ module CommitsHelper
if
current_controller?
(
:projects
,
:commits
)
if
@repo
.
blob_at
(
commit
.
id
,
@path
)
return
link_to
(
"Browse File
»
"
,
"Browse File"
,
namespace_project_blob_path
(
project
.
namespace
,
project
,
tree_join
(
commit
.
id
,
@path
)),
class:
"
pull-righ
t"
class:
"
btn btn-defaul
t"
)
elsif
@path
.
present?
return
link_to
(
"Browse Directory
»
"
,
"Browse Directory"
,
namespace_project_tree_path
(
project
.
namespace
,
project
,
tree_join
(
commit
.
id
,
@path
)),
class:
"
pull-righ
t"
class:
"
btn btn-defaul
t"
)
end
end
link_to
(
"Browse Files"
,
namespace_project_tree_path
(
project
.
namespace
,
project
,
commit
),
class:
"
pull-righ
t"
class:
"
btn btn-defaul
t"
)
end
...
...
@@ -187,12 +197,10 @@ module CommitsHelper
source_email
=
clean
(
commit
.
send
"
#{
options
[
:source
]
}
_email"
.
to_sym
)
person_name
=
user
.
try
(
:name
)
||
source_name
person_email
=
user
.
try
(
:email
)
||
source_email
text
=
if
options
[
:avatar
]
avatar
=
image_tag
(
avatar_icon
(
person_email
,
options
[
:size
]),
class:
"avatar
#{
"s
#{
options
[
:size
]
}
"
if
options
[
:size
]
}
"
,
width:
options
[
:size
],
alt:
""
)
%Q{
#{
avatar
}
<span class="commit-
#{
options
[
:source
]
}
-name">
#{
person_name
}
</span>}
%Q{<span class="commit-
#{
options
[
:source
]
}
-name">
#{
person_name
}
</span>}
else
person_name
end
...
...
app/views/projects/commits/_commit.html.haml
View file @
01f577bb
...
...
@@ -9,26 +9,30 @@
=
cache
(
cache_key
)
do
%li
.commit.js-toggle-container
{
id:
"commit-#{commit.short_id}"
}
=
commit_author_avatar
(
commit
,
size:
36
)
.commit-row-title
%span
.item-title
=
link_to_gfm
commit
.
title
,
namespace_project_commit_path
(
project
.
namespace
,
project
,
commit
.
id
),
class:
"commit-row-message"
%span
.commit-row-message.visible-xs-inline
·
=
commit
.
short_id
-
if
commit
.
status
=
render_commit_status
(
commit
,
cssclass:
'visible-xs-inline'
)
-
if
commit
.
description?
%a
.text-expander.js-toggle-button
...
%a
.text-expander.
hidden-xs.
js-toggle-button
...
.
pull-right
.
commit-actions.hidden-xs
-
if
commit
.
status
=
render_commit_status
(
commit
)
=
clipboard_button
(
clipboard_text:
commit
.
id
)
=
link_to
commit
.
short_id
,
namespace_project_commit_path
(
project
.
namespace
,
project
,
commit
),
class:
"commit_short_id"
=
render_commit_status
(
commit
,
cssclass:
'btn btn-transparent'
)
=
clipboard_button_with_class
({
clipboard_text:
commit
.
id
},
css_class:
'btn-transparent'
)
=
link_to
commit
.
short_id
,
namespace_project_commit_path
(
project
.
namespace
,
project
,
commit
),
class:
"commit-short-id btn btn-transparent"
=
link_to_browse_code
(
project
,
commit
)
-
if
commit
.
description?
.commit-row-description.js-toggle-content
%pre
%pre
.commit-row-description.js-toggle-content
=
preserve
(
markdown
(
escape_once
(
commit
.
description
),
pipeline: :single_line
,
author:
commit
.
author
))
.commit-row-info
by
=
commit_author_link
(
commit
,
avatar:
true
,
size:
24
)
.committed_ago
#{
time_ago_with_tooltip
(
commit
.
committed_date
)
}
=
link_to_browse_code
(
project
,
commit
)
=
commit_author_link
(
commit
,
avatar:
false
,
size:
24
)
authored
#{
time_ago_with_tooltip
(
commit
.
committed_date
)
}
app/views/projects/commits/_commits.html.haml
View file @
01f577bb
...
...
@@ -4,18 +4,11 @@
-
commits
,
hidden
=
limited_commits
(
@commits
)
-
commits
.
chunk
{
|
c
|
c
.
committed_date
.
in_time_zone
.
to_date
}.
each
do
|
day
,
commits
|
.row.commits-row
.col-md-2.hidden-xs.hidden-sm
%h5
.commits-row-date
%i
.fa.fa-calendar
%span
=
day
.
strftime
(
'%d %b, %Y'
)
.light
=
pluralize
(
commits
.
count
,
'commit'
)
.col-md-10.col-sm-12
%ul
.content-list
%li
.commit-header
=
"
#{
day
.
strftime
(
'%d %b, %Y'
)
}
#{
pluralize
(
commits
.
count
,
'commit'
)
}
"
%li
.commits-row
%ul
.list-unstyled.commit-list
=
render
commits
,
project:
project
%hr
.lists-separator
-
if
hidden
>
0
.alert.alert-warning
%li
.alert.alert-warning
#{
number_with_delimiter
(
hidden
)
}
additional commits have been omitted to prevent performance issues.
app/views/projects/commits/show.html.haml
View file @
01f577bb
...
...
@@ -23,21 +23,18 @@
Create Merge Request
.control
=
form_tag
(
namespace_project_commits_path
(
@project
.
namespace
,
@project
,
@id
),
method: :get
,
class:
'pull-left commits-search-form'
)
do
=
search_field_tag
:search
,
params
[
:search
],
{
placeholder:
'Filter by commit message'
,
id:
'commits-search'
,
class:
'form-control search-text-input'
,
spellcheck:
false
}
=
form_tag
(
namespace_project_commits_path
(
@project
.
namespace
,
@project
,
@id
),
method: :get
,
class:
'commits-search-form'
)
do
=
search_field_tag
:search
,
params
[
:search
],
{
placeholder:
'Filter by commit message'
,
id:
'commits-search'
,
class:
'form-control search-text-input input-short'
,
spellcheck:
false
}
-
if
current_user
&&
current_user
.
private_token
.control
=
link_to
namespace_project_commits_path
(
@project
.
namespace
,
@project
,
@ref
,
{
format: :atom
,
private_token:
current_user
.
private_token
}),
title:
"Commits Feed"
,
class:
'btn'
do
=
icon
(
"rss"
)
%ul
.breadcrumb.repo-breadcrumb
=
commits_breadcrumbs
%div
{
id:
dom_id
(
@project
)}
#commits-list
.content_list
=
render
"commits"
,
project:
@projec
t
.clear
%ol
#commits-list
.list-unstyled.content_lis
t
=
render
"commits"
,
project:
@project
=
spinner
:javascript
...
...
app/views/projects/merge_requests/show/_commits.html.haml
View file @
01f577bb
...
...
@@ -2,4 +2,5 @@
=
icon
(
"sort-amount-desc"
)
Most recent commits displayed first
=
render
"projects/commits/commits"
,
project:
@merge_request
.
project
%ol
#commits-list
.list-unstyled
=
render
"projects/commits/commits"
,
project:
@merge_request
.
project
features/steps/project/source/browse_files.rb
View file @
01f577bb
...
...
@@ -202,8 +202,8 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
end
step
'I see Browse dir link'
do
expect
(
page
).
to
have_link
'Browse Directory
»
'
expect
(
page
).
not_to
have_link
'Browse Code
»
'
expect
(
page
).
to
have_link
'Browse Directory'
expect
(
page
).
not_to
have_link
'Browse Code'
end
step
'I click on readme file'
do
...
...
@@ -219,7 +219,7 @@ class Spinach::Features::ProjectSourceBrowseFiles < Spinach::FeatureSteps
step
'I see Browse code link'
do
expect
(
page
).
to
have_link
'Browse Files'
expect
(
page
).
not_to
have_link
'Browse Directory
»
'
expect
(
page
).
not_to
have_link
'Browse Directory'
end
step
'I click on Permalink'
do
...
...
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