mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-26 01:33:22 +00:00
Use ShippingMethod :frontend method and drop :backend to avoid ClassLength Rubocop error
This commit is contained in:
committed by
Filipe
parent
0673f9a5ae
commit
87431c188e
@@ -71,10 +71,6 @@ module Spree
|
||||
spree_calculators.__send__ model_name_without_spree_namespace
|
||||
end
|
||||
|
||||
def backend?
|
||||
!frontend?
|
||||
end
|
||||
|
||||
# Some shipping methods are only meant to be set via backend
|
||||
def frontend?
|
||||
display_on != "back_end"
|
||||
|
||||
@@ -32,14 +32,14 @@
|
||||
- if shipping_methods.any?
|
||||
- shipping_methods.each do |shipping_method|
|
||||
%p
|
||||
%label{ class: ("disabled" if shipping_method.backend?) }
|
||||
%label{ class: ("disabled" unless shipping_method.frontend?) }
|
||||
= check_box_tag "order_cycle[selected_shipping_method_ids][]",
|
||||
shipping_method.id, @order_cycle.shipping_methods.include?(shipping_method),
|
||||
disabled: shipping_method.backend?,
|
||||
disabled: !shipping_method.frontend?,
|
||||
id: "order_cycle_selected_shipping_method_ids_#{shipping_method.id}",
|
||||
data: ({ "action" => "change->select-all#toggleCheckbox", "select-all-target" => "checkbox" } unless shipping_method.backend?)
|
||||
data: ({ "action" => "change->select-all#toggleCheckbox", "select-all-target" => "checkbox" } if shipping_method.frontend?)
|
||||
= shipping_method.name
|
||||
- if shipping_method.backend?
|
||||
- unless shipping_method.frontend?
|
||||
= "(#{t('.back_end')})"
|
||||
- if @order_cycle.distributors.many?
|
||||
—
|
||||
|
||||
Reference in New Issue
Block a user