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
2da289cf
Commit
2da289cf
authored
May 08, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add assignee and milestone to 2nd step
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
ee3cd06f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
4 deletions
+30
-4
app/assets/javascripts/project_users_select.js.coffee
app/assets/javascripts/project_users_select.js.coffee
+1
-1
app/helpers/issues_helper.rb
app/helpers/issues_helper.rb
+1
-1
app/helpers/selects_helper.rb
app/helpers/selects_helper.rb
+2
-2
app/views/projects/merge_requests/_form.html.haml
app/views/projects/merge_requests/_form.html.haml
+4
-0
app/views/projects/merge_requests/_new_submit.html.haml
app/views/projects/merge_requests/_new_submit.html.haml
+22
-0
No files found.
app/assets/javascripts/project_users_select.js.coffee
View file @
2da289cf
@
projectUsersSelect
=
init
:
->
$
(
'.ajax-project-users-select'
).
each
(
i
,
select
)
->
project_id
=
$
(
'body'
).
data
(
'project-id'
)
project_id
=
$
(
select
).
data
(
'project-id'
)
||
$
(
'body'
).
data
(
'project-id'
)
$
(
select
).
select2
placeholder
:
$
(
select
).
data
(
'placeholder'
)
||
"Search for a user"
...
...
app/helpers/issues_helper.rb
View file @
2da289cf
...
...
@@ -82,7 +82,7 @@ module IssuesHelper
end
def
milestone_options
object
options_from_collection_for_select
(
@
project
.
milestones
.
active
,
'id'
,
'title'
,
object
.
milestone_id
)
options_from_collection_for_select
(
object
.
project
.
milestones
.
active
,
'id'
,
'title'
,
object
.
milestone_id
)
end
def
issue_box_class
(
item
)
...
...
app/helpers/selects_helper.rb
View file @
2da289cf
...
...
@@ -14,7 +14,7 @@ module SelectsHelper
css_class
<<
(
opts
[
:class
]
||
''
)
value
=
opts
[
:selected
]
||
''
placeholder
=
opts
[
:placeholder
]
||
'Select user'
hidden_field_tag
(
id
,
value
,
class:
css_class
,
'data-placeholder'
=>
placeholder
)
project_id
=
opts
[
:project_id
]
||
@project
.
id
hidden_field_tag
(
id
,
value
,
class:
css_class
,
'data-placeholder'
=>
placeholder
,
'data-project-id'
=>
project_id
)
end
end
app/views/projects/merge_requests/_form.html.haml
View file @
2da289cf
...
...
@@ -56,3 +56,7 @@
:javascript
disableButtonIfEmptyField
(
"
#merge_request_title
"
,
"
.btn-save
"
);
$
(
'
.assign-to-me-link
'
).
on
(
'
click
'
,
function
(
e
){
$
(
'
#merge_request_assignee_id
'
).
val
(
"
#{
current_user
.
id
}
"
).
trigger
(
"
change
"
);
e
.
preventDefault
();
});
app/views/projects/merge_requests/_new_submit.html.haml
View file @
2da289cf
...
...
@@ -25,6 +25,21 @@
=
f
.
label
:description
,
"Description"
=
f
.
text_area
:description
,
class:
"form-control js-gfm-input"
,
rows:
10
%p
.hint
Description is parsed with
#{
link_to
"GitLab Flavored Markdown"
,
help_markdown_path
,
target:
'_blank'
}
.
.form-group
.issue-assignee
=
f
.
label
:assignee_id
do
%i
.icon-user
Assign to
%div
=
project_users_select_tag
(
'merge_request[assignee_id]'
,
placeholder:
'Select a user'
,
class:
'custom-form-control'
,
selected:
@merge_request
.
assignee_id
,
project_id:
@merge_request
.
target_project_id
)
=
link_to
'Assign to me'
,
'#'
,
class:
'btn btn-small assign-to-me-link'
.form-group
.issue-milestone
=
f
.
label
:milestone_id
do
%i
.icon-time
Milestone
%div
=
f
.
select
(
:milestone_id
,
milestone_options
(
@merge_request
),
{
include_blank:
"Select milestone"
},
{
class:
'select2'
})
.panel-footer
-
if
@target_repo
.
contribution_guide
-
contribution_guide_url
=
project_blob_path
(
@target_project
,
tree_join
(
@target_repo
.
root_ref
,
@target_repo
.
contribution_guide
.
name
))
...
...
@@ -58,3 +73,10 @@
.bs-callout.bs-callout-danger
%h4
This comparison includes more than
#{
MergeRequestDiff
::
COMMITS_SAFE_SIZE
}
commits.
%p
To preserve performance the line changes are not shown.
:javascript
$
(
'
.assign-to-me-link
'
).
on
(
'
click
'
,
function
(
e
){
$
(
'
#merge_request_assignee_id
'
).
val
(
"
#{
current_user
.
id
}
"
).
trigger
(
"
change
"
);
e
.
preventDefault
();
});
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