2015-04-30 13:06:18 -04:00
|
|
|
class Dashboard::MilestonesController < Dashboard::ApplicationController
|
2017-06-08 12:43:05 -04:00
|
|
|
include MilestoneActions
|
|
|
|
|
2015-11-13 13:20:48 -05:00
|
|
|
before_action :projects
|
2017-06-08 12:43:05 -04:00
|
|
|
before_action :milestone, only: [:show, :merge_requests, :participants, :labels]
|
2015-03-03 10:19:37 -05:00
|
|
|
|
|
|
|
def index
|
2016-03-22 14:19:53 -04:00
|
|
|
respond_to do |format|
|
2016-03-23 04:09:58 -04:00
|
|
|
format.html do
|
2016-12-12 23:29:12 -05:00
|
|
|
@milestone_states = GlobalMilestone.states_count(@projects)
|
2016-03-23 04:09:58 -04:00
|
|
|
@milestones = Kaminari.paginate_array(milestones).page(params[:page])
|
|
|
|
end
|
2016-03-22 14:19:53 -04:00
|
|
|
format.json do
|
2016-03-23 04:09:58 -04:00
|
|
|
render json: milestones
|
2016-03-22 14:19:53 -04:00
|
|
|
end
|
|
|
|
end
|
2015-03-03 10:19:37 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def show
|
|
|
|
end
|
2017-01-06 07:47:18 -05:00
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def milestones
|
2017-01-13 10:12:27 -05:00
|
|
|
@milestones = DashboardMilestone.build_collection(@projects, params)
|
2017-01-06 07:47:18 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def milestone
|
2017-01-13 10:12:27 -05:00
|
|
|
@milestone = DashboardMilestone.build(@projects, params[:title])
|
2017-01-06 07:47:18 -05:00
|
|
|
render_404 unless @milestone
|
|
|
|
end
|
2015-03-03 10:19:37 -05:00
|
|
|
end
|