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
Tatuya Kamada
gitlab-ce
Commits
6fb90a2c
Commit
6fb90a2c
authored
Dec 07, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include groups in dashboard "New Milestone" select.
parent
5a9a8d03
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
8 deletions
+21
-8
app/assets/javascripts/project_select.js.coffee
app/assets/javascripts/project_select.js.coffee
+19
-6
app/views/dashboard/milestones/index.html.haml
app/views/dashboard/milestones/index.html.haml
+1
-1
app/views/shared/_new_project_item_select.html.haml
app/views/shared/_new_project_item_select.html.haml
+1
-1
No files found.
app/assets/javascripts/project_select.js.coffee
View file @
6fb90a2c
...
@@ -2,25 +2,38 @@ class @ProjectSelect
...
@@ -2,25 +2,38 @@ class @ProjectSelect
constructor
:
->
constructor
:
->
$
(
'.ajax-project-select'
).
each
(
i
,
select
)
->
$
(
'.ajax-project-select'
).
each
(
i
,
select
)
->
@
groupId
=
$
(
select
).
data
(
'group-id'
)
@
groupId
=
$
(
select
).
data
(
'group-id'
)
@
includeGroups
=
$
(
select
).
data
(
'include-groups'
)
placeholder
=
"Search for project"
placeholder
+=
" or group"
if
@
includeGroups
$
(
select
).
select2
$
(
select
).
select2
placeholder
:
"Search for project"
placeholder
:
placeholder
multiple
:
$
(
select
).
hasClass
(
'multiselect'
)
minimumInputLength
:
0
minimumInputLength
:
0
query
:
(
query
)
=>
query
:
(
query
)
=>
c
allback
=
(
projects
)
->
finalC
allback
=
(
projects
)
->
data
=
{
results
:
projects
}
data
=
{
results
:
projects
}
query
.
callback
(
data
)
query
.
callback
(
data
)
if
@
includeGroups
projectsCallback
=
(
projects
)
->
groupsCallback
=
(
groups
)
->
data
=
groups
.
concat
(
projects
)
finalCallback
(
data
)
Api
.
groups
query
.
term
,
false
,
groupsCallback
else
projectsCallback
=
finalCallback
if
@
groupId
if
@
groupId
Api
.
groupProjects
@
groupId
,
query
.
term
,
c
allback
Api
.
groupProjects
@
groupId
,
query
.
term
,
projectsC
allback
else
else
Api
.
projects
query
.
term
,
c
allback
Api
.
projects
query
.
term
,
projectsC
allback
id
:
(
project
)
->
id
:
(
project
)
->
project
.
web_url
project
.
web_url
text
:
(
project
)
->
text
:
(
project
)
->
project
.
name_with_namespace
project
.
name_with_namespace
||
project
.
name
dropdownCssClass
:
"ajax-project-dropdown"
dropdownCssClass
:
"ajax-project-dropdown"
app/views/dashboard/milestones/index.html.haml
View file @
6fb90a2c
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
.project-issuable-filter
.project-issuable-filter
.controls
.controls
=
render
'shared/new_project_item_select'
,
path:
'milestones/new'
,
label:
"New Milestone"
=
render
'shared/new_project_item_select'
,
path:
'milestones/new'
,
label:
"New Milestone"
,
include_groups:
true
=
render
'shared/milestones_filter'
=
render
'shared/milestones_filter'
...
...
app/views/shared/_new_project_item_select.html.haml
View file @
6fb90a2c
-
if
@projects
.
any?
-
if
@projects
.
any?
.prepend-left-10.new-project-item-select-holder
.prepend-left-10.new-project-item-select-holder
=
project_select_tag
:project_path
,
class:
"new-project-item-select"
=
project_select_tag
:project_path
,
class:
"new-project-item-select"
,
data:
{
include_groups:
local_assigns
[
:include_groups
]
}
%a
.btn.btn-new.new-project-item-select-button
%a
.btn.btn-new.new-project-item-select-button
=
icon
(
'plus'
)
=
icon
(
'plus'
)
=
local_assigns
[
:label
]
=
local_assigns
[
:label
]
...
...
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