Restrict compatilibility edit on admin investment form

Why:

* A non-winner but compatible investment shouldn't be marked as incompatible

How:

* Show incompatilibility checkbox only if investment is winner or incompatible
This commit is contained in:
Bertocq
2017-07-10 17:34:05 +02:00
parent 2fba9de33b
commit 741a342bb0
2 changed files with 16 additions and 3 deletions

View File

@@ -63,6 +63,7 @@
<div class="row margin-top">
<% if @investment.incompatible? || @investment.winner? %>
<div class="small-12 medium-3 column">
<h2 id="incompatible"><%= t("admin.budget_investments.edit.compatibility") %></h2>
<%= f.label :incompatible do %>
@@ -70,6 +71,7 @@
<span class="checkbox"><%= t("admin.budget_investments.edit.mark_as_incompatible") %></span>
<% end %>
</div>
<% end %>
<div class="small-12 medium-3 column float-left">
<h2 id="selected"><%= t("admin.budget_investments.edit.selection") %></h2>
<%= f.label :selected do %>