Merge pull request #3263 from Platoniq/dashboard-recommended-actions-page

Dashboard recommended actions page
This commit is contained in:
Alberto
2019-03-19 16:21:28 +01:00
committed by GitHub
16 changed files with 264 additions and 19 deletions

View File

@@ -1,5 +1,6 @@
class DashboardController < Dashboard::BaseController
helper_method :dashboard_action, :active_resources, :course
before_action :set_done_and_pending_actions, only: [:recommended_actions, :progress]
def show
authorize! :dashboard, proposal
@@ -20,6 +21,10 @@ class DashboardController < Dashboard::BaseController
authorize! :dashboard, proposal
end
def recommended_actions
authorize! :dashboard, proposal
end
private
def active_resources
@@ -32,4 +37,9 @@ class DashboardController < Dashboard::BaseController
def course
@course ||= Dashboard::Action.course_for(proposal)
end
def set_done_and_pending_actions
@done_actions = proposed_actions.joins(:proposals).where("proposals.id = ?", proposal.id)
@pending_actions = proposed_actions - @done_actions
end
end