diff options
Diffstat (limited to 'app/controllers/dashboard_controller.rb')
-rw-r--r-- | app/controllers/dashboard_controller.rb | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb index c28f17167e6..a054940738e 100644 --- a/app/controllers/dashboard_controller.rb +++ b/app/controllers/dashboard_controller.rb @@ -2,18 +2,17 @@ class DashboardController < ApplicationController respond_to :html def index - @projects = current_user.projects.all - - @active_projects = @projects.select(&:last_activity_date).sort_by(&:last_activity_date).reverse + @projects = current_user.projects.includes(:events).order("events.created_at DESC") + @projects = @projects.page(params[:page]).per(40) - @merge_requests = MergeRequest.where("author_id = :id or assignee_id = :id", :id => current_user.id).opened.order("created_at DESC").limit(5) + @events = Event.where(:project_id => current_user.projects.map(&:id)).recent.limit(20) - @user = current_user - @issues = current_user.assigned_issues.opened.order("created_at DESC").limit(5) - @issues = @issues.includes(:author, :project) + @last_push = current_user.recent_push - @events = Event.where(:project_id => @projects.map(&:id)).recent.limit(20) - @last_push = Event.where(:project_id => @projects.map(&:id)).recent.code_push.limit(1).first + respond_to do |format| + format.html + format.atom { render :layout => false } + end end # Get authored or assigned open merge requests |