mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-03 22:06:07 +00:00
Make name of payment_methods more human readable
This commit is contained in:
@@ -30,4 +30,21 @@ end
|
||||
# Ensure that all derived classes also allow distributor_ids
|
||||
Spree::Gateway.providers.each do |p|
|
||||
p.attr_accessible :distributor_ids
|
||||
p.instance_eval do
|
||||
def clean_name
|
||||
case name
|
||||
when "Spree::PaymentMethod::Check"
|
||||
"Cash/EFT/etc. (payments for which automatic validation is not required)"
|
||||
when "Spree::Gateway::Migs"
|
||||
"MasterCard Internet Gateway Service (MIGS)"
|
||||
when "Spree::BillingIntegration::PaypalExpressUk"
|
||||
"PayPal Express (UK)"
|
||||
when "Spree::BillingIntegration::PaypalExpress"
|
||||
"PayPal Express"
|
||||
else
|
||||
i = name.rindex('::') + 2
|
||||
name[i..-1]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -33,13 +33,16 @@
|
||||
= radio_button :payment_method, :active, false
|
||||
|
||||
= label_tag nil, t(:say_no)
|
||||
.row
|
||||
.alpha.three.columns
|
||||
= f.label :type, t(:provider)
|
||||
.omega.eight.columns
|
||||
= collection_select(:payment_method, :type, @providers, :to_s, :clean_name, {}, {:id => 'gtwy-type', :class => 'select2 fullwidth'})
|
||||
|
||||
%fieldset.alpha.eleven.columns.no-border-bottom#gateway_fields
|
||||
%legend{ align="center"}
|
||||
= t(:gateway)
|
||||
#preference-settings.field{"data-hook" => ""}
|
||||
= f.label :type, t(:provider)
|
||||
= collection_select(:payment_method, :type, @providers, :to_s, :name, {}, {:id => 'gtwy-type', :class => 'select2 fullwidth'})
|
||||
= t(:provider_settings)
|
||||
#preference-settings
|
||||
- unless @object.new_record?
|
||||
= preference_fields(@object, f)
|
||||
- if @object.respond_to?(:preferences)
|
||||
|
||||
Reference in New Issue
Block a user