Budget investments cannot be edited when budget is finished. Only milestones can be managed.

This commit is contained in:
iagirre
2017-12-27 12:15:38 +01:00
parent 910323eb73
commit ec8715efd3
2 changed files with 24 additions and 22 deletions

View File

@@ -55,6 +55,7 @@
<%= investment.valuation_finished? ? t('shared.yes'): t('shared.no') %> <%= investment.valuation_finished? ? t('shared.yes'): t('shared.no') %>
</td> </td>
<td class="small"> <td class="small">
<% unless investment.budget.finished? %>
<% if investment.selected? %> <% if investment.selected? %>
<%= link_to toggle_selection_admin_budget_budget_investment_path(@budget, <%= link_to toggle_selection_admin_budget_budget_investment_path(@budget,
investment, investment,
@@ -76,6 +77,7 @@
<%= t("admin.budget_investments.index.select") %> <%= t("admin.budget_investments.index.select") %>
<% end %> <% end %>
<% end %> <% end %>
<% end %>
</td> </td>
<% if params[:filter] == 'selected' %> <% if params[:filter] == 'selected' %>
<td class="small text-center"> <td class="small text-center">

View File

@@ -6,7 +6,7 @@
<%= link_to t("admin.budget_investments.show.edit"), <%= link_to t("admin.budget_investments.show.edit"),
edit_admin_budget_budget_investment_path(@budget, @investment, edit_admin_budget_budget_investment_path(@budget, @investment,
Budget::Investment.filter_params(params)) %> Budget::Investment.filter_params(params)) unless @budget.finished? %>
<hr> <hr>
@@ -34,7 +34,7 @@
<p> <p>
<%= link_to t("admin.budget_investments.show.edit_classification"), <%= link_to t("admin.budget_investments.show.edit_classification"),
edit_admin_budget_budget_investment_path(@budget, @investment, edit_admin_budget_budget_investment_path(@budget, @investment,
{anchor: 'classification'}.merge(Budget::Investment.filter_params(params))) %> {anchor: 'classification'}.merge(Budget::Investment.filter_params(params))) unless @budget.finished? %>
</p> </p>
<hr> <hr>
@@ -44,7 +44,7 @@
<%= render 'valuation/budget_investments/written_by_valuators' %> <%= render 'valuation/budget_investments/written_by_valuators' %>
<p> <p>
<%= link_to t("admin.budget_investments.show.edit_dossier"), edit_valuation_budget_budget_investment_path(@budget, @investment) %> <%= link_to t("admin.budget_investments.show.edit_dossier"), edit_valuation_budget_budget_investment_path(@budget, @investment) unless @budget.finished? %>
</p> </p>
<hr> <hr>