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
iv
gitlab-ce
Commits
41654267
Commit
41654267
authored
Jan 06, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restyle and refactor milestones filter
parent
560e717f
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
70 additions
and
85 deletions
+70
-85
app/controllers/projects/milestones_controller.rb
app/controllers/projects/milestones_controller.rb
+1
-1
app/helpers/groups_helper.rb
app/helpers/groups_helper.rb
+0
-12
app/helpers/milestones_helper.rb
app/helpers/milestones_helper.rb
+9
-0
app/views/groups/_filter.html.haml
app/views/groups/_filter.html.haml
+0
-12
app/views/groups/milestones/index.html.haml
app/views/groups/milestones/index.html.haml
+34
-38
app/views/projects/milestones/index.html.haml
app/views/projects/milestones/index.html.haml
+10
-22
app/views/shared/_milestones_filter.html.haml
app/views/shared/_milestones_filter.html.haml
+16
-0
No files found.
app/controllers/projects/milestones_controller.rb
View file @
41654267
...
@@ -11,7 +11,7 @@ class Projects::MilestonesController < Projects::ApplicationController
...
@@ -11,7 +11,7 @@ class Projects::MilestonesController < Projects::ApplicationController
respond_to
:html
respond_to
:html
def
index
def
index
@milestones
=
case
params
[
:
f
]
@milestones
=
case
params
[
:
state
]
when
'all'
;
@project
.
milestones
.
order
(
"state, due_date DESC"
)
when
'all'
;
@project
.
milestones
.
order
(
"state, due_date DESC"
)
when
'closed'
;
@project
.
milestones
.
closed
.
order
(
"due_date DESC"
)
when
'closed'
;
@project
.
milestones
.
closed
.
order
(
"due_date DESC"
)
else
@project
.
milestones
.
active
.
order
(
"due_date ASC"
)
else
@project
.
milestones
.
active
.
order
(
"due_date ASC"
)
...
...
app/helpers/groups_helper.rb
View file @
41654267
...
@@ -33,18 +33,6 @@ module GroupsHelper
...
@@ -33,18 +33,6 @@ module GroupsHelper
title
title
end
end
def
group_filter_path
(
entity
,
options
=
{})
exist_opts
=
{
status:
params
[
:status
]
}
options
=
exist_opts
.
merge
(
options
)
path
=
request
.
path
path
<<
"?
#{
options
.
to_param
}
"
path
end
def
group_settings_page?
def
group_settings_page?
if
current_controller?
(
'groups'
)
if
current_controller?
(
'groups'
)
current_action?
(
'edit'
)
||
current_action?
(
'projects'
)
current_action?
(
'edit'
)
||
current_action?
(
'projects'
)
...
...
app/helpers/milestones_helper.rb
0 → 100644
View file @
41654267
module
MilestonesHelper
def
milestones_filter_path
(
opts
=
{})
if
@project
project_milestones_path
(
@project
,
opts
)
elsif
@group
group_milestones_path
(
@group
,
opts
)
end
end
end
app/views/groups/_filter.html.haml
deleted
100644 → 0
View file @
560e717f
=
form_tag
group_filter_path
(
entity
),
method:
'get'
do
%fieldset
%ul
.nav.nav-pills.nav-stacked
%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
Closed
%li
{
class:
(
"active"
if
params
[
:status
]
==
'all'
)}
=
link_to
group_filter_path
(
entity
,
status:
'all'
)
do
All
app/views/groups/milestones/index.html.haml
View file @
41654267
...
@@ -9,42 +9,38 @@
...
@@ -9,42 +9,38 @@
%hr
%hr
.row
=
render
'shared/milestones_filter'
.fixed.sidebar-expand-button.hidden-lg.hidden-md
.milestones
%i
.fa.fa-list.fa-2x
.panel.panel-default
.col-md-3.responsive-side
%ul
.well-list
=
render
'groups/filter'
,
entity:
'milestone'
-
if
@group_milestones
.
blank?
.col-md-9
%li
.panel.panel-default
.nothing-here-block
No milestones to show
%ul
.well-list
-
else
-
if
@group_milestones
.
blank?
-
@group_milestones
.
each
do
|
milestone
|
%li
%li
{
class:
"milestone milestone-#{milestone.closed? ? 'closed' : 'open'}"
,
id:
dom_id
(
milestone
.
milestones
.
first
)
}
.nothing-here-block
No milestones to show
.pull-right
-
else
-
if
can?
(
current_user
,
:manage_group
,
@group
)
-
@group_milestones
.
each
do
|
milestone
|
-
if
milestone
.
closed?
%li
{
class:
"milestone milestone-#{milestone.closed? ? 'closed' : 'open'}"
,
id:
dom_id
(
milestone
.
milestones
.
first
)
}
=
link_to
'Reopen Milestone'
,
group_milestone_path
(
@group
,
milestone
.
safe_title
,
title:
milestone
.
title
,
milestone:
{
state_event: :activate
}),
method: :put
,
class:
"btn btn-small btn-grouped btn-reopen"
.pull-right
-
else
-
if
can?
(
current_user
,
:manage_group
,
@group
)
=
link_to
'Close Milestone'
,
group_milestone_path
(
@group
,
milestone
.
safe_title
,
title:
milestone
.
title
,
milestone:
{
state_event: :close
}),
method: :put
,
class:
"btn btn-small btn-close"
-
if
milestone
.
closed?
%h4
=
link_to
'Reopen Milestone'
,
group_milestone_path
(
@group
,
milestone
.
safe_title
,
title:
milestone
.
title
,
milestone:
{
state_event: :activate
}),
method: :put
,
class:
"btn btn-small btn-grouped btn-reopen"
=
link_to_gfm
truncate
(
milestone
.
title
,
length:
100
),
group_milestone_path
(
@group
,
milestone
.
safe_title
,
title:
milestone
.
title
)
-
else
%div
=
link_to
'Close Milestone'
,
group_milestone_path
(
@group
,
milestone
.
safe_title
,
title:
milestone
.
title
,
milestone:
{
state_event: :close
}),
method: :put
,
class:
"btn btn-small btn-close"
%h4
=
link_to_gfm
truncate
(
milestone
.
title
,
length:
100
),
group_milestone_path
(
@group
,
milestone
.
safe_title
,
title:
milestone
.
title
)
%div
%div
%div
=
link_to
group_milestone_path
(
@group
,
milestone
.
safe_title
,
title:
milestone
.
title
)
do
=
link_to
group_milestone_path
(
@group
,
milestone
.
safe_title
,
title:
milestone
.
title
)
do
=
pluralize
milestone
.
issue_count
,
'Issue'
=
pluralize
milestone
.
issue_count
,
'Issue'
=
link_to
group_milestone_path
(
@group
,
milestone
.
safe_title
,
title:
milestone
.
title
)
do
=
link_to
group_milestone_path
(
@group
,
milestone
.
safe_title
,
title:
milestone
.
title
)
do
=
pluralize
milestone
.
merge_requests_count
,
'Merge Request'
=
pluralize
milestone
.
merge_requests_count
,
'Merge Request'
%span
.light
#{
milestone
.
percent_complete
}
% complete
%span
.light
#{
milestone
.
percent_complete
}
% complete
.progress.progress-info
.progress.progress-info
.progress-bar
{
style:
"width: #{milestone.percent_complete}%;"
}
.progress-bar
{
style:
"width: #{milestone.percent_complete}%;"
}
%div
%div
%br
%br
-
milestone
.
projects
.
each
do
|
project
|
-
milestone
.
projects
.
each
do
|
project
|
%span
.label.label-default
%span
.label.label-default
=
project
.
name
=
project
.
name
=
paginate
@group_milestones
,
theme:
"gitlab"
=
paginate
@group_milestones
,
theme:
"gitlab"
app/views/projects/milestones/index.html.haml
View file @
41654267
...
@@ -7,27 +7,15 @@
...
@@ -7,27 +7,15 @@
%i
.fa.fa-plus
%i
.fa.fa-plus
New Milestone
New Milestone
.row
=
render
'shared/milestones_filter'
.fixed.sidebar-expand-button.hidden-lg.hidden-md.hidden-xs
%i
.fa.fa-list.fa-2x
.col-md-3.responsive-side
%ul
.nav.nav-pills.nav-stacked
%li
{
class:
(
"active"
if
(
params
[
:f
]
==
"active"
||
!
params
[
:f
]))}
=
link_to
project_milestones_path
(
@project
,
f:
"active"
)
do
Active
%li
{
class:
(
"active"
if
params
[
:f
]
==
"closed"
)}
=
link_to
project_milestones_path
(
@project
,
f:
"closed"
)
do
Closed
%li
{
class:
(
"active"
if
params
[
:f
]
==
"all"
)}
=
link_to
project_milestones_path
(
@project
,
f:
"all"
)
do
All
.col-md-9
.panel.panel-default
%ul
.well-list
=
render
@milestones
-
if
@milestones
.
blank?
.milestones
%li
.panel.panel-default
.nothing-here-block
No milestones to show
%ul
.well-list
=
render
@milestones
=
paginate
@milestones
,
theme:
"gitlab"
-
if
@milestones
.
blank?
%li
.nothing-here-block
No milestones to show
=
paginate
@milestones
,
theme:
"gitlab"
app/views/shared/_milestones_filter.html.haml
0 → 100644
View file @
41654267
.fixed.sidebar-expand-button.hidden-lg.hidden-md
%i
.fa.fa-list.fa-2x
.responsive-side.milestones-filters.append-bottom-10
%ul
.nav.nav-pills.nav-compact
%li
{
class:
(
"active"
if
params
[
:state
].
blank?
||
params
[
:state
]
==
'opened'
)}
=
link_to
milestones_filter_path
(
state:
'opened'
)
do
%i
.fa.fa-exclamation-circle
Open
%li
{
class:
(
"active"
if
params
[
:state
]
==
'closed'
)}
=
link_to
milestones_filter_path
(
state:
'closed'
)
do
%i
.fa.fa-check-circle
Closed
%li
{
class:
(
"active"
if
params
[
:state
]
==
'all'
)}
=
link_to
milestones_filter_path
(
state:
'all'
)
do
%i
.fa.fa-compass
All
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