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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
d79c0ea2
Commit
d79c0ea2
authored
Jul 29, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow set labels from Issue/MR forms
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
d45a6b29
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
73 deletions
+17
-73
app/controllers/projects/issues_controller.rb
app/controllers/projects/issues_controller.rb
+1
-1
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+1
-1
app/views/projects/issues/_form.html.haml
app/views/projects/issues/_form.html.haml
+2
-34
app/views/projects/merge_requests/_form.html.haml
app/views/projects/merge_requests/_form.html.haml
+6
-37
app/views/projects/merge_requests/_new_submit.html.haml
app/views/projects/merge_requests/_new_submit.html.haml
+7
-0
No files found.
app/controllers/projects/issues_controller.rb
View file @
d79c0ea2
...
...
@@ -152,7 +152,7 @@ class Projects::IssuesController < Projects::ApplicationController
def
issue_params
params
.
require
(
:issue
).
permit
(
:title
,
:assignee_id
,
:position
,
:description
,
:milestone_id
,
:
label_list
,
:state_event
:milestone_id
,
:
state_event
,
label_ids:
[]
)
end
end
app/controllers/projects/merge_requests_controller.rb
View file @
d79c0ea2
...
...
@@ -242,7 +242,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
params
.
require
(
:merge_request
).
permit
(
:title
,
:assignee_id
,
:source_project_id
,
:source_branch
,
:target_project_id
,
:target_branch
,
:milestone_id
,
:state_event
,
:description
,
:label_list
:state_event
,
:description
,
label_ids:
[]
)
end
end
app/views/projects/issues/_form.html.haml
View file @
d79c0ea2
...
...
@@ -44,14 +44,11 @@
.col-sm-10
=
f
.
select
(
:milestone_id
,
milestone_options
(
@issue
),
{
include_blank:
"Select milestone"
},
{
class:
'select2'
})
.form-group
=
f
.
label
:label_
list
,
class:
'control-label'
do
=
f
.
label
:label_
ids
,
class:
'control-label'
do
%i
.icon-tag
Labels
.col-sm-10
=
f
.
text_field
:label_list
,
maxlength:
2000
,
class:
"form-control"
%p
.hint
Separate labels with commas.
=
f
.
collection_select
:label_ids
,
@project
.
labels
.
all
,
:id
,
:name
,
{
selected:
@issue
.
label_ids
},
multiple:
true
,
class:
'select2'
.form-actions
-
if
@issue
.
new_record?
...
...
@@ -63,35 +60,6 @@
=
link_to
"Cancel"
,
cancel_path
,
class:
'btn btn-cancel'
:javascript
$
(
"
#issue_label_list
"
)
.
bind
(
"
keydown
"
,
function
(
event
)
{
if
(
event
.
keyCode
===
$
.
ui
.
keyCode
.
TAB
&&
$
(
this
).
data
(
"
autocomplete
"
).
menu
.
active
)
{
event
.
preventDefault
();
}
})
.
bind
(
"
click
"
,
function
(
event
)
{
$
(
this
).
autocomplete
(
"
search
"
,
""
);
})
.
autocomplete
({
minLength
:
0
,
source
:
function
(
request
,
response
)
{
response
(
$
.
ui
.
autocomplete
.
filter
(
#{
raw
labels_autocomplete_source
}
,
extractLast
(
request
.
term
)
)
);
},
focus
:
function
()
{
return
false
;
},
select
:
function
(
event
,
ui
)
{
var
terms
=
split
(
this
.
value
);
terms
.
pop
();
terms
.
push
(
ui
.
item
.
value
);
terms
.
push
(
""
);
this
.
value
=
terms
.
join
(
"
,
"
);
return
false
;
}
});
$
(
'
.assign-to-me-link
'
).
on
(
'
click
'
,
function
(
e
){
$
(
'
#issue_assignee_id
'
).
val
(
"
#{
current_user
.
id
}
"
).
trigger
(
"
change
"
);
e
.
preventDefault
();
...
...
app/views/projects/merge_requests/_form.html.haml
View file @
d79c0ea2
...
...
@@ -46,14 +46,12 @@
.col-sm-10
=
f
.
select
(
:milestone_id
,
milestone_options
(
@merge_request
),
{
include_blank:
"Select milestone"
},
{
class:
'select2'
})
-
if
@merge_request
.
persisted?
# Only allow labels on edit to avoid fork vs upstream repo labels issue
.form-group
=
f
.
label
:label_list
,
class:
'control-label'
do
%i
.icon-tag
Labels
.col-sm-10
=
f
.
text_field
:label_list
,
maxlength:
2000
,
class:
"form-control"
%p
.hint
Separate labels with commas.
.form-group
=
f
.
label
:label_ids
,
class:
'control-label'
do
%i
.icon-tag
Labels
.col-sm-10
=
f
.
collection_select
:label_ids
,
@merge_request
.
target_project
.
labels
.
all
,
:id
,
:name
,
{
selected:
@merge_request
.
label_ids
},
multiple:
true
,
class:
'select2'
.form-actions
-
if
@merge_request
.
new_record?
...
...
@@ -74,33 +72,4 @@
e
.
preventDefault
();
});
$
(
"
#merge_request_label_list
"
)
.
bind
(
"
keydown
"
,
function
(
event
)
{
if
(
event
.
keyCode
===
$
.
ui
.
keyCode
.
TAB
&&
$
(
this
).
data
(
"
autocomplete
"
).
menu
.
active
)
{
event
.
preventDefault
();
}
})
.
bind
(
"
click
"
,
function
(
event
)
{
$
(
this
).
autocomplete
(
"
search
"
,
""
);
})
.
autocomplete
({
minLength
:
0
,
source
:
function
(
request
,
response
)
{
response
(
$
.
ui
.
autocomplete
.
filter
(
#{
raw
labels_autocomplete_source
}
,
extractLast
(
request
.
term
)
)
);
},
focus
:
function
()
{
return
false
;
},
select
:
function
(
event
,
ui
)
{
var
terms
=
split
(
this
.
value
);
terms
.
pop
();
terms
.
push
(
ui
.
item
.
value
);
terms
.
push
(
""
);
this
.
value
=
terms
.
join
(
"
,
"
);
return
false
;
}
});
window
.
project_image_path_upload
=
"
#{
upload_image_project_path
@project
}
"
;
app/views/projects/merge_requests/_new_submit.html.haml
View file @
d79c0ea2
...
...
@@ -43,6 +43,13 @@
%i
.icon-time
Milestone
%div
=
f
.
select
(
:milestone_id
,
milestone_options
(
@merge_request
),
{
include_blank:
"Select milestone"
},
{
class:
'select2'
})
.form-group
=
f
.
label
:label_ids
do
%i
.icon-tag
Labels
%div
=
f
.
collection_select
:label_ids
,
@merge_request
.
target_project
.
labels
.
all
,
:id
,
:name
,
{
selected:
@merge_request
.
label_ids
},
multiple:
true
,
class:
'select2'
.panel-footer
-
if
contribution_guide_url
(
@target_project
)
%p
...
...
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