Shows unselected message only on balloting or later phase

This commit is contained in:
decabeza
2018-11-12 17:23:58 +01:00
parent 06969e0ec7
commit dfa7148406
2 changed files with 38 additions and 37 deletions

View File

@@ -142,42 +142,43 @@
</div>
</div>
<% end %>
<% else %>
<% if investment.unfeasible? %>
<div class="callout warning">
<%= t("budgets.investments.show.project_unfeasible_html") %>
</div>
<% elsif investment.winner? %>
<div class="callout success">
<strong><%= t("budgets.investments.show.project_winner") %></strong>
</div>
<% elsif investment.selected? %>
<div class="callout success">
<%= t("budgets.investments.show.project_selected_html") %>
</div>
<% elsif !investment.selected? %>
<div class="callout warning">
<%= t("budgets.investments.show.project_not_selected_html") %>
</div>
<% else %>
<br>
<div class="float-right">
<span class="label-budget-investment float-left">
<%= t("budgets.investments.show.title") %>
</span>
<span class="icon-budget"></span>
</div>
<% end %>
<% if investment.should_show_price? %>
<div class="sidebar-divider"></div>
<h2><%= t("budgets.investments.show.price") %></h2>
<div class="supports text-center">
<p class="investment-project-amount">
<%= investment.formatted_price %>
</p>
</div>
<% end %>
<% end %>
<% if investment.unfeasible? %>
<div class="callout warning">
<%= t("budgets.investments.show.project_unfeasible_html") %>
</div>
<% elsif investment.winner? %>
<div class="callout success">
<strong><%= t("budgets.investments.show.project_winner") %></strong>
</div>
<% elsif investment.selected? %>
<div class="callout success">
<%= t("budgets.investments.show.project_selected_html") %>
</div>
<% elsif !investment.selected? && @budget.balloting_or_later? %>
<div class="callout warning">
<%= t("budgets.investments.show.project_not_selected_html") %>
</div>
<% else %>
<br>
<div class="float-right">
<span class="label-budget-investment float-left">
<%= t("budgets.investments.show.title") %>
</span>
<span class="icon-budget"></span>
</div>
<% end %>
<% if investment.should_show_price? %>
<div class="sidebar-divider"></div>
<h2><%= t("budgets.investments.show.price") %></h2>
<div class="supports text-center">
<p class="investment-project-amount">
<%= investment.formatted_price %>
</p>
</div>
<% end %>
<%= render partial: 'shared/social_share', locals: {
share_title: t("budgets.investments.show.share"),
title: investment.title,

View File

@@ -1047,6 +1047,7 @@ feature 'Budget Investments' do
end
scenario "Show (not selected budget investment)" do
budget.update(phase: 'balloting')
user = create(:user)
login_as(user)
@@ -1055,8 +1056,7 @@ feature 'Budget Investments' do
:finished,
budget: budget,
group: group,
heading: heading,
unfeasibility_explanation: 'Local government is not competent in this matter')
heading: heading)
visit budget_investment_path(budget_id: budget.id, id: investment.id)