solidusio-contrib/solidus_volume_pricing

View on GitHub
app/views/spree/admin/volume_prices/_table.html.erb

Summary

Maintainability
Test Coverage
<table class="table">
  <thead>
    <tr>
      <th><%= t('spree.name') %></th>
      <th><%= t('spree.discount_type') %></th>
      <th><%= t('spree.range') %></th>
      <th><%= t('spree.amount') %></th>
      <th><%= t('spree.position') %></th>
      <th><%= t('spree.role') %></th>
      <th class="actions"></th>
    </tr>
  </thead>
  <tbody id="volume_prices">
    <%= f.fields_for :volume_prices do |vp_form| %>
      <%= render partial: 'spree/admin/volume_prices/volume_price_fields', locals: { f: vp_form } %>
    <% end %>
  </tbody>
</table>

<span id="new_add_volume_price" data-hook>
  <%= link_to t(:add_volume_price, scope: :spree), 'javascript:;', {
    data: { target: 'tbody#volume_prices' },
    class: 'btn btn-primary spree_add_fields',
    id: 'add_volume_price'
  } %>
</span>