summaryrefslogtreecommitdiff
path: root/app/controllers/dashboard_controller.rb
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <mail@zjvandeweg.nl>2015-11-18 11:58:01 +0100
committerZeger-Jan van de Weg <mail@zjvandeweg.nl>2015-11-18 11:58:01 +0100
commit53b285c9a8b7eec9ee10906ef519da376347b69e (patch)
treee3fa4f337112cedb08343e7d3ea85ecc1f48fb1d /app/controllers/dashboard_controller.rb
parent2f048df4a4a83ff009d2ef2d14ee04e5a2798618 (diff)
parent21a59b23fe4d8bc4331f746c75f9242a49d75faa (diff)
downloadgitlab-ce-53b285c9a8b7eec9ee10906ef519da376347b69e.tar.gz
Merge branch 'master' into merge-if-green
Diffstat (limited to 'app/controllers/dashboard_controller.rb')
-rw-r--r--app/controllers/dashboard_controller.rb25
1 files changed, 8 insertions, 17 deletions
diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb
index 4ebb3d7276e..087da935087 100644
--- a/app/controllers/dashboard_controller.rb
+++ b/app/controllers/dashboard_controller.rb
@@ -1,25 +1,12 @@
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 merge_requests
- @merge_requests = get_merge_requests_collection
- @merge_requests = @merge_requests.page(params[:page]).per(PER_PAGE)
- @merge_requests = @merge_requests.preload(:author, :target_project)
- end
-
- def issues
- @issues = get_issues_collection
- @issues = @issues.page(params[:page]).per(PER_PAGE)
- @issues = @issues.preload(:author, :project)
-
- respond_to do |format|
- format.html
- format.atom { render layout: false }
- end
- end
-
def activity
@last_push = current_user.recent_push
@@ -47,4 +34,8 @@ class DashboardController < Dashboard::ApplicationController
@events = @event_filter.apply_filter(@events).with_associations
@events = @events.limit(20).offset(params[:offset] || 0)
end
+
+ def projects
+ @projects ||= current_user.authorized_projects.sorted_by_activity.non_archived
+ end
end