Adds price explanation link on budget investments show

This commit is contained in:
decabeza
2018-12-18 11:46:17 +01:00
parent d583c93ebf
commit 7316c16edd
4 changed files with 14 additions and 1 deletions

View File

@@ -80,7 +80,9 @@
<% end %>
<% if investment.should_show_price_explanation? %>
<h2><%= t('budgets.investments.show.price_explanation') %></h2>
<h2 id="price_explanation" data-magellan-target="price_explanation">
<%= t("budgets.investments.show.price_explanation") %>
</h2>
<p><%= investment.price_explanation %></p>
<% end %>
@@ -177,6 +179,12 @@
<%= investment.formatted_price %>
</p>
</div>
<% if investment.should_show_price_explanation? %>
<div class="text-center" data-magellan>
<%= link_to t("budgets.investments.show.see_price_explanation"),
"#price_explanation", class: "small" %>
</div>
<% end %>
<% end %>
<%= render 'shared/social_share',

View File

@@ -127,6 +127,7 @@ en:
project_selected_html: 'This investment project <strong>has been selected</strong> for balloting phase.'
project_winner: 'Winning investment project'
project_not_selected_html: 'This investment project <strong>has not been selected</strong> for balloting phase.'
see_price_explanation: See price explanation
wrong_price_format: Only integer numbers
investment:
add: Vote

View File

@@ -127,6 +127,7 @@ es:
project_selected_html: 'Este proyecto de gasto <strong>ha sido seleccionado</strong> para la fase de votación.'
project_winner: 'Proyecto de gasto ganador'
project_not_selected_html: 'Este proyecto de gasto <strong>no ha sido seleccionado</strong> 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

View File

@@ -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)