From 0e9190bc4338cc30e079b22000295e5cd56b9834 Mon Sep 17 00:00:00 2001 From: decabeza Date: Mon, 5 Mar 2018 14:02:38 +0100 Subject: [PATCH 1/3] Adds heading link on different heading message --- app/models/budget/investment.rb | 10 +++--- .../budgets/investments/_ballot.html.erb | 34 +++++++++++++------ .../budgets/investments/_header.html.erb | 2 +- config/locales/en/budgets.yml | 2 +- config/locales/es/budgets.yml | 2 +- spec/features/budgets/ballots_spec.rb | 4 +-- spec/models/budget/investment_spec.rb | 2 +- 7 files changed, 35 insertions(+), 21 deletions(-) diff --git a/app/models/budget/investment.rb b/app/models/budget/investment.rb index c5d4d775d..dff2dd2e0 100644 --- a/app/models/budget/investment.rb +++ b/app/models/budget/investment.rb @@ -208,11 +208,11 @@ class Budget end def reason_for_not_being_ballotable_by(user, ballot) - return permission_problem(user) if permission_problem?(user) - return :not_selected unless selected? - return :no_ballots_allowed unless budget.balloting? - return :different_heading_assigned unless ballot.valid_heading?(heading) - return :not_enough_money_html if ballot.present? && !enough_money?(ballot) + return permission_problem(user) if permission_problem?(user) + return :not_selected unless selected? + return :no_ballots_allowed unless budget.balloting? + return :different_heading_assigned_html unless ballot.valid_heading?(heading) + return :not_enough_money_html if ballot.present? && !enough_money?(ballot) end def permission_problem(user) diff --git a/app/views/budgets/investments/_ballot.html.erb b/app/views/budgets/investments/_ballot.html.erb index 605caebc7..f65ec6c74 100644 --- a/app/views/budgets/investments/_ballot.html.erb +++ b/app/views/budgets/investments/_ballot.html.erb @@ -42,17 +42,31 @@ <% if reason.present? && !ballot.has_investment?(investment) %> -