From ffdbdf987960539f145a55d4240b7c5964e607c3 Mon Sep 17 00:00:00 2001 From: Thomas Herrmann Date: Mon, 21 Oct 2024 10:37:51 +0200 Subject: [PATCH] include position in edit form for admins and event managers --- app/controllers/exhibits_controller.rb | 1 + app/views/exhibits/_form.html.erb | 7 ++++++- config/locales/application.de.yml | 1 + config/locales/application.en.yml | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/controllers/exhibits_controller.rb b/app/controllers/exhibits_controller.rb index 95643091..5462b337 100644 --- a/app/controllers/exhibits_controller.rb +++ b/app/controllers/exhibits_controller.rb @@ -102,6 +102,7 @@ def exhibit_params :size_studs, :size, :value, :building_hours, :brick_count, :needs_power_supply, :needs_transportation, :is_installation, :is_part_of_installation, :installation_exhibit_id, :is_collab, + :platform, :position, :remarks, :size_x, :size_y, :size_z, :unit_id, :size_x_meter, :size_y_meter, :size_z_meter, :former_exhibit_id, diff --git a/app/views/exhibits/_form.html.erb b/app/views/exhibits/_form.html.erb index 16f8cf9f..ee8e2b59 100644 --- a/app/views/exhibits/_form.html.erb +++ b/app/views/exhibits/_form.html.erb @@ -71,7 +71,12 @@ <%= f.select :installation_exhibit_id, @exhibit.event_installations.collect { |i| [i.name, i.id] }, {:prompt => t('please_choose')} %> -
+ <% if user_is_admin? || (@exhibit.attendance && @exhibit.attendance.event && @exhibit.attendance.event.is_managed_by?(current_user)) -%> + <%= f.label :value, t('label_table_position') %>
+ <%= f.number_field :platform %> . <%= f.number_field :position %> + <% end %> + +
<%= f.label :remarks, t('label_further_remarks') %>
<%= f.text_area :remarks, cols: 80, rows: 10 %>
diff --git a/config/locales/application.de.yml b/config/locales/application.de.yml index 6d1be490..00897d06 100644 --- a/config/locales/application.de.yml +++ b/config/locales/application.de.yml @@ -219,3 +219,4 @@ de: label_moc_is_collab: "Dieses MOC ist eine COLLAB (enthält keine Einzel-MOCs)" moc_data_imported_stats_notice: "MOC-Daten importiert (%{import} übersprungen, %{import2} fehlerhaft, %{import3} importiert)" failed_moc_ids: "Fehlerhafte MOC-IDs: %{inspect}" + label_table_position: "Tischposition:" diff --git a/config/locales/application.en.yml b/config/locales/application.en.yml index fd47f633..9d7723ab 100644 --- a/config/locales/application.en.yml +++ b/config/locales/application.en.yml @@ -219,3 +219,4 @@ en: label_moc_is_collab: "This is a COLLAB joint project (no single MOCs included)" moc_data_imported_stats_notice: "MOC data imported (%{import} skipped, %{import2} failed, %{import3} imported)" failed_moc_ids: "Failed MOC-IDs: %{inspect}" + label_table_position: "Position:"