From e964d88fbf137728b2fe77b5af03455cf9e4348e Mon Sep 17 00:00:00 2001 From: Tomasz Donarski Date: Tue, 12 Dec 2023 13:42:47 +0100 Subject: [PATCH] Display CSV import form only if batch has template promotion set. --- .../spree/admin/promotion_batches/edit.html.erb | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/app/views/spree/admin/promotion_batches/edit.html.erb b/app/views/spree/admin/promotion_batches/edit.html.erb index 6e2110a551..fcbb3091f3 100644 --- a/app/views/spree/admin/promotion_batches/edit.html.erb +++ b/app/views/spree/admin/promotion_batches/edit.html.erb @@ -3,14 +3,16 @@ <%= @promotion_batch.id %> <% end %> -
-
- <%= form_tag csv_import_admin_promotion_batch_path, method: :post, multipart: true do %> - <%= file_field_tag :file, accept: ".csv" %> - <%= submit_tag 'Import codes from CSV' %> - <% end %> +<% if @promotion_batch.template_promotion_id%> +
+
+ <%= form_tag csv_import_admin_promotion_batch_path, method: :post, multipart: true do %> + <%= file_field_tag :file, accept: ".csv" %> + <%= submit_tag 'Import codes from CSV' %> + <% end %> +
-
+<% end %> <% unless @promotion_batch.template_promotion_id%> <%= form_for @promotion_batch, url: object_url, method: :put do |f| %>