Add notice when supporting an investment
It was hard to notice what was going on when supporting one investment which was at the bottom of the investment index page. I wonder whether we should add the title of the investment to this text; I'm not doing so because we don't do that anywhere else.
This commit is contained in:
@@ -92,8 +92,13 @@ module Budgets
|
||||
|
||||
def vote
|
||||
@investment.register_selection(current_user)
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to budget_investments_path(heading_id: @investment.heading.id) }
|
||||
format.html do
|
||||
redirect_to budget_investments_path(heading_id: @investment.heading.id),
|
||||
notice: t("flash.actions.create.support")
|
||||
end
|
||||
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
@@ -40,8 +40,13 @@ class Management::Budgets::InvestmentsController < Management::BaseController
|
||||
|
||||
def vote
|
||||
@investment.register_selection(managed_user)
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to management_budget_investments_path(heading_id: @investment.heading.id) }
|
||||
format.html do
|
||||
redirect_to management_budget_investments_path(heading_id: @investment.heading.id),
|
||||
notice: t("flash.actions.create.support")
|
||||
end
|
||||
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
@@ -14,6 +14,7 @@ en:
|
||||
proposal_notification: "Your message has been sent correctly."
|
||||
budget_investment: "Budget Investment created successfully."
|
||||
signature_sheet: "Signature sheet created successfully"
|
||||
support: "Investment supported successfully"
|
||||
topic: "Topic created successfully."
|
||||
valuator_group: "Valuator group created successfully"
|
||||
save_changes:
|
||||
|
||||
@@ -14,6 +14,7 @@ es:
|
||||
proposal_notification: "Tu mensaje ha sido enviado correctamente."
|
||||
budget_investment: "Proyecto de gasto creado correctamente."
|
||||
signature_sheet: "Hoja de firmas creada correctamente"
|
||||
support: "Proyecto de gasto apoyado correctamente"
|
||||
topic: "Tema creado correctamente."
|
||||
valuator_group: "Grupo de evaluadores creado correctamente"
|
||||
save_changes:
|
||||
|
||||
@@ -127,6 +127,8 @@ describe "Votes" do
|
||||
"Share it!"
|
||||
end
|
||||
|
||||
expect(page).to have_content "Investment supported successfully"
|
||||
|
||||
visit budget_investments_path(budget, heading_id: san_francisco.id)
|
||||
|
||||
within("#budget_investment_#{san_francisco_investment.id}") do
|
||||
|
||||
@@ -329,6 +329,7 @@ describe "Budget Investments" do
|
||||
|
||||
expect(page).to have_content "1 support"
|
||||
expect(page).to have_content "You have already supported this investment project. Share it!"
|
||||
expect(page).to have_content "Investment supported successfully"
|
||||
expect(page).to have_content "CONSUL\nMANAGEMENT"
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user