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
e8d15f13
Commit
e8d15f13
authored
Feb 13, 2016
by
Rubén Dávila
Committed by
Robert Speicher
Feb 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor revert_commit_link helper.
parent
a07021fa
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
10 deletions
+4
-10
app/helpers/commits_helper.rb
app/helpers/commits_helper.rb
+2
-2
app/helpers/merge_requests_helper.rb
app/helpers/merge_requests_helper.rb
+0
-6
app/views/projects/commit/_commit_box.html.haml
app/views/projects/commit/_commit_box.html.haml
+1
-1
app/views/projects/merge_requests/widget/_merged.html.haml
app/views/projects/merge_requests/widget/_merged.html.haml
+1
-1
No files found.
app/helpers/commits_helper.rb
View file @
e8d15f13
...
@@ -123,10 +123,10 @@ module CommitsHelper
...
@@ -123,10 +123,10 @@ module CommitsHelper
)
)
end
end
def
revert_commit_link
(
show_modal_condition
,
continue_to_path
,
btn_class:
nil
)
def
revert_commit_link
(
continue_to_path
,
btn_class:
nil
)
return
unless
current_user
return
unless
current_user
if
show_modal_condition
if
can_collaborate_with_project?
content_tag
:span
,
'data-toggle'
=>
'modal'
,
'data-target'
=>
'#modal-revert-commit'
do
content_tag
:span
,
'data-toggle'
=>
'modal'
,
'data-target'
=>
'#modal-revert-commit'
do
link_to
'Revert'
,
'#modal-revert-commit'
,
'data-toggle'
=>
'tooltip'
,
'data-original-title'
=>
'Create merge request to revert commit'
,
class:
"btn btn-close btn-
#{
btn_class
}
"
link_to
'Revert'
,
'#modal-revert-commit'
,
'data-toggle'
=>
'tooltip'
,
'data-original-title'
=>
'Create merge request to revert commit'
,
class:
"btn btn-close btn-
#{
btn_class
}
"
end
end
...
...
app/helpers/merge_requests_helper.rb
View file @
e8d15f13
...
@@ -92,10 +92,4 @@ module MergeRequestsHelper
...
@@ -92,10 +92,4 @@ module MergeRequestsHelper
[
"
#{
source_path
}
:
#{
source_branch
}
"
,
"
#{
target_path
}
:
#{
target_branch
}
"
]
[
"
#{
source_path
}
:
#{
source_branch
}
"
,
"
#{
target_path
}
:
#{
target_branch
}
"
]
end
end
end
end
def
can_update_merge_request?
project
||=
@project
can_collaborate_with_project?
(
project
)
end
end
end
app/views/projects/commit/_commit_box.html.haml
View file @
e8d15f13
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
=
link_to
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
@commit
),
class:
"btn btn-grouped"
do
=
link_to
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
@commit
),
class:
"btn btn-grouped"
do
=
icon
(
'files-o'
)
=
icon
(
'files-o'
)
Browse Files
Browse Files
=
revert_commit_link
(
can_collaborate_with_project?
,
namespace_project_commit_path
(
@project
.
namespace
,
@project
,
@commit
.
id
))
=
revert_commit_link
(
namespace_project_commit_path
(
@project
.
namespace
,
@project
,
@commit
.
id
))
%div
%div
%p
%p
...
...
app/views/projects/merge_requests/widget/_merged.html.haml
View file @
e8d15f13
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
by
#{
link_to_member
(
@project
,
@merge_request
.
merge_event
.
author
,
avatar:
true
)
}
by
#{
link_to_member
(
@project
,
@merge_request
.
merge_event
.
author
,
avatar:
true
)
}
#{
time_ago_with_tooltip
(
@merge_request
.
merge_event
.
created_at
)
}
#{
time_ago_with_tooltip
(
@merge_request
.
merge_event
.
created_at
)
}
-
if
@merge_request
.
merge_commit_sha
.
present?
-
if
@merge_request
.
merge_commit_sha
.
present?
=
revert_commit_link
(
can_update_merge_request?
,
namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
btn_class:
'sm'
)
=
revert_commit_link
(
namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
btn_class:
'sm'
)
%div
%div
-
if
!
@merge_request
.
source_branch_exists?
||
(
params
[
:delete_source
]
==
'true'
)
-
if
!
@merge_request
.
source_branch_exists?
||
(
params
[
:delete_source
]
==
'true'
)
The changes were merged into
The changes were merged into
...
...
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