app/views/spree/admin/variants/index.html.erb in spree_backend-4.1.15 vs app/views/spree/admin/variants/index.html.erb in spree_backend-4.2.0.beta
- old
+ new
@@ -2,29 +2,30 @@
<%# Place for new variant form %>
<div id="new_variant" data-hook></div>
<% if @variants.any? %>
+<div class="table-responsive">
<table class="table sortable" data-sortable-link="<%= update_positions_admin_product_variants_path(@product) %>">
<thead data-hook="variants_header">
<tr>
<th colspan="2"><%= Spree.t(:options) %></th>
<th><%= Spree.t(:price) %></th>
<th><%= Spree.t(:sku) %></th>
<th class="actions"></th>
</tr>
</thead>
- <tbody>
+ <tbody id="sortVert">
<% @variants.each do |variant| %>
<tr id="<%= spree_dom_id variant %>" <%= 'style="color:red;"' if variant.deleted? %> data-hook="variants_row">
<td class="move-handle">
<% if can? :edit, variant %>
- <span class="icon icon-move handle"></span>
+ <%= svg_icon name: "sort.svg", width: '18', height: '18' %>
<% end %>
</td>
<td><%= variant.options_text %></td>
- <td><%= variant.display_price.to_html %></td>
+ <td><%= display_price(variant) %></td>
<td><%= variant.sku %></td>
<td class="actions actions-2 text-right">
<%= link_to_edit(variant, no_text: true) if can?(:edit, variant) && !variant.deleted? %>
<%= link_to_delete(variant, no_text: true) if can?(:destroy, variant) && !variant.deleted? %>
</td>
@@ -35,10 +36,11 @@
<td colspan="5"><%= Spree.t(:none) %></td>
</tr>
<% end %>
</tbody>
</table>
+</div>
<% else %>
<div class="no-objects-found alert alert-info">
<%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::Variant)) %>
<% if can?(:create, Spree::Variant) && !@product.empty_option_values? %>
- <%= link_to(Spree.t(:add_one), spree.new_admin_product_variant_path(@product)) %>!
@@ -58,9 +60,9 @@
</p>
<% end %>
<% else %>
<% content_for :page_actions do %>
<%= product_preview_link(@product) %>
- <%= button_link_to(Spree.t(:new_variant), spree.new_admin_product_variant_url(@product), { icon: 'add', :'data-update' => 'new_variant', class: 'btn-success', id: 'new_var_link' }) if can? :create, Spree::Variant %>
- <%= button_link_to (@deleted.blank? ? Spree.t(:show_deleted) : Spree.t(:show_active)), spree.admin_product_variants_url(@product, deleted: @deleted.blank? ? "on" : "off"), { class: 'btn-outline-secondary', icon: 'filter' } %>
+ <%= button_link_to(Spree.t(:new_variant), spree.new_admin_product_variant_url(@product), { icon: 'add.svg', :'data-update' => 'new_variant', class: 'btn-success', id: 'new_var_link' }) if can? :create, Spree::Variant %>
+ <%= button_link_to (@deleted.blank? ? Spree.t(:show_deleted) : Spree.t(:show_active)), spree.admin_product_variants_url(@product, deleted: @deleted.blank? ? "on" : "off"), { class: 'btn-outline-secondary', icon: 'filter.svg' } %>
<% end %>
<% end %>