mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Merge pull request #2754 from HugsDaniel/apply_overrides_to_shipping_methods_index
[Spree Upgrade] Replace Spree::ShippingMethods index view by our own and apply overrides
This commit is contained in:
@@ -1,6 +0,0 @@
|
||||
/ insert_after "[data-hook='admin_shipping_methods_index_rows'] td:first-child"
|
||||
|
||||
%td.align-center
|
||||
- shipping_method.distributors.each do |distributor|
|
||||
= distributor.name
|
||||
%br/
|
||||
@@ -1,4 +0,0 @@
|
||||
/ insert_after "[data-hook='admin_shipping_methods_index_headers'] th:first-child"
|
||||
|
||||
%th
|
||||
= t(:products_distributor)
|
||||
@@ -1 +0,0 @@
|
||||
/ replace_contents "table#listing_shipping_methods colgroup"
|
||||
@@ -1 +0,0 @@
|
||||
remove "code[erb-loud]:contains(\"render :partial => 'spree/admin/shared/configuration_menu'\")"
|
||||
37
app/views/spree/admin/shipping_methods/index.html.haml
Normal file
37
app/views/spree/admin/shipping_methods/index.html.haml
Normal file
@@ -0,0 +1,37 @@
|
||||
- content_for :page_title do
|
||||
= Spree.t(:shipping_methods)
|
||||
- content_for :page_actions do
|
||||
%li
|
||||
= button_link_to Spree.t(:new_shipping_method), new_object_url, icon: 'icon-plus', id: 'admin_new_shipping_method_link'
|
||||
- if @shipping_methods.any?
|
||||
%table#listing_shipping_methods.index
|
||||
%colgroup
|
||||
%col{style: "width: 20%"}/
|
||||
%col{style: "width: 15%"}/
|
||||
%col{style: "width: 40%"}/
|
||||
%col{style: "width: 10%"}/
|
||||
%col{style: "width: 15%"}/
|
||||
%thead
|
||||
%tr
|
||||
%th= Spree.t(:name)
|
||||
%th= t(:products_distributor)
|
||||
%th= Spree.t(:zone)
|
||||
%th= Spree.t(:calculator)
|
||||
%th= Spree.t(:display)
|
||||
%th.actions
|
||||
%tbody
|
||||
- @shipping_methods.each do |shipping_method|
|
||||
%tr{class: "#{cycle('odd', 'even')}", id: "#{spree_dom_id shipping_method}"}
|
||||
%td= shipping_method.name
|
||||
%td.align-center
|
||||
- shipping_method.distributors.each do |distributor|
|
||||
= distributor.name
|
||||
%br/
|
||||
%td= shipping_method.zones.collect(&:name).join(", ") if shipping_method.zones
|
||||
%td= shipping_method.calculator.description
|
||||
%td.align-center= shipping_method.display_on.blank? ? Spree.t(:both) : Spree.t(shipping_method.display_on)
|
||||
%td.actions
|
||||
= link_to_edit shipping_method, no_text: true
|
||||
= link_to_delete shipping_method, no_text: true
|
||||
- else
|
||||
.alpha.twelve.columns.no-objects-found= Spree.t(:no_shipping_methods_found)
|
||||
Reference in New Issue
Block a user