Current goal indicator

Indicator with current goal and the supports required to achieve it has
been added
This commit is contained in:
Juan Salvador Pérez García
2018-06-28 10:44:58 +02:00
parent a22027a343
commit 50d4523ded
6 changed files with 40 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
class ProposalsDashboardController < Dashboard::BaseController
helper_method :proposal_dashboard_action
helper_method :proposal_dashboard_action, :next_goal_supports
def index
authorize! :dashboard, proposal
@@ -61,4 +61,8 @@ class ProposalsDashboardController < Dashboard::BaseController
def proposal_dashboard_action
@proposal_dashboard_action ||= ProposalDashboardAction.find(params[:id])
end
def next_goal_supports
ProposalDashboardAction.next_goal_for(proposal)&.required_supports || Setting["votes_for_proposal_success"]
end
end