BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
72b055d0
Commit
72b055d0
authored
Jul 11, 2016
by
Robert Speicher
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'mr-close-btn' into 'master'
Correctly shows close button on merge requests Closes #19403 See merge request !5036
parents
f5ceb638
b6845179
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
merge_requests_helper.rb
app/helpers/merge_requests_helper.rb
+4
-0
_mr_title.html.haml
app/views/projects/merge_requests/show/_mr_title.html.haml
+4
-4
No files found.
app/helpers/merge_requests_helper.rb
View file @
72b055d0
...
...
@@ -96,4 +96,8 @@ module MergeRequestsHelper
[
"
#{
source_path
}
:
#{
source_branch
}
"
,
"
#{
target_path
}
:
#{
target_branch
}
"
]
end
end
def
merge_request_button_visibility
(
merge_request
,
closed
)
return
'hidden'
if
merge_request
.
closed?
==
closed
||
(
merge_request
.
merged?
==
closed
&&
!
merge_request
.
closed?
)
end
end
app/views/projects/merge_requests/show/_mr_title.html.haml
View file @
72b055d0
...
...
@@ -19,13 +19,13 @@
Options
.dropdown-menu.dropdown-menu-align-right.hidden-lg
%ul
%li
{
class:
issue
_button_visibility
(
@merge_request
,
true
)
}
%li
{
class:
merge_request
_button_visibility
(
@merge_request
,
true
)
}
=
link_to
'Close'
,
merge_request_path
(
@merge_request
,
merge_request:
{
state_event: :close
}),
method: :put
,
title:
'Close merge request'
%li
{
class:
issue
_button_visibility
(
@merge_request
,
false
)
}
%li
{
class:
merge_request
_button_visibility
(
@merge_request
,
false
)
}
=
link_to
'Reopen'
,
merge_request_path
(
@merge_request
,
merge_request:
{
state_event: :reopen
}),
method: :put
,
class:
'reopen-mr-link'
,
title:
'Reopen merge request'
%li
=
link_to
'Edit'
,
edit_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
class:
'issuable-edit'
=
link_to
'Close'
,
merge_request_path
(
@merge_request
,
merge_request:
{
state_event: :close
}),
method: :put
,
class:
"hidden-xs hidden-sm btn btn-grouped btn-close
#{
issue
_button_visibility
(
@merge_request
,
true
)
}
"
,
title:
'Close merge request'
=
link_to
'Reopen'
,
merge_request_path
(
@merge_request
,
merge_request:
{
state_event: :reopen
}),
method: :put
,
class:
"hidden-xs hidden-sm btn btn-grouped btn-reopen reopen-mr-link
#{
issue
_button_visibility
(
@merge_request
,
false
)
}
"
,
title:
'Reopen merge request'
=
link_to
'Close'
,
merge_request_path
(
@merge_request
,
merge_request:
{
state_event: :close
}),
method: :put
,
class:
"hidden-xs hidden-sm btn btn-grouped btn-close
#{
merge_request
_button_visibility
(
@merge_request
,
true
)
}
"
,
title:
'Close merge request'
=
link_to
'Reopen'
,
merge_request_path
(
@merge_request
,
merge_request:
{
state_event: :reopen
}),
method: :put
,
class:
"hidden-xs hidden-sm btn btn-grouped btn-reopen reopen-mr-link
#{
merge_request
_button_visibility
(
@merge_request
,
false
)
}
"
,
title:
'Reopen merge request'
=
link_to
edit_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
class:
"hidden-xs hidden-sm btn btn-grouped issuable-edit"
do
Edit
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