Skip to content

Commit

Permalink
Allow capacity,name edit when registrations
Browse files Browse the repository at this point in the history
  • Loading branch information
Xander authored and TomNaessens committed Mar 17, 2024
1 parent e8e07b7 commit f2f0c63
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/views/access_levels/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<%= form_for [object.event, object], remote: true do |f| %>
<td><%= f.text_field :name, class: 'form-control' %></td>
<td><%= f.number_field :capacity, class: 'form-control', placeholder: 0 %></td>
<td><%= f.text_field :price, value: nice_amount(f.object.price), class: 'form-control', placeholder: "0.00" , disabled: f.object.registrations? %></td>
<td><%= f.text_field :price, value: nice_amount(f.object.price), class: 'form-control', placeholder: "0.00", disabled: f.object.registrations.any? %></td>
<td width="130px">
<%= f.collection_select :permit, AccessLevel.permits.keys, :itself, lambda {|k| translate(k)}, {}, class: 'form-control', disabled: f.object.registrations? %>
<%= f.collection_select :permit, AccessLevel.permits.keys, :itself, lambda {|k| translate(k)}, {}, class: 'form-control', disabled: f.object.registrations.any? %>
</td>
<td><div class="checkbox"><%= f.check_box :has_comment, disabled: f.object.registrations? %></div></td>
<td><div class="checkbox"><%= f.check_box :hidden, disabled: f.object.registrations? %></div></td>
<td><div class="checkbox"><%= f.check_box :has_comment, disabled: f.object.registrations.any? %></div></td>
<td><div class="checkbox"><%= f.check_box :hidden, disabled: f.object.registrations.any? %></div></td>
<td><%= f.button button_name, class: 'btn btn-sm btn-primary' %></td>
<%= javascript_tag do %>
var id = "#<% if button_name == 'Save' %>edit_<% end %><%= dom_id(f.object) %>";
Expand Down

0 comments on commit f2f0c63

Please sign in to comment.