debian-mirror-gitlab/app/controllers/dashboard/milestones_controller.rb

33 lines
759 B
Ruby
Raw Normal View History

2015-09-11 14:41:01 +05:30
class Dashboard::MilestonesController < Dashboard::ApplicationController
2017-09-10 17:25:29 +05:30
include MilestoneActions
2015-11-26 14:37:03 +05:30
before_action :projects
2017-09-10 17:25:29 +05:30
before_action :milestone, only: [:show, :merge_requests, :participants, :labels]
2015-04-26 12:48:37 +05:30
def index
2016-06-02 11:05:42 +05:30
respond_to do |format|
format.html do
2017-08-17 22:00:37 +05:30
@milestone_states = GlobalMilestone.states_count(@projects)
2016-06-02 11:05:42 +05:30
@milestones = Kaminari.paginate_array(milestones).page(params[:page])
end
format.json do
render json: milestones
end
end
2015-04-26 12:48:37 +05:30
end
def show
end
2017-08-17 22:00:37 +05:30
private
def milestones
@milestones = DashboardMilestone.build_collection(@projects, params)
end
def milestone
@milestone = DashboardMilestone.build(@projects, params[:title])
render_404 unless @milestone
end
2015-04-26 12:48:37 +05:30
end