mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Clean up payment methods form
This commit is contained in:
@@ -7,6 +7,10 @@ module EnterprisesHelper
|
||||
enterprises.map { |enterprise| [enterprise.name + ": " + enterprise.address.address1 + ", " + enterprise.address.city, enterprise.id.to_i] }
|
||||
end
|
||||
|
||||
def enterprises_to_names(enterprises)
|
||||
enterprises.map(&:name).sort.join(', ')
|
||||
end
|
||||
|
||||
def enterprise_confirm_delete_message(enterprise)
|
||||
if enterprise.supplied_products.present?
|
||||
"This will also delete the #{pluralize enterprise.supplied_products.count, 'product'} that this enterprise supplies. Are you sure you want to continue?"
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
/
|
||||
insert_before '[data-hook="environment"]'
|
||||
/ insert_before '[data-hook="environment"]'
|
||||
|
||||
= f.field_container :distributors do
|
||||
= f.label :distributors
|
||||
%br
|
||||
- distributors = Enterprise.is_distributor.managed_by(spree_current_user) | f.object.distributors
|
||||
= collection_select(:payment_method, :distributor_ids, distributors, :id, :name, {include_blank: false}, {class: "select2 fullwidth", multiple: true})
|
||||
= f.collection_select(:distributor_ids, distributors, :id, :name, {include_blank: false}, {class: "select2 fullwidth", multiple: true})
|
||||
= f.error_message_on :distributors
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/ insert_top "[data-hook='admin_payment_methods_index_rows']"
|
||||
|
||||
%td.align-center
|
||||
= method.distributors.map(&:name).sort.join(', ')
|
||||
= enterprises_to_names method.distributors
|
||||
|
||||
Reference in New Issue
Block a user