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
4ca8a175
Commit
4ca8a175
authored
Jun 26, 2014
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Filter group milestones.
parent
0723bf1a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
26 deletions
+42
-26
app/controllers/groups/milestones_controller.rb
app/controllers/groups/milestones_controller.rb
+10
-0
app/helpers/groups_helper.rb
app/helpers/groups_helper.rb
+1
-2
app/models/group_milestone.rb
app/models/group_milestone.rb
+9
-0
app/views/groups/_filter.html.haml
app/views/groups/_filter.html.haml
+2
-2
app/views/groups/milestones/index.html.haml
app/views/groups/milestones/index.html.haml
+20
-22
No files found.
app/controllers/groups/milestones_controller.rb
View file @
4ca8a175
...
...
@@ -6,6 +6,16 @@ class Groups::MilestonesController < ApplicationController
project_ids
=
@group
.
projects
project_milestones
=
Milestone
.
where
(
project_id:
project_ids
)
@group_milestones
=
Milestones
::
GroupService
.
new
(
project_milestones
).
execute
@group_milestones
=
case
params
[
:status
]
when
'all'
;
@group_milestones
when
'closed'
;
status
(
'closed'
)
else
status
(
'active'
)
end
end
private
def
status
(
state
)
@group_milestones
.
map
{
|
milestone
|
next
if
milestone
.
state
!=
state
;
milestone
}.
compact
end
end
app/helpers/groups_helper.rb
View file @
4ca8a175
...
...
@@ -35,8 +35,7 @@ module GroupsHelper
def
group_filter_path
(
entity
,
options
=
{})
exist_opts
=
{
state:
params
[
:state
],
scope:
params
[
:scope
]
status:
params
[
:status
]
}
options
=
exist_opts
.
merge
(
options
)
...
...
app/models/group_milestone.rb
View file @
4ca8a175
...
...
@@ -38,4 +38,13 @@ class GroupMilestone
rescue
ZeroDivisionError
100
end
def
state
state
=
milestones
.
map
{
|
milestone
|
milestone
.
state
}
if
state
.
all?
{
|
milestone_state
|
milestone_state
==
'active'
}
'active'
else
'closed'
end
end
end
app/views/groups/_filter.html.haml
View file @
4ca8a175
=
form_tag
group_filter_path
(
entity
),
method:
'get'
do
%fieldset
%ul
.nav.nav-pills.nav-stacked
%li
{
class:
(
"active"
if
!
params
[
:status
]
)}
=
link_to
group_filter_path
(
entity
,
status:
nil
)
do
%li
{
class:
(
"active"
if
(
params
[
:status
]
==
'active'
||
!
params
[
:status
])
)}
=
link_to
group_filter_path
(
entity
,
status:
'active'
)
do
Active
%li
{
class:
(
"active"
if
params
[
:status
]
==
'closed'
)}
=
link_to
group_filter_path
(
entity
,
status:
'closed'
)
do
...
...
app/views/groups/milestones/index.html.haml
View file @
4ca8a175
...
...
@@ -13,7 +13,7 @@
.fixed.sidebar-expand-button.hidden-lg.hidden-md
%i
.icon-list.icon-2x
.col-md-3.responsive-side
=
render
'groups/filter'
,
entity:
'milestone
s
'
=
render
'groups/filter'
,
entity:
'milestone'
.col-md-9
.panel.panel-default
%ul
.well-list
...
...
@@ -22,27 +22,25 @@
.nothing-here-block
No milestones to show
-
else
-
@group_milestones
.
each
do
|
milestone
|
%li
{
class:
"milestone milestone-open"
,
id:
1
}
.pull-right
=
link_to
'Close Milestone'
,
root_path
,
method: :put
,
remote:
true
,
class:
"btn btn-small btn-remove"
%li
{
class:
"milestone milestone-#{milestone.state == 'closed' ? 'closed' : 'open'}"
,
id:
dom_id
(
milestone
.
milestones
.
first
)
}
-
unless
milestone
.
state
==
'closed'
.pull-right
=
link_to
'Close Milestone'
,
root_path
,
method: :put
,
remote:
true
,
class:
"btn btn-small btn-remove"
%h4
=
link_to_gfm
truncate
(
milestone
.
title
,
length:
100
),
root_path
-
if
false
%span
.muted
Empty
-
else
%div
%div
%div
=
link_to
root_path
do
=
pluralize
milestone
.
issue_count
,
'Issue'
=
link_to
root_path
do
=
pluralize
milestone
.
merge_requests_count
,
'Merge Request'
%span
.light
#{
milestone
.
percent_complete
}
% complete
.progress.progress-info
.progress-bar
{
style:
"width: #{milestone.percent_complete}%;"
}
%div
%br
-
milestone
.
project_names
.
each
do
|
name
|
%span
.label.label-default
=
name
=
link_to
root_path
do
=
pluralize
milestone
.
issue_count
,
'Issue'
=
link_to
root_path
do
=
pluralize
milestone
.
merge_requests_count
,
'Merge Request'
%span
.light
#{
milestone
.
percent_complete
}
% complete
.progress.progress-info
.progress-bar
{
style:
"width: #{milestone.percent_complete}%;"
}
%div
%br
-
milestone
.
project_names
.
each
do
|
name
|
%span
.label.label-default
=
name
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