<% admin_breadcrumb(link_to plural_resource_name(Spree::Promotion), spree.admin_promotions_path) %> <% admin_breadcrumb(link_to @promotion.name, spree.edit_admin_promotion_path(@promotion.id)) %> <% admin_breadcrumb(plural_resource_name(Spree::PromotionCodeBatch)) %> <% content_for :page_actions do %>
  • <% if can?(:create, Spree::PromotionCodeBatch) %> <%= link_to t('spree.new_promotion_code_batch'), new_object_url, class: 'btn btn-primary' %> <% end %>
  • <% end %> <% if @promotion_code_batches.any? %> <% @promotion_code_batches.each do |promotion_code_batch| %> <% end %>
    <%= Spree::PromotionCodeBatch.human_attribute_name(:base_code) %> <%= Spree::PromotionCodeBatch.human_attribute_name(:total_codes) %> <%= Spree::PromotionCodeBatch.human_attribute_name(:status) %> <%= Spree::PromotionCodeBatch.human_attribute_name(:email) %>
    <%= promotion_code_batch.base_code %> <%= promotion_code_batch.number_of_codes %> <% if promotion_code_batch.error.present? %> <%= t( "spree.promotion_code_batches.errored", error: promotion_code_batch.error ) %> <% elsif promotion_code_batch.finished? %> <%= t( "spree.promotion_code_batches.finished", number_of_codes: promotion_code_batch.number_of_codes ) %> <%= link_to( t('spree.download_promotion_codes_list'), admin_promotion_promotion_code_batch_download_path( promotion_code_batch_id: promotion_code_batch.id, format: :csv ) ) %> <% else %> <%= t( "spree.promotion_code_batches.processing", number_of_codes: promotion_code_batch.number_of_codes, number_of_codes_processed: promotion_code_batch.promotion_codes.count ) %> <% end %> <%= promotion_code_batch.email %>
    <% else %>
    <%= render 'spree/admin/shared/no_objects_found', resource: Spree::PromotionCodeBatch, new_resource_url: new_object_url %>
    <% end %>