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
Jérome Perrin
gitlab-ce
Commits
562a09c1
Commit
562a09c1
authored
Mar 08, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
milestone dropdown
parent
d6e5ed8a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
9 deletions
+44
-9
app/assets/javascripts/api.js.coffee
app/assets/javascripts/api.js.coffee
+13
-0
app/assets/javascripts/gl_dropdown.js.coffee
app/assets/javascripts/gl_dropdown.js.coffee
+1
-1
app/assets/javascripts/labels_select.js.coffee
app/assets/javascripts/labels_select.js.coffee
+4
-1
app/assets/javascripts/milestone_select.js.coffee
app/assets/javascripts/milestone_select.js.coffee
+23
-0
app/views/shared/issuable/_filter.html.haml
app/views/shared/issuable/_filter.html.haml
+3
-7
No files found.
app/assets/javascripts/api.js.coffee
View file @
562a09c1
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
group_projects_path
:
"/api/:version/groups/:id/projects.json"
group_projects_path
:
"/api/:version/groups/:id/projects.json"
projects_path
:
"/api/:version/projects.json"
projects_path
:
"/api/:version/projects.json"
labels_path
:
"/api/:version/projects/:id/labels"
labels_path
:
"/api/:version/projects/:id/labels"
milestones_path
:
"/api/:version/projects/:id/milestones"
group
:
(
group_id
,
callback
)
->
group
:
(
group_id
,
callback
)
->
url
=
Api
.
buildUrl
(
Api
.
group_path
)
url
=
Api
.
buildUrl
(
Api
.
group_path
)
...
@@ -74,6 +75,18 @@
...
@@ -74,6 +75,18 @@
).
done
(
labels
)
->
).
done
(
labels
)
->
callback
(
labels
)
callback
(
labels
)
milestones
:
(
project_id
,
callback
)
->
url
=
Api
.
buildUrl
(
Api
.
milestones_path
)
url
=
url
.
replace
(
':id'
,
project_id
)
$
.
ajax
(
url
:
url
data
:
private_token
:
gon
.
api_token
dataType
:
"json"
).
done
(
milestones
)
->
callback
(
milestones
)
# Return group projects list. Filtered by query
# Return group projects list. Filtered by query
groupProjects
:
(
group_id
,
query
,
callback
)
->
groupProjects
:
(
group_id
,
query
,
callback
)
->
url
=
Api
.
buildUrl
(
Api
.
group_projects_path
)
url
=
Api
.
buildUrl
(
Api
.
group_projects_path
)
...
...
app/assets/javascripts/gl_dropdown.js.coffee
View file @
562a09c1
...
@@ -148,7 +148,7 @@ class GitLabDropdown
...
@@ -148,7 +148,7 @@ class GitLabDropdown
html
=
@
options
.
renderRow
(
data
)
html
=
@
options
.
renderRow
(
data
)
else
else
selected
=
if
@
options
.
isSelected
then
@
options
.
isSelected
(
data
)
else
false
selected
=
if
@
options
.
isSelected
then
@
options
.
isSelected
(
data
)
else
false
url
=
if
@
options
.
url
then
@
options
.
url
(
data
)
else
""
url
=
if
@
options
.
url
then
@
options
.
url
(
data
)
else
"
#
"
text
=
if
@
options
.
text
then
@
options
.
text
(
data
)
else
""
text
=
if
@
options
.
text
then
@
options
.
text
(
data
)
else
""
cssClass
=
""
;
cssClass
=
""
;
...
...
app/assets/javascripts/labels_select.js.coffee
View file @
562a09c1
...
@@ -2,13 +2,16 @@ class @LabelsSelect
...
@@ -2,13 +2,16 @@ class @LabelsSelect
constructor
:
->
constructor
:
->
$
(
'.js-label-select'
).
each
(
i
,
dropdown
)
->
$
(
'.js-label-select'
).
each
(
i
,
dropdown
)
->
projectId
=
$
(
dropdown
).
data
(
'project-id'
)
projectId
=
$
(
dropdown
).
data
(
'project-id'
)
selectedLabel
=
$
(
dropdown
).
data
(
'selected'
)
$
(
dropdown
).
glDropdown
(
$
(
dropdown
).
glDropdown
(
data
:
(
callback
)
->
data
:
(
callback
)
->
Api
.
projectLabels
8
,
callback
Api
.
projectLabels
8
,
callback
renderRow
:
(
label
)
->
renderRow
:
(
label
)
->
selected
=
if
label
.
name
is
selectedLabel
then
"is-active"
else
""
"<li>
"<li>
<a href='#'>
<a href='#'
class='
#{
selected
}
'
>
#{
label
.
name
}
#{
label
.
name
}
</a>
</a>
</li>"
</li>"
...
...
app/assets/javascripts/milestone_select.js.coffee
0 → 100644
View file @
562a09c1
class
@
MilestoneSelect
constructor
:
->
$
(
'.js-milestone-select'
).
each
(
i
,
dropdown
)
->
projectId
=
$
(
dropdown
).
data
(
'project-id'
)
selectedMilestone
=
$
(
dropdown
).
data
(
'selected'
)
$
(
dropdown
).
glDropdown
(
data
:
(
callback
)
->
Api
.
milestones
projectId
,
callback
filterable
:
true
search
:
fields
:
[
'name'
]
selectable
:
true
fieldName
:
$
(
dropdown
).
data
(
'field-name'
)
text
:
(
milestone
)
->
milestone
.
title
id
:
(
milestone
)
->
milestone
.
title
isSelected
:
(
milestone
)
->
milestone
.
title
is
selectedMilestone
clicked
:
->
$
(
dropdown
).
parents
(
'form'
).
submit
()
)
app/views/shared/issuable/_filter.html.haml
View file @
562a09c1
...
@@ -15,13 +15,8 @@
...
@@ -15,13 +15,8 @@
placeholder:
"Search assignee"
,
data:
{
any_user:
"Any Author"
,
first_user:
true
,
null_user:
true
,
current_user:
true
,
project_id:
@project
.
id
,
selected:
params
[
:assignee_id
],
field_name:
"assignee_id"
})
placeholder:
"Search assignee"
,
data:
{
any_user:
"Any Author"
,
first_user:
true
,
null_user:
true
,
current_user:
true
,
project_id:
@project
.
id
,
selected:
params
[
:assignee_id
],
field_name:
"assignee_id"
})
.filter-item.inline.milestone-filter
.filter-item.inline.milestone-filter
=
dropdown_tag
(
"Milestone"
,
title:
"Filter by milestone"
,
filter:
true
,
dropdown_class:
"dropdown-menu-selectable"
,
=
dropdown_tag
(
"Milestone"
,
title:
"Filter by milestone"
,
toggle_class:
'js-milestone-select'
,
filter:
true
,
dropdown_class:
"dropdown-menu-selectable"
,
placeholder:
"Search milestones"
,
data:
{
field_name:
"milestone_title"
})
do
placeholder:
"Search milestones"
,
data:
{
field_name:
"milestone_title"
,
selected:
params
[
:milestone_title
],
project_id:
@project
.
id
})
%ul
-
@project
.
milestones
.
each
do
|
milestone
|
%li
%a
{
href:
"#"
,
data:
{
id:
milestone
.
id
}}
=
milestone
.
name
.filter-item.inline.labels-filter
.filter-item.inline.labels-filter
=
dropdown_tag
(
"Label"
,
title:
"Filter by label"
,
toggle_class:
"js-label-select"
,
filter:
true
,
dropdown_class:
"dropdown-menu-labels dropdown-menu-selectable"
,
=
dropdown_tag
(
"Label"
,
title:
"Filter by label"
,
toggle_class:
"js-label-select"
,
filter:
true
,
dropdown_class:
"dropdown-menu-labels dropdown-menu-selectable"
,
...
@@ -55,6 +50,7 @@
...
@@ -55,6 +50,7 @@
:javascript
:javascript
new
UsersSelect
();
new
UsersSelect
();
new
LabelsSelect
();
new
LabelsSelect
();
new
MilestoneSelect
();
$
(
'
form.filter-form
'
).
on
(
'
submit
'
,
function
(
event
)
{
$
(
'
form.filter-form
'
).
on
(
'
submit
'
,
function
(
event
)
{
event
.
preventDefault
();
event
.
preventDefault
();
Turbolinks
.
visit
(
this
.
action
+
'
&
'
+
$
(
this
).
serialize
());
Turbolinks
.
visit
(
this
.
action
+
'
&
'
+
$
(
this
).
serialize
());
...
...
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