Files
gitlabhq/app/controllers/dashboard_controller.rb
Rémy Coutable e257e81cbf Merge branch 'fix/14505' into 'master'
Fix an issue causing the Dashboard/Milestones page to be blank

Fixes #14505 and #14514.

See merge request !3348
2016-03-23 12:48:08 +01:00

38 lines
831 B
Ruby

class DashboardController < Dashboard::ApplicationController
include IssuesAction
include MergeRequestsAction
before_action :event_filter, only: :activity
before_action :projects, only: [:issues, :merge_requests]
respond_to :html
def activity
@last_push = current_user.recent_push
respond_to do |format|
format.html
format.json do
load_events
pager_json("events/_events", @events.count)
end
end
end
protected
def load_events
projects =
if params[:filter] == "starred"
current_user.starred_projects
else
current_user.authorized_projects
end
@events = Event.in_projects(projects)
@events = @event_filter.apply_filter(@events).with_associations
@events = @events.limit(20).offset(params[:offset] || 0)
end
end