From 7316c16edd84e478b07b95b5233faec268cfafb3 Mon Sep 17 00:00:00 2001 From: decabeza Date: Tue, 18 Dec 2018 11:46:17 +0100 Subject: [PATCH] Adds price explanation link on budget investments show --- .../budgets/investments/_investment_show.html.erb | 10 +++++++++- config/locales/en/budgets.yml | 1 + config/locales/es/budgets.yml | 1 + spec/features/budgets/investments_spec.rb | 3 +++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/views/budgets/investments/_investment_show.html.erb b/app/views/budgets/investments/_investment_show.html.erb index 5100a2fdd..49543417d 100644 --- a/app/views/budgets/investments/_investment_show.html.erb +++ b/app/views/budgets/investments/_investment_show.html.erb @@ -80,7 +80,9 @@ <% end %> <% if investment.should_show_price_explanation? %> -

<%= t('budgets.investments.show.price_explanation') %>

+

+ <%= t("budgets.investments.show.price_explanation") %> +

<%= investment.price_explanation %>

<% end %> @@ -177,6 +179,12 @@ <%= investment.formatted_price %>

+ <% if investment.should_show_price_explanation? %> +
+ <%= link_to t("budgets.investments.show.see_price_explanation"), + "#price_explanation", class: "small" %> +
+ <% end %> <% end %> <%= render 'shared/social_share', diff --git a/config/locales/en/budgets.yml b/config/locales/en/budgets.yml index 961cde423..f7e99240d 100644 --- a/config/locales/en/budgets.yml +++ b/config/locales/en/budgets.yml @@ -127,6 +127,7 @@ en: project_selected_html: 'This investment project has been selected for balloting phase.' project_winner: 'Winning investment project' project_not_selected_html: 'This investment project has not been selected for balloting phase.' + see_price_explanation: See price explanation wrong_price_format: Only integer numbers investment: add: Vote diff --git a/config/locales/es/budgets.yml b/config/locales/es/budgets.yml index e55cff134..5b4406b3e 100644 --- a/config/locales/es/budgets.yml +++ b/config/locales/es/budgets.yml @@ -127,6 +127,7 @@ es: project_selected_html: 'Este proyecto de gasto ha sido seleccionado para la fase de votación.' project_winner: 'Proyecto de gasto ganador' project_not_selected_html: 'Este proyecto de gasto no ha sido seleccionado para la fase de votación.' + see_price_explanation: Ver informe de coste wrong_price_format: Solo puede incluir caracteres numéricos investment: add: Votar diff --git a/spec/features/budgets/investments_spec.rb b/spec/features/budgets/investments_spec.rb index df3593e40..7186922e4 100644 --- a/spec/features/budgets/investments_spec.rb +++ b/spec/features/budgets/investments_spec.rb @@ -902,6 +902,7 @@ feature 'Budget Investments' do expect(page).to have_content(investment.formatted_price) expect(page).to have_content(investment.price_explanation) + expect(page).to have_link("See price explanation") if budget.finished? investment.update(winner: true) @@ -920,6 +921,7 @@ feature 'Budget Investments' do expect(page).not_to have_content(investment.formatted_price) expect(page).not_to have_content(investment.price_explanation) + expect(page).not_to have_link("See price explanation") visit budget_investments_path(budget) @@ -941,6 +943,7 @@ feature 'Budget Investments' do expect(page).not_to have_content(investment.formatted_price) expect(page).not_to have_content(investment.price_explanation) + expect(page).not_to have_link("See price explanation") visit budget_investments_path(budget)