summaryrefslogtreecommitdiff
path: root/app/controllers/dashboard_controller.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-06-19 17:48:43 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-06-19 17:48:43 +0300
commit63a67bb4abff7690ef5f1c91b924c6aaf7f90985 (patch)
treec0995c170032f2406b1a6642a415dbe714989879 /app/controllers/dashboard_controller.rb
parent6e35aceff29ddeae6282de31e81e48446ab927fa (diff)
downloadgitlab-ce-63a67bb4abff7690ef5f1c91b924c6aaf7f90985.tar.gz
Remove second search. More compact list. Additional filter
Diffstat (limited to 'app/controllers/dashboard_controller.rb')
-rw-r--r--app/controllers/dashboard_controller.rb14
1 files changed, 8 insertions, 6 deletions
diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb
index fc7dc3fab63..4b9bfcf843b 100644
--- a/app/controllers/dashboard_controller.rb
+++ b/app/controllers/dashboard_controller.rb
@@ -1,7 +1,7 @@
class DashboardController < ApplicationController
respond_to :html
- before_filter :load_projects
+ before_filter :load_projects, except: [:projects]
before_filter :event_filter, only: :show
def show
@@ -26,16 +26,18 @@ class DashboardController < ApplicationController
def projects
@projects = case params[:scope]
when 'personal' then
- @projects.personal(current_user)
+ current_user.namespace.projects
when 'joined' then
- @projects.joined(current_user)
+ current_user.authorized_projects.joined(current_user)
+ when 'owned' then
+ current_user.owned_projects
else
- @projects
- end
+ current_user.authorized_projects
+ end.sorted_by_activity
@projects = @projects.search(params[:search]) if params[:search].present?
- @labels = Project.where(id: @projects.map(&:id)).tags_on(:labels)
+ @labels = current_user.authorized_projects.tags_on(:labels)
@projects = @projects.tagged_with(params[:label]) if params[:label].present?
@projects = @projects.page(params[:page]).per(30)