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
2830b46c
Commit
2830b46c
authored
May 26, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduced number of buttons in commit header
Closes #17576
parent
adc64e45
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
26 deletions
+28
-26
app/assets/stylesheets/framework/dropdowns.scss
app/assets/stylesheets/framework/dropdowns.scss
+1
-1
app/assets/stylesheets/pages/commit.scss
app/assets/stylesheets/pages/commit.scss
+0
-4
app/helpers/commits_helper.rb
app/helpers/commits_helper.rb
+12
-7
app/views/projects/commit/_commit_box.html.haml
app/views/projects/commit/_commit_box.html.haml
+15
-14
No files found.
app/assets/stylesheets/framework/dropdowns.scss
View file @
2830b46c
...
@@ -154,7 +154,7 @@
...
@@ -154,7 +154,7 @@
color
:
$dropdown-header-color
;
color
:
$dropdown-header-color
;
font-size
:
13px
;
font-size
:
13px
;
line-height
:
22px
;
line-height
:
22px
;
padding
:
0
10px
10px
;
padding
:
0
10px
;
}
}
.separator
+
.dropdown-header
{
.separator
+
.dropdown-header
{
...
...
app/assets/stylesheets/pages/commit.scss
View file @
2830b46c
...
@@ -35,10 +35,6 @@
...
@@ -35,10 +35,6 @@
font-weight
:
bold
;
font-weight
:
bold
;
}
}
.time_ago
{
margin-left
:
8px
;
}
.fa-clipboard
{
.fa-clipboard
{
color
:
$dropdown-title-btn-color
;
color
:
$dropdown-title-btn-color
;
}
}
...
...
app/helpers/commits_helper.rb
View file @
2830b46c
...
@@ -123,13 +123,14 @@ module CommitsHelper
...
@@ -123,13 +123,14 @@ module CommitsHelper
)
)
end
end
def
revert_commit_link
(
commit
,
continue_to_path
,
btn_class:
nil
)
def
revert_commit_link
(
commit
,
continue_to_path
,
btn_class:
nil
,
has_tooltip:
true
)
return
unless
current_user
return
unless
current_user
tooltip
=
"Revert this
#{
commit
.
change_type_title
}
in a new merge request"
tooltip
=
"Revert this
#{
commit
.
change_type_title
}
in a new merge request"
if
has_tooltip
if
can_collaborate_with_project?
if
can_collaborate_with_project?
link_to
'Revert'
,
'#modal-revert-commit'
,
'data-toggle'
=>
'modal'
,
'data-container'
=>
'body'
,
title:
tooltip
,
class:
"btn btn-default btn-grouped btn-
#{
btn_class
}
has-tooltip"
btn_class
=
"btn btn-grouped btn-close btn-
#{
btn_class
}
"
unless
btn_class
.
nil?
link_to
'Revert'
,
'#modal-revert-commit'
,
'data-toggle'
=>
'modal'
,
'data-container'
=>
'body'
,
title:
(
tooltip
if
has_tooltip
),
class:
"
#{
btn_class
}
#{
'has-tooltip'
if
has_tooltip
}
"
elsif
can?
(
current_user
,
:fork_project
,
@project
)
elsif
can?
(
current_user
,
:fork_project
,
@project
)
continue_params
=
{
continue_params
=
{
to:
continue_to_path
,
to:
continue_to_path
,
...
@@ -140,17 +141,20 @@ module CommitsHelper
...
@@ -140,17 +141,20 @@ module CommitsHelper
namespace_key:
current_user
.
namespace
.
id
,
namespace_key:
current_user
.
namespace
.
id
,
continue:
continue_params
)
continue:
continue_params
)
link_to
'Revert'
,
fork_path
,
class:
'btn btn-grouped btn-close'
,
method: :post
,
'data-toggle'
=>
'tooltip'
,
'data-container'
=>
'body'
,
title:
tooltip
btn_class
=
"btn btn-grouped btn-close"
unless
btn_class
.
nil?
link_to
'Revert'
,
fork_path
,
class:
btn_class
,
method: :post
,
'data-toggle'
=>
'tooltip'
,
'data-container'
=>
'body'
,
title:
(
tooltip
if
has_tooltip
)
end
end
end
end
def
cherry_pick_commit_link
(
commit
,
continue_to_path
,
btn_class:
nil
)
def
cherry_pick_commit_link
(
commit
,
continue_to_path
,
btn_class:
nil
,
has_tooltip:
true
)
return
unless
current_user
return
unless
current_user
tooltip
=
"Cherry-pick this
#{
commit
.
change_type_title
}
in a new merge request"
tooltip
=
"Cherry-pick this
#{
commit
.
change_type_title
}
in a new merge request"
if
can_collaborate_with_project?
if
can_collaborate_with_project?
link_to
'Cherry-pick'
,
'#modal-cherry-pick-commit'
,
'data-toggle'
=>
'modal'
,
'data-container'
=>
'body'
,
title:
tooltip
,
class:
"btn btn-default btn-grouped btn-
#{
btn_class
}
has-tooltip"
btn_class
=
"btn btn-default btn-grouped btn-
#{
btn_class
}
"
unless
btn_class
.
nil?
link_to
'Cherry-pick'
,
'#modal-cherry-pick-commit'
,
'data-toggle'
=>
'modal'
,
'data-container'
=>
'body'
,
title:
(
tooltip
if
has_tooltip
),
class:
"
#{
btn_class
}
#{
'has-tooltip'
if
has_tooltip
}
"
elsif
can?
(
current_user
,
:fork_project
,
@project
)
elsif
can?
(
current_user
,
:fork_project
,
@project
)
continue_params
=
{
continue_params
=
{
to:
continue_to_path
,
to:
continue_to_path
,
...
@@ -161,7 +165,8 @@ module CommitsHelper
...
@@ -161,7 +165,8 @@ module CommitsHelper
namespace_key:
current_user
.
namespace
.
id
,
namespace_key:
current_user
.
namespace
.
id
,
continue:
continue_params
)
continue:
continue_params
)
link_to
'Cherry-pick'
,
fork_path
,
class:
'btn btn-grouped btn-close'
,
method: :post
,
'data-toggle'
=>
'tooltip'
,
'data-container'
=>
'body'
,
title:
tooltip
btn_class
=
"btn btn-grouped btn-close"
unless
btn_class
.
nil?
link_to
'Cherry-pick'
,
fork_path
,
class:
"
#{
btn_class
}
"
,
method: :post
,
'data-toggle'
=>
'tooltip'
,
'data-container'
=>
'body'
,
title:
(
tooltip
if
has_tooltip
)
end
end
end
end
...
...
app/views/projects/commit/_commit_box.html.haml
View file @
2830b46c
...
@@ -2,26 +2,27 @@
...
@@ -2,26 +2,27 @@
%div
%div
-
if
defined?
(
@notes_count
)
&&
@notes_count
>
0
-
if
defined?
(
@notes_count
)
&&
@notes_count
>
0
%span
.btn.disabled.btn-grouped
%span
.btn.disabled.btn-grouped
%i
.fa.fa-comment
=
icon
(
'comment'
)
=
@notes_count
=
@notes_count
.pull-left.btn-group
=
link_to
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
@commit
),
class:
"btn btn-grouped"
do
%a
.btn.btn-grouped.dropdown-toggle
{
data:
{
toggle: :dropdown
}
}
Browse Files
%i
.fa.fa-download
.dropdown.inline
Download as
%a
.btn.btn-default.dropdown-toggle
{
data:
{
toggle:
"dropdown"
}
}
Options
%span
.caret
%span
.caret
%ul
.dropdown-menu
%ul
.dropdown-menu.dropdown-menu-align-right
-
unless
@commit
.
has_been_reverted?
(
current_user
)
%li
.clearfix
=
revert_commit_link
(
@commit
,
namespace_project_commit_path
(
@project
.
namespace
,
@project
,
@commit
.
id
),
has_tooltip:
false
)
%li
.clearfix
=
cherry_pick_commit_link
(
@commit
,
namespace_project_commit_path
(
@project
.
namespace
,
@project
,
@commit
.
id
),
has_tooltip:
false
)
%li
.divider
%li
.dropdown-header
Download
-
unless
@commit
.
parents
.
length
>
1
-
unless
@commit
.
parents
.
length
>
1
%li
=
link_to
"Email Patches"
,
namespace_project_commit_path
(
@project
.
namespace
,
@project
,
@commit
,
format: :patch
)
%li
=
link_to
"Email Patches"
,
namespace_project_commit_path
(
@project
.
namespace
,
@project
,
@commit
,
format: :patch
)
%li
=
link_to
"Plain Diff"
,
namespace_project_commit_path
(
@project
.
namespace
,
@project
,
@commit
,
format: :diff
)
%li
=
link_to
"Plain Diff"
,
namespace_project_commit_path
(
@project
.
namespace
,
@project
,
@commit
,
format: :diff
)
=
link_to
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
@commit
),
class:
"btn btn-grouped"
do
=
icon
(
'files-o'
)
Browse Files
-
unless
@commit
.
has_been_reverted?
(
current_user
)
=
revert_commit_link
(
@commit
,
namespace_project_commit_path
(
@project
.
namespace
,
@project
,
@commit
.
id
))
=
cherry_pick_commit_link
(
@commit
,
namespace_project_commit_path
(
@project
.
namespace
,
@project
,
@commit
.
id
))
%div
%p
.commit-info-row
.commit-info-row
%span
.light
Authored by
%span
.light
Authored by
%strong
%strong
...
...
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