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

44 lines
1.1 KiB
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
2018-11-18 11:00:15 +05:30
def group_milestones
groups = GroupsFinder.new(current_user, all_available: true).execute
DashboardGroupMilestone.build_collection(groups)
end
# See [#39545](https://gitlab.com/gitlab-org/gitlab-ce/issues/39545) for info about the deprecation of dynamic milestones
def dynamic_milestones
DashboardMilestone.build_collection(@projects, params)
end
2017-08-17 22:00:37 +05:30
def milestones
2018-11-18 11:00:15 +05:30
@milestones = group_milestones + dynamic_milestones
2017-08-17 22:00:37 +05:30
end
def milestone
@milestone = DashboardMilestone.build(@projects, params[:title])
render_404 unless @milestone
end
2015-04-26 12:48:37 +05:30
end