Skip to content

Commit

Permalink
Display CSV import form only if batch
Browse files Browse the repository at this point in the history
has template promotion set.
  • Loading branch information
tomdonarski committed Dec 12, 2023
1 parent 56732e4 commit e964d88
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions app/views/spree/admin/promotion_batches/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
<%= @promotion_batch.id %>
<% end %>

<div class="card">
<div class="card-body">
<%= 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%>
<div class="card">
<div class="card-body">
<%= 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 %>
</div>
</div>
</div>
<% end %>

<% unless @promotion_batch.template_promotion_id%>
<%= form_for @promotion_batch, url: object_url, method: :put do |f| %>
Expand Down

0 comments on commit e964d88

Please sign in to comment.