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
35adeee5
Commit
35adeee5
authored
Dec 12, 2016
by
Mike Greiling
Committed by
Alfredo Sumaran
Dec 21, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
homogenize revert and cherry-pick button styles generated by commits_helper
parent
528c3e2b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
7 deletions
+4
-7
app/helpers/commits_helper.rb
app/helpers/commits_helper.rb
+4
-7
No files found.
app/helpers/commits_helper.rb
View file @
35adeee5
...
...
@@ -131,9 +131,9 @@ module CommitsHelper
return
unless
current_user
tooltip
=
"Revert this
#{
commit
.
change_type_title
(
current_user
)
}
in a new merge request"
if
has_tooltip
btn_class
=
"btn btn-warning btn-
#{
btn_class
}
"
unless
btn_class
.
nil?
if
can_collaborate_with_project?
btn_class
=
"btn btn-warning 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
)
continue_params
=
{
...
...
@@ -145,8 +145,6 @@ module CommitsHelper
namespace_key:
current_user
.
namespace
.
id
,
continue:
continue_params
)
btn_class
=
"btn btn-grouped btn-warning"
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
...
...
@@ -154,10 +152,10 @@ module CommitsHelper
def
cherry_pick_commit_link
(
commit
,
continue_to_path
,
btn_class:
nil
,
has_tooltip:
true
)
return
unless
current_user
tooltip
=
"Cherry-pick this
#{
commit
.
change_type_title
(
current_user
)
}
in a new merge request"
tooltip
=
"Cherry-pick this
#{
commit
.
change_type_title
(
current_user
)
}
in a new merge request"
if
has_tooltip
btn_class
=
"btn btn-default btn-
#{
btn_class
}
"
unless
btn_class
.
nil?
if
can_collaborate_with_project?
btn_class
=
"btn btn-default 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
)
continue_params
=
{
...
...
@@ -169,8 +167,7 @@ module CommitsHelper
namespace_key:
current_user
.
namespace
.
id
,
continue:
continue_params
)
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
)
link_to
'Cherry-pick'
,
fork_path
,
class:
btn_class
,
method: :post
,
'data-toggle'
=>
'tooltip'
,
'data-container'
=>
'body'
,
title:
(
tooltip
if
has_tooltip
)
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