diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-09-02 20:17:04 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2015-09-02 20:17:04 +0300 |
commit | 5bbe6c4d54f9cffcac9d3c14d5ef5ad0248ffcc9 (patch) | |
tree | 5959e40045a34cb667301781f76ed0ac6e1a395b /app/controllers/dashboard_controller.rb | |
parent | 28219ea9211d6caafa34620859ff0e879ec54c12 (diff) |
Split starred projects list and activity in same way like we did with your projects
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app/controllers/dashboard_controller.rb')
-rw-r--r-- | app/controllers/dashboard_controller.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb index d745131694b..2bc2e5e58f5 100644 --- a/app/controllers/dashboard_controller.rb +++ b/app/controllers/dashboard_controller.rb @@ -1,5 +1,5 @@ class DashboardController < Dashboard::ApplicationController - before_action :load_projects + before_action :load_projects, except: :activity before_action :event_filter, only: :activity respond_to :html @@ -55,7 +55,14 @@ class DashboardController < Dashboard::ApplicationController end def load_events - @events = Event.in_projects(current_user.authorized_projects.pluck(:id)) + project_ids = + if params[:filter] == "starred" + current_user.starred_projects + else + current_user.authorized_projects + end.pluck(:id) + + @events = Event.in_projects(project_ids) @events = @event_filter.apply_filter(@events).with_associations @events = @events.limit(20).offset(params[:offset] || 0) end |