From f2f0c63778669e611e66f7572c095dd0c9d06085 Mon Sep 17 00:00:00 2001 From: Xander Date: Wed, 19 Apr 2023 21:34:18 +0200 Subject: [PATCH] Allow capacity,name edit when registrations --- app/views/access_levels/_form.html.erb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/access_levels/_form.html.erb b/app/views/access_levels/_form.html.erb index ce642853..c1c8e195 100644 --- a/app/views/access_levels/_form.html.erb +++ b/app/views/access_levels/_form.html.erb @@ -2,12 +2,12 @@ <%= form_for [object.event, object], remote: true do |f| %> <%= f.text_field :name, class: 'form-control' %> <%= f.number_field :capacity, class: 'form-control', placeholder: 0 %> - <%= f.text_field :price, value: nice_amount(f.object.price), class: 'form-control', placeholder: "0.00" , disabled: f.object.registrations? %> + <%= f.text_field :price, value: nice_amount(f.object.price), class: 'form-control', placeholder: "0.00", disabled: f.object.registrations.any? %> - <%= 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? %> -
<%= f.check_box :has_comment, disabled: f.object.registrations? %>
-
<%= f.check_box :hidden, disabled: f.object.registrations? %>
+
<%= f.check_box :has_comment, disabled: f.object.registrations.any? %>
+
<%= f.check_box :hidden, disabled: f.object.registrations.any? %>
<%= f.button button_name, class: 'btn btn-sm btn-primary' %> <%= javascript_tag do %> var id = "#<% if button_name == 'Save' %>edit_<% end %><%= dom_id(f.object) %>";