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