Skip to content

Commit

Permalink
Add basic index page for PromotionBatches
Browse files Browse the repository at this point in the history
  • Loading branch information
tomdonarski committed Nov 21, 2023
1 parent cc305d4 commit 4c4390c
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
6 changes: 6 additions & 0 deletions app/controllers/spree/admin/promotion_batches_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module Spree
module Admin
class PromotionBatchesController < ResourceController
end
end
end
28 changes: 28 additions & 0 deletions app/views/spree/admin/promotion_batches/index.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<% content_for :page_title do %>
<%= plural_resource_name(Spree::PromotionBatch) %>
<% end %>

<% if @promotion_batches.any? %>
<div class="table-responsive border rounded bg-white">
<table class="table">
<thead class="text-muted">
<tr>
<th><%= Spree.t(:id) %></th>
<th><%= Spree.t(:status) %></th>
<th><%= Spree.t(:size) %></th>
<th><%= Spree.t(:template_promotion) %></th>
</tr>
</thead>
<tbody>
<% @promotion_batches.each do |promotion_batch| %>
<tr id="<%= spree_dom_id promotion_batch %>">
<td><%= link_to promotion_batch.id, spree.edit_admin_promotion_batch_path(promotion_batch) %></td>
<td><%= promotion_batch.status %></td>
<td><%= promotion_batch.promotions.count %></td>
<td><%= promotion_batch.template_promotion_id %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
<% end %>
2 changes: 2 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

resources :promotion_categories, except: [:show]

resources :promotion_batches

resources :zones

resources :stores, except: %i[index show] do
Expand Down

0 comments on commit 4c4390c

Please sign in to comment.