mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-20 19:56:48 +00:00
Compare commits
152 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1abdd0112e | ||
|
|
bc6ffe3b0c | ||
|
|
eea73aa989 | ||
|
|
03b0ce430d | ||
|
|
ad14f7f9b0 | ||
|
|
7cc7c62232 | ||
|
|
b6dc46a911 | ||
|
|
0b70c67908 | ||
|
|
71a181341b | ||
|
|
cf3f511f4d | ||
|
|
1d1067ebc1 | ||
|
|
bd4d0ba5d3 | ||
|
|
3b682bc47f | ||
|
|
be35f97622 | ||
|
|
ca79270ba3 | ||
|
|
2cf7b1b36c | ||
|
|
f7c07f492c | ||
|
|
9f17e4fd8f | ||
|
|
c980d22826 | ||
|
|
ceee89fad0 | ||
|
|
a942218708 | ||
|
|
26946ec102 | ||
|
|
dd31cbe014 | ||
|
|
46733d0c0d | ||
|
|
57a9d6e1e2 | ||
|
|
ad592785cf | ||
|
|
f3ba0ebdbb | ||
|
|
4d64bf6ece | ||
|
|
3c9c5862d1 | ||
|
|
78a8f53d8d | ||
|
|
806c8b943d | ||
|
|
85096a997f | ||
|
|
19b6cb13f1 | ||
|
|
dd228cc750 | ||
|
|
586e8a9abe | ||
|
|
1847b62cf4 | ||
|
|
0618c9e4dd | ||
|
|
d15301021a | ||
|
|
55e8dace44 | ||
|
|
9a9b455e66 | ||
|
|
399fe2c01b | ||
|
|
3aeb87debc | ||
|
|
7b06fdd943 | ||
|
|
6755354196 | ||
|
|
440e69e156 | ||
|
|
a53223aefc | ||
|
|
cc1b4123b7 | ||
|
|
65ce183830 | ||
|
|
7e606471e4 | ||
|
|
1dace1f0e3 | ||
|
|
08d26102d2 | ||
|
|
35790b3cca | ||
|
|
2ce05d48bf | ||
|
|
6b826423c1 | ||
|
|
412457bb19 | ||
|
|
2605b9cdf0 | ||
|
|
867947f6b2 | ||
|
|
8d9b33abe8 | ||
|
|
57fe1db10e | ||
|
|
18d2599075 | ||
|
|
292b33b4ea | ||
|
|
8591934c19 | ||
|
|
9bf84bd5a8 | ||
|
|
67a603f77f | ||
|
|
331ac28b71 | ||
|
|
3ead050a56 | ||
|
|
23dd09eaad | ||
|
|
8585e6c7f0 | ||
|
|
866452383d | ||
|
|
402fc902ff | ||
|
|
8f21b66b96 | ||
|
|
c9b540677c | ||
|
|
4f579facfe | ||
|
|
fa62ec0bff | ||
|
|
cb3ea133e9 | ||
|
|
10490536e2 | ||
|
|
a43737af8b | ||
|
|
0138f04506 | ||
|
|
4a2684e3d9 | ||
|
|
e860e2ca57 | ||
|
|
da69dca471 | ||
|
|
e4f3aae7c0 | ||
|
|
72ae7ea8a2 | ||
|
|
8f95de10bc | ||
|
|
cbe1b53189 | ||
|
|
9c30c3c0ed | ||
|
|
9a03428412 | ||
|
|
76afc0b407 | ||
|
|
200e9c5078 | ||
|
|
caea5b2aa8 | ||
|
|
3730d76b44 | ||
|
|
28c25cff2c | ||
|
|
20edcfab26 | ||
|
|
642787b95a | ||
|
|
a1438d3b2e | ||
|
|
fc8e3d1ece | ||
|
|
21991515df | ||
|
|
3534559fbf | ||
|
|
f1373b902c | ||
|
|
e5e67fbdf0 | ||
|
|
f1e80e92de | ||
|
|
c5186c2412 | ||
|
|
52f56baa8c | ||
|
|
0b51d8b297 | ||
|
|
0f5aa11f05 | ||
|
|
00624d1b96 | ||
|
|
7e8aaaa5f9 | ||
|
|
49b8dcb880 | ||
|
|
479520bf97 | ||
|
|
b66b50cd56 | ||
|
|
50cbc971a1 | ||
|
|
7178a69a54 | ||
|
|
e06e8fc460 | ||
|
|
ee402db734 | ||
|
|
3f1e496731 | ||
|
|
494f0d8ff6 | ||
|
|
15715f9bb4 | ||
|
|
4baf53a0a9 | ||
|
|
8041111886 | ||
|
|
adc2bcb442 | ||
|
|
8a51c5cb5d | ||
|
|
e114d58ff2 | ||
|
|
b7fc3df86a | ||
|
|
01fe12e72b | ||
|
|
c5e125747f | ||
|
|
3baaa5cc40 | ||
|
|
e29d6048c2 | ||
|
|
c4ba8db7ed | ||
|
|
764169c9ca | ||
|
|
30a1832302 | ||
|
|
a07f64f8a8 | ||
|
|
ca2d66eacf | ||
|
|
c65108731c | ||
|
|
5928eba767 | ||
|
|
874d33caaa | ||
|
|
66be86cca9 | ||
|
|
35110eaf4a | ||
|
|
c62f1bd550 | ||
|
|
2cc751cb30 | ||
|
|
2ec35b6306 | ||
|
|
e963ab4bd4 | ||
|
|
14eee1c9e4 | ||
|
|
ff049d33e7 | ||
|
|
b02e25af0e | ||
|
|
76293c335b | ||
|
|
01d2c3cb9e | ||
|
|
80c76606df | ||
|
|
b07fbec8c6 | ||
|
|
c4205fce34 | ||
|
|
a959f8e745 | ||
|
|
437c39f795 | ||
|
|
27f1aeb803 |
@@ -42,7 +42,6 @@ Layout/LineLength:
|
||||
- app/helpers/angular_form_helper.rb
|
||||
- app/helpers/checkout_helper.rb
|
||||
- app/helpers/enterprises_helper.rb
|
||||
- app/helpers/injection_helper.rb
|
||||
- app/helpers/markdown_helper.rb
|
||||
- app/helpers/order_cycles_helper.rb
|
||||
- app/helpers/spree/orders_helper.rb
|
||||
@@ -88,6 +87,7 @@ Layout/LineLength:
|
||||
- Gemfile
|
||||
- lib/discourse/single_sign_on.rb
|
||||
- lib/open_food_network/available_payment_method_filter.rb
|
||||
- lib/open_food_network/bulk_coop_report.rb
|
||||
- lib/open_food_network/customers_report.rb
|
||||
- lib/open_food_network/enterprise_fee_applicator.rb
|
||||
- lib/open_food_network/enterprise_fee_calculator.rb
|
||||
@@ -452,6 +452,7 @@ Metrics/AbcSize:
|
||||
- spec/services/order_checkout_restart_spec.rb
|
||||
- spec/support/i18n_translations_checker.rb
|
||||
- spec/support/performance_helper.rb
|
||||
- spec/support/request/web_helper.rb
|
||||
|
||||
Metrics/BlockLength:
|
||||
Max: 25
|
||||
@@ -811,40 +812,17 @@ Metrics/ModuleLength:
|
||||
- app/helpers/spree/admin/navigation_helper.rb
|
||||
- app/models/spree/order/checkout.rb
|
||||
- app/models/spree/payment/processing.rb
|
||||
- engines/order_management/spec/services/order_management/order/updater_spec.rb
|
||||
- engines/order_management/spec/services/order_management/stock/package_spec.rb
|
||||
- engines/order_management/spec/services/order_management/subscriptions/estimator_spec.rb
|
||||
- engines/order_management/spec/services/order_management/subscriptions/form_spec.rb
|
||||
- engines/order_management/spec/services/order_management/subscriptions/proxy_order_syncer_spec.rb
|
||||
- engines/order_management/spec/services/order_management/subscriptions/summarizer_spec.rb
|
||||
- engines/order_management/spec/services/order_management/subscriptions/validator_spec.rb
|
||||
- engines/order_management/spec/services/order_management/subscriptions/variants_list_spec.rb
|
||||
- lib/open_food_network/column_preference_defaults.rb
|
||||
- spec/controllers/admin/order_cycles_controller_spec.rb
|
||||
- spec/controllers/api/order_cycles_controller_spec.rb
|
||||
- spec/controllers/api/orders_controller_spec.rb
|
||||
- spec/controllers/spree/admin/payment_methods_controller_spec.rb
|
||||
- spec/lib/open_food_network/address_finder_spec.rb
|
||||
- spec/lib/open_food_network/customers_report_spec.rb
|
||||
- spec/lib/open_food_network/enterprise_fee_calculator_spec.rb
|
||||
- spec/lib/open_food_network/order_cycle_form_applicator_spec.rb
|
||||
- spec/lib/open_food_network/order_cycle_permissions_spec.rb
|
||||
- spec/lib/open_food_network/order_grouper_spec.rb
|
||||
- spec/lib/open_food_network/packing_report_spec.rb
|
||||
- spec/lib/open_food_network/permissions_spec.rb
|
||||
- spec/lib/open_food_network/products_and_inventory_report_spec.rb
|
||||
- spec/lib/open_food_network/scope_variant_to_hub_spec.rb
|
||||
- spec/lib/open_food_network/tag_rule_applicator_spec.rb
|
||||
- spec/lib/open_food_network/user_balance_calculator_spec.rb
|
||||
- spec/lib/open_food_network/users_and_enterprises_report_spec.rb
|
||||
- spec/models/spree/adjustment_spec.rb
|
||||
- spec/models/spree/credit_card_spec.rb
|
||||
- spec/models/spree/line_item_spec.rb
|
||||
- spec/models/spree/product_spec.rb
|
||||
- spec/models/spree/shipping_method_spec.rb
|
||||
- spec/models/spree/variant_spec.rb
|
||||
- spec/services/permissions/order_spec.rb
|
||||
- spec/services/variant_units/option_value_namer_spec.rb
|
||||
|
||||
Metrics/ParameterLists:
|
||||
Max: 5
|
||||
|
||||
7
.rubocop_specs.yml
Normal file
7
.rubocop_specs.yml
Normal file
@@ -0,0 +1,7 @@
|
||||
inherit_from:
|
||||
- .rubocop.yml
|
||||
|
||||
# This rubocop config file is only used for specs
|
||||
# Here we allow specs to be 300 lines long
|
||||
Metrics/ModuleLength:
|
||||
Max: 300
|
||||
@@ -556,41 +556,6 @@ Style/ClassAndModuleChildren:
|
||||
- 'app/models/tag_rule/filter_order_cycles.rb'
|
||||
- 'app/models/tag_rule/filter_payment_methods.rb'
|
||||
- 'app/models/tag_rule/filter_shipping_methods.rb'
|
||||
- 'app/serializers/api/address_serializer.rb'
|
||||
- 'app/serializers/api/admin/basic_enterprise_fee_serializer.rb'
|
||||
- 'app/serializers/api/admin/basic_enterprise_serializer.rb'
|
||||
- 'app/serializers/api/admin/basic_order_cycle_serializer.rb'
|
||||
- 'app/serializers/api/admin/calculator/flat_percent_item_total_serializer.rb'
|
||||
- 'app/serializers/api/admin/calculator_serializer.rb'
|
||||
- 'app/serializers/api/admin/column_preference_serializer.rb'
|
||||
- 'app/serializers/api/admin/customer_serializer.rb'
|
||||
- 'app/serializers/api/admin/enterprise_fee_serializer.rb'
|
||||
- 'app/serializers/api/admin/enterprise_relationship_permission_serializer.rb'
|
||||
- 'app/serializers/api/admin/enterprise_relationship_serializer.rb'
|
||||
- 'app/serializers/api/admin/enterprise_role_serializer.rb'
|
||||
- 'app/serializers/api/admin/enterprise_serializer.rb'
|
||||
- 'app/serializers/api/admin/exchange_serializer.rb'
|
||||
- 'app/serializers/api/admin/for_order_cycle/enterprise_serializer.rb'
|
||||
- 'app/serializers/api/admin/for_order_cycle/supplied_product_serializer.rb'
|
||||
- 'app/serializers/api/admin/id_name_serializer.rb'
|
||||
- 'app/serializers/api/admin/id_serializer.rb'
|
||||
- 'app/serializers/api/admin/index_enterprise_serializer.rb'
|
||||
- 'app/serializers/api/admin/inventory_item_serializer.rb'
|
||||
- 'app/serializers/api/admin/line_item_serializer.rb'
|
||||
- 'app/serializers/api/admin/order_cycle_serializer.rb'
|
||||
- 'app/serializers/api/admin/order_serializer.rb'
|
||||
- 'app/serializers/api/admin/payment_method/base_serializer.rb'
|
||||
- 'app/serializers/api/admin/payment_method/stripe_serializer.rb'
|
||||
- 'app/serializers/api/admin/product_serializer.rb'
|
||||
- 'app/serializers/api/admin/shipping_method_serializer.rb'
|
||||
- 'app/serializers/api/admin/tag_rule_serializer.rb'
|
||||
- 'app/serializers/api/admin/tax_category_serializer.rb'
|
||||
- 'app/serializers/api/admin/taxon_serializer.rb'
|
||||
- 'app/serializers/api/admin/units_product_serializer.rb'
|
||||
- 'app/serializers/api/admin/units_variant_serializer.rb'
|
||||
- 'app/serializers/api/admin/user_serializer.rb'
|
||||
- 'app/serializers/api/admin/variant_override_serializer.rb'
|
||||
- 'app/serializers/api/admin/variant_serializer.rb'
|
||||
- 'app/serializers/api/country_serializer.rb'
|
||||
- 'app/serializers/api/currency_config_serializer.rb'
|
||||
- 'app/serializers/api/current_order_serializer.rb'
|
||||
@@ -845,48 +810,6 @@ Style/FrozenStringLiteralComment:
|
||||
- 'app/models/variant_override_set.rb'
|
||||
- 'app/serializers/api/address_serializer.rb'
|
||||
- 'app/serializers/api/adjustment_serializer.rb'
|
||||
- 'app/serializers/api/admin/basic_enterprise_fee_serializer.rb'
|
||||
- 'app/serializers/api/admin/basic_enterprise_serializer.rb'
|
||||
- 'app/serializers/api/admin/basic_order_cycle_serializer.rb'
|
||||
- 'app/serializers/api/admin/calculator/flat_percent_item_total_serializer.rb'
|
||||
- 'app/serializers/api/admin/calculator_serializer.rb'
|
||||
- 'app/serializers/api/admin/column_preference_serializer.rb'
|
||||
- 'app/serializers/api/admin/customer_serializer.rb'
|
||||
- 'app/serializers/api/admin/enterprise_fee_serializer.rb'
|
||||
- 'app/serializers/api/admin/enterprise_relationship_permission_serializer.rb'
|
||||
- 'app/serializers/api/admin/enterprise_relationship_serializer.rb'
|
||||
- 'app/serializers/api/admin/enterprise_role_serializer.rb'
|
||||
- 'app/serializers/api/admin/enterprise_serializer.rb'
|
||||
- 'app/serializers/api/admin/exchange_serializer.rb'
|
||||
- 'app/serializers/api/admin/for_order_cycle/enterprise_serializer.rb'
|
||||
- 'app/serializers/api/admin/for_order_cycle/supplied_product_serializer.rb'
|
||||
- 'app/serializers/api/admin/id_email_serializer.rb'
|
||||
- 'app/serializers/api/admin/id_name_serializer.rb'
|
||||
- 'app/serializers/api/admin/id_serializer.rb'
|
||||
- 'app/serializers/api/admin/index_enterprise_serializer.rb'
|
||||
- 'app/serializers/api/admin/index_order_cycle_serializer.rb'
|
||||
- 'app/serializers/api/admin/inventory_item_serializer.rb'
|
||||
- 'app/serializers/api/admin/line_item_serializer.rb'
|
||||
- 'app/serializers/api/admin/order_cycle_serializer.rb'
|
||||
- 'app/serializers/api/admin/order_serializer.rb'
|
||||
- 'app/serializers/api/admin/payment_method/base_serializer.rb'
|
||||
- 'app/serializers/api/admin/payment_method/stripe_serializer.rb'
|
||||
- 'app/serializers/api/admin/payment_method_serializer.rb'
|
||||
- 'app/serializers/api/admin/product_serializer.rb'
|
||||
- 'app/serializers/api/admin/proxy_order_serializer.rb'
|
||||
- 'app/serializers/api/admin/schedule_serializer.rb'
|
||||
- 'app/serializers/api/admin/shipping_method_serializer.rb'
|
||||
- 'app/serializers/api/admin/subscription_customer_serializer.rb'
|
||||
- 'app/serializers/api/admin/subscription_line_item_serializer.rb'
|
||||
- 'app/serializers/api/admin/subscription_serializer.rb'
|
||||
- 'app/serializers/api/admin/tag_rule_serializer.rb'
|
||||
- 'app/serializers/api/admin/tax_category_serializer.rb'
|
||||
- 'app/serializers/api/admin/taxon_serializer.rb'
|
||||
- 'app/serializers/api/admin/units_product_serializer.rb'
|
||||
- 'app/serializers/api/admin/units_variant_serializer.rb'
|
||||
- 'app/serializers/api/admin/user_serializer.rb'
|
||||
- 'app/serializers/api/admin/variant_override_serializer.rb'
|
||||
- 'app/serializers/api/admin/variant_serializer.rb'
|
||||
- 'app/serializers/api/cached_enterprise_serializer.rb'
|
||||
- 'app/serializers/api/country_serializer.rb'
|
||||
- 'app/serializers/api/credit_card_serializer.rb'
|
||||
|
||||
@@ -149,7 +149,7 @@ GEM
|
||||
nokogiri (>= 1.4.4)
|
||||
uuidtools (~> 2.1)
|
||||
bcrypt (3.1.13)
|
||||
bugsnag (6.17.0)
|
||||
bugsnag (6.18.0)
|
||||
concurrent-ruby (~> 1.0)
|
||||
builder (3.1.4)
|
||||
byebug (11.0.1)
|
||||
|
||||
@@ -104,7 +104,7 @@ angular.module("ofn.admin").controller "AdminProductEditCtrl", ($scope, $timeout
|
||||
$scope.$watch 'sortOptions', (sort) ->
|
||||
return unless sort && sort.predicate != ""
|
||||
|
||||
$scope.sorting = sort.getSortingExpr()
|
||||
$scope.q.sorting = sort.getSortingExpr()
|
||||
$scope.fetchProducts()
|
||||
, true
|
||||
|
||||
|
||||
@@ -47,3 +47,8 @@ angular.module("admin.customers").controller "customersCtrl", ($scope, $q, $filt
|
||||
tag.text.toLowerCase().indexOf(query.toLowerCase()) != -1
|
||||
defer.resolve filtered
|
||||
defer.promise
|
||||
|
||||
$scope.displayBalanceStatus = (customer) ->
|
||||
return unless customer.balance_status
|
||||
|
||||
t('admin.customers.index.' + customer.balance_status)
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
angular.module("admin.enterprises").directive 'termsAndConditionsWarning', ($compile, $templateCache, DialogDefaults, $timeout) ->
|
||||
restrict: 'A'
|
||||
scope: true
|
||||
|
||||
link: (scope, element, attr) ->
|
||||
# This file input click handler will hold the browser file input dialog and show a warning modal
|
||||
scope.hold_file_input_and_show_warning_modal = (event) ->
|
||||
event.preventDefault()
|
||||
scope.template = $compile($templateCache.get('admin/modals/terms_and_conditions_warning.html'))(scope)
|
||||
if scope.template.dialog
|
||||
scope.template.dialog(DialogDefaults)
|
||||
scope.template.dialog('open')
|
||||
scope.$apply()
|
||||
|
||||
element.bind 'click', scope.hold_file_input_and_show_warning_modal
|
||||
|
||||
# When the user presses continue in the warning modal, we open the browser file input dialog
|
||||
scope.continue = ->
|
||||
scope.template.dialog('close')
|
||||
|
||||
# unbind warning modal handler and click file input again to open the browser file input dialog
|
||||
element.unbind('click').trigger('click')
|
||||
# afterwards, bind warning modal handler again so that the warning is shown the next time
|
||||
$timeout ->
|
||||
element.bind 'click', scope.hold_file_input_and_show_warning_modal
|
||||
return
|
||||
|
||||
scope.close = ->
|
||||
scope.template.dialog('close')
|
||||
return
|
||||
@@ -1,4 +1,4 @@
|
||||
angular.module("admin.products").factory "VariantUnitManager", ->
|
||||
angular.module("admin.products").factory "VariantUnitManager", (availableUnits) ->
|
||||
class VariantUnitManager
|
||||
@units:
|
||||
'weight':
|
||||
@@ -29,12 +29,13 @@ angular.module("admin.products").factory "VariantUnitManager", ->
|
||||
system: 'metric'
|
||||
|
||||
@variantUnitOptions: ->
|
||||
available = availableUnits.split(",")
|
||||
options = for unit_type, _ of @units
|
||||
for scale in @unitScales(unit_type)
|
||||
for scale in @unitScales(unit_type, available)
|
||||
name = @getUnitName(scale, unit_type)
|
||||
["#{I18n.t(unit_type)} (#{name})", "#{unit_type}_#{scale}"]
|
||||
options.push [[I18n.t('items'), 'items']]
|
||||
[].concat options...
|
||||
options = [].concat options...
|
||||
|
||||
@getScale: (value, unitType) ->
|
||||
scaledValue = null
|
||||
@@ -53,8 +54,13 @@ angular.module("admin.products").factory "VariantUnitManager", ->
|
||||
else
|
||||
''
|
||||
|
||||
@unitScales: (unitType) ->
|
||||
(parseFloat(scale) for scale in Object.keys(@units[unitType])).sort (a, b) ->
|
||||
@unitScales: (unitType, availableUnits = null) ->
|
||||
scales = Object.keys(@units[unitType])
|
||||
if availableUnits
|
||||
scales = scales.filter (scale) ->
|
||||
availableUnits.includes(VariantUnitManager.getUnitName(scale, unitType))
|
||||
|
||||
(parseFloat(scale) for scale in scales).sort (a, b) ->
|
||||
a - b
|
||||
|
||||
@compatibleUnitScales: (scale, unitType) ->
|
||||
|
||||
@@ -95,6 +95,10 @@ Darkswarm.factory 'Checkout', ($injector, CurrentOrder, ShippingMethods, StripeE
|
||||
last_name: @order.bill_address.lastname
|
||||
save_requested_by_customer: @secrets.save_requested_by_customer
|
||||
}
|
||||
|
||||
if @terms_and_conditions_accepted()
|
||||
munged_order["terms_and_conditions_accepted"] = true
|
||||
|
||||
munged_order
|
||||
|
||||
shippingMethod: ->
|
||||
@@ -114,3 +118,7 @@ Darkswarm.factory 'Checkout', ($injector, CurrentOrder, ShippingMethods, StripeE
|
||||
|
||||
cartTotal: ->
|
||||
@order.display_total + @shippingPrice() + @paymentPrice()
|
||||
|
||||
terms_and_conditions_accepted: ->
|
||||
terms_and_conditions_checkbox = angular.element("#accept_terms")[0]
|
||||
terms_and_conditions_checkbox? && terms_and_conditions_checkbox.checked
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
%div
|
||||
.margin-bottom-30.text-center
|
||||
.text-big
|
||||
{{ 'js.admin.modals.terms_and_conditions_info.title' | t }}
|
||||
.margin-bottom-30
|
||||
%p
|
||||
{{ 'js.admin.modals.terms_and_conditions_info.message_1' | t }}
|
||||
.margin-bottom-30
|
||||
%p
|
||||
{{ 'js.admin.modals.terms_and_conditions_info.message_2' | t }}
|
||||
|
||||
.text-center
|
||||
%input.button.red.icon-plus{ type: 'button', value: t('js.admin.modals.got_it'), ng: { click: 'close()' } }
|
||||
@@ -0,0 +1,14 @@
|
||||
%div
|
||||
.margin-bottom-30.text-center
|
||||
.text-big
|
||||
{{ 'js.admin.modals.terms_and_conditions_warning.title' | t }}
|
||||
.margin-bottom-30
|
||||
%p
|
||||
{{ 'js.admin.modals.terms_and_conditions_warning.message_1' | t }}
|
||||
.margin-bottom-30
|
||||
%p
|
||||
{{ 'js.admin.modals.terms_and_conditions_warning.message_2' | t }}
|
||||
|
||||
.text-center
|
||||
%input.button.red{ type: 'button', value: t('js.admin.modals.close'), ng: { click: 'close()' } }
|
||||
%input.button.red{ type: 'button', value: t('js.admin.modals.continue'), ng: { click: 'continue()' } }
|
||||
@@ -154,3 +154,7 @@ input.text-big {
|
||||
.pad-top {
|
||||
padding-top: 1em;
|
||||
}
|
||||
|
||||
.white-space-nowrap {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
@@ -181,10 +181,10 @@ module Admin
|
||||
enterprise_payment_methods = @enterprise.payment_methods.to_a
|
||||
enterprise_shipping_methods = @enterprise.shipping_methods.to_a
|
||||
# rubocop:disable Style/TernaryParentheses
|
||||
@payment_methods = Spree::PaymentMethod.managed_by(spree_current_user).sort_by! do |pm|
|
||||
@payment_methods = Spree::PaymentMethod.managed_by(spree_current_user).to_a.sort_by! do |pm|
|
||||
[(enterprise_payment_methods.include? pm) ? 0 : 1, pm.name]
|
||||
end
|
||||
@shipping_methods = Spree::ShippingMethod.managed_by(spree_current_user).sort_by! do |sm|
|
||||
@shipping_methods = Spree::ShippingMethod.managed_by(spree_current_user).to_a.sort_by! do |sm|
|
||||
[(enterprise_shipping_methods.include? sm) ? 0 : 1, sm.name]
|
||||
end
|
||||
# rubocop:enable Style/TernaryParentheses
|
||||
|
||||
@@ -10,6 +10,7 @@ module Spree
|
||||
end
|
||||
|
||||
def update
|
||||
merge_available_units_params unless params[:available_units].nil?
|
||||
params.each do |name, value|
|
||||
next unless Spree::Config.has_preference? name
|
||||
|
||||
@@ -19,6 +20,13 @@ module Spree
|
||||
|
||||
redirect_to spree.edit_admin_general_settings_path
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def merge_available_units_params
|
||||
params[:available_units] =
|
||||
params[:available_units].select { |_unit, checked| checked == "1" }.keys.join(",")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -127,7 +127,7 @@ module Spree
|
||||
|
||||
def load_hubs
|
||||
# rubocop:disable Style/TernaryParentheses
|
||||
@hubs = Enterprise.managed_by(spree_current_user).is_distributor.sort_by! do |d|
|
||||
@hubs = Enterprise.managed_by(spree_current_user).is_distributor.to_a.sort_by! do |d|
|
||||
[(@payment_method.has_distributor? d) ? 0 : 1, d.name]
|
||||
end
|
||||
# rubocop:enable Style/TernaryParentheses
|
||||
|
||||
@@ -50,7 +50,7 @@ module Spree
|
||||
|
||||
def load_hubs
|
||||
# rubocop:disable Style/TernaryParentheses
|
||||
@hubs = Enterprise.managed_by(spree_current_user).is_distributor.sort_by! do |d|
|
||||
@hubs = Enterprise.managed_by(spree_current_user).is_distributor.to_a.sort_by! do |d|
|
||||
[(@shipping_method.has_distributor? d) ? 0 : 1, d.name]
|
||||
end
|
||||
# rubocop:enable Style/TernaryParentheses
|
||||
|
||||
@@ -184,6 +184,12 @@ module Admin
|
||||
json: "'#{@spree_api_key}'" }
|
||||
end
|
||||
|
||||
def admin_inject_available_units
|
||||
admin_inject_json "admin.products",
|
||||
"availableUnits",
|
||||
Spree::Config.available_units
|
||||
end
|
||||
|
||||
def admin_inject_json(ng_module, name, data)
|
||||
json = data.to_json
|
||||
render partial: "admin/json/injection_ams",
|
||||
|
||||
@@ -7,6 +7,8 @@ module CheckoutHelper
|
||||
adjustments = order.adjustments.eligible
|
||||
exclude = opts[:exclude] || {}
|
||||
|
||||
adjustments = adjustments.to_a
|
||||
|
||||
# Remove empty tax adjustments and (optionally) shipping fees
|
||||
adjustments.reject! { |a| a.originator_type == 'Spree::TaxRate' && a.amount == 0 }
|
||||
adjustments.reject! { |a| a.originator_type == 'Spree::ShippingMethod' } if exclude.include? :shipping
|
||||
|
||||
@@ -4,7 +4,7 @@ module InjectionHelper
|
||||
include SerializerHelper
|
||||
|
||||
def inject_enterprises(enterprises = nil)
|
||||
inject_json_ams(
|
||||
inject_json_array(
|
||||
"enterprises",
|
||||
enterprises || default_enterprise_query,
|
||||
Api::EnterpriseSerializer,
|
||||
@@ -15,7 +15,7 @@ module InjectionHelper
|
||||
def inject_groups
|
||||
select_only = required_attributes EnterpriseGroup, Api::GroupListSerializer
|
||||
|
||||
inject_json_ams(
|
||||
inject_json_array(
|
||||
"groups",
|
||||
EnterpriseGroup.on_front_page.by_position.select(select_only).
|
||||
includes(enterprises: [:shipping_methods, { address: [:state, :country] }],
|
||||
@@ -26,7 +26,7 @@ module InjectionHelper
|
||||
end
|
||||
|
||||
def inject_enterprise_shopfront(enterprise)
|
||||
inject_json_ams(
|
||||
inject_json(
|
||||
"shopfront",
|
||||
enterprise,
|
||||
Api::EnterpriseShopfrontSerializer
|
||||
@@ -36,7 +36,7 @@ module InjectionHelper
|
||||
def inject_enterprise_shopfront_list
|
||||
select_only = required_attributes Enterprise, Api::EnterpriseShopfrontListSerializer
|
||||
|
||||
inject_json_ams(
|
||||
inject_json_array(
|
||||
"enterprises",
|
||||
Enterprise.activated.visible.select(select_only).includes(address: [:state, :country]).all,
|
||||
Api::EnterpriseShopfrontListSerializer
|
||||
@@ -50,13 +50,13 @@ module InjectionHelper
|
||||
includes(:properties, address: [:state, :country], supplied_products: :properties).
|
||||
all
|
||||
|
||||
inject_json_ams "enterprises",
|
||||
enterprises_and_relatives,
|
||||
Api::EnterpriseSerializer, enterprise_injection_data
|
||||
inject_json_array "enterprises",
|
||||
enterprises_and_relatives,
|
||||
Api::EnterpriseSerializer, enterprise_injection_data
|
||||
end
|
||||
|
||||
def inject_group_enterprises
|
||||
inject_json_ams(
|
||||
inject_json_array(
|
||||
"enterprises",
|
||||
@group.enterprises.activated.all,
|
||||
Api::EnterpriseSerializer,
|
||||
@@ -65,11 +65,18 @@ module InjectionHelper
|
||||
end
|
||||
|
||||
def inject_current_hub
|
||||
inject_json_ams "currentHub", current_distributor, Api::EnterpriseSerializer, enterprise_injection_data
|
||||
inject_json "currentHub",
|
||||
current_distributor,
|
||||
Api::EnterpriseSerializer,
|
||||
enterprise_injection_data
|
||||
end
|
||||
|
||||
def inject_current_order
|
||||
inject_json_ams "currentOrder", current_order, Api::CurrentOrderSerializer, current_distributor: current_distributor, current_order_cycle: current_order_cycle
|
||||
inject_json "currentOrder",
|
||||
current_order,
|
||||
Api::CurrentOrderSerializer,
|
||||
current_distributor: current_distributor,
|
||||
current_order_cycle: current_order_cycle
|
||||
end
|
||||
|
||||
def inject_current_order_cycle
|
||||
@@ -79,73 +86,78 @@ module InjectionHelper
|
||||
end
|
||||
|
||||
def inject_available_shipping_methods
|
||||
inject_json_ams "shippingMethods", available_shipping_methods,
|
||||
Api::ShippingMethodSerializer, current_order: current_order
|
||||
inject_json_array "shippingMethods", available_shipping_methods,
|
||||
Api::ShippingMethodSerializer, current_order: current_order
|
||||
end
|
||||
|
||||
def inject_available_payment_methods
|
||||
inject_json_ams "paymentMethods", available_payment_methods,
|
||||
Api::PaymentMethodSerializer, current_order: current_order
|
||||
inject_json_array "paymentMethods", available_payment_methods,
|
||||
Api::PaymentMethodSerializer, current_order: current_order
|
||||
end
|
||||
|
||||
def inject_taxons
|
||||
inject_json_ams "taxons", Spree::Taxon.all.to_a, Api::TaxonSerializer
|
||||
inject_json_array "taxons", Spree::Taxon.all.to_a, Api::TaxonSerializer
|
||||
end
|
||||
|
||||
def inject_properties
|
||||
inject_json_ams "properties", Spree::Property.all.to_a, Api::PropertySerializer
|
||||
inject_json_array "properties", Spree::Property.all.to_a, Api::PropertySerializer
|
||||
end
|
||||
|
||||
def inject_currency_config
|
||||
inject_json_ams "currencyConfig", {}, Api::CurrencyConfigSerializer
|
||||
inject_json "currencyConfig", {}, Api::CurrencyConfigSerializer
|
||||
end
|
||||
|
||||
def inject_open_street_map_config
|
||||
inject_json_ams "openStreetMapConfig", {}, Api::OpenStreetMapConfigSerializer
|
||||
inject_json "openStreetMapConfig", {}, Api::OpenStreetMapConfigSerializer
|
||||
end
|
||||
|
||||
def inject_spree_api_key
|
||||
render partial: "json/injection_ams", locals: { name: 'spreeApiKey', json: "'#{@spree_api_key}'" }
|
||||
render partial: "json/injection_ams",
|
||||
locals: { name: 'spreeApiKey', json: "'#{@spree_api_key}'" }
|
||||
end
|
||||
|
||||
def inject_available_countries
|
||||
inject_json_ams "availableCountries", available_countries, Api::CountrySerializer
|
||||
inject_json_array "availableCountries", available_countries, Api::CountrySerializer
|
||||
end
|
||||
|
||||
def inject_enterprise_attributes
|
||||
render partial: "json/injection_ams", locals: { name: 'enterpriseAttributes', json: @enterprise_attributes.to_json.to_s }
|
||||
render partial: "json/injection_ams",
|
||||
locals: { name: 'enterpriseAttributes', json: @enterprise_attributes.to_json.to_s }
|
||||
end
|
||||
|
||||
def inject_orders
|
||||
inject_json_ams "orders", @orders.all, Api::OrderSerializer
|
||||
inject_json_array "orders", @orders.all, Api::OrderSerializer
|
||||
end
|
||||
|
||||
def inject_shops
|
||||
customers = spree_current_user.customers
|
||||
shops = Enterprise.where(id: @orders.pluck(:distributor_id).uniq | customers.pluck(:enterprise_id))
|
||||
inject_json_ams "shops", shops.all, Api::ShopForOrdersSerializer
|
||||
shops = Enterprise.where(id: @orders.pluck(:distributor_id).uniq |
|
||||
customers.pluck(:enterprise_id))
|
||||
inject_json_array "shops", shops.all, Api::ShopForOrdersSerializer
|
||||
end
|
||||
|
||||
def inject_saved_credit_cards
|
||||
data = spree_current_user ? spree_current_user.credit_cards.with_payment_profile.all : []
|
||||
|
||||
inject_json_ams "savedCreditCards", data, Api::CreditCardSerializer
|
||||
inject_json_array "savedCreditCards", data, Api::CreditCardSerializer
|
||||
end
|
||||
|
||||
def inject_current_user
|
||||
inject_json_ams "user", spree_current_user, Api::UserSerializer
|
||||
inject_json "user", spree_current_user, Api::UserSerializer
|
||||
end
|
||||
|
||||
def inject_rails_flash
|
||||
inject_json_ams "railsFlash", OpenStruct.new(flash.to_hash), Api::RailsFlashSerializer
|
||||
inject_json "railsFlash", OpenStruct.new(flash.to_hash), Api::RailsFlashSerializer
|
||||
end
|
||||
|
||||
def inject_json_ams(name, data, serializer, opts = {})
|
||||
if data.is_a?(Array)
|
||||
opts = { each_serializer: serializer }.merge(opts)
|
||||
serializer = ActiveModel::ArraySerializer
|
||||
end
|
||||
def inject_json_array(name, data, serializer, opts = {})
|
||||
opts = { each_serializer: serializer }.merge(opts)
|
||||
serializer = ActiveModel::ArraySerializer
|
||||
|
||||
inject_json(name, data, serializer, opts)
|
||||
end
|
||||
|
||||
def inject_json(name, data, serializer, opts = {})
|
||||
serializer_instance = serializer.new(data, opts)
|
||||
json = serializer_instance.to_json
|
||||
render partial: "json/injection_ams", locals: { name: name, json: json }
|
||||
|
||||
@@ -8,6 +8,10 @@ module Spree
|
||||
end
|
||||
options_from_collection_for_select(currencies, :first, :last, Spree::Config[:currency])
|
||||
end
|
||||
|
||||
def all_units
|
||||
["g", "oz", "lb", "kg", "T", "mL", "L", "kL"]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
16
app/helpers/terms_and_conditions_helper.rb
Normal file
16
app/helpers/terms_and_conditions_helper.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module TermsAndConditionsHelper
|
||||
def terms_and_conditions_activated?
|
||||
current_order.distributor.terms_and_conditions.file?
|
||||
end
|
||||
|
||||
def terms_and_conditions_already_accepted?
|
||||
customer_terms_and_conditions_accepted_at = spree_current_user&.
|
||||
customer_of(current_order.distributor)&.terms_and_conditions_accepted_at
|
||||
|
||||
customer_terms_and_conditions_accepted_at.present? &&
|
||||
(customer_terms_and_conditions_accepted_at >
|
||||
current_order.distributor.terms_and_conditions_updated_at)
|
||||
end
|
||||
end
|
||||
@@ -60,11 +60,11 @@ class ProducerMailer < Spree::BaseMailer
|
||||
end
|
||||
|
||||
def total_from_line_items(line_items)
|
||||
Spree::Money.new line_items.sum(&:total)
|
||||
Spree::Money.new line_items.to_a.sum(&:total)
|
||||
end
|
||||
|
||||
def tax_total_from_line_items(line_items)
|
||||
Spree::Money.new line_items.sum(&:included_tax)
|
||||
Spree::Money.new line_items.to_a.sum(&:included_tax)
|
||||
end
|
||||
|
||||
# This hack makes ActiveRecord skip the default_scope (deleted_at IS NULL)
|
||||
|
||||
@@ -8,10 +8,12 @@ module Spree
|
||||
def reset_password_instructions(user, token, _opts = {})
|
||||
@edit_password_reset_url = spree.
|
||||
edit_spree_user_password_url(reset_password_token: token)
|
||||
subject = "#{Spree::Config[:site_name]} " \
|
||||
"#{I18n.t('spree.user_mailer.reset_password_instructions.subject')}"
|
||||
|
||||
mail(to: user.email, from: from_address,
|
||||
subject: Spree::Config[:site_name] + ' ' +
|
||||
I18n.t(:subject, scope: [:devise, :mailer, :reset_password_instructions]))
|
||||
I18n.with_locale valid_locale(user) do
|
||||
mail(to: user.email, from: from_address, subject: subject)
|
||||
end
|
||||
end
|
||||
|
||||
# This is a OFN specific email, not from Devise::Mailer
|
||||
|
||||
@@ -49,7 +49,7 @@ module Calculator
|
||||
# Finds relevant fees for each line_item,
|
||||
# calculates the tax on them, and returns the total tax
|
||||
def per_item_fees_total(order, calculator)
|
||||
order.line_items.sum do |line_item|
|
||||
order.line_items.to_a.sum do |line_item|
|
||||
calculator.per_item_enterprise_fee_applicators_for(line_item.variant)
|
||||
.select { |applicator| applicable_rate?(applicator, line_item) }
|
||||
.sum { |applicator| applicator.enterprise_fee.compute_amount(line_item) }
|
||||
|
||||
@@ -18,7 +18,7 @@ class Calculator::FlatPercentPerItem < Spree::Calculator
|
||||
end
|
||||
|
||||
def compute(object)
|
||||
line_items_for(object).sum do |li|
|
||||
line_items_for(object).to_a.sum do |li|
|
||||
unless li.price.present? && li.quantity.present?
|
||||
raise ArgumentError, "object must respond to #price and #quantity"
|
||||
end
|
||||
|
||||
@@ -32,7 +32,7 @@ module Calculator
|
||||
private
|
||||
|
||||
def total_weight(line_items)
|
||||
line_items.sum do |line_item|
|
||||
line_items.to_a.sum do |line_item|
|
||||
line_item_weight(line_item)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -470,6 +470,8 @@ class Enterprise < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def initialize_permalink
|
||||
return unless name
|
||||
|
||||
self.permalink = Enterprise.find_available_permalink(name)
|
||||
end
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ class ModelSet
|
||||
# Remove all elements to be deleted from collection and return them
|
||||
# Allows us to render @model_set.collection without deleted elements
|
||||
deleted = []
|
||||
@collection = collection.to_a
|
||||
collection.delete_if { |e| deleted << e if @delete_if.andand.call(e.attributes) }
|
||||
deleted
|
||||
end
|
||||
|
||||
@@ -144,5 +144,8 @@ module Spree
|
||||
# Enable cache
|
||||
preference :enable_products_cache?, :boolean,
|
||||
default: (Rails.env.production? || Rails.env.staging?)
|
||||
|
||||
# Available units
|
||||
preference :available_units, :string, default: "g,kg,T,mL,L,kL"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -192,7 +192,7 @@ module Spree
|
||||
|
||||
line_item_adjustments = OrderAdjustmentsFetcher.new(order).line_item_adjustments(self)
|
||||
|
||||
(price + line_item_adjustments.sum(&:amount) / quantity).round(2)
|
||||
(price + line_item_adjustments.to_a.sum(&:amount) / quantity).round(2)
|
||||
end
|
||||
|
||||
def single_display_amount_with_adjustments
|
||||
|
||||
@@ -30,7 +30,7 @@ module Spree
|
||||
|
||||
def fetch_stock_items
|
||||
# Don't re-fetch associated stock items from the DB if we've already eager-loaded them
|
||||
return @variant.stock_items.to_a if @variant.stock_items.loaded?
|
||||
return @variant.stock_items if @variant.stock_items.loaded?
|
||||
|
||||
Spree::StockItem.joins(:stock_location).
|
||||
where(:variant_id => @variant, Spree::StockLocation.table_name => { active: true })
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
class Api::Admin::BasicEnterpriseFeeSerializer < ActiveModel::Serializer
|
||||
attributes :id, :enterprise_id
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Api
|
||||
module Admin
|
||||
class BasicEnterpriseFeeSerializer < ActiveModel::Serializer
|
||||
attributes :id, :enterprise_id
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,12 +1,18 @@
|
||||
class Api::Admin::BasicEnterpriseSerializer < ActiveModel::Serializer
|
||||
attributes :name, :id, :is_primary_producer, :is_distributor, :sells, :category,
|
||||
:payment_method_ids, :shipping_method_ids, :producer_profile_only, :permalink
|
||||
# frozen_string_literal: true
|
||||
|
||||
def payment_method_ids
|
||||
object.payment_methods.map(&:id)
|
||||
end
|
||||
module Api
|
||||
module Admin
|
||||
class BasicEnterpriseSerializer < ActiveModel::Serializer
|
||||
attributes :name, :id, :is_primary_producer, :is_distributor, :sells, :category,
|
||||
:payment_method_ids, :shipping_method_ids, :producer_profile_only, :permalink
|
||||
|
||||
def shipping_method_ids
|
||||
object.shipping_methods.map(&:id)
|
||||
def payment_method_ids
|
||||
object.payment_methods.map(&:id)
|
||||
end
|
||||
|
||||
def shipping_method_ids
|
||||
object.shipping_methods.map(&:id)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,20 +1,26 @@
|
||||
class Api::Admin::BasicOrderCycleSerializer < ActiveModel::Serializer
|
||||
include OrderCyclesHelper
|
||||
# frozen_string_literal: true
|
||||
|
||||
attributes :id, :name, :status, :orders_open_at, :orders_close_at
|
||||
module Api
|
||||
module Admin
|
||||
class BasicOrderCycleSerializer < ActiveModel::Serializer
|
||||
include OrderCyclesHelper
|
||||
|
||||
has_many :suppliers, serializer: Api::Admin::IdNameSerializer
|
||||
has_many :distributors, serializer: Api::Admin::IdNameSerializer
|
||||
attributes :id, :name, :status, :orders_open_at, :orders_close_at
|
||||
|
||||
def status
|
||||
order_cycle_status_class object
|
||||
end
|
||||
has_many :suppliers, serializer: Api::Admin::IdNameSerializer
|
||||
has_many :distributors, serializer: Api::Admin::IdNameSerializer
|
||||
|
||||
def orders_open_at
|
||||
object.orders_open_at.andand.strftime("%F %T %z")
|
||||
end
|
||||
def status
|
||||
order_cycle_status_class object
|
||||
end
|
||||
|
||||
def orders_close_at
|
||||
object.orders_close_at.andand.strftime("%F %T %z")
|
||||
def orders_open_at
|
||||
object.orders_open_at.andand.strftime("%F %T %z")
|
||||
end
|
||||
|
||||
def orders_close_at
|
||||
object.orders_close_at.andand.strftime("%F %T %z")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,7 +1,15 @@
|
||||
class Api::Admin::Calculator::FlatPercentItemTotalSerializer < ActiveModel::Serializer
|
||||
attributes :id, :preferred_flat_percent
|
||||
# frozen_string_literal: true
|
||||
|
||||
def preferred_flat_percent
|
||||
object.preferred_flat_percent.to_i
|
||||
module Api
|
||||
module Admin
|
||||
module Calculator
|
||||
class FlatPercentItemTotalSerializer < ActiveModel::Serializer
|
||||
attributes :id, :preferred_flat_percent
|
||||
|
||||
def preferred_flat_percent
|
||||
object.preferred_flat_percent.to_i
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
class Api::Admin::CalculatorSerializer < ActiveModel::Serializer
|
||||
attributes :name, :description
|
||||
# frozen_string_literal: true
|
||||
|
||||
delegate :name, to: :object
|
||||
module Api
|
||||
module Admin
|
||||
class CalculatorSerializer < ActiveModel::Serializer
|
||||
attributes :name, :description
|
||||
|
||||
delegate :description, to: :object
|
||||
delegate :name, to: :object
|
||||
|
||||
delegate :description, to: :object
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
class Api::Admin::ColumnPreferenceSerializer < ActiveModel::Serializer
|
||||
attributes :id, :user_id, :action_name, :column_name, :name, :visible
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Api
|
||||
module Admin
|
||||
class ColumnPreferenceSerializer < ActiveModel::Serializer
|
||||
attributes :id, :user_id, :action_name, :column_name, :name, :visible
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,36 +1,61 @@
|
||||
class Api::Admin::CustomerSerializer < ActiveModel::Serializer
|
||||
attributes :id, :email, :enterprise_id, :user_id, :code, :tags, :tag_list, :name,
|
||||
:allow_charges, :default_card_present?
|
||||
# frozen_string_literal: true
|
||||
|
||||
has_one :ship_address, serializer: Api::AddressSerializer
|
||||
has_one :bill_address, serializer: Api::AddressSerializer
|
||||
module Api
|
||||
module Admin
|
||||
class CustomerSerializer < ActiveModel::Serializer
|
||||
attributes :id, :email, :enterprise_id, :user_id, :code, :tags, :tag_list, :name,
|
||||
:allow_charges, :default_card_present?, :balance, :balance_status
|
||||
|
||||
def tag_list
|
||||
customer_tag_list.join(",")
|
||||
end
|
||||
has_one :ship_address, serializer: Api::AddressSerializer
|
||||
has_one :bill_address, serializer: Api::AddressSerializer
|
||||
|
||||
def name
|
||||
object.name.presence || object.bill_address.andand.full_name
|
||||
end
|
||||
def name
|
||||
object.name.presence || object.bill_address.andand.full_name
|
||||
end
|
||||
|
||||
def tags
|
||||
customer_tag_list.map do |tag|
|
||||
tag_rule_map = options[:tag_rule_mapping].andand[tag]
|
||||
tag_rule_map || { text: tag, rules: nil }
|
||||
def tag_list
|
||||
customer_tag_list.join(",")
|
||||
end
|
||||
|
||||
def balance
|
||||
Spree::Money.new(balance_value, currency: Spree::Config[:currency]).to_s
|
||||
end
|
||||
|
||||
def balance_status
|
||||
if balance_value.positive?
|
||||
"credit_owed"
|
||||
elsif balance_value.negative?
|
||||
"balance_due"
|
||||
else
|
||||
""
|
||||
end
|
||||
end
|
||||
|
||||
def tags
|
||||
customer_tag_list.map do |tag|
|
||||
tag_rule_map = options[:tag_rule_mapping].andand[tag]
|
||||
tag_rule_map || { text: tag, rules: nil }
|
||||
end
|
||||
end
|
||||
|
||||
def default_card_present?
|
||||
return unless object.user
|
||||
|
||||
object.user.default_card.present?
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def customer_tag_list
|
||||
return object.tag_list unless options[:customer_tags]
|
||||
|
||||
options[:customer_tags].andand[object.id] || []
|
||||
end
|
||||
|
||||
def balance_value
|
||||
@balance_value ||=
|
||||
OpenFoodNetwork::UserBalanceCalculator.new(object.email, object.enterprise).balance
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def default_card_present?
|
||||
return unless object.user
|
||||
|
||||
object.user.default_card.present?
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def customer_tag_list
|
||||
return object.tag_list unless options[:customer_tags]
|
||||
|
||||
options[:customer_tags].andand[object.id] || []
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,26 +1,32 @@
|
||||
class Api::Admin::EnterpriseFeeSerializer < ActiveModel::Serializer
|
||||
attributes :id, :enterprise_id, :fee_type, :name, :tax_category_id, :inherits_tax_category,
|
||||
:calculator_type, :enterprise_name, :calculator_description, :calculator_settings
|
||||
# frozen_string_literal: true
|
||||
|
||||
def enterprise_name
|
||||
object.enterprise.andand.name
|
||||
end
|
||||
module Api
|
||||
module Admin
|
||||
class EnterpriseFeeSerializer < ActiveModel::Serializer
|
||||
attributes :id, :enterprise_id, :fee_type, :name, :tax_category_id, :inherits_tax_category,
|
||||
:calculator_type, :enterprise_name, :calculator_description, :calculator_settings
|
||||
|
||||
def calculator_description
|
||||
object.calculator.andand.description
|
||||
end
|
||||
def enterprise_name
|
||||
object.enterprise.andand.name
|
||||
end
|
||||
|
||||
def calculator_settings
|
||||
return nil unless options[:include_calculators]
|
||||
def calculator_description
|
||||
object.calculator.andand.description
|
||||
end
|
||||
|
||||
result = nil
|
||||
def calculator_settings
|
||||
return nil unless options[:include_calculators]
|
||||
|
||||
options[:controller].__send__(:with_format, :html) do
|
||||
result = options[:controller].
|
||||
render_to_string(partial: 'admin/enterprise_fees/calculator_settings',
|
||||
locals: { enterprise_fee: object })
|
||||
result = nil
|
||||
|
||||
options[:controller].__send__(:with_format, :html) do
|
||||
result = options[:controller].
|
||||
render_to_string(partial: 'admin/enterprise_fees/calculator_settings',
|
||||
locals: { enterprise_fee: object })
|
||||
end
|
||||
|
||||
result.gsub('[0]', '[{{ $index }}]').gsub('_0_', '_{{ $index }}_')
|
||||
end
|
||||
end
|
||||
|
||||
result.gsub('[0]', '[{{ $index }}]').gsub('_0_', '_{{ $index }}_')
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
class Api::Admin::EnterpriseRelationshipPermissionSerializer < ActiveModel::Serializer
|
||||
attributes :id, :name
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Api
|
||||
module Admin
|
||||
class EnterpriseRelationshipPermissionSerializer < ActiveModel::Serializer
|
||||
attributes :id, :name
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,13 +1,19 @@
|
||||
class Api::Admin::EnterpriseRelationshipSerializer < ActiveModel::Serializer
|
||||
attributes :id, :parent_id, :parent_name, :child_id, :child_name
|
||||
# frozen_string_literal: true
|
||||
|
||||
has_many :permissions
|
||||
module Api
|
||||
module Admin
|
||||
class EnterpriseRelationshipSerializer < ActiveModel::Serializer
|
||||
attributes :id, :parent_id, :parent_name, :child_id, :child_name
|
||||
|
||||
def parent_name
|
||||
object.parent.name
|
||||
end
|
||||
has_many :permissions
|
||||
|
||||
def child_name
|
||||
object.child.name
|
||||
def parent_name
|
||||
object.parent.name
|
||||
end
|
||||
|
||||
def child_name
|
||||
object.child.name
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,11 +1,17 @@
|
||||
class Api::Admin::EnterpriseRoleSerializer < ActiveModel::Serializer
|
||||
attributes :id, :user_id, :enterprise_id, :user_email, :enterprise_name
|
||||
# frozen_string_literal: true
|
||||
|
||||
def user_email
|
||||
object.user.email
|
||||
end
|
||||
module Api
|
||||
module Admin
|
||||
class EnterpriseRoleSerializer < ActiveModel::Serializer
|
||||
attributes :id, :user_id, :enterprise_id, :user_email, :enterprise_name
|
||||
|
||||
def enterprise_name
|
||||
object.enterprise.name
|
||||
def user_email
|
||||
object.user.email
|
||||
end
|
||||
|
||||
def enterprise_name
|
||||
object.enterprise.name
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,77 +1,92 @@
|
||||
class Api::Admin::EnterpriseSerializer < ActiveModel::Serializer
|
||||
attributes :name, :id, :is_primary_producer, :is_distributor, :sells, :category, :permalink,
|
||||
:payment_method_ids, :shipping_method_ids, :producer_profile_only, :long_description,
|
||||
:preferred_shopfront_message, :preferred_shopfront_closed_message,
|
||||
:preferred_shopfront_taxon_order, :preferred_shopfront_order_cycle_order,
|
||||
:preferred_product_selection_from_inventory_only,
|
||||
:preferred_show_customer_names_to_suppliers, :owner, :contact, :users, :tag_groups,
|
||||
:default_tag_group, :require_login, :allow_guest_orders, :allow_order_changes,
|
||||
:logo, :promo_image, :terms_and_conditions, :terms_and_conditions_file_name
|
||||
# frozen_string_literal: true
|
||||
|
||||
has_one :owner, serializer: Api::Admin::UserSerializer
|
||||
has_many :users, serializer: Api::Admin::UserSerializer
|
||||
has_one :address, serializer: Api::AddressSerializer
|
||||
module Api
|
||||
module Admin
|
||||
class EnterpriseSerializer < ActiveModel::Serializer
|
||||
attributes :name, :id, :is_primary_producer, :is_distributor, :sells, :category, :permalink,
|
||||
:payment_method_ids, :shipping_method_ids, :producer_profile_only,
|
||||
:long_description, :preferred_product_selection_from_inventory_only,
|
||||
:preferred_shopfront_message, :preferred_shopfront_closed_message,
|
||||
:preferred_shopfront_taxon_order, :preferred_shopfront_order_cycle_order,
|
||||
:preferred_show_customer_names_to_suppliers, :owner, :contact, :users, :tag_groups,
|
||||
:default_tag_group, :require_login, :allow_guest_orders, :allow_order_changes,
|
||||
:logo, :promo_image, :terms_and_conditions,
|
||||
:terms_and_conditions_file_name, :terms_and_conditions_updated_at
|
||||
|
||||
def logo
|
||||
attachment_urls(object.logo, [:thumb, :small, :medium])
|
||||
end
|
||||
has_one :owner, serializer: Api::Admin::UserSerializer
|
||||
has_many :users, serializer: Api::Admin::UserSerializer
|
||||
has_one :address, serializer: Api::AddressSerializer
|
||||
|
||||
def promo_image
|
||||
attachment_urls(object.promo_image, [:thumb, :medium, :large])
|
||||
end
|
||||
|
||||
def terms_and_conditions
|
||||
return unless @object.terms_and_conditions.file?
|
||||
|
||||
@object.terms_and_conditions.url
|
||||
end
|
||||
|
||||
def tag_groups
|
||||
object.tag_rules.prioritised.reject(&:is_default).each_with_object([]) do |tag_rule, tag_groups|
|
||||
tag_group = find_match(tag_groups, tag_rule.preferred_customer_tags.
|
||||
split(",").
|
||||
map{ |t| { text: t } })
|
||||
if tag_group[:rules].blank?
|
||||
tag_groups << tag_group
|
||||
tag_group[:position] = tag_groups.count
|
||||
def logo
|
||||
attachment_urls(object.logo, [:thumb, :small, :medium])
|
||||
end
|
||||
tag_group[:rules] << Api::Admin::TagRuleSerializer.new(tag_rule).serializable_hash
|
||||
end
|
||||
end
|
||||
|
||||
def default_tag_group
|
||||
default_rules = object.tag_rules.select(&:is_default)
|
||||
serialized_rules =
|
||||
ActiveModel::ArraySerializer.new(default_rules,
|
||||
each_serializer: Api::Admin::TagRuleSerializer)
|
||||
{ tags: [], rules: serialized_rules }
|
||||
end
|
||||
def promo_image
|
||||
attachment_urls(object.promo_image, [:thumb, :medium, :large])
|
||||
end
|
||||
|
||||
def find_match(tag_groups, tags)
|
||||
tag_groups.each do |tag_group|
|
||||
return tag_group if tag_group[:tags].length == tags.length &&
|
||||
(tag_group[:tags] & tags) == tag_group[:tags]
|
||||
end
|
||||
{ tags: tags, rules: [] }
|
||||
end
|
||||
def terms_and_conditions
|
||||
return unless object.terms_and_conditions.file?
|
||||
|
||||
private
|
||||
object.terms_and_conditions.url
|
||||
end
|
||||
|
||||
# Returns a hash of URLs for specified versions of an attachment.
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# attachment_urls(object.logo, [:thumb, :small, :medium])
|
||||
# # {
|
||||
# # thumb: LOGO_THUMB_URL,
|
||||
# # small: LOGO_SMALL_URL,
|
||||
# # medium: LOGO_MEDIUM_URL
|
||||
# # }
|
||||
def attachment_urls(attachment, versions)
|
||||
return unless attachment.file?
|
||||
def terms_and_conditions_updated_at
|
||||
object.terms_and_conditions_updated_at&.to_s
|
||||
end
|
||||
|
||||
versions.each_with_object({}) do |version, urls|
|
||||
urls[version] = attachment.url(version)
|
||||
def tag_groups
|
||||
prioritized_tag_rules.each_with_object([]) do |tag_rule, tag_groups|
|
||||
tag_group = find_match(tag_groups, tag_rule.preferred_customer_tags.
|
||||
split(",").
|
||||
map{ |t| { text: t } })
|
||||
if tag_group[:rules].blank?
|
||||
tag_groups << tag_group
|
||||
tag_group[:position] = tag_groups.count
|
||||
end
|
||||
tag_group[:rules] << Api::Admin::TagRuleSerializer.new(tag_rule).serializable_hash
|
||||
end
|
||||
end
|
||||
|
||||
def default_tag_group
|
||||
default_rules = object.tag_rules.select(&:is_default)
|
||||
serialized_rules =
|
||||
ActiveModel::ArraySerializer.new(default_rules,
|
||||
each_serializer: Api::Admin::TagRuleSerializer)
|
||||
{ tags: [], rules: serialized_rules }
|
||||
end
|
||||
|
||||
def find_match(tag_groups, tags)
|
||||
tag_groups.each do |tag_group|
|
||||
return tag_group if tag_group[:tags].length == tags.length &&
|
||||
(tag_group[:tags] & tags) == tag_group[:tags]
|
||||
end
|
||||
{ tags: tags, rules: [] }
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def prioritized_tag_rules
|
||||
object.tag_rules.prioritised.reject(&:is_default)
|
||||
end
|
||||
|
||||
# Returns a hash of URLs for specified versions of an attachment.
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# attachment_urls(object.logo, [:thumb, :small, :medium])
|
||||
# # {
|
||||
# # thumb: LOGO_THUMB_URL,
|
||||
# # small: LOGO_SMALL_URL,
|
||||
# # medium: LOGO_MEDIUM_URL
|
||||
# # }
|
||||
def attachment_urls(attachment, versions)
|
||||
return unless attachment.file?
|
||||
|
||||
versions.each_with_object({}) do |version, urls|
|
||||
urls[version] = attachment.url(version)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,48 +1,54 @@
|
||||
class Api::Admin::ExchangeSerializer < ActiveModel::Serializer
|
||||
attributes :id, :sender_id, :receiver_id, :incoming, :variants,
|
||||
:receival_instructions, :pickup_time, :pickup_instructions,
|
||||
:tags, :tag_list
|
||||
# frozen_string_literal: true
|
||||
|
||||
has_many :enterprise_fees, serializer: Api::Admin::BasicEnterpriseFeeSerializer
|
||||
module Api
|
||||
module Admin
|
||||
class ExchangeSerializer < ActiveModel::Serializer
|
||||
attributes :id, :sender_id, :receiver_id, :incoming, :variants,
|
||||
:receival_instructions, :pickup_time, :pickup_instructions,
|
||||
:tags, :tag_list
|
||||
|
||||
def variants
|
||||
variants = object.incoming? ? visible_incoming_variants : visible_outgoing_variants
|
||||
Hash[object.variants.merge(variants).map { |v| [v.id, true] }]
|
||||
end
|
||||
has_many :enterprise_fees, serializer: Api::Admin::BasicEnterpriseFeeSerializer
|
||||
|
||||
private
|
||||
def variants
|
||||
variants = object.incoming? ? visible_incoming_variants : visible_outgoing_variants
|
||||
Hash[object.variants.merge(variants).map { |v| [v.id, true] }]
|
||||
end
|
||||
|
||||
def visible_incoming_variants
|
||||
if object.order_cycle.prefers_product_selection_from_coordinator_inventory_only?
|
||||
permitted_incoming_variants.visible_for(object.order_cycle.coordinator)
|
||||
else
|
||||
permitted_incoming_variants
|
||||
private
|
||||
|
||||
def visible_incoming_variants
|
||||
if object.order_cycle.prefers_product_selection_from_coordinator_inventory_only?
|
||||
permitted_incoming_variants.visible_for(object.order_cycle.coordinator)
|
||||
else
|
||||
permitted_incoming_variants
|
||||
end
|
||||
end
|
||||
|
||||
def visible_outgoing_variants
|
||||
if object.receiver.prefers_product_selection_from_inventory_only?
|
||||
permitted_outgoing_variants.visible_for(object.receiver)
|
||||
else
|
||||
permitted_outgoing_variants.not_hidden_for(object.receiver)
|
||||
end
|
||||
end
|
||||
|
||||
def permitted_incoming_variants
|
||||
OpenFoodNetwork::OrderCyclePermissions.new(options[:current_user], object.order_cycle).
|
||||
visible_variants_for_incoming_exchanges_from(object.sender)
|
||||
end
|
||||
|
||||
def permitted_outgoing_variants
|
||||
OpenFoodNetwork::OrderCyclePermissions.new(options[:current_user], object.order_cycle)
|
||||
.visible_variants_for_outgoing_exchanges_to(object.receiver)
|
||||
end
|
||||
|
||||
def tag_list
|
||||
object.tag_list.join(",")
|
||||
end
|
||||
|
||||
def tags
|
||||
object.tag_list.map{ |t| { text: t } }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def visible_outgoing_variants
|
||||
if object.receiver.prefers_product_selection_from_inventory_only?
|
||||
permitted_outgoing_variants.visible_for(object.receiver)
|
||||
else
|
||||
permitted_outgoing_variants.not_hidden_for(object.receiver)
|
||||
end
|
||||
end
|
||||
|
||||
def permitted_incoming_variants
|
||||
OpenFoodNetwork::OrderCyclePermissions.new(options[:current_user], object.order_cycle).
|
||||
visible_variants_for_incoming_exchanges_from(object.sender)
|
||||
end
|
||||
|
||||
def permitted_outgoing_variants
|
||||
OpenFoodNetwork::OrderCyclePermissions.new(options[:current_user], object.order_cycle)
|
||||
.visible_variants_for_outgoing_exchanges_to(object.receiver)
|
||||
end
|
||||
|
||||
def tag_list
|
||||
object.tag_list.join(",")
|
||||
end
|
||||
|
||||
def tags
|
||||
object.tag_list.map{ |t| { text: t } }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,46 +1,54 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'open_food_network/enterprise_issue_validator'
|
||||
|
||||
class Api::Admin::ForOrderCycle::EnterpriseSerializer < ActiveModel::Serializer
|
||||
attributes :id, :name, :managed,
|
||||
:issues_summary_supplier, :issues_summary_distributor,
|
||||
:is_primary_producer, :is_distributor, :sells
|
||||
module Api
|
||||
module Admin
|
||||
module ForOrderCycle
|
||||
class EnterpriseSerializer < ActiveModel::Serializer
|
||||
attributes :id, :name, :managed,
|
||||
:issues_summary_supplier, :issues_summary_distributor,
|
||||
:is_primary_producer, :is_distributor, :sells
|
||||
|
||||
def issues_summary_supplier
|
||||
issues =
|
||||
OpenFoodNetwork::EnterpriseIssueValidator.
|
||||
new(object).
|
||||
issues_summary(confirmation_only: true)
|
||||
def issues_summary_supplier
|
||||
issues =
|
||||
OpenFoodNetwork::EnterpriseIssueValidator.
|
||||
new(object).
|
||||
issues_summary(confirmation_only: true)
|
||||
|
||||
if issues.nil? && products.empty?
|
||||
issues = "no products in inventory"
|
||||
if issues.nil? && products.empty?
|
||||
issues = "no products in inventory"
|
||||
end
|
||||
issues
|
||||
end
|
||||
|
||||
def issues_summary_distributor
|
||||
OpenFoodNetwork::EnterpriseIssueValidator.new(object).issues_summary
|
||||
end
|
||||
|
||||
def managed
|
||||
Enterprise.managed_by(options[:spree_current_user]).include? object
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def products_scope
|
||||
products_relation = object.supplied_products
|
||||
if order_cycle.prefers_product_selection_from_coordinator_inventory_only?
|
||||
products_relation = products_relation.
|
||||
visible_for(order_cycle.coordinator)
|
||||
end
|
||||
products_relation
|
||||
end
|
||||
|
||||
def products
|
||||
@products ||= products_scope
|
||||
end
|
||||
|
||||
def order_cycle
|
||||
options[:order_cycle]
|
||||
end
|
||||
end
|
||||
end
|
||||
issues
|
||||
end
|
||||
|
||||
def issues_summary_distributor
|
||||
OpenFoodNetwork::EnterpriseIssueValidator.new(object).issues_summary
|
||||
end
|
||||
|
||||
def managed
|
||||
Enterprise.managed_by(options[:spree_current_user]).include? object
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def products_scope
|
||||
products_relation = object.supplied_products
|
||||
if order_cycle.prefers_product_selection_from_coordinator_inventory_only?
|
||||
products_relation = products_relation.
|
||||
visible_for(order_cycle.coordinator)
|
||||
end
|
||||
products_relation
|
||||
end
|
||||
|
||||
def products
|
||||
@products ||= products_scope
|
||||
end
|
||||
|
||||
def order_cycle
|
||||
options[:order_cycle]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,31 +1,39 @@
|
||||
class Api::Admin::ForOrderCycle::SuppliedProductSerializer < ActiveModel::Serializer
|
||||
attributes :name, :supplier_name, :image_url, :master_id, :variants
|
||||
# frozen_string_literal: true
|
||||
|
||||
def supplier_name
|
||||
object.supplier.andand.name
|
||||
end
|
||||
module Api
|
||||
module Admin
|
||||
module ForOrderCycle
|
||||
class SuppliedProductSerializer < ActiveModel::Serializer
|
||||
attributes :name, :supplier_name, :image_url, :master_id, :variants
|
||||
|
||||
def image_url
|
||||
object.images.present? ? object.images.first.attachment.url(:mini) : nil
|
||||
end
|
||||
def supplier_name
|
||||
object.supplier.andand.name
|
||||
end
|
||||
|
||||
def master_id
|
||||
object.master.id
|
||||
end
|
||||
def image_url
|
||||
object.images.present? ? object.images.first.attachment.url(:mini) : nil
|
||||
end
|
||||
|
||||
def variants
|
||||
variants = if order_cycle.present? &&
|
||||
order_cycle.prefers_product_selection_from_coordinator_inventory_only?
|
||||
object.variants.visible_for(order_cycle.coordinator)
|
||||
else
|
||||
object.variants
|
||||
end
|
||||
variants.map { |variant| { id: variant.id, label: variant.full_name } }
|
||||
end
|
||||
def master_id
|
||||
object.master.id
|
||||
end
|
||||
|
||||
private
|
||||
def variants
|
||||
variants = if order_cycle.present? &&
|
||||
order_cycle.prefers_product_selection_from_coordinator_inventory_only?
|
||||
object.variants.visible_for(order_cycle.coordinator)
|
||||
else
|
||||
object.variants
|
||||
end
|
||||
variants.map { |variant| { id: variant.id, label: variant.full_name } }
|
||||
end
|
||||
|
||||
def order_cycle
|
||||
options[:order_cycle]
|
||||
private
|
||||
|
||||
def order_cycle
|
||||
options[:order_cycle]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Api
|
||||
module Admin
|
||||
class IdEmailSerializer < ActiveModel::Serializer
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
class Api::Admin::IdNameSerializer < ActiveModel::Serializer
|
||||
attributes :id, :name
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Api
|
||||
module Admin
|
||||
class IdNameSerializer < ActiveModel::Serializer
|
||||
attributes :id, :name
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
class Api::Admin::IdSerializer < ActiveModel::Serializer
|
||||
attributes :id
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Api
|
||||
module Admin
|
||||
class IdSerializer < ActiveModel::Serializer
|
||||
attributes :id
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,24 +1,30 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'open_food_network/enterprise_issue_validator'
|
||||
|
||||
class Api::Admin::IndexEnterpriseSerializer < ActiveModel::Serializer
|
||||
attributes :name, :id, :permalink, :is_primary_producer, :sells, :producer_profile_only, :owned,
|
||||
:edit_path, :issues, :warnings
|
||||
module Api
|
||||
module Admin
|
||||
class IndexEnterpriseSerializer < ActiveModel::Serializer
|
||||
attributes :name, :id, :permalink, :is_primary_producer, :sells,
|
||||
:producer_profile_only, :owned, :edit_path, :issues, :warnings
|
||||
|
||||
def owned
|
||||
return true if options[:spree_current_user].admin?
|
||||
def owned
|
||||
return true if options[:spree_current_user].admin?
|
||||
|
||||
object.owner == options[:spree_current_user]
|
||||
end
|
||||
object.owner == options[:spree_current_user]
|
||||
end
|
||||
|
||||
def edit_path
|
||||
edit_admin_enterprise_path(object)
|
||||
end
|
||||
def edit_path
|
||||
edit_admin_enterprise_path(object)
|
||||
end
|
||||
|
||||
def issues
|
||||
OpenFoodNetwork::EnterpriseIssueValidator.new(object).issues
|
||||
end
|
||||
def issues
|
||||
OpenFoodNetwork::EnterpriseIssueValidator.new(object).issues
|
||||
end
|
||||
|
||||
def warnings
|
||||
OpenFoodNetwork::EnterpriseIssueValidator.new(object).warnings
|
||||
def warnings
|
||||
OpenFoodNetwork::EnterpriseIssueValidator.new(object).warnings
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'open_food_network/order_cycle_permissions'
|
||||
|
||||
module Api
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
class Api::Admin::InventoryItemSerializer < ActiveModel::Serializer
|
||||
attributes :id, :enterprise_id, :variant_id, :visible
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Api
|
||||
module Admin
|
||||
class InventoryItemSerializer < ActiveModel::Serializer
|
||||
attributes :id, :enterprise_id, :variant_id, :visible
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,29 +1,35 @@
|
||||
class Api::Admin::LineItemSerializer < ActiveModel::Serializer
|
||||
attributes :id, :quantity, :max_quantity, :price, :supplier, :final_weight_volume,
|
||||
:units_product, :units_variant
|
||||
# frozen_string_literal: true
|
||||
|
||||
has_one :order, serializer: Api::Admin::IdSerializer
|
||||
module Api
|
||||
module Admin
|
||||
class LineItemSerializer < ActiveModel::Serializer
|
||||
attributes :id, :quantity, :max_quantity, :price, :supplier, :final_weight_volume,
|
||||
:units_product, :units_variant
|
||||
|
||||
def supplier
|
||||
{ id: object.product.supplier_id }
|
||||
end
|
||||
has_one :order, serializer: Api::Admin::IdSerializer
|
||||
|
||||
def units_product
|
||||
Api::Admin::UnitsProductSerializer.new(object.product).serializable_hash
|
||||
end
|
||||
def supplier
|
||||
{ id: object.product.supplier_id }
|
||||
end
|
||||
|
||||
def units_variant
|
||||
Api::Admin::UnitsVariantSerializer.new(object.variant).serializable_hash
|
||||
end
|
||||
def units_product
|
||||
Api::Admin::UnitsProductSerializer.new(object.product).serializable_hash
|
||||
end
|
||||
|
||||
def final_weight_volume
|
||||
object.final_weight_volume.to_f
|
||||
end
|
||||
def units_variant
|
||||
Api::Admin::UnitsVariantSerializer.new(object.variant).serializable_hash
|
||||
end
|
||||
|
||||
def max_quantity
|
||||
return object.quantity unless object.max_quantity.present? &&
|
||||
object.max_quantity > object.quantity
|
||||
def final_weight_volume
|
||||
object.final_weight_volume.to_f
|
||||
end
|
||||
|
||||
object.max_quantity
|
||||
def max_quantity
|
||||
return object.quantity unless object.max_quantity.present? &&
|
||||
object.max_quantity > object.quantity
|
||||
|
||||
object.max_quantity
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,88 +1,95 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'open_food_network/order_cycle_permissions'
|
||||
|
||||
class Api::Admin::OrderCycleSerializer < ActiveModel::Serializer
|
||||
attributes :id, :name, :orders_open_at, :orders_close_at, :coordinator_id, :exchanges,
|
||||
:editable_variants_for_incoming_exchanges, :editable_variants_for_outgoing_exchanges,
|
||||
:visible_variants_for_outgoing_exchanges,
|
||||
:viewing_as_coordinator, :schedule_ids, :subscriptions_count
|
||||
module Api
|
||||
module Admin
|
||||
class OrderCycleSerializer < ActiveModel::Serializer
|
||||
attributes :id, :name, :orders_open_at, :orders_close_at, :coordinator_id, :exchanges,
|
||||
:editable_variants_for_incoming_exchanges,
|
||||
:editable_variants_for_outgoing_exchanges,
|
||||
:visible_variants_for_outgoing_exchanges,
|
||||
:viewing_as_coordinator, :schedule_ids, :subscriptions_count
|
||||
|
||||
has_many :coordinator_fees, serializer: Api::IdSerializer
|
||||
has_many :coordinator_fees, serializer: Api::IdSerializer
|
||||
|
||||
def orders_open_at
|
||||
object.orders_open_at.to_s
|
||||
end
|
||||
def orders_open_at
|
||||
object.orders_open_at.to_s
|
||||
end
|
||||
|
||||
def orders_close_at
|
||||
object.orders_close_at.to_s
|
||||
end
|
||||
def orders_close_at
|
||||
object.orders_close_at.to_s
|
||||
end
|
||||
|
||||
def viewing_as_coordinator
|
||||
Enterprise.managed_by(options[:current_user]).include? object.coordinator
|
||||
end
|
||||
def viewing_as_coordinator
|
||||
Enterprise.managed_by(options[:current_user]).include? object.coordinator
|
||||
end
|
||||
|
||||
def subscriptions_count
|
||||
ProxyOrder.not_canceled.where(order_cycle_id: object.id).count
|
||||
end
|
||||
def subscriptions_count
|
||||
ProxyOrder.not_canceled.where(order_cycle_id: object.id).count
|
||||
end
|
||||
|
||||
def exchanges
|
||||
scoped_exchanges = permissions.visible_exchanges.by_enterprise_name
|
||||
def exchanges
|
||||
scoped_exchanges = permissions.visible_exchanges.by_enterprise_name
|
||||
|
||||
ActiveModel::ArraySerializer.
|
||||
new(scoped_exchanges, each_serializer: Api::Admin::ExchangeSerializer,
|
||||
current_user: options[:current_user])
|
||||
end
|
||||
ActiveModel::ArraySerializer.
|
||||
new(scoped_exchanges, each_serializer: Api::Admin::ExchangeSerializer,
|
||||
current_user: options[:current_user])
|
||||
end
|
||||
|
||||
def editable_variants_for_incoming_exchanges
|
||||
variant_ids_by_supplier_id(permissions.all_incoming_editable_variants.all)
|
||||
end
|
||||
def editable_variants_for_incoming_exchanges
|
||||
variant_ids_by_supplier_id(permissions.all_incoming_editable_variants.all)
|
||||
end
|
||||
|
||||
def editable_variants_for_outgoing_exchanges
|
||||
# For each enterprise that the current user is able to see in this order cycle,
|
||||
# work out which variants should be editable within incoming exchanges from that enterprise
|
||||
editable = {}
|
||||
visible_enterprises.each do |enterprise|
|
||||
variants = permissions.editable_variants_for_outgoing_exchanges_to(enterprise).pluck(:id)
|
||||
editable[enterprise.id] = variants if variants.any?
|
||||
end
|
||||
editable
|
||||
end
|
||||
def editable_variants_for_outgoing_exchanges
|
||||
# For each enterprise that the current user is able to see in this order cycle,
|
||||
# work out which variants should be editable within incoming exchanges from that enterprise
|
||||
editable = {}
|
||||
visible_enterprises.each do |enterprise|
|
||||
variants = permissions.editable_variants_for_outgoing_exchanges_to(enterprise).pluck(:id)
|
||||
editable[enterprise.id] = variants if variants.any?
|
||||
end
|
||||
editable
|
||||
end
|
||||
|
||||
def visible_variants_for_outgoing_exchanges
|
||||
# For each enterprise that the current user is able to see in this order cycle,
|
||||
# work out which variants should be visible within outgoing exchanges from that enterprise
|
||||
visible = {}
|
||||
visible_enterprises.each do |enterprise|
|
||||
# This is hopefully a temporary measure, pending the arrival of multiple named inventories
|
||||
# for shops. We need this here to allow hubs to restrict visible variants to only those in
|
||||
# their inventory if they so choose
|
||||
variants = if enterprise.prefers_product_selection_from_inventory_only?
|
||||
permissions.
|
||||
visible_variants_for_outgoing_exchanges_to(enterprise).
|
||||
visible_for(enterprise)
|
||||
else
|
||||
permissions.
|
||||
visible_variants_for_outgoing_exchanges_to(enterprise).
|
||||
not_hidden_for(enterprise)
|
||||
end.pluck(:id)
|
||||
visible[enterprise.id] = variants if variants.any?
|
||||
end
|
||||
visible
|
||||
end
|
||||
def visible_variants_for_outgoing_exchanges
|
||||
# For each enterprise that the current user is able to see in this order cycle,
|
||||
# work out which variants should be visible within outgoing exchanges from that enterprise
|
||||
visible = {}
|
||||
visible_enterprises.each do |enterprise|
|
||||
# This is hopefully a temporary measure, pending the arrival of multiple named inventories
|
||||
# for shops. We need this here to allow hubs to restrict visible variants to only those in
|
||||
# their inventory if they so choose
|
||||
variants = if enterprise.prefers_product_selection_from_inventory_only?
|
||||
permissions.
|
||||
visible_variants_for_outgoing_exchanges_to(enterprise).
|
||||
visible_for(enterprise)
|
||||
else
|
||||
permissions.
|
||||
visible_variants_for_outgoing_exchanges_to(enterprise).
|
||||
not_hidden_for(enterprise)
|
||||
end.pluck(:id)
|
||||
visible[enterprise.id] = variants if variants.any?
|
||||
end
|
||||
visible
|
||||
end
|
||||
|
||||
private
|
||||
private
|
||||
|
||||
def permissions
|
||||
@permissions ||= OpenFoodNetwork::OrderCyclePermissions.new(options[:current_user], object)
|
||||
end
|
||||
def permissions
|
||||
@permissions ||= OpenFoodNetwork::OrderCyclePermissions.new(options[:current_user], object)
|
||||
end
|
||||
|
||||
def visible_enterprises
|
||||
@visible_enterprises ||= permissions.visible_enterprises
|
||||
end
|
||||
def visible_enterprises
|
||||
@visible_enterprises ||= permissions.visible_enterprises
|
||||
end
|
||||
|
||||
def variant_ids_by_supplier_id(variants)
|
||||
grouped_by_supplier = variants.group_by(&:supplier_id)
|
||||
grouped_by_supplier.each do |supplier_id, grouped_variants|
|
||||
grouped_by_supplier[supplier_id] = grouped_variants.map(&:id)
|
||||
def variant_ids_by_supplier_id(variants)
|
||||
grouped_by_supplier = variants.group_by(&:supplier_id)
|
||||
grouped_by_supplier.each do |supplier_id, grouped_variants|
|
||||
grouped_by_supplier[supplier_id] = grouped_variants.map(&:id)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,71 +1,77 @@
|
||||
class Api::Admin::OrderSerializer < ActiveModel::Serializer
|
||||
attributes :id, :number, :user_id, :full_name, :email, :phone, :completed_at, :display_total,
|
||||
:edit_path, :state, :payment_state, :shipment_state,
|
||||
:payments_path, :ready_to_ship, :ready_to_capture, :created_at,
|
||||
:distributor_name, :special_instructions,
|
||||
:item_total, :adjustment_total, :payment_total, :total, :display_outstanding_balance
|
||||
# frozen_string_literal: true
|
||||
|
||||
has_one :distributor, serializer: Api::Admin::IdSerializer
|
||||
has_one :order_cycle, serializer: Api::Admin::IdSerializer
|
||||
module Api
|
||||
module Admin
|
||||
class OrderSerializer < ActiveModel::Serializer
|
||||
attributes :id, :number, :user_id, :full_name, :email, :phone, :completed_at, :display_total,
|
||||
:edit_path, :state, :payment_state, :shipment_state,
|
||||
:payments_path, :ready_to_ship, :ready_to_capture, :created_at,
|
||||
:distributor_name, :special_instructions, :display_outstanding_balance,
|
||||
:item_total, :adjustment_total, :payment_total, :total
|
||||
|
||||
def full_name
|
||||
object.billing_address.nil? ? "" : ( object.billing_address.full_name || "" )
|
||||
end
|
||||
has_one :distributor, serializer: Api::Admin::IdSerializer
|
||||
has_one :order_cycle, serializer: Api::Admin::IdSerializer
|
||||
|
||||
def distributor_name
|
||||
object.distributor.andand.name
|
||||
end
|
||||
def full_name
|
||||
object.billing_address.nil? ? "" : ( object.billing_address.full_name || "" )
|
||||
end
|
||||
|
||||
def display_outstanding_balance
|
||||
return "" if object.outstanding_balance.zero?
|
||||
def distributor_name
|
||||
object.distributor.andand.name
|
||||
end
|
||||
|
||||
object.display_outstanding_balance.to_s
|
||||
end
|
||||
def display_outstanding_balance
|
||||
return "" if object.outstanding_balance.zero?
|
||||
|
||||
def edit_path
|
||||
return '' unless object.id
|
||||
object.display_outstanding_balance.to_s
|
||||
end
|
||||
|
||||
spree_routes_helper.edit_admin_order_path(object)
|
||||
end
|
||||
def edit_path
|
||||
return '' unless object.id
|
||||
|
||||
def payments_path
|
||||
return '' unless object.payment_state
|
||||
spree_routes_helper.edit_admin_order_path(object)
|
||||
end
|
||||
|
||||
spree_routes_helper.admin_order_payments_path(object)
|
||||
end
|
||||
def payments_path
|
||||
return '' unless object.payment_state
|
||||
|
||||
def ready_to_capture
|
||||
pending_payment = object.pending_payments.first
|
||||
object.payment_required? && pending_payment
|
||||
end
|
||||
spree_routes_helper.admin_order_payments_path(object)
|
||||
end
|
||||
|
||||
def ready_to_ship
|
||||
object.ready_to_ship?
|
||||
end
|
||||
def ready_to_capture
|
||||
pending_payment = object.pending_payments.first
|
||||
object.payment_required? && pending_payment
|
||||
end
|
||||
|
||||
def display_total
|
||||
object.display_total.to_html
|
||||
end
|
||||
def ready_to_ship
|
||||
object.ready_to_ship?
|
||||
end
|
||||
|
||||
def email
|
||||
object.email || ""
|
||||
end
|
||||
def display_total
|
||||
object.display_total.to_html
|
||||
end
|
||||
|
||||
def phone
|
||||
object.billing_address.nil? ? "a" : ( object.billing_address.phone || "" )
|
||||
end
|
||||
def email
|
||||
object.email || ""
|
||||
end
|
||||
|
||||
def created_at
|
||||
object.created_at.blank? ? "" : I18n.l(object.created_at, format: '%B %d, %Y')
|
||||
end
|
||||
def phone
|
||||
object.billing_address.nil? ? "a" : ( object.billing_address.phone || "" )
|
||||
end
|
||||
|
||||
def completed_at
|
||||
object.completed_at.blank? ? "" : I18n.l(object.completed_at, format: '%B %d, %Y')
|
||||
end
|
||||
def created_at
|
||||
object.created_at.blank? ? "" : I18n.l(object.created_at, format: '%B %d, %Y')
|
||||
end
|
||||
|
||||
private
|
||||
def completed_at
|
||||
object.completed_at.blank? ? "" : I18n.l(object.completed_at, format: '%B %d, %Y')
|
||||
end
|
||||
|
||||
def spree_routes_helper
|
||||
Spree::Core::Engine.routes.url_helpers
|
||||
private
|
||||
|
||||
def spree_routes_helper
|
||||
Spree::Core::Engine.routes.url_helpers
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,13 +1,19 @@
|
||||
module Api::Admin::PaymentMethod
|
||||
class BaseSerializer < ActiveModel::Serializer
|
||||
attributes :id, :name, :type, :tag_list, :tags
|
||||
# frozen_string_literal: true
|
||||
|
||||
def tag_list
|
||||
object.tag_list.join(",")
|
||||
end
|
||||
module Api
|
||||
module Admin
|
||||
module PaymentMethod
|
||||
class BaseSerializer < ActiveModel::Serializer
|
||||
attributes :id, :name, :type, :tag_list, :tags
|
||||
|
||||
def tags
|
||||
object.tag_list.map{ |t| { text: t } }
|
||||
def tag_list
|
||||
object.tag_list.join(",")
|
||||
end
|
||||
|
||||
def tags
|
||||
object.tag_list.map{ |t| { text: t } }
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
module Api::Admin::PaymentMethod
|
||||
class StripeSerializer < BaseSerializer
|
||||
attributes :preferred_enterprise_id
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Api
|
||||
module Admin
|
||||
module PaymentMethod
|
||||
class StripeSerializer < BaseSerializer
|
||||
attributes :preferred_enterprise_id
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Api
|
||||
module Admin
|
||||
class PaymentMethodSerializer < ActiveModel::Serializer
|
||||
|
||||
@@ -1,44 +1,50 @@
|
||||
class Api::Admin::ProductSerializer < ActiveModel::Serializer
|
||||
attributes :id, :name, :sku, :variant_unit, :variant_unit_scale, :variant_unit_name,
|
||||
:inherits_properties, :on_hand, :price, :available_on, :permalink_live,
|
||||
:tax_category_id, :import_date, :image_url, :thumb_url
|
||||
# frozen_string_literal: true
|
||||
|
||||
has_one :supplier, key: :producer_id, embed: :id
|
||||
has_one :primary_taxon, key: :category_id, embed: :id
|
||||
has_many :variants, key: :variants, serializer: Api::Admin::VariantSerializer
|
||||
has_one :master, serializer: Api::Admin::VariantSerializer
|
||||
module Api
|
||||
module Admin
|
||||
class ProductSerializer < ActiveModel::Serializer
|
||||
attributes :id, :name, :sku, :variant_unit, :variant_unit_scale, :variant_unit_name,
|
||||
:inherits_properties, :on_hand, :price, :available_on, :permalink_live,
|
||||
:tax_category_id, :import_date, :image_url, :thumb_url
|
||||
|
||||
def image_url
|
||||
if object.images.present?
|
||||
object.images.first.attachment.url(:product)
|
||||
else
|
||||
"/noimage/product.png"
|
||||
has_one :supplier, key: :producer_id, embed: :id
|
||||
has_one :primary_taxon, key: :category_id, embed: :id
|
||||
has_many :variants, key: :variants, serializer: Api::Admin::VariantSerializer
|
||||
has_one :master, serializer: Api::Admin::VariantSerializer
|
||||
|
||||
def image_url
|
||||
if object.images.present?
|
||||
object.images.first.attachment.url(:product)
|
||||
else
|
||||
"/noimage/product.png"
|
||||
end
|
||||
end
|
||||
|
||||
def thumb_url
|
||||
if object.images.present?
|
||||
object.images.first.attachment.url(:mini)
|
||||
else
|
||||
"/noimage/mini.png"
|
||||
end
|
||||
end
|
||||
|
||||
def on_hand
|
||||
return 0 if object.on_hand.nil?
|
||||
|
||||
object.on_hand
|
||||
end
|
||||
|
||||
def price
|
||||
object.price.nil? ? '0.0' : object.price
|
||||
end
|
||||
|
||||
def available_on
|
||||
object.available_on.blank? ? "" : object.available_on.strftime("%F %T")
|
||||
end
|
||||
|
||||
def permalink_live
|
||||
object.permalink
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def thumb_url
|
||||
if object.images.present?
|
||||
object.images.first.attachment.url(:mini)
|
||||
else
|
||||
"/noimage/mini.png"
|
||||
end
|
||||
end
|
||||
|
||||
def on_hand
|
||||
return 0 if object.on_hand.nil?
|
||||
|
||||
object.on_hand
|
||||
end
|
||||
|
||||
def price
|
||||
object.price.nil? ? '0.0' : object.price
|
||||
end
|
||||
|
||||
def available_on
|
||||
object.available_on.blank? ? "" : object.available_on.strftime("%F %T")
|
||||
end
|
||||
|
||||
def permalink_live
|
||||
object.permalink
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Api
|
||||
module Admin
|
||||
class ProxyOrderSerializer < ActiveModel::Serializer
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Api
|
||||
module Admin
|
||||
class ScheduleSerializer < ActiveModel::Serializer
|
||||
|
||||
@@ -1,11 +1,17 @@
|
||||
class Api::Admin::ShippingMethodSerializer < ActiveModel::Serializer
|
||||
attributes :id, :name, :tag_list, :tags
|
||||
# frozen_string_literal: true
|
||||
|
||||
def tag_list
|
||||
object.tag_list.join(",")
|
||||
end
|
||||
module Api
|
||||
module Admin
|
||||
class ShippingMethodSerializer < ActiveModel::Serializer
|
||||
attributes :id, :name, :tag_list, :tags
|
||||
|
||||
def tags
|
||||
object.tag_list.map{ |t| { text: t } }
|
||||
def tag_list
|
||||
object.tag_list.join(",")
|
||||
end
|
||||
|
||||
def tags
|
||||
object.tag_list.map{ |t| { text: t } }
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Api
|
||||
module Admin
|
||||
# Used by admin subscription form
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Api
|
||||
module Admin
|
||||
class SubscriptionLineItemSerializer < ActiveModel::Serializer
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Api
|
||||
module Admin
|
||||
class SubscriptionSerializer < ActiveModel::Serializer
|
||||
|
||||
@@ -1,51 +1,63 @@
|
||||
class Api::Admin::TagRuleSerializer < ActiveModel::Serializer
|
||||
delegate :serializable_hash, to: :rule_specific_serializer
|
||||
# frozen_string_literal: true
|
||||
|
||||
def rule_specific_serializer
|
||||
"Api::Admin::#{object.class}Serializer".constantize.new(object)
|
||||
end
|
||||
end
|
||||
module Api
|
||||
module Admin
|
||||
class TagRuleSerializer < ActiveModel::Serializer
|
||||
delegate :serializable_hash, to: :rule_specific_serializer
|
||||
|
||||
module Api::Admin::TagRule
|
||||
class BaseSerializer < ActiveModel::Serializer
|
||||
attributes :id, :enterprise_id, :type, :is_default, :preferred_customer_tags
|
||||
end
|
||||
|
||||
class DiscountOrderSerializer < BaseSerializer
|
||||
has_one :calculator, serializer: Api::Admin::Calculator::FlatPercentItemTotalSerializer
|
||||
end
|
||||
|
||||
class FilterShippingMethodsSerializer < BaseSerializer
|
||||
attributes :preferred_matched_shipping_methods_visibility, :preferred_shipping_method_tags,
|
||||
:shipping_method_tags
|
||||
|
||||
def shipping_method_tags
|
||||
object.preferred_shipping_method_tags.split(",")
|
||||
end
|
||||
end
|
||||
|
||||
class FilterPaymentMethodsSerializer < BaseSerializer
|
||||
attributes :preferred_matched_payment_methods_visibility, :preferred_payment_method_tags,
|
||||
:payment_method_tags
|
||||
|
||||
def payment_method_tags
|
||||
object.preferred_payment_method_tags.split(",")
|
||||
end
|
||||
end
|
||||
|
||||
class FilterProductsSerializer < BaseSerializer
|
||||
attributes :preferred_matched_variants_visibility, :preferred_variant_tags, :variant_tags
|
||||
|
||||
def variant_tags
|
||||
object.preferred_variant_tags.split(",")
|
||||
end
|
||||
end
|
||||
|
||||
class FilterOrderCyclesSerializer < BaseSerializer
|
||||
attributes :preferred_matched_order_cycles_visibility, :preferred_exchange_tags, :exchange_tags
|
||||
|
||||
def exchange_tags
|
||||
object.preferred_exchange_tags.split(",")
|
||||
def rule_specific_serializer
|
||||
"Api::Admin::#{object.class}Serializer".constantize.new(object)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
module Api
|
||||
module Admin
|
||||
module TagRule
|
||||
class BaseSerializer < ActiveModel::Serializer
|
||||
attributes :id, :enterprise_id, :type, :is_default, :preferred_customer_tags
|
||||
end
|
||||
|
||||
class DiscountOrderSerializer < BaseSerializer
|
||||
has_one :calculator, serializer: Api::Admin::Calculator::FlatPercentItemTotalSerializer
|
||||
end
|
||||
|
||||
class FilterShippingMethodsSerializer < BaseSerializer
|
||||
attributes :preferred_matched_shipping_methods_visibility, :preferred_shipping_method_tags,
|
||||
:shipping_method_tags
|
||||
|
||||
def shipping_method_tags
|
||||
object.preferred_shipping_method_tags.split(",")
|
||||
end
|
||||
end
|
||||
|
||||
class FilterPaymentMethodsSerializer < BaseSerializer
|
||||
attributes :preferred_matched_payment_methods_visibility, :preferred_payment_method_tags,
|
||||
:payment_method_tags
|
||||
|
||||
def payment_method_tags
|
||||
object.preferred_payment_method_tags.split(",")
|
||||
end
|
||||
end
|
||||
|
||||
class FilterProductsSerializer < BaseSerializer
|
||||
attributes :preferred_matched_variants_visibility, :preferred_variant_tags, :variant_tags
|
||||
|
||||
def variant_tags
|
||||
object.preferred_variant_tags.split(",")
|
||||
end
|
||||
end
|
||||
|
||||
class FilterOrderCyclesSerializer < BaseSerializer
|
||||
attributes :preferred_matched_order_cycles_visibility,
|
||||
:preferred_exchange_tags,
|
||||
:exchange_tags
|
||||
|
||||
def exchange_tags
|
||||
object.preferred_exchange_tags.split(",")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
class Api::Admin::TaxCategorySerializer < ActiveModel::Serializer
|
||||
attributes :id, :name
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Api
|
||||
module Admin
|
||||
class TaxCategorySerializer < ActiveModel::Serializer
|
||||
attributes :id, :name
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
class Api::Admin::TaxonSerializer < ActiveModel::Serializer
|
||||
attributes :id, :name, :pretty_name
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Api
|
||||
module Admin
|
||||
class TaxonSerializer < ActiveModel::Serializer
|
||||
attributes :id, :name, :pretty_name
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
class Api::Admin::UnitsProductSerializer < ActiveModel::Serializer
|
||||
attributes :id, :name, :group_buy_unit_size, :variant_unit
|
||||
# frozen_string_literal: true
|
||||
|
||||
module Api
|
||||
module Admin
|
||||
class UnitsProductSerializer < ActiveModel::Serializer
|
||||
attributes :id, :name, :group_buy_unit_size, :variant_unit
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
class Api::Admin::UnitsVariantSerializer < ActiveModel::Serializer
|
||||
attributes :id, :full_name, :unit_value
|
||||
# frozen_string_literal: true
|
||||
|
||||
def full_name
|
||||
full_name = object.full_name
|
||||
object.product.name + (full_name.blank? ? "" : ": #{full_name}")
|
||||
module Api
|
||||
module Admin
|
||||
class UnitsVariantSerializer < ActiveModel::Serializer
|
||||
attributes :id, :full_name, :unit_value
|
||||
|
||||
def full_name
|
||||
full_name = object.full_name
|
||||
object.product.name + (full_name.blank? ? "" : ": #{full_name}")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,20 +1,26 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'open_food_network/address_finder'
|
||||
|
||||
class Api::Admin::UserSerializer < ActiveModel::Serializer
|
||||
attributes :id, :email, :confirmed
|
||||
module Api
|
||||
module Admin
|
||||
class UserSerializer < ActiveModel::Serializer
|
||||
attributes :id, :email, :confirmed
|
||||
|
||||
has_one :ship_address, serializer: Api::AddressSerializer
|
||||
has_one :bill_address, serializer: Api::AddressSerializer
|
||||
has_one :ship_address, serializer: Api::AddressSerializer
|
||||
has_one :bill_address, serializer: Api::AddressSerializer
|
||||
|
||||
def ship_address
|
||||
OpenFoodNetwork::AddressFinder.new(object.email, object).ship_address
|
||||
end
|
||||
def ship_address
|
||||
OpenFoodNetwork::AddressFinder.new(object.email, object).ship_address
|
||||
end
|
||||
|
||||
def bill_address
|
||||
OpenFoodNetwork::AddressFinder.new(object.email, object).bill_address
|
||||
end
|
||||
def bill_address
|
||||
OpenFoodNetwork::AddressFinder.new(object.email, object).bill_address
|
||||
end
|
||||
|
||||
def confirmed
|
||||
object.confirmed?
|
||||
def confirmed
|
||||
object.confirmed?
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,12 +1,18 @@
|
||||
class Api::Admin::VariantOverrideSerializer < ActiveModel::Serializer
|
||||
attributes :id, :hub_id, :variant_id, :sku, :price, :count_on_hand, :on_demand, :default_stock,
|
||||
:resettable, :tag_list, :tags, :import_date
|
||||
# frozen_string_literal: true
|
||||
|
||||
def tag_list
|
||||
object.tag_list.join(",")
|
||||
end
|
||||
module Api
|
||||
module Admin
|
||||
class VariantOverrideSerializer < ActiveModel::Serializer
|
||||
attributes :id, :hub_id, :variant_id, :sku, :price, :count_on_hand, :on_demand,
|
||||
:default_stock, :resettable, :tag_list, :tags, :import_date
|
||||
|
||||
def tags
|
||||
object.tag_list.map { |t| { text: t } }
|
||||
def tag_list
|
||||
object.tag_list.join(",")
|
||||
end
|
||||
|
||||
def tags
|
||||
object.tag_list.map { |t| { text: t } }
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,53 +1,60 @@
|
||||
class Api::Admin::VariantSerializer < ActiveModel::Serializer
|
||||
attributes :id, :name, :producer_name, :image, :sku, :import_date,
|
||||
:options_text, :unit_value, :unit_description, :unit_to_display,
|
||||
:display_as, :display_name, :name_to_display,
|
||||
:price, :on_demand, :on_hand, :in_stock, :stock_location_id, :stock_location_name
|
||||
# frozen_string_literal: true
|
||||
|
||||
has_many :variant_overrides
|
||||
module Api
|
||||
module Admin
|
||||
class VariantSerializer < ActiveModel::Serializer
|
||||
attributes :id, :name, :producer_name, :image, :sku, :import_date,
|
||||
:options_text, :unit_value, :unit_description, :unit_to_display,
|
||||
:display_as, :display_name, :name_to_display,
|
||||
:price, :on_demand, :on_hand, :in_stock, :stock_location_id, :stock_location_name
|
||||
|
||||
def name
|
||||
if object.full_name.present?
|
||||
"#{object.name} - #{object.full_name}"
|
||||
else
|
||||
object.name
|
||||
has_many :variant_overrides
|
||||
|
||||
def name
|
||||
if object.full_name.present?
|
||||
"#{object.name} - #{object.full_name}"
|
||||
else
|
||||
object.name
|
||||
end
|
||||
end
|
||||
|
||||
def on_hand
|
||||
return 0 if object.on_hand.nil?
|
||||
|
||||
object.on_hand
|
||||
end
|
||||
|
||||
def price
|
||||
# Decimals are passed to json as strings,
|
||||
# we need to run parseFloat.toFixed(2) on the client.
|
||||
object.price.nil? ? 0.to_f : object.price
|
||||
end
|
||||
|
||||
def producer_name
|
||||
object.product.supplier.name
|
||||
end
|
||||
|
||||
def image
|
||||
return if object.product.images.empty?
|
||||
|
||||
object.product.images.first.mini_url
|
||||
end
|
||||
|
||||
def in_stock
|
||||
object.in_stock?
|
||||
end
|
||||
|
||||
def stock_location_id
|
||||
return if object.stock_items.empty?
|
||||
|
||||
object.stock_items.first.stock_location.id
|
||||
end
|
||||
|
||||
def stock_location_name
|
||||
return if object.stock_items.empty?
|
||||
|
||||
object.stock_items.first.stock_location.name
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def on_hand
|
||||
return 0 if object.on_hand.nil?
|
||||
|
||||
object.on_hand
|
||||
end
|
||||
|
||||
def price
|
||||
# Decimals are passed to json as strings, we need to run parseFloat.toFixed(2) on the client.
|
||||
object.price.nil? ? 0.to_f : object.price
|
||||
end
|
||||
|
||||
def producer_name
|
||||
object.product.supplier.name
|
||||
end
|
||||
|
||||
def image
|
||||
return if object.product.images.empty?
|
||||
|
||||
object.product.images.first.mini_url
|
||||
end
|
||||
|
||||
def in_stock
|
||||
object.in_stock?
|
||||
end
|
||||
|
||||
def stock_location_id
|
||||
return if object.stock_items.empty?
|
||||
|
||||
object.stock_items.first.stock_location.id
|
||||
end
|
||||
|
||||
def stock_location_name
|
||||
return if object.stock_items.empty?
|
||||
|
||||
object.stock_items.first.stock_location.name
|
||||
end
|
||||
end
|
||||
|
||||
@@ -8,6 +8,7 @@ module Checkout
|
||||
end
|
||||
|
||||
def success(controller, params, current_user)
|
||||
set_customer_terms_and_conditions_accepted_at(params)
|
||||
save_order_addresses_as_user_default(params, current_user)
|
||||
OrderCompletionReset.new(controller, @order).call
|
||||
end
|
||||
@@ -26,5 +27,11 @@ module Checkout
|
||||
user_default_address_setter.set_default_bill_address if params[:order][:default_bill_address]
|
||||
user_default_address_setter.set_default_ship_address if params[:order][:default_ship_address]
|
||||
end
|
||||
|
||||
def set_customer_terms_and_conditions_accepted_at(params)
|
||||
return unless params[:order]
|
||||
|
||||
@order.customer.update(terms_and_conditions_accepted_at: Time.zone.now) if params[:order][:terms_and_conditions_accepted]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -55,6 +55,7 @@
|
||||
%col.tags{ width: "20%", 'ng-show' => 'columns.tags.visible' }
|
||||
%col.bill_address{ width: "10%", 'ng-show' => 'columns.bill_address.visible' }
|
||||
%col.ship_address{ width: "10%", 'ng-show' => 'columns.ship_address.visible' }
|
||||
%col.balance{ width: "10%", 'ng-show' => 'columns.balance.visible' }
|
||||
%col.actions{ width: "10%"}
|
||||
%thead
|
||||
%tr{ ng: { controller: "ColumnsCtrl" } }
|
||||
@@ -69,6 +70,7 @@
|
||||
%th.tags{ 'ng-show' => 'columns.tags.visible' }=t('admin.tags')
|
||||
%th.bill_address{ 'ng-show' => 'columns.bill_address.visible' }=t('admin.customers.index.bill_address')
|
||||
%th.ship_address{ 'ng-show' => 'columns.ship_address.visible' }=t('admin.customers.index.ship_address')
|
||||
%th.balance{ 'ng-show' => 'columns.balance.visible' }=t('admin.customers.index.balance')
|
||||
%th.actions
|
||||
Ask?
|
||||
%input{ :type => 'checkbox', 'ng-model' => "confirmDelete" }
|
||||
@@ -92,6 +94,9 @@
|
||||
%a{ id: 'bill-address-link', href: 'javascript:void(0)', "ng-bind" => "customer.bill_address ? customer.bill_address.address1 : '#{t('admin.customers.index.edit')}' | limitTo: 15", 'edit-address-dialog' => true }
|
||||
%td.ship_address{ 'ng-show' => 'columns.ship_address.visible' }
|
||||
%a{ id: 'ship-address-link', href: 'javascript:void(0)', "ng-bind" => "customer.ship_address ? customer.ship_address.address1 : '#{t('admin.customers.index.edit')}' | limitTo: 15", 'edit-address-dialog' => true }
|
||||
%td.balance.align-center{ 'ng-show' => 'columns.balance.visible'}
|
||||
%span.state.white-space-nowrap{ 'ng-class' => 'customer.balance_status', 'ng-bind' => 'displayBalanceStatus(customer)' }
|
||||
%span{ 'ng-bind' => '::customer.balance' }
|
||||
%td.actions
|
||||
%a{ 'ng-click' => "deleteCustomer(customer)", :class => "delete-customer icon-trash no-text" }
|
||||
|
||||
|
||||
@@ -35,12 +35,15 @@
|
||||
.row
|
||||
.alpha.three.columns
|
||||
= f.label :terms_and_conditions, t('.terms_and_conditions')
|
||||
%i.text-big.icon-question-sign.help-modal{ template: 'admin/modals/terms_and_conditions_info.html' }
|
||||
|
||||
.omega.eight.columns
|
||||
%a{ href: '{{ Enterprise.terms_and_conditions }}', ng: { if: 'Enterprise.terms_and_conditions' } }
|
||||
%a{ href: '{{ Enterprise.terms_and_conditions }}', target: '_blank', ng: { if: 'Enterprise.terms_and_conditions' } }
|
||||
= '{{ Enterprise.terms_and_conditions_file_name }}'
|
||||
= t('.uploaded_on')
|
||||
= '{{ Enterprise.terms_and_conditions_updated_at }}'
|
||||
.pad-top
|
||||
= f.file_field :terms_and_conditions
|
||||
= f.file_field :terms_and_conditions, accept: 'application/pdf', 'terms-and-conditions-warning' => 'true'
|
||||
.pad-top
|
||||
%a.button.red{ href: '', ng: {click: 'removeTermsAndConditions()', if: 'Enterprise.terms_and_conditions'} }
|
||||
= t('.remove_terms_and_conditions')
|
||||
|
||||
@@ -16,6 +16,6 @@
|
||||
= render "checkout/already_ordered", f: f if show_bought_items?
|
||||
= render "checkout/terms_and_conditions", f: f
|
||||
%p
|
||||
%button.button.primary{type: :submit}
|
||||
%button.button.primary{ type: :submit, ng: { disabled: "terms_and_conditions_activated && !terms_and_conditions_accepted" } }
|
||||
= t :checkout_send
|
||||
/ {{ checkout.$valid }}
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
%p.small
|
||||
= t('.message_html', terms_and_conditions_link: link_to( t( '.link_text' ), current_order.distributor.terms_and_conditions.url, target: '_blank')) if current_order.distributor.terms_and_conditions.file?
|
||||
- if terms_and_conditions_activated?
|
||||
%p
|
||||
%input{ type: 'checkbox', id: 'accept_terms', ng: { model: "terms_and_conditions_accepted", init: "terms_and_conditions_activated=#{terms_and_conditions_activated?}; terms_and_conditions_accepted=#{terms_and_conditions_already_accepted?}" } }
|
||||
%label.small{for: "accept_terms"}= t('.message_html', terms_and_conditions_link: link_to( t( '.link_text' ), current_order.distributor.terms_and_conditions.url, target: '_blank'))
|
||||
|
||||
@@ -87,6 +87,14 @@
|
||||
.field
|
||||
= preference_field_tag(:enable_localized_number?, Spree::Config[:enable_localized_number?], type: Spree::Config.preference_type(:enable_localized_number?))
|
||||
= label_tag(:enable_localized_number?, t('admin.number_localization.enable_localized_number')) + tag(:br)
|
||||
%fieldset.available_units.no-border-bottom
|
||||
%legend{:align => "center"}= t('admin.available_units')
|
||||
.field
|
||||
- available_units = Spree::Config[:available_units].split(",")
|
||||
- all_units.each do |unit|
|
||||
- selected = available_units.include?(unit)
|
||||
= preference_field_tag("available_units[#{unit}]", selected, { type: :boolean, selected: selected })
|
||||
= label_tag(unit, unit.downcase) + tag(:br)
|
||||
|
||||
.form-buttons.filter-actions.actions{"data-hook" => "buttons"}
|
||||
= button Spree.t('actions.update'), 'icon-refresh'
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
= render :partial => 'spree/admin/shared/order_sub_menu'
|
||||
|
||||
= admin_inject_column_preferences module: 'admin.lineItems'
|
||||
= admin_inject_available_units
|
||||
|
||||
%div{ ng: { controller: 'LineItemsCtrl' } }
|
||||
%save-bar{ dirty: "bulk_order_form.$dirty", persist: "false" }
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
= render 'spree/admin/products/index/header'
|
||||
= render 'spree/admin/products/index/data'
|
||||
= admin_inject_available_units
|
||||
|
||||
%div{ ng: { app: 'ofn.admin', controller: 'AdminProductEditCtrl', init: 'initialise()' } }
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
= render partial: 'spree/shared/error_messages', locals: { target: @variant }
|
||||
|
||||
= admin_inject_available_units
|
||||
|
||||
= form_for [:admin, @product, @variant], :url => admin_product_variant_path(@product, @variant, @url_filters) do |f|
|
||||
%fieldset.no-border-top
|
||||
%div
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
= render partial: 'spree/shared/error_messages', locals: { target: @variant }
|
||||
|
||||
= admin_inject_available_units
|
||||
|
||||
= form_for [:admin, @product, @variant], :url => admin_product_variants_path(@product, @url_filters) do |f|
|
||||
%fieldset{'data-hook' => "admin_variant_new_form"}
|
||||
%legend{align: "center"}= t('.new_variant')
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
%td.toggle-bought{ colspan: 2, ng: { click: 'showBought=!showBought' } }
|
||||
%h5.brick
|
||||
%i{ ng: { class: "{ 'ofn-i_007-caret-right': !showBought, 'ofn-i_005-caret-down': showBought}"} }
|
||||
= t(:orders_bought_items_notice, count: @order.finalised_line_items.sum(&:quantity))
|
||||
= t(:orders_bought_items_notice, count: @order.finalised_line_items.to_a.sum(&:quantity))
|
||||
%td.text-right{ colspan: 3 }
|
||||
%a.edit-finalised.button.radius.expand.small{ href: changeable_orders_link_path, ng: { class: "{secondary: !showBought, primary: showBought}" } }
|
||||
= t(:orders_bought_edit_button)
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
# Google requires an API key with a billing account to use their API.
|
||||
# The key is stored in config/application.yml.
|
||||
|
||||
Geocoder.configure(
|
||||
lookup: :google,
|
||||
timeout: ENV.fetch('GEOCODER_TIMEOUT', 3).to_i,
|
||||
lookup: ENV.fetch('GEOCODER_SERVICE', :google).to_sym,
|
||||
use_https: true,
|
||||
api_key: ENV.fetch('GOOGLE_MAPS_API_KEY', nil)
|
||||
api_key: ENV.fetch('GEOCODER_API_KEY', ENV["GOOGLE_MAPS_API_KEY"])
|
||||
)
|
||||
|
||||
@@ -351,6 +351,7 @@ ar:
|
||||
has_n_rules: "لديه %{num} قواعد"
|
||||
unsaved_confirm_leave: "هناك تغييرات لم يتم حفظها في هذه الصفحة. أكمل بدون حفظ؟"
|
||||
unsaved_changes: "لم تحفظ التغييرات"
|
||||
available_units: "الوحدات المتاحة"
|
||||
shopfront_settings:
|
||||
embedded_shopfront_settings: "إعدادات واجهة المتجر المدمجة "
|
||||
enable_embedded_shopfronts: "تمكين واجهة المتجر المدمجة"
|
||||
@@ -396,20 +397,23 @@ ar:
|
||||
duplicate_code: "هذا الكود مستخدم بالفعل"
|
||||
bill_address: "عنوان وصول الفواتير"
|
||||
ship_address: "عنوان الشحن"
|
||||
update_address_success: 'تم تحديث العنوان بنجاح.'
|
||||
update_address_error: 'آسف! يرجى إدخال جميع الحقول المطلوبة!'
|
||||
edit_bill_address: 'تحرير عنوان الفواتير'
|
||||
edit_ship_address: 'تحرير عنوان الشحن'
|
||||
required_fileds: 'تتم الإشارة إلى الحقول المطلوبة بعلامة النجمة'
|
||||
select_country: 'اختر الدولة'
|
||||
select_state: 'اختر ولايه'
|
||||
edit: 'تعديل'
|
||||
update_address: 'تحديث العنوان'
|
||||
confirm_delete: 'متأكد من ان يتم حذف؟'
|
||||
balance: "الباقي"
|
||||
update_address_success: "تم تحديث العنوان بنجاح."
|
||||
update_address_error: "آسف! يرجى إدخال جميع الحقول المطلوبة!"
|
||||
edit_bill_address: "تحرير عنوان الفواتير"
|
||||
edit_ship_address: "تحرير عنوان الشحن"
|
||||
required_fileds: "تتم الإشارة إلى الحقول المطلوبة بعلامة النجمة"
|
||||
select_country: "اختر الدولة"
|
||||
select_state: "اختر ولايه"
|
||||
edit: "تعديل"
|
||||
update_address: "تحديث العنوان"
|
||||
confirm_delete: "متأكد من ان يتم حذف؟"
|
||||
search_by_email: "البحث عن طريق البريد الإلكتروني / الرمز ..."
|
||||
guest_label: 'الخروج كضيف'
|
||||
guest_label: "الخروج كضيف"
|
||||
credit_owed: "الائتمان مدين"
|
||||
balance_due: "الرصيد المستحق"
|
||||
destroy:
|
||||
has_associated_orders: 'فشل الحذف: قام العميل بربط الطلبات مع متجره'
|
||||
has_associated_orders: "فشل الحذف: قام العميل بربط الطلبات مع متجره"
|
||||
contents:
|
||||
edit:
|
||||
title: المحتوى
|
||||
@@ -1160,8 +1164,7 @@ ar:
|
||||
cart: "سلة التسوق"
|
||||
message_html: "لديك طلب لدورة الطلب هذه بالفعل. تحقق من %{cart} لرؤية العناصر التي طلبتها من قبل. يمكنك أيضًا إلغاء العناصر طالما كانت دورة الطلب مفتوحة."
|
||||
terms_and_conditions:
|
||||
message_html: "من خلال تقديم هذا الطلب ، فإنك توافق على %{terms_and_conditions_link}."
|
||||
link_text: "شروط الخدمة"
|
||||
link_text: "الأحكام والشروط"
|
||||
failed: "فشل الخروج. يرجى إعلامنا حتى نتمكن من معالجة طلبك."
|
||||
shops:
|
||||
hubs:
|
||||
@@ -2383,8 +2386,9 @@ ar:
|
||||
admin:
|
||||
enterprise_limit_reached: "لقد وصلت إلى الحد القياسي للمؤسسات لكل حساب. اكتب %{contact_email} إذا كنت بحاجة إلى زيادته."
|
||||
modals:
|
||||
got_it: فهمتك
|
||||
got_it: "فهمتك"
|
||||
close: "إغلاق"
|
||||
continue: "تابع"
|
||||
invite: "ادعو"
|
||||
invite_title: "دعوة مستخدم غير مسجل"
|
||||
tag_rule_help:
|
||||
@@ -3044,6 +3048,7 @@ ar:
|
||||
new_taxonomy: "تصنيف جديد"
|
||||
back_to_taxonomies_list: "العودة إلى قائمة التصنيفات"
|
||||
shipping_methods: "طرق الشحن"
|
||||
shipping_method: "طريقة الشحن"
|
||||
shipping_categories: "فئات الشحن"
|
||||
new_shipping_category: "فئة الشحن الجديدة"
|
||||
back_to_shipping_categories: "العودة إلى فئات الشحن"
|
||||
@@ -3519,6 +3524,7 @@ ar:
|
||||
issue_text: |
|
||||
إذا لم يعمل عنوان URL أعلاه ، فحاول نسخه ولصقه في متصفحك.
|
||||
إذا كنت لا تزال تواجه مشاكل ، فلا تتردد في الاتصال بنا.
|
||||
subject: "تعليمات إعادة تعيين كلمة المرور"
|
||||
confirmation_instructions:
|
||||
subject: "يرجى تأكيد حسابك OFN"
|
||||
shipment_mailer:
|
||||
|
||||
@@ -396,20 +396,22 @@ ca:
|
||||
duplicate_code: "Aquest codi ja s'ha utilitzat."
|
||||
bill_address: "Adreça de facturació"
|
||||
ship_address: "Adreça d'enviament"
|
||||
update_address_success: 'L''adreça s''ha actualitzat correctament.'
|
||||
update_address_error: 'Ho sentim! Introduïu tots els camps obligatoris.'
|
||||
edit_bill_address: 'Edita l''adreça de facturació'
|
||||
edit_ship_address: 'Edita l''adreça d''enviament'
|
||||
required_fileds: 'Els camps obligatoris es denoten amb un asterisc'
|
||||
select_country: 'Selecciona país'
|
||||
select_state: 'Selecciona província'
|
||||
edit: 'Editar'
|
||||
update_address: 'Actualitza l''adreça'
|
||||
confirm_delete: 'Estàs segur que vols suprimir?'
|
||||
balance: "Balanç"
|
||||
update_address_success: "L'adreça s'ha actualitzat correctament."
|
||||
update_address_error: "Ho sentim! Introduïu tots els camps obligatoris."
|
||||
edit_bill_address: "Edita l'adreça de facturació"
|
||||
edit_ship_address: "Edita l'adreça d'enviament"
|
||||
required_fileds: "Els camps obligatoris es denoten amb un asterisc"
|
||||
select_country: "Selecciona país"
|
||||
select_state: "Selecciona província"
|
||||
edit: "Editar"
|
||||
update_address: "Actualitza l'adreça"
|
||||
confirm_delete: "Estàs segur que vols suprimir?"
|
||||
search_by_email: "Cerca per correu electrònic/codi ..."
|
||||
guest_label: 'Fer comanda com a convidat'
|
||||
guest_label: "Fer comanda com a convidat"
|
||||
credit_owed: "Crèdit a deure"
|
||||
destroy:
|
||||
has_associated_orders: 'S''ha produït un error en suprimir: la consumidora té comandes associades amb la seva botiga'
|
||||
has_associated_orders: "S'ha produït un error en suprimir: la consumidora té comandes associades amb la seva botiga"
|
||||
contents:
|
||||
edit:
|
||||
title: Contingut
|
||||
@@ -1164,8 +1166,7 @@ ca:
|
||||
cart: "cistella"
|
||||
message_html: "Ja teniu una comanda per a aquest cicle de comanda. Consulteu %{cart} per veure els articles que heu demanat anteriorment. També podeu cancel·lar articles sempre que el cicle de comanda estigui obert."
|
||||
terms_and_conditions:
|
||||
message_html: "En fer aquesta comanda accepteu %{terms_and_conditions_link}."
|
||||
link_text: "Termes del servei"
|
||||
link_text: "Termes i condicions"
|
||||
failed: "La comanda ha fallat. Informeu-nos perquè puguem processar la vostra comanda."
|
||||
shops:
|
||||
hubs:
|
||||
@@ -2381,8 +2382,9 @@ ca:
|
||||
admin:
|
||||
enterprise_limit_reached: "Has assolit el límit estàndard d'organitzacions per compte. Escriu a %{contact_email} si necessites augmentar-lo."
|
||||
modals:
|
||||
got_it: Ho tinc
|
||||
got_it: "Ho tinc"
|
||||
close: "Tanca"
|
||||
continue: "Continua"
|
||||
invite: "Convida"
|
||||
invite_title: "Convida un usuari no registrat"
|
||||
tag_rule_help:
|
||||
@@ -2952,6 +2954,7 @@ ca:
|
||||
new_taxonomy: "Nova taxonomia"
|
||||
back_to_taxonomies_list: "Torna a la llista de taxonomies"
|
||||
shipping_methods: "Mètodes d'enviament"
|
||||
shipping_method: "Mètode d'enviament"
|
||||
shipping_categories: "Tipus d'enviament"
|
||||
new_shipping_category: "Nova categoria d’enviament"
|
||||
back_to_shipping_categories: "Tornar a les categories d'enviament"
|
||||
@@ -3368,7 +3371,7 @@ ca:
|
||||
or_enter_new_card: "O bé introdueix els detalls d'una nova targeta:"
|
||||
remember_this_card: Recordar aquesta targeta?
|
||||
date_picker:
|
||||
format: '%d-% m-% Y'
|
||||
format: '%d-%m-%Y'
|
||||
js_format: 'dd-mm-yy'
|
||||
orders:
|
||||
error_flash_for_unavailable_items: "Un ítem del teu carret ja no està disponible. Sis plau actualitza les quantitats seleccionades."
|
||||
|
||||
@@ -379,20 +379,21 @@ de_DE:
|
||||
duplicate_code: "Dieser Kode wird bereits verwendet."
|
||||
bill_address: "Rechnungsadresse"
|
||||
ship_address: "Lieferadresse"
|
||||
update_address_success: 'Adresse wurde erfolgreich aktualisiert.'
|
||||
update_address_error: 'Es tut uns leid! Bitte füllen Sie alle erforderlichen Felder aus!'
|
||||
edit_bill_address: 'Rechnungsadresse bearbeiten'
|
||||
edit_ship_address: 'Lieferadresse bearbeiten'
|
||||
required_fileds: 'Die erforderlichen Felder sind mit einem Sternchen gekennzeichnet.'
|
||||
select_country: 'Land wählen'
|
||||
select_state: 'Bundesland wählen'
|
||||
edit: 'Bearbeiten'
|
||||
update_address: 'Adresse aktualisieren'
|
||||
confirm_delete: 'Sicher zu löschen?'
|
||||
balance: "Saldo"
|
||||
update_address_success: "Adresse wurde erfolgreich aktualisiert."
|
||||
update_address_error: "Es tut uns leid! Bitte füllen Sie alle erforderlichen Felder aus!"
|
||||
edit_bill_address: "Rechnungsadresse bearbeiten"
|
||||
edit_ship_address: "Lieferadresse bearbeiten"
|
||||
required_fileds: "Die erforderlichen Felder sind mit einem Sternchen gekennzeichnet."
|
||||
select_country: "Land wählen"
|
||||
select_state: "Bundesland wählen"
|
||||
edit: "Bearbeiten"
|
||||
update_address: "Adresse aktualisieren"
|
||||
confirm_delete: "Sicher zu löschen?"
|
||||
search_by_email: "Suche nach Email/Kode"
|
||||
guest_label: 'Gäste Kasse'
|
||||
guest_label: "Gäste Kasse"
|
||||
destroy:
|
||||
has_associated_orders: 'Löschen fehlgeschlagen: Kunde hat Bestellungen mit diesem Laden'
|
||||
has_associated_orders: "Löschen fehlgeschlagen: Kunde hat Bestellungen mit diesem Laden"
|
||||
contents:
|
||||
edit:
|
||||
title: Inhalt
|
||||
@@ -2314,8 +2315,9 @@ de_DE:
|
||||
admin:
|
||||
enterprise_limit_reached: "Sie haben die Standardgrenze für Unternehmen pro Konto erreicht. Schreiben Sie an %{contact_email}, wenn Sie es erhöhen müssen."
|
||||
modals:
|
||||
got_it: Ich habs
|
||||
got_it: "Ich habs"
|
||||
close: "Schließen"
|
||||
continue: "Fortsetzen"
|
||||
invite: "Einladen"
|
||||
invite_title: "Laden Sie einen nicht registrierten Benutzer ein"
|
||||
tag_rule_help:
|
||||
@@ -2862,6 +2864,7 @@ de_DE:
|
||||
new_taxonomy: "Neue Taxonomie"
|
||||
back_to_taxonomies_list: "Zurück zur Taxonomieliste"
|
||||
shipping_methods: "Lieferart"
|
||||
shipping_method: "Lieferart"
|
||||
shipping_categories: "Versandkategorien"
|
||||
new_shipping_category: "Neue Versandkategorie"
|
||||
back_to_shipping_categories: "Zurück zu den Versandkategorien"
|
||||
@@ -3230,8 +3233,8 @@ de_DE:
|
||||
or_enter_new_card: "Oder geben Sie Details für eine neue Karte ein:"
|
||||
remember_this_card: Diese Karte speichern?
|
||||
date_picker:
|
||||
format: '% Y-% m-%d'
|
||||
js_format: 'JJ-MM-TT'
|
||||
format: '%Y.%m.%d'
|
||||
js_format: 'dd.mm.yy'
|
||||
orders:
|
||||
edit:
|
||||
login_to_view_order: "Bitte loggen Sie sich ein, um Ihre Bestellung anzuzeigen."
|
||||
|
||||
@@ -394,6 +394,8 @@ en:
|
||||
unsaved_confirm_leave: "There are unsaved changed on this page. Continue without saving?"
|
||||
unsaved_changes: "You have unsaved changes"
|
||||
|
||||
available_units: "Available Units"
|
||||
|
||||
shopfront_settings:
|
||||
embedded_shopfront_settings: "Embedded Shopfront Settings"
|
||||
enable_embedded_shopfronts: "Enable Embedded Shopfronts"
|
||||
@@ -444,20 +446,23 @@ en:
|
||||
duplicate_code: "This code is used already."
|
||||
bill_address: "Billing Address"
|
||||
ship_address: "Shipping Address"
|
||||
update_address_success: 'Address updated successfully.'
|
||||
update_address_error: 'Sorry! Please input all of the required fields!'
|
||||
edit_bill_address: 'Edit Billing Address'
|
||||
edit_ship_address: 'Edit Shipping Address'
|
||||
required_fileds: 'Required fields are denoted with an asterisk '
|
||||
select_country: 'Select Country'
|
||||
select_state: 'Select State'
|
||||
edit: 'Edit'
|
||||
update_address: 'Update Address'
|
||||
confirm_delete: 'Sure to delete?'
|
||||
balance: "Balance"
|
||||
update_address_success: "Address updated successfully."
|
||||
update_address_error: "Sorry! Please input all of the required fields!"
|
||||
edit_bill_address: "Edit Billing Address"
|
||||
edit_ship_address: "Edit Shipping Address"
|
||||
required_fileds: "Required fields are denoted with an asterisk "
|
||||
select_country: "Select Country"
|
||||
select_state: "Select State"
|
||||
edit: "Edit"
|
||||
update_address: "Update Address"
|
||||
confirm_delete: "Sure to delete?"
|
||||
search_by_email: "Search by email/code..."
|
||||
guest_label: 'Guest checkout'
|
||||
guest_label: "Guest checkout"
|
||||
credit_owed: "Credit Owed"
|
||||
balance_due: "Balance Due"
|
||||
destroy:
|
||||
has_associated_orders: 'Delete failed: customer has associated orders with his shop'
|
||||
has_associated_orders: "Delete failed: customer has associated orders with his shop"
|
||||
|
||||
contents:
|
||||
edit:
|
||||
@@ -700,6 +705,7 @@ en:
|
||||
invoice_text: Add customized text at the end of invoices
|
||||
terms_and_conditions: "Terms and Conditions"
|
||||
remove_terms_and_conditions: "Remove File"
|
||||
uploaded_on: "uploaded on"
|
||||
contact:
|
||||
name: Name
|
||||
name_placeholder: eg. Gustav Plum
|
||||
@@ -1230,8 +1236,8 @@ en:
|
||||
cart: "cart"
|
||||
message_html: "You have an order for this order cycle already. Check the %{cart} to see the items you ordered before. You can also cancel items as long as the order cycle is open."
|
||||
terms_and_conditions:
|
||||
message_html: "By placing this order you agree to the %{terms_and_conditions_link}."
|
||||
link_text: "Terms of Service"
|
||||
message_html: "I agree to the seller's %{terms_and_conditions_link}."
|
||||
link_text: "Terms and Conditions"
|
||||
failed: "The checkout failed. Please let us know so that we can process your order."
|
||||
shops:
|
||||
hubs:
|
||||
@@ -2512,8 +2518,9 @@ See the %{link} to find out more about %{sitename}'s features and to start using
|
||||
admin:
|
||||
enterprise_limit_reached: "You have reached the standard limit of enterprises per account. Write to %{contact_email} if you need to increase it."
|
||||
modals:
|
||||
got_it: Got it
|
||||
got_it: "Got it"
|
||||
close: "Close"
|
||||
continue: "Continue"
|
||||
invite: "Invite"
|
||||
invite_title: "Invite an unregistered user"
|
||||
tag_rule_help:
|
||||
@@ -2532,6 +2539,14 @@ See the %{link} to find out more about %{sitename}'s features and to start using
|
||||
customer_tagged_rules_text: >
|
||||
By creating rules related to a specific customer tag, you can override the default
|
||||
behaviour (whether it be to show or to hide items) for customers with the specified tag.
|
||||
terms_and_conditions_info:
|
||||
title: "Uploading Terms and Conditions"
|
||||
message_1: "Terms and Conditions are the contract between you, the seller, and the shopper. If you upload a file here shoppers must accept your Terms and Conditions in order to complete checkout. For the shopper this will appear as a checkbox at checkout that must be checked in order to proceed with checkout. We highly recommend you upload Terms and Conditions in alignment with national legislation."
|
||||
message_2: "Shoppers will only be required to accept Terms and Conditions once. However if you change you Terms and Conditions shoppers will again be required to accept them before they can checkout."
|
||||
terms_and_conditions_warning:
|
||||
title: "Uploading Terms and Conditions"
|
||||
message_1: "All your buyers will have to agree to them once at checkout. If you update the file, all your buyers will have to agree to them again at checkout."
|
||||
message_2: "For buyers with subscriptions, you need to email them the Terms and Conditions (or the changes to them) for now, nothing will notify them about these new Terms and Conditions."
|
||||
panels:
|
||||
save: SAVE
|
||||
saved: SAVED
|
||||
@@ -3104,6 +3119,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using
|
||||
back_to_taxonomies_list: "Back to Taxonomies List"
|
||||
|
||||
shipping_methods: "Shipping Methods"
|
||||
shipping_method: "Shipping Method"
|
||||
|
||||
shipping_categories: "Shipping Categories"
|
||||
new_shipping_category: "New Shipping Category"
|
||||
@@ -3583,6 +3599,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using
|
||||
issue_text: |
|
||||
If the above URL does not work try copying and pasting it into your browser.
|
||||
If you continue to have problems please feel free to contact us.
|
||||
subject: "Reset password instructions"
|
||||
confirmation_instructions:
|
||||
subject: "Please confirm your OFN account"
|
||||
shipment_mailer:
|
||||
|
||||
@@ -373,20 +373,21 @@ en_AU:
|
||||
duplicate_code: "This code is used already."
|
||||
bill_address: "Billing Address"
|
||||
ship_address: "Shipping Address"
|
||||
update_address_success: 'Address updated successfully.'
|
||||
update_address_error: 'Sorry! Please input all of the required fields!'
|
||||
edit_bill_address: 'Edit Billing Address'
|
||||
edit_ship_address: 'Edit Shipping Address'
|
||||
required_fileds: 'Required fields are denoted with an asterisk '
|
||||
select_country: 'Select Country'
|
||||
select_state: 'Select State'
|
||||
edit: 'Edit'
|
||||
update_address: 'Update Address'
|
||||
confirm_delete: 'Sure to delete?'
|
||||
balance: "Balance"
|
||||
update_address_success: "Address updated successfully."
|
||||
update_address_error: "Sorry! Please input all of the required fields!"
|
||||
edit_bill_address: "Edit Billing Address"
|
||||
edit_ship_address: "Edit Shipping Address"
|
||||
required_fileds: "Required fields are denoted with an asterisk "
|
||||
select_country: "Select Country"
|
||||
select_state: "Select State"
|
||||
edit: "Edit"
|
||||
update_address: "Update Address"
|
||||
confirm_delete: "Sure to delete?"
|
||||
search_by_email: "Search by email/code..."
|
||||
guest_label: 'Guest checkout'
|
||||
guest_label: "Guest checkout"
|
||||
destroy:
|
||||
has_associated_orders: 'Delete failed: customer has associated orders with his shop'
|
||||
has_associated_orders: "Delete failed: customer has associated orders with his shop"
|
||||
contents:
|
||||
edit:
|
||||
title: Content
|
||||
@@ -2315,8 +2316,9 @@ en_AU:
|
||||
admin:
|
||||
enterprise_limit_reached: "You have reached the standard limit of enterprises per account. Write to %{contact_email} if you need to increase it."
|
||||
modals:
|
||||
got_it: Got it
|
||||
got_it: "Got it"
|
||||
close: "Close"
|
||||
continue: "Continue"
|
||||
invite: "Invite"
|
||||
invite_title: "Invite an unregistered user"
|
||||
tag_rule_help:
|
||||
@@ -2786,6 +2788,7 @@ en_AU:
|
||||
new_taxonomy: "New Taxonomy"
|
||||
back_to_taxonomies_list: "Back to Taxonomies List"
|
||||
shipping_methods: "Shipping Methods"
|
||||
shipping_method: "Shipping Method"
|
||||
shipping_categories: "Shipping Categories"
|
||||
new_shipping_category: "New Shipping Category"
|
||||
back_to_shipping_categories: "Back To Shipping Categories"
|
||||
|
||||
@@ -368,20 +368,21 @@ en_BE:
|
||||
duplicate_code: "This code is used already."
|
||||
bill_address: "Billing Address"
|
||||
ship_address: "Shipping Address"
|
||||
update_address_success: 'Address updated successfully.'
|
||||
update_address_error: 'Sorry! Please input all of the required fields!'
|
||||
edit_bill_address: 'Edit Billing Address'
|
||||
edit_ship_address: 'Edit Shipping Address'
|
||||
required_fileds: 'Required fields are denoted with an asterisk '
|
||||
select_country: 'Select Country'
|
||||
select_state: 'Select State'
|
||||
edit: 'Edit'
|
||||
update_address: 'Update Address'
|
||||
confirm_delete: 'Sure to delete?'
|
||||
balance: "Balance"
|
||||
update_address_success: "Address updated successfully."
|
||||
update_address_error: "Sorry! Please input all of the required fields!"
|
||||
edit_bill_address: "Edit Billing Address"
|
||||
edit_ship_address: "Edit Shipping Address"
|
||||
required_fileds: "Required fields are denoted with an asterisk "
|
||||
select_country: "Select Country"
|
||||
select_state: "Select State"
|
||||
edit: "Edit"
|
||||
update_address: "Update Address"
|
||||
confirm_delete: "Sure to delete?"
|
||||
search_by_email: "Search by email/code..."
|
||||
guest_label: 'Guest checkout'
|
||||
guest_label: "Guest checkout"
|
||||
destroy:
|
||||
has_associated_orders: 'Delete failed: customer has associated orders with his shop'
|
||||
has_associated_orders: "Delete failed: customer has associated orders with his shop"
|
||||
contents:
|
||||
edit:
|
||||
title: Content
|
||||
@@ -2275,8 +2276,9 @@ en_BE:
|
||||
admin:
|
||||
enterprise_limit_reached: "You have reached the standard limit of enterprises per account. Write to %{contact_email} if you need to increase it."
|
||||
modals:
|
||||
got_it: Got it
|
||||
got_it: "Got it"
|
||||
close: "Close"
|
||||
continue: "Continue"
|
||||
invite: "Invite"
|
||||
invite_title: "Invite an unregistered user"
|
||||
tag_rule_help:
|
||||
@@ -2743,6 +2745,7 @@ en_BE:
|
||||
new_taxonomy: "New Taxonomy"
|
||||
back_to_taxonomies_list: "Back to Taxonomies List"
|
||||
shipping_methods: "Shipping Methods"
|
||||
shipping_method: "Shipping Method"
|
||||
shipping_categories: "Shipping Categories"
|
||||
new_shipping_category: "New Shipping Category"
|
||||
back_to_shipping_categories: "Back To Shipping Categories"
|
||||
|
||||
@@ -396,20 +396,22 @@ en_CA:
|
||||
duplicate_code: "This code is used already."
|
||||
bill_address: "Billing Address"
|
||||
ship_address: "Shipping Address"
|
||||
update_address_success: 'Address updated successfully.'
|
||||
update_address_error: 'Sorry! Please input all of the required fields!'
|
||||
edit_bill_address: 'Edit Billing Address'
|
||||
edit_ship_address: 'Edit Shipping Address'
|
||||
required_fileds: 'Required fields are denoted with an asterisk '
|
||||
select_country: 'Select Country'
|
||||
select_state: 'Select Province'
|
||||
edit: 'Edit'
|
||||
update_address: 'Update Address'
|
||||
confirm_delete: 'Sure to delete?'
|
||||
balance: "Balance"
|
||||
update_address_success: "Address updated successfully."
|
||||
update_address_error: "Sorry! Please input all of the required fields!"
|
||||
edit_bill_address: "Edit Billing Address"
|
||||
edit_ship_address: "Edit Shipping Address"
|
||||
required_fileds: "Required fields are denoted with an asterisk "
|
||||
select_country: "Select Country"
|
||||
select_state: "Select Province"
|
||||
edit: "Edit"
|
||||
update_address: "Update Address"
|
||||
confirm_delete: "Sure to delete?"
|
||||
search_by_email: "Search by email/code..."
|
||||
guest_label: 'Guest checkout'
|
||||
guest_label: "Guest checkout"
|
||||
credit_owed: "Credit Owed"
|
||||
destroy:
|
||||
has_associated_orders: 'Delete failed: customer has associated orders with his shop'
|
||||
has_associated_orders: "Delete failed: customer has associated orders with his shop"
|
||||
contents:
|
||||
edit:
|
||||
title: Content
|
||||
@@ -1161,8 +1163,7 @@ en_CA:
|
||||
cart: "cart"
|
||||
message_html: "You have an order for this order cycle already. Check the %{cart} to see the items you ordered before. You can also cancel items as long as the order cycle is open."
|
||||
terms_and_conditions:
|
||||
message_html: "By placing this order you agree to the %{terms_and_conditions_link}."
|
||||
link_text: "Terms of Service"
|
||||
link_text: "Terms and Conditions"
|
||||
failed: "The checkout failed. Please let us know so that we can process your order."
|
||||
shops:
|
||||
hubs:
|
||||
@@ -2378,8 +2379,9 @@ en_CA:
|
||||
admin:
|
||||
enterprise_limit_reached: "You have reached the standard limit of enterprises per account. Write to %{contact_email} if you need to increase it."
|
||||
modals:
|
||||
got_it: Got it
|
||||
got_it: "Got it"
|
||||
close: "Close"
|
||||
continue: "Continue"
|
||||
invite: "Invite"
|
||||
invite_title: "Invite an unregistered user"
|
||||
tag_rule_help:
|
||||
@@ -2947,6 +2949,7 @@ en_CA:
|
||||
new_taxonomy: "New Taxonomy"
|
||||
back_to_taxonomies_list: "Back to Taxonomies List"
|
||||
shipping_methods: "Delivery/Pick-up Methods"
|
||||
shipping_method: "Shipping Method"
|
||||
shipping_categories: "Shipping Categories"
|
||||
new_shipping_category: "New Shipping Category"
|
||||
back_to_shipping_categories: "Back to Shipping Categories"
|
||||
|
||||
@@ -373,20 +373,21 @@ en_DE:
|
||||
duplicate_code: "This code is used already."
|
||||
bill_address: "Billing Address"
|
||||
ship_address: "Shipping Address"
|
||||
update_address_success: 'Address updated successfully.'
|
||||
update_address_error: 'Sorry! Please input all of the required fields!'
|
||||
edit_bill_address: 'Edit Billing Address'
|
||||
edit_ship_address: 'Edit Shipping Address'
|
||||
required_fileds: 'Required fields are denoted with an asterisk '
|
||||
select_country: 'Select Country'
|
||||
select_state: 'Select State'
|
||||
edit: 'Edit'
|
||||
update_address: 'Update Address'
|
||||
confirm_delete: 'Sure to delete?'
|
||||
balance: "Balance"
|
||||
update_address_success: "Address updated successfully."
|
||||
update_address_error: "Sorry! Please input all of the required fields!"
|
||||
edit_bill_address: "Edit Billing Address"
|
||||
edit_ship_address: "Edit Shipping Address"
|
||||
required_fileds: "Required fields are denoted with an asterisk "
|
||||
select_country: "Select Country"
|
||||
select_state: "Select State"
|
||||
edit: "Edit"
|
||||
update_address: "Update Address"
|
||||
confirm_delete: "Sure to delete?"
|
||||
search_by_email: "Search by email/code..."
|
||||
guest_label: 'Guest checkout'
|
||||
guest_label: "Guest checkout"
|
||||
destroy:
|
||||
has_associated_orders: 'Delete failed: customer has associated orders with his shop'
|
||||
has_associated_orders: "Delete failed: customer has associated orders with his shop"
|
||||
contents:
|
||||
edit:
|
||||
title: Content
|
||||
@@ -2285,8 +2286,9 @@ en_DE:
|
||||
admin:
|
||||
enterprise_limit_reached: "You have reached the standard limit of enterprises per account. Write to %{contact_email} if you need to increase it."
|
||||
modals:
|
||||
got_it: Got it
|
||||
got_it: "Got it"
|
||||
close: "Close"
|
||||
continue: "Continue"
|
||||
invite: "Invite"
|
||||
invite_title: "Invite an unregistered user"
|
||||
tag_rule_help:
|
||||
@@ -2756,6 +2758,7 @@ en_DE:
|
||||
new_taxonomy: "New Taxonomy"
|
||||
back_to_taxonomies_list: "Back to Taxonomies List"
|
||||
shipping_methods: "Shipping Methods"
|
||||
shipping_method: "Shipping Method"
|
||||
shipping_categories: "Shipping Categories"
|
||||
new_shipping_category: "New Shipping Category"
|
||||
back_to_shipping_categories: "Back To Shipping Categories"
|
||||
|
||||
@@ -351,6 +351,7 @@ en_FR:
|
||||
has_n_rules: "has %{num} rules"
|
||||
unsaved_confirm_leave: "There are unsaved changed on this page. Continue without saving?"
|
||||
unsaved_changes: "You have unsaved changes"
|
||||
available_units: "Available Units"
|
||||
shopfront_settings:
|
||||
embedded_shopfront_settings: "Embedded Shopfront Settings"
|
||||
enable_embedded_shopfronts: "Enable Embedded Shopfronts"
|
||||
@@ -396,20 +397,23 @@ en_FR:
|
||||
duplicate_code: "This code is used already."
|
||||
bill_address: "Billing Address"
|
||||
ship_address: "Shipping Address"
|
||||
update_address_success: 'Address updated successfully.'
|
||||
update_address_error: 'Sorry! Please input all of the required fields!'
|
||||
edit_bill_address: 'Edit Billing Address'
|
||||
edit_ship_address: 'Edit Shipping Address'
|
||||
required_fileds: 'Required fields are denoted with an asterisk '
|
||||
select_country: 'Select Country'
|
||||
select_state: 'Select State'
|
||||
edit: 'Edit'
|
||||
update_address: 'Update Address'
|
||||
confirm_delete: 'Sure to delete?'
|
||||
balance: "Balance"
|
||||
update_address_success: "Address updated successfully."
|
||||
update_address_error: "Sorry! Please input all of the required fields!"
|
||||
edit_bill_address: "Edit Billing Address"
|
||||
edit_ship_address: "Edit Shipping Address"
|
||||
required_fileds: "Required fields are denoted with an asterisk "
|
||||
select_country: "Select Country"
|
||||
select_state: "Select State"
|
||||
edit: "Edit"
|
||||
update_address: "Update Address"
|
||||
confirm_delete: "Sure to delete?"
|
||||
search_by_email: "Search by email/code..."
|
||||
guest_label: 'Guest checkout'
|
||||
guest_label: "Guest checkout"
|
||||
credit_owed: "Credit Owed"
|
||||
balance_due: "Balance Due"
|
||||
destroy:
|
||||
has_associated_orders: 'Delete failed: customer has associated orders with his shop'
|
||||
has_associated_orders: "Delete failed: customer has associated orders with his shop"
|
||||
contents:
|
||||
edit:
|
||||
title: Content
|
||||
@@ -1161,8 +1165,7 @@ en_FR:
|
||||
cart: "cart"
|
||||
message_html: "You have an order for this order cycle already. Check the %{cart} to see the items you ordered before. You can also cancel items as long as the order cycle is open."
|
||||
terms_and_conditions:
|
||||
message_html: "By placing this order you agree to the%{terms_and_conditions_link}."
|
||||
link_text: "Terms of Service"
|
||||
link_text: "Terms and Conditions"
|
||||
failed: "The checkout failed. Please let us know so that we can process your order."
|
||||
shops:
|
||||
hubs:
|
||||
@@ -1256,9 +1259,9 @@ en_FR:
|
||||
menu_4_title: "Groups"
|
||||
menu_4_url: "/groups"
|
||||
menu_5_title: "Open my shop"
|
||||
menu_5_url: "https://apropos.coopcircuits.fr/"
|
||||
menu_5_url: "/sell"
|
||||
menu_6_title: "About"
|
||||
menu_6_url: "https://apropos.coopcircuits.fr/blog/"
|
||||
menu_6_url: "https://apropos.coopcircuits.fr/"
|
||||
menu_7_title: "Learn"
|
||||
menu_7_url: "https://apropos.coopcircuits.fr/ressources/"
|
||||
logo: "Logo (640x130)"
|
||||
@@ -2378,8 +2381,9 @@ en_FR:
|
||||
admin:
|
||||
enterprise_limit_reached: "You have reached the standard limit of enterprises per account. Write to %{contact_email} if you need to increase it."
|
||||
modals:
|
||||
got_it: Got it
|
||||
got_it: "Got it"
|
||||
close: "Close"
|
||||
continue: "Continue"
|
||||
invite: "Invite"
|
||||
invite_title: "Invite an unregistered user"
|
||||
tag_rule_help:
|
||||
@@ -2948,6 +2952,7 @@ en_FR:
|
||||
new_taxonomy: "New Taxonomy"
|
||||
back_to_taxonomies_list: "Back to Taxonomies List"
|
||||
shipping_methods: "Shipping Methods"
|
||||
shipping_method: "Shipping Method"
|
||||
shipping_categories: "Shipping Categories"
|
||||
new_shipping_category: "New Shipping Category"
|
||||
back_to_shipping_categories: "Back To Shipping Categories"
|
||||
@@ -3419,6 +3424,7 @@ en_FR:
|
||||
issue_text: |
|
||||
If the above URL does not work try copying and pasting it into your browser.
|
||||
If you continue to have problems please feel free to contact us.
|
||||
subject: "Reset password instructions"
|
||||
confirmation_instructions:
|
||||
subject: "Please confirm your OFN account"
|
||||
shipment_mailer:
|
||||
|
||||
@@ -393,20 +393,22 @@ en_GB:
|
||||
duplicate_code: "This code is used already."
|
||||
bill_address: "Billing Address"
|
||||
ship_address: "Shipping Address"
|
||||
update_address_success: 'Address updated successfully.'
|
||||
update_address_error: 'Sorry! Please input all of the required fields!'
|
||||
edit_bill_address: 'Edit Billing Address'
|
||||
edit_ship_address: 'Edit Shipping Address'
|
||||
required_fileds: 'Required fields are denoted with an asterisk'
|
||||
select_country: 'Select Country'
|
||||
select_state: 'Select County'
|
||||
edit: 'Edit'
|
||||
update_address: 'Update Address'
|
||||
confirm_delete: 'Sure to delete?'
|
||||
balance: "Balance"
|
||||
update_address_success: "Address updated successfully."
|
||||
update_address_error: "Sorry! Please input all of the required fields!"
|
||||
edit_bill_address: "Edit Billing Address"
|
||||
edit_ship_address: "Edit Shipping Address"
|
||||
required_fileds: "Required fields are denoted with an asterisk"
|
||||
select_country: "Select Country"
|
||||
select_state: "Select County"
|
||||
edit: "Edit"
|
||||
update_address: "Update Address"
|
||||
confirm_delete: "Sure to delete?"
|
||||
search_by_email: "Search by email/code..."
|
||||
guest_label: 'Guest checkout'
|
||||
guest_label: "Guest checkout"
|
||||
credit_owed: "Credit Owed"
|
||||
destroy:
|
||||
has_associated_orders: 'Delete failed: customer has associated orders with this shop'
|
||||
has_associated_orders: "Delete failed: customer has associated orders with this shop"
|
||||
contents:
|
||||
edit:
|
||||
title: Content
|
||||
@@ -1158,8 +1160,7 @@ en_GB:
|
||||
cart: "cart"
|
||||
message_html: "You have an order for this order cycle already. Check the %{cart} to see the items you ordered before. You can also cancel items as long as the order cycle is open."
|
||||
terms_and_conditions:
|
||||
message_html: "By placing this order you agree to the %{terms_and_conditions_link}."
|
||||
link_text: "Terms of Service"
|
||||
link_text: "Terms and Conditions"
|
||||
failed: "The checkout failed. Please let us know so that we can process your order."
|
||||
shops:
|
||||
hubs:
|
||||
@@ -2374,8 +2375,9 @@ en_GB:
|
||||
admin:
|
||||
enterprise_limit_reached: "You have reached the standard limit of enterprises per account. Write to %{contact_email} if you need to increase it."
|
||||
modals:
|
||||
got_it: Got it
|
||||
got_it: "Got it"
|
||||
close: "Close"
|
||||
continue: "Continue"
|
||||
invite: "Invite"
|
||||
invite_title: "Invite an unregistered user"
|
||||
tag_rule_help:
|
||||
@@ -2946,6 +2948,7 @@ en_GB:
|
||||
new_taxonomy: "New Taxonomy"
|
||||
back_to_taxonomies_list: "Back to Taxonomies List"
|
||||
shipping_methods: "Shipping Methods"
|
||||
shipping_method: "Shipping Method"
|
||||
shipping_categories: "Shipping Categories"
|
||||
new_shipping_category: "New Shipping Category"
|
||||
back_to_shipping_categories: "Back To Shipping Categories"
|
||||
|
||||
@@ -24,6 +24,9 @@ en_IE:
|
||||
spree/credit_card:
|
||||
base: "Credit Card"
|
||||
number: "Number"
|
||||
month: "Month"
|
||||
verification_value: "Verification Value"
|
||||
year: "Year"
|
||||
order_cycle:
|
||||
orders_close_at: Close date
|
||||
variant_override:
|
||||
@@ -122,6 +125,7 @@ en_IE:
|
||||
not_array_error: "must be an array"
|
||||
invalid_element_error: "must contain only valid integers"
|
||||
datetime_picker_ui:
|
||||
current_text: Now
|
||||
close_text: Done
|
||||
time_text: Time
|
||||
enterprise_mailer:
|
||||
@@ -231,6 +235,7 @@ en_IE:
|
||||
enterprises: Enterprises
|
||||
enterprise_groups: Groups
|
||||
reports: Reports
|
||||
listing_reports: Listing Reports
|
||||
variant_overrides: Inventory
|
||||
import: Import
|
||||
spree_products: Spree Products
|
||||
@@ -391,20 +396,22 @@ en_IE:
|
||||
duplicate_code: "This code is used already."
|
||||
bill_address: "Billing Address"
|
||||
ship_address: "Shipping Address"
|
||||
update_address_success: 'Address updated successfully.'
|
||||
update_address_error: 'Sorry! Please input all of the required fields!'
|
||||
edit_bill_address: 'Edit Billing Address'
|
||||
edit_ship_address: 'Edit Shipping Address'
|
||||
required_fileds: 'Required fields are denoted with an asterisk'
|
||||
select_country: 'Select Country'
|
||||
select_state: 'Select County'
|
||||
edit: 'Edit'
|
||||
update_address: 'Update Address'
|
||||
confirm_delete: 'Sure to delete?'
|
||||
balance: "Balance"
|
||||
update_address_success: "Address updated successfully."
|
||||
update_address_error: "Sorry! Please input all of the required fields!"
|
||||
edit_bill_address: "Edit Billing Address"
|
||||
edit_ship_address: "Edit Shipping Address"
|
||||
required_fileds: "Required fields are denoted with an asterisk"
|
||||
select_country: "Select Country"
|
||||
select_state: "Select County"
|
||||
edit: "Edit"
|
||||
update_address: "Update Address"
|
||||
confirm_delete: "Sure to delete?"
|
||||
search_by_email: "Search by email/code..."
|
||||
guest_label: 'Guest checkout'
|
||||
guest_label: "Guest checkout"
|
||||
credit_owed: "Credit Owed"
|
||||
destroy:
|
||||
has_associated_orders: 'Delete failed: customer has associated orders with this shop'
|
||||
has_associated_orders: "Delete failed: customer has associated orders with this shop"
|
||||
contents:
|
||||
edit:
|
||||
title: Content
|
||||
@@ -600,6 +607,7 @@ en_IE:
|
||||
order_date: "Completed at"
|
||||
max: "Max"
|
||||
product_unit: "Product: Unit"
|
||||
weight_volume: "Weight/Volume (g)"
|
||||
ask: "Ask?"
|
||||
page_title: "Bulk Order Management"
|
||||
actions_delete: "Delete Selected"
|
||||
@@ -636,6 +644,8 @@ en_IE:
|
||||
acn_placeholder: eg. 123 456 789
|
||||
display_invoice_logo: Display logo in invoices
|
||||
invoice_text: Add customized text at the end of invoices
|
||||
terms_and_conditions: "Terms and Conditions"
|
||||
remove_terms_and_conditions: "Remove File"
|
||||
contact:
|
||||
name: Name
|
||||
name_placeholder: eg. Amanda Plum
|
||||
@@ -726,6 +736,8 @@ en_IE:
|
||||
enable_subscriptions_tip: "Enable subscriptions functionality?"
|
||||
enable_subscriptions_false: "Disabled"
|
||||
enable_subscriptions_true: "Enabled"
|
||||
customer_names_in_reports: "Customer Names in Reports"
|
||||
customer_names_tip: "Enable your suppliers to see your customers names in reports"
|
||||
customer_names_false: "Disabled"
|
||||
customer_names_true: "Enabled"
|
||||
shopfront_message: "Shopfront Message"
|
||||
@@ -1142,12 +1154,16 @@ en_IE:
|
||||
destroy_attachment_does_not_exist: "Logo does not exist"
|
||||
enterprise_promo_image:
|
||||
destroy_attachment_does_not_exist: "Promo image does not exist"
|
||||
enterprise_terms_and_conditions:
|
||||
destroy_attachment_does_not_exist: "Terms and Conditions file does not exist"
|
||||
orders:
|
||||
failed_to_update: "Failed to update order"
|
||||
checkout:
|
||||
already_ordered:
|
||||
cart: "cart"
|
||||
message_html: "You have an order for this order cycle already. Check the %{cart} to see the items you ordered before. You can also cancel items as long as the order cycle is open."
|
||||
terms_and_conditions:
|
||||
link_text: "Terms and Conditions"
|
||||
failed: "The checkout failed. Please let us know so that we can process your order."
|
||||
shops:
|
||||
hubs:
|
||||
@@ -1377,9 +1393,9 @@ en_IE:
|
||||
cookies_policy_link: "cookies policy"
|
||||
cookies_accept_button: "Accept Cookies"
|
||||
home_shop: Shop Now
|
||||
brandstory_headline: "Growing Local Food Online"
|
||||
brandstory_intro: "THE online community helping you to build a successful food enterprise"
|
||||
brandstory_part1: "The Open Food Network software platform allows farmers to sell produce online, at a price that works for them. It has been built specifically for selling food so it can handle tricky measures or stock levels that only food has - a dozen eggs, a bunch of parsley, a whole chicken that varies in weight…"
|
||||
brandstory_headline: "Powering a new food system"
|
||||
brandstory_intro: "Our open source platform enables new, ethical supply chains. Food producers can sell online, wholesalers can manage buying groups and supply produce through networks of food hubs and shops. Communities can bring together producers to create a virtual farmers’ market, building a resilient local food economy."
|
||||
brandstory_part1: "The Open Food Network software platform allows farmers and producers to sell at a price that works for them. It has been built specifically for selling food so it can handle tricky measures or stock levels that only food has - a dozen eggs, a bunch of parsley, a whole chicken that varies in weight…"
|
||||
brandstory_part2: "Food Producers can create an online shop, collect payments, sell through other shops on the platform and access reduced-rate courier services."
|
||||
brandstory_part3: "Wholesalers can integrate OFN with their existing systems and manage buying groups to supply customers with their produce through our national network of food hubs and shops."
|
||||
brandstory_part4: "Communities can bring together producers in their local area to create virtual farmers’ markets, building a resilient local food economy."
|
||||
@@ -1986,6 +2002,7 @@ en_IE:
|
||||
calculator: "Calculator"
|
||||
calculator_values: "Calculator values"
|
||||
calculator_settings_warning: "If you are changing the calculator type, you must save first before you can edit the calculator settings"
|
||||
calculator_preferred_unit_error: "must be kg or lb"
|
||||
flat_percent_per_item: "Flat Percent (per item)"
|
||||
flat_rate_per_item: "Flat Rate (per item)"
|
||||
flat_rate_per_order: "Flat Rate (per order)"
|
||||
@@ -2295,6 +2312,7 @@ en_IE:
|
||||
enterprise_name_error: "has already been taken. If this is your enterprise and you would like to claim ownership, or if you would like to trade with this enterprise please contact the current manager of this profile at %{email}."
|
||||
enterprise_owner_error: "^%{email} is not permitted to own any more enterprises (limit is %{enterprise_limit})."
|
||||
enterprise_role_uniqueness_error: "^That role is already present."
|
||||
enterprise_terms_and_conditions_type_error: "Only PDFs are allowed"
|
||||
inventory_item_visibility_error: must be true or false
|
||||
product_importer_file_error: "error: no file uploaded"
|
||||
product_importer_spreadsheet_error: "could not process file: invalid filetype"
|
||||
@@ -2361,8 +2379,9 @@ en_IE:
|
||||
admin:
|
||||
enterprise_limit_reached: "You have reached the standard limit of enterprises per account. Write to %{contact_email} if you need to increase it."
|
||||
modals:
|
||||
got_it: Got it
|
||||
got_it: "Got it"
|
||||
close: "Close"
|
||||
continue: "Continue"
|
||||
invite: "Invite"
|
||||
invite_title: "Invite an unregistered user"
|
||||
tag_rule_help:
|
||||
@@ -2579,6 +2598,8 @@ en_IE:
|
||||
immediate_logo_removal_warning: "The logo will be removed immediately after you confirm."
|
||||
removed_promo_image_successfully: "Promo image removed successfully"
|
||||
immediate_promo_image_removal_warning: "The promo image will be removed immediately after you confirm."
|
||||
immediate_terms_and_conditions_removal_warning: "The Terms and Conditions file will be removed immediately after you confirm."
|
||||
removed_terms_and_conditions_successfully: "Terms and Conditions file removed successfully"
|
||||
insufficient_stock: "Insufficient stock available, only %{on_hand} remaining"
|
||||
out_of_stock:
|
||||
reduced_stock_available: Reduced stock available
|
||||
@@ -2590,8 +2611,12 @@ en_IE:
|
||||
shopfront:
|
||||
variant:
|
||||
add_to_cart: "Add"
|
||||
in_cart: "in cart"
|
||||
quantity_in_cart: "%{quantity} in cart"
|
||||
bulk_buy_modal:
|
||||
min_quantity: "Min quantity"
|
||||
max_quantity: "Max quantity"
|
||||
price_breakdown: "Price breakdown"
|
||||
variants:
|
||||
on_demand:
|
||||
'yes': "Unlimited"
|
||||
@@ -2657,6 +2682,11 @@ en_IE:
|
||||
signup_or_login: "Start By signing up (or logging in)"
|
||||
have_an_account: "Already have an account?"
|
||||
action_login: "Log in now."
|
||||
stripe_elements:
|
||||
unknown_error_from_stripe: |
|
||||
There was a problem setting up your card in our payments gateway.
|
||||
Please refresh the page and try again, if it fails a second time,
|
||||
please contact us for support.
|
||||
inflections:
|
||||
each:
|
||||
one: "each"
|
||||
@@ -2787,6 +2817,8 @@ en_IE:
|
||||
adjustments: "Adjustments"
|
||||
payments: "Payments"
|
||||
return_authorizations: "Return Authorisations"
|
||||
credit_owed: "Credit Owed"
|
||||
new_adjustment: "New Adjustment"
|
||||
payment: "Payment"
|
||||
payment_method: "Payment Method"
|
||||
shipment: "Shipment"
|
||||
@@ -2924,6 +2956,7 @@ en_IE:
|
||||
new_taxonomy: "New Taxonomy"
|
||||
back_to_taxonomies_list: "Back to Taxonomies List"
|
||||
shipping_methods: "Shipping Methods"
|
||||
shipping_method: "Shipping Method"
|
||||
shipping_categories: "Shipping Categories"
|
||||
new_shipping_category: "New Shipping Category"
|
||||
back_to_shipping_categories: "Back To Shipping Categories"
|
||||
@@ -2965,13 +2998,18 @@ en_IE:
|
||||
inventory_error_flash_for_insufficient_quantity: "An item in your cart has become unavailable."
|
||||
inventory: Inventory
|
||||
zipcode: Postcode
|
||||
weight: Weight (per kg or lb)
|
||||
error_user_destroy_with_orders: "Users with completed orders may not be deleted"
|
||||
cannot_create_payment_without_payment_methods: "You cannot create a payment for an order without any payment methods defined."
|
||||
please_define_payment_methods: "Please define some payment methods first."
|
||||
options: "Options"
|
||||
has_no_shipped_units: "has no shipped units"
|
||||
successfully_created: '%{resource} has been successfully created!'
|
||||
successfully_updated: '%{resource} has been successfully updated!'
|
||||
payment_processing_failed: "Payment could not be processed, please check the details you entered"
|
||||
not_available: "N/A"
|
||||
order_populator:
|
||||
out_of_stock: '%{item} is out of stock.'
|
||||
actions:
|
||||
update: "Update"
|
||||
shared:
|
||||
@@ -2981,6 +3019,7 @@ en_IE:
|
||||
other: "%{count} errors prohibited this record from being saved:"
|
||||
there_were_problems_with_the_following_fields: "There were problems with the following fields"
|
||||
payments_list:
|
||||
date_time: "Date/time"
|
||||
amount: "Amount"
|
||||
payment_method: "Payment Method"
|
||||
payment_state: "Payment County"
|
||||
@@ -3253,6 +3292,8 @@ en_IE:
|
||||
bulk_coop_allocation: 'Bulk Co-op - Allocation'
|
||||
bulk_coop_packing_sheets: 'Bulk Co-op - Packing Sheets'
|
||||
bulk_coop_customer_payments: 'Bulk Co-op - Customer Payments'
|
||||
customer_names_message:
|
||||
customer_names_tip: "If customer names are hidden for orders you have supplied, you can contact the distributor and ask if they can update their shop preferences to allow their suppliers to view customer names."
|
||||
users:
|
||||
index:
|
||||
listing_users: "Listing Users"
|
||||
@@ -3387,6 +3428,7 @@ en_IE:
|
||||
issue_text: |
|
||||
If the above URL does not work try copying and pasting it into your browser.
|
||||
If you continue to have problems please feel free to contact us.
|
||||
subject: "Reset password instructions"
|
||||
confirmation_instructions:
|
||||
subject: "Please confirm your OFN account"
|
||||
shipment_mailer:
|
||||
@@ -3485,3 +3527,8 @@ en_IE:
|
||||
shipment:
|
||||
cannot_ready: "Cannot ready shipment."
|
||||
invalid_taxonomy_id: "Invalid taxonomy id."
|
||||
activerecord:
|
||||
models:
|
||||
spree/payment:
|
||||
one: Payment
|
||||
other: Payments
|
||||
|
||||
@@ -387,20 +387,21 @@ en_IN:
|
||||
duplicate_code: "This code is used already."
|
||||
bill_address: "Billing Address"
|
||||
ship_address: "Shipping Address"
|
||||
update_address_success: 'Address updated successfully.'
|
||||
update_address_error: 'Sorry! Please input all of the required fields!'
|
||||
edit_bill_address: 'Edit Billing Address'
|
||||
edit_ship_address: 'Edit Shipping Address'
|
||||
required_fileds: 'Required fields are denoted with an asterisk'
|
||||
select_country: 'Select Country'
|
||||
select_state: 'Select State'
|
||||
edit: 'Edit'
|
||||
update_address: 'Update Address'
|
||||
confirm_delete: 'Sure to delete?'
|
||||
balance: "Balance"
|
||||
update_address_success: "Address updated successfully."
|
||||
update_address_error: "Sorry! Please input all of the required fields!"
|
||||
edit_bill_address: "Edit Billing Address"
|
||||
edit_ship_address: "Edit Shipping Address"
|
||||
required_fileds: "Required fields are denoted with an asterisk"
|
||||
select_country: "Select Country"
|
||||
select_state: "Select State"
|
||||
edit: "Edit"
|
||||
update_address: "Update Address"
|
||||
confirm_delete: "Sure to delete?"
|
||||
search_by_email: "Search by email/code..."
|
||||
guest_label: 'Guest checkout'
|
||||
guest_label: "Guest checkout"
|
||||
destroy:
|
||||
has_associated_orders: 'Delete failed: customer has associated orders with this shop'
|
||||
has_associated_orders: "Delete failed: customer has associated orders with this shop"
|
||||
contents:
|
||||
edit:
|
||||
title: Content
|
||||
@@ -2355,8 +2356,9 @@ en_IN:
|
||||
admin:
|
||||
enterprise_limit_reached: "You have reached the standard limit of enterprises per account. Write to %{contact_email} if you need to increase it."
|
||||
modals:
|
||||
got_it: Got it
|
||||
got_it: "Got it"
|
||||
close: "Close"
|
||||
continue: "Continue"
|
||||
invite: "Invite"
|
||||
invite_title: "Invite an unregistered user"
|
||||
tag_rule_help:
|
||||
@@ -2918,6 +2920,7 @@ en_IN:
|
||||
new_taxonomy: "New Taxonomy"
|
||||
back_to_taxonomies_list: "Back to Taxonomies List"
|
||||
shipping_methods: "Shipping Methods"
|
||||
shipping_method: "Shipping Method"
|
||||
shipping_categories: "Shipping Categories"
|
||||
new_shipping_category: "New Shipping Category"
|
||||
back_to_shipping_categories: "Back To Shipping Categories"
|
||||
|
||||
@@ -393,20 +393,22 @@ en_NZ:
|
||||
duplicate_code: "This code is used already."
|
||||
bill_address: "Billing Address"
|
||||
ship_address: "Shipping Address"
|
||||
update_address_success: 'Address updated successfully.'
|
||||
update_address_error: 'Sorry! Please input all of the required fields!'
|
||||
edit_bill_address: 'Edit Billing Address'
|
||||
edit_ship_address: 'Edit Shipping Address'
|
||||
required_fileds: 'Required fields are denoted with an asterisk '
|
||||
select_country: 'Select Country'
|
||||
select_state: 'Select State'
|
||||
edit: 'Edit'
|
||||
update_address: 'Update Address'
|
||||
confirm_delete: 'Sure to delete?'
|
||||
balance: "Balance"
|
||||
update_address_success: "Address updated successfully."
|
||||
update_address_error: "Sorry! Please input all of the required fields!"
|
||||
edit_bill_address: "Edit Billing Address"
|
||||
edit_ship_address: "Edit Shipping Address"
|
||||
required_fileds: "Required fields are denoted with an asterisk "
|
||||
select_country: "Select Country"
|
||||
select_state: "Select State"
|
||||
edit: "Edit"
|
||||
update_address: "Update Address"
|
||||
confirm_delete: "Sure to delete?"
|
||||
search_by_email: "Search by email/code..."
|
||||
guest_label: 'Guest checkout'
|
||||
guest_label: "Guest checkout"
|
||||
credit_owed: "Credit Owed"
|
||||
destroy:
|
||||
has_associated_orders: 'Delete failed: customer has associated orders with his shop'
|
||||
has_associated_orders: "Delete failed: customer has associated orders with his shop"
|
||||
contents:
|
||||
edit:
|
||||
title: Content
|
||||
@@ -1158,8 +1160,7 @@ en_NZ:
|
||||
cart: "cart"
|
||||
message_html: "You have an order for this order cycle already. Check the %{cart} to see the items you ordered before. You can also cancel items as long as the order cycle is open."
|
||||
terms_and_conditions:
|
||||
message_html: "By placing this order you agree to the %{terms_and_conditions_link}."
|
||||
link_text: "Terms of Service"
|
||||
link_text: "Terms and Conditions"
|
||||
failed: "The checkout failed. Please let us know so that we can process your order."
|
||||
shops:
|
||||
hubs:
|
||||
@@ -2374,8 +2375,9 @@ en_NZ:
|
||||
admin:
|
||||
enterprise_limit_reached: "You have reached the standard limit of enterprises per account. Write to %{contact_email} if you need to increase it."
|
||||
modals:
|
||||
got_it: Got it
|
||||
got_it: "Got it"
|
||||
close: "Close"
|
||||
continue: "Continue"
|
||||
invite: "Invite"
|
||||
invite_title: "Invite an unregistered user"
|
||||
tag_rule_help:
|
||||
@@ -2940,6 +2942,7 @@ en_NZ:
|
||||
new_taxonomy: "New Taxonomy"
|
||||
back_to_taxonomies_list: "Back to Taxonomies List"
|
||||
shipping_methods: "Shipping Methods"
|
||||
shipping_method: "Shipping Method"
|
||||
shipping_categories: "Shipping Categories"
|
||||
new_shipping_category: "New Shipping Category"
|
||||
back_to_shipping_categories: "Back To Shipping Categories"
|
||||
|
||||
@@ -381,20 +381,21 @@ en_PH:
|
||||
duplicate_code: "This code is used already."
|
||||
bill_address: "Billing Address"
|
||||
ship_address: "Shipping Address"
|
||||
update_address_success: 'Address updated successfully.'
|
||||
update_address_error: 'Sorry! Please input all of the required fields!'
|
||||
edit_bill_address: 'Edit Billing Address'
|
||||
edit_ship_address: 'Edit Shipping Address'
|
||||
required_fileds: 'Required fields are denoted with an asterisk '
|
||||
select_country: 'Select Country'
|
||||
select_state: 'Select Province'
|
||||
edit: 'Edit'
|
||||
update_address: 'Update Address'
|
||||
confirm_delete: 'Sure to delete?'
|
||||
balance: "Balance"
|
||||
update_address_success: "Address updated successfully."
|
||||
update_address_error: "Sorry! Please input all of the required fields!"
|
||||
edit_bill_address: "Edit Billing Address"
|
||||
edit_ship_address: "Edit Shipping Address"
|
||||
required_fileds: "Required fields are denoted with an asterisk "
|
||||
select_country: "Select Country"
|
||||
select_state: "Select Province"
|
||||
edit: "Edit"
|
||||
update_address: "Update Address"
|
||||
confirm_delete: "Sure to delete?"
|
||||
search_by_email: "Search by email/code..."
|
||||
guest_label: 'Guest checkout'
|
||||
guest_label: "Guest checkout"
|
||||
destroy:
|
||||
has_associated_orders: 'Delete failed: customer has associated orders with his shop'
|
||||
has_associated_orders: "Delete failed: customer has associated orders with his shop"
|
||||
contents:
|
||||
edit:
|
||||
title: Content
|
||||
@@ -2322,8 +2323,9 @@ en_PH:
|
||||
admin:
|
||||
enterprise_limit_reached: "You have reached the standard limit of enterprises per account. Write to %{contact_email} if you need to increase it."
|
||||
modals:
|
||||
got_it: Got it
|
||||
got_it: "Got it"
|
||||
close: "Close"
|
||||
continue: "Continue"
|
||||
invite: "Invite"
|
||||
invite_title: "Invite an unregistered user"
|
||||
tag_rule_help:
|
||||
@@ -2873,6 +2875,7 @@ en_PH:
|
||||
new_taxonomy: "New Category"
|
||||
back_to_taxonomies_list: "Back to Taxonomies List"
|
||||
shipping_methods: "Shipping Methods"
|
||||
shipping_method: "Shipping Method"
|
||||
shipping_categories: "Shipping Categories"
|
||||
new_shipping_category: "New Shipping Category"
|
||||
back_to_shipping_categories: "Back To Shipping Categories"
|
||||
|
||||
@@ -393,20 +393,22 @@ en_US:
|
||||
duplicate_code: "This code is used already."
|
||||
bill_address: "Billing Address"
|
||||
ship_address: "Shipping Address"
|
||||
update_address_success: 'Address updated successfully.'
|
||||
update_address_error: 'Sorry! Please input all of the required fields!'
|
||||
edit_bill_address: 'Edit Billing Address'
|
||||
edit_ship_address: 'Edit Shipping Address'
|
||||
required_fileds: 'Required fields are denoted with an asterisk '
|
||||
select_country: 'Select Country'
|
||||
select_state: 'Select State'
|
||||
edit: 'Edit'
|
||||
update_address: 'Update Address'
|
||||
confirm_delete: 'Sure to delete?'
|
||||
balance: "Balance"
|
||||
update_address_success: "Address updated successfully."
|
||||
update_address_error: "Sorry! Please input all of the required fields!"
|
||||
edit_bill_address: "Edit Billing Address"
|
||||
edit_ship_address: "Edit Shipping Address"
|
||||
required_fileds: "Required fields are denoted with an asterisk "
|
||||
select_country: "Select Country"
|
||||
select_state: "Select State"
|
||||
edit: "Edit"
|
||||
update_address: "Update Address"
|
||||
confirm_delete: "Sure to delete?"
|
||||
search_by_email: "Search by email/code..."
|
||||
guest_label: 'Guest checkout'
|
||||
guest_label: "Guest checkout"
|
||||
credit_owed: "Credit Owed"
|
||||
destroy:
|
||||
has_associated_orders: 'Delete failed: customer has associated orders with his shop'
|
||||
has_associated_orders: "Delete failed: customer has associated orders with his shop"
|
||||
contents:
|
||||
edit:
|
||||
title: Content
|
||||
@@ -1158,8 +1160,7 @@ en_US:
|
||||
cart: "cart"
|
||||
message_html: "You have an order for this order cycle already. Check the %{cart} to see the items you ordered before. You can also cancel items as long as the order cycle is open."
|
||||
terms_and_conditions:
|
||||
message_html: "By placing this order you agree to the %{terms_and_conditions_link}."
|
||||
link_text: "Terms of Service"
|
||||
link_text: "Terms and Conditions"
|
||||
failed: "The checkout failed. Please let us know so that we can process your order."
|
||||
shops:
|
||||
hubs:
|
||||
@@ -2375,8 +2376,9 @@ en_US:
|
||||
admin:
|
||||
enterprise_limit_reached: "You have reached the standard limit of enterprises per account. Write to %{contact_email} if you need to increase it."
|
||||
modals:
|
||||
got_it: Got it
|
||||
got_it: "Got it"
|
||||
close: "Close"
|
||||
continue: "Continue"
|
||||
invite: "Invite"
|
||||
invite_title: "Invite an unregistered user"
|
||||
tag_rule_help:
|
||||
@@ -2941,6 +2943,7 @@ en_US:
|
||||
new_taxonomy: "New Taxonomy"
|
||||
back_to_taxonomies_list: "Back to Taxonomies List"
|
||||
shipping_methods: "Shipping Methods"
|
||||
shipping_method: "Shipping Method"
|
||||
shipping_categories: "Shipping Categories"
|
||||
new_shipping_category: "New Shipping Category"
|
||||
back_to_shipping_categories: "Back To Shipping Categories"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user