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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
19e9808f
Commit
19e9808f
authored
Nov 30, 2016
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[EE] Refactor branch chooser in issuable form
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
1c66e080
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
28 deletions
+40
-28
app/views/shared/issuable/_approvals.html.haml
app/views/shared/issuable/_approvals.html.haml
+8
-3
app/views/shared/issuable/_form.html.haml
app/views/shared/issuable/_form.html.haml
+2
-25
app/views/shared/issuable/form/_branch_chooser.html.haml
app/views/shared/issuable/form/_branch_chooser.html.haml
+30
-0
No files found.
app/views/shared/issuable/_approvals.html.haml
View file @
19e9808f
-
issuable
=
local_assigns
.
fetch
(
:issuable
)
-
form
=
local_assigns
.
fetch
(
:form
)
-
return
unless
issuable
.
is_a?
(
MergeRequest
)
-
return
unless
issuable
.
requires_approve?
-
approvals_required
=
issuable
.
target_project
.
approvals_before_merge
.form-group
=
f
.
label
:approvals_before_merge
,
class:
'control-label'
do
=
f
orm
.
label
:approvals_before_merge
,
class:
'control-label'
do
Approvals required
.col-sm-10
=
f
.
number_field
:approvals_before_merge
,
class:
'form-control'
,
value:
approvals_required
=
f
orm
.
number_field
:approvals_before_merge
,
class:
'form-control'
,
value:
approvals_required
.help-block
Number of users who need to approve this merge request before it can be accepted.
If this isn't greater than the project default (
#{
pluralize
(
approvals_required
,
'user'
)
}
),
then it will be ignored and the project default will be used.
.form-group
=
f
.
label
:approver_ids
,
class:
'control-label'
do
=
f
orm
.
label
:approver_ids
,
class:
'control-label'
do
Approvers
.col-sm-10
-
author
=
issuable
.
author
||
current_user
...
...
app/views/shared/issuable/_form.html.haml
View file @
19e9808f
...
...
@@ -40,32 +40,9 @@
title:
'Moving an issue will copy the discussion to a different project and close it here. All participants will be notified of the new location.'
}
=
icon
(
'question-circle'
)
=
render
'shared/issuable/approvals'
,
issuable:
issuable
,
f:
form
=
render
'shared/issuable/approvals'
,
issuable:
issuable
,
f
orm
:
form
-
if
issuable
.
is_a?
(
MergeRequest
)
&&
!
issuable
.
closed_without_fork?
%hr
-
if
@merge_request
.
new_record?
.form-group
=
form
.
label
:source_branch
,
class:
'control-label'
.col-sm-10
.issuable-form-select-holder
=
form
.
select
(
:source_branch
,
[
@merge_request
.
source_branch
],
{
},
{
class:
'source_branch select2 span2'
,
disabled:
true
})
.form-group
=
form
.
label
:target_branch
,
class:
'control-label'
.col-sm-10
.issuable-form-select-holder
=
form
.
select
(
:target_branch
,
@merge_request
.
target_branches
,
{
include_blank:
true
},
{
class:
'target_branch select2 span2'
,
disabled:
@merge_request
.
new_record?
,
data:
{
placeholder:
"Select branch"
}
})
-
if
@merge_request
.
new_record?
=
link_to
'Change branches'
,
mr_change_branches_path
(
@merge_request
)
-
if
@merge_request
.
can_remove_source_branch?
(
current_user
)
.form-group
.col-sm-10.col-sm-offset-2
.checkbox
=
label_tag
'merge_request[force_remove_source_branch]'
do
=
hidden_field_tag
'merge_request[force_remove_source_branch]'
,
'0'
,
id:
nil
=
check_box_tag
'merge_request[force_remove_source_branch]'
,
'1'
,
@merge_request
.
force_remove_source_branch?
Remove source branch when merge request is accepted.
=
render
'shared/issuable/form/branch_chooser'
,
issuable:
issuable
,
form:
form
-
is_footer
=
!
(
issuable
.
is_a?
(
MergeRequest
)
&&
issuable
.
new_record?
)
.row-content-block
{
class:
(
is_footer
?
"footer-block"
:
"middle-block"
)}
...
...
app/views/shared/issuable/form/_branch_chooser.html.haml
0 → 100644
View file @
19e9808f
-
issuable
=
local_assigns
.
fetch
(
:issuable
)
-
form
=
local_assigns
.
fetch
(
:form
)
-
return
unless
issuable
.
is_a?
(
MergeRequest
)
-
return
if
issuable
.
closed_without_fork?
%hr
-
if
issuable
.
new_record?
.form-group
=
form
.
label
:source_branch
,
class:
'control-label'
.col-sm-10
.issuable-form-select-holder
=
form
.
select
(
:source_branch
,
[
issuable
.
source_branch
],
{},
{
class:
'source_branch select2 span2'
,
disabled:
true
})
.form-group
=
form
.
label
:target_branch
,
class:
'control-label'
.col-sm-10
.issuable-form-select-holder
=
form
.
select
(
:target_branch
,
issuable
.
target_branches
,
{
include_blank:
true
},
{
class:
'target_branch select2 span2'
,
disabled:
issuable
.
new_record?
,
data:
{
placeholder:
"Select branch"
}})
-
if
issuable
.
new_record?
=
link_to
'Change branches'
,
mr_change_branches_path
(
issuable
)
-
if
issuable
.
can_remove_source_branch?
(
current_user
)
.form-group
.col-sm-10.col-sm-offset-2
.checkbox
=
label_tag
'merge_request[force_remove_source_branch]'
do
=
hidden_field_tag
'merge_request[force_remove_source_branch]'
,
'0'
,
id:
nil
=
check_box_tag
'merge_request[force_remove_source_branch]'
,
'1'
,
issuable
.
force_remove_source_branch?
Remove source branch when merge request is accepted.
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