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
b6845179
Commit
b6845179
authored
Jul 11, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved merge request button visibility out of issue_helper
parent
c674c119
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
5 deletions
+9
-5
app/helpers/issues_helper.rb
app/helpers/issues_helper.rb
+1
-1
app/helpers/merge_requests_helper.rb
app/helpers/merge_requests_helper.rb
+4
-0
app/views/projects/merge_requests/show/_mr_title.html.haml
app/views/projects/merge_requests/show/_mr_title.html.haml
+4
-4
No files found.
app/helpers/issues_helper.rb
View file @
b6845179
...
@@ -102,7 +102,7 @@ module IssuesHelper
...
@@ -102,7 +102,7 @@ module IssuesHelper
end
end
def
issue_button_visibility
(
issue
,
closed
)
def
issue_button_visibility
(
issue
,
closed
)
return
'hidden'
if
issue
.
closed?
==
closed
||
(
issue
.
try
(
:merged?
)
==
closed
&&
!
issue
.
closed?
)
return
'hidden'
if
issue
.
closed?
==
closed
end
end
def
merge_requests_sentence
(
merge_requests
)
def
merge_requests_sentence
(
merge_requests
)
...
...
app/helpers/merge_requests_helper.rb
View file @
b6845179
...
@@ -92,4 +92,8 @@ module MergeRequestsHelper
...
@@ -92,4 +92,8 @@ module MergeRequestsHelper
[
"
#{
source_path
}
:
#{
source_branch
}
"
,
"
#{
target_path
}
:
#{
target_branch
}
"
]
[
"
#{
source_path
}
:
#{
source_branch
}
"
,
"
#{
target_path
}
:
#{
target_branch
}
"
]
end
end
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
end
app/views/projects/merge_requests/show/_mr_title.html.haml
View file @
b6845179
...
@@ -19,13 +19,13 @@
...
@@ -19,13 +19,13 @@
Options
Options
.dropdown-menu.dropdown-menu-align-right.hidden-lg
.dropdown-menu.dropdown-menu-align-right.hidden-lg
%ul
%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'
=
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'
=
link_to
'Reopen'
,
merge_request_path
(
@merge_request
,
merge_request:
{
state_event: :reopen
}),
method: :put
,
class:
'reopen-mr-link'
,
title:
'Reopen merge request'
%li
%li
=
link_to
'Edit'
,
edit_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
),
class:
'issuable-edit'
=
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
'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
#{
issue
_button_visibility
(
@merge_request
,
false
)
}
"
,
title:
'Reopen 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
=
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
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