Filter projects on dashboard
This commit is contained in:
parent
a03f318964
commit
c38b9a2f80
5 changed files with 46 additions and 0 deletions
|
@ -7,6 +7,15 @@ class DashboardController < ApplicationController
|
|||
def index
|
||||
@groups = current_user.authorized_groups
|
||||
|
||||
@projects = case params[:scope]
|
||||
when 'personal' then
|
||||
@projects.personal(current_user)
|
||||
when 'joined' then
|
||||
@projects.joined(current_user)
|
||||
else
|
||||
@projects
|
||||
end
|
||||
|
||||
@projects = @projects.page(params[:page]).per(30)
|
||||
|
||||
@events = Event.in_projects(current_user.project_ids)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue