Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
49de11567b | ||
|
|
3af0365c6b | ||
|
|
be92b0049b | ||
|
|
a1c94d0d9f | ||
|
|
f6bb8a9a04 |
@@ -16,10 +16,6 @@ plugins:
|
||||
enabled: false
|
||||
PropertySortOrder:
|
||||
enabled: false
|
||||
StringQuotes:
|
||||
enabled: false
|
||||
DeclarationOrder:
|
||||
enabled: false
|
||||
duplication:
|
||||
enabled: true
|
||||
exclude_patterns:
|
||||
|
||||
1
.gitignore
vendored
@@ -31,7 +31,6 @@ public/system
|
||||
public/stylesheets
|
||||
public/images
|
||||
public/spree
|
||||
public/assets
|
||||
config/abr.yml
|
||||
config/initializers/feature_toggle.rb
|
||||
NERD_tree*
|
||||
|
||||
@@ -33,6 +33,7 @@ Layout/LineLength:
|
||||
- app/controllers/admin/inventory_items_controller.rb
|
||||
- app/controllers/admin/manager_invitations_controller.rb
|
||||
- app/controllers/admin/product_import_controller.rb
|
||||
- app/controllers/admin/proxy_orders_controller.rb
|
||||
- app/controllers/admin/schedules_controller.rb
|
||||
- app/controllers/admin/subscriptions_controller.rb
|
||||
- app/controllers/admin/variant_overrides_controller.rb
|
||||
@@ -88,6 +89,7 @@ Layout/LineLength:
|
||||
- app/models/spree/tax_rate_decorator.rb
|
||||
- app/models/spree/taxon_decorator.rb
|
||||
- app/models/spree/user.rb
|
||||
- app/models/spree/variant_decorator.rb
|
||||
- app/models/subscription.rb
|
||||
- app/models/variant_override.rb
|
||||
- app/models/variant_override_set.rb
|
||||
@@ -96,6 +98,7 @@ Layout/LineLength:
|
||||
- app/services/embedded_page_service.rb
|
||||
- app/services/order_cycle_form.rb
|
||||
- app/services/order_factory.rb
|
||||
- app/services/subscriptions_count.rb
|
||||
- app/services/variants_stock_levels.rb
|
||||
- engines/web/app/helpers/web/cookies_policy_helper.rb
|
||||
- lib/discourse/single_sign_on.rb
|
||||
@@ -142,6 +145,7 @@ Layout/LineLength:
|
||||
- spec/controllers/api/product_images_controller_spec.rb
|
||||
- spec/controllers/api/products_controller_spec.rb
|
||||
- spec/controllers/api/promo_images_controller_spec.rb
|
||||
- spec/controllers/api/shipments_controller_spec.rb
|
||||
- spec/controllers/api/variants_controller_spec.rb
|
||||
- spec/controllers/cart_controller_spec.rb
|
||||
- spec/controllers/checkout_controller_spec.rb
|
||||
@@ -154,6 +158,7 @@ Layout/LineLength:
|
||||
- spec/controllers/spree/admin/orders/customer_details_controller_spec.rb
|
||||
- spec/controllers/spree/admin/orders_controller_spec.rb
|
||||
- spec/controllers/spree/admin/payment_methods_controller_spec.rb
|
||||
- spec/controllers/spree/admin/payments_controller_spec.rb
|
||||
- spec/controllers/spree/admin/products_controller_spec.rb
|
||||
- spec/controllers/spree/admin/reports_controller_spec.rb
|
||||
- spec/controllers/spree/admin/variants_controller_spec.rb
|
||||
@@ -178,6 +183,7 @@ Layout/LineLength:
|
||||
- spec/features/admin/image_settings_spec.rb
|
||||
- spec/features/admin/multilingual_spec.rb
|
||||
- spec/features/admin/order_cycles_spec.rb
|
||||
- spec/features/admin/orders_spec.rb
|
||||
- spec/features/admin/overview_spec.rb
|
||||
- spec/features/admin/payment_method_spec.rb
|
||||
- spec/features/admin/product_import_spec.rb
|
||||
@@ -225,6 +231,7 @@ Layout/LineLength:
|
||||
- spec/lib/open_food_network/group_buy_report_spec.rb
|
||||
- spec/lib/open_food_network/lettuce_share_report_spec.rb
|
||||
- spec/lib/open_food_network/option_value_namer_spec.rb
|
||||
- spec/lib/open_food_network/order_and_distributor_report_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
|
||||
@@ -232,7 +239,10 @@ Layout/LineLength:
|
||||
- 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/proxy_order_syncer_spec.rb
|
||||
- spec/lib/open_food_network/scope_variant_to_hub_spec.rb
|
||||
- spec/lib/open_food_network/subscription_payment_updater_spec.rb
|
||||
- spec/lib/open_food_network/subscription_summarizer_spec.rb
|
||||
- spec/lib/open_food_network/tag_rule_applicator_spec.rb
|
||||
- spec/lib/open_food_network/users_and_enterprises_report_spec.rb
|
||||
- spec/lib/open_food_network/xero_invoices_report_spec.rb
|
||||
@@ -307,6 +317,10 @@ Layout/LineLength:
|
||||
- spec/services/permissions/order_spec.rb
|
||||
- spec/services/product_tag_rules_filterer_spec.rb
|
||||
- spec/services/products_renderer_spec.rb
|
||||
- spec/services/subscription_estimator_spec.rb
|
||||
- spec/services/subscription_form_spec.rb
|
||||
- spec/services/subscription_validator_spec.rb
|
||||
- spec/services/subscription_variants_service_spec.rb
|
||||
- spec/spec_helper.rb
|
||||
- spec/support/cancan_helper.rb
|
||||
- spec/support/delayed_job_helper.rb
|
||||
@@ -372,6 +386,7 @@ Metrics/AbcSize:
|
||||
- app/helpers/spree/admin/base_helper.rb
|
||||
- app/helpers/spree/admin/zones_helper.rb
|
||||
- app/helpers/spree/orders_helper.rb
|
||||
- app/mailers/producer_mailer.rb
|
||||
- app/models/calculator/flat_percent_per_item.rb
|
||||
- app/models/column_preference.rb
|
||||
- app/models/enterprise.rb
|
||||
@@ -396,7 +411,7 @@ Metrics/AbcSize:
|
||||
- app/services/cart_service.rb
|
||||
- app/services/create_order_cycle.rb
|
||||
- app/services/order_syncer.rb
|
||||
- engines/order_management/app/services/order_management/subscriptions/validator.rb
|
||||
- app/services/subscription_validator.rb
|
||||
- lib/active_merchant/billing/gateways/stripe_decorator.rb
|
||||
- lib/active_merchant/billing/gateways/stripe_payment_intents.rb
|
||||
- lib/discourse/single_sign_on.rb
|
||||
@@ -462,6 +477,7 @@ Metrics/BlockLength:
|
||||
- spec/factories/shipping_method_factory.rb
|
||||
- spec/factories/subscription_factory.rb
|
||||
- spec/factories/variant_factory.rb
|
||||
- spec/features/admin/orders_spec.rb
|
||||
- spec/features/consumer/shopping/embedded_shopfronts_spec.rb
|
||||
- spec/lib/open_food_network/group_buy_report_spec.rb
|
||||
- spec/models/tag_rule/discount_order_spec.rb
|
||||
@@ -567,6 +583,7 @@ Metrics/MethodLength:
|
||||
- app/helpers/spree/admin/navigation_helper.rb
|
||||
- app/helpers/spree/admin/base_helper.rb
|
||||
- app/jobs/subscription_placement_job.rb
|
||||
- app/mailers/producer_mailer.rb
|
||||
- app/models/column_preference.rb
|
||||
- app/models/enterprise.rb
|
||||
- app/models/enterprise_relationship.rb
|
||||
@@ -669,12 +686,6 @@ Metrics/ModuleLength:
|
||||
- app/helpers/injection_helper.rb
|
||||
- app/helpers/spree/admin/navigation_helper.rb
|
||||
- app/helpers/spree/admin/base_helper.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/enterprises_controller_spec.rb
|
||||
- spec/controllers/admin/order_cycles_controller_spec.rb
|
||||
@@ -690,7 +701,9 @@ Metrics/ModuleLength:
|
||||
- spec/lib/open_food_network/order_grouper_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/proxy_order_syncer_spec.rb
|
||||
- spec/lib/open_food_network/scope_variant_to_hub_spec.rb
|
||||
- spec/lib/open_food_network/subscription_payment_updater_spec.rb
|
||||
- spec/lib/open_food_network/tag_rule_applicator_spec.rb
|
||||
- spec/lib/open_food_network/users_and_enterprises_report_spec.rb
|
||||
- spec/models/spree/ability_spec.rb
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
# rubocop locally, the default configuration file `.rubocop.yml` loads
|
||||
# our "todo lists" to ignore all current violations.
|
||||
AllCops:
|
||||
TargetRailsVersion: 4.0
|
||||
TargetRailsVersion: 3.2
|
||||
Exclude:
|
||||
- 'bin/**/*'
|
||||
- 'db/**/*'
|
||||
@@ -20,6 +20,9 @@ AllCops:
|
||||
#
|
||||
# Cop settings that have been agreed upon by the OFN community
|
||||
|
||||
Rails:
|
||||
Enabled: true
|
||||
|
||||
Style/Documentation:
|
||||
Enabled: false
|
||||
|
||||
@@ -58,6 +61,24 @@ Lint/UselessAssignment:
|
||||
Exclude:
|
||||
- spec/**/*
|
||||
|
||||
# AFAIK, there is no good alternative to dynamic matchers until we upgrade
|
||||
# to Rails 4 and can use #find_by. If there is a better approach, let's do it.
|
||||
Rails/DynamicFindBy:
|
||||
Enabled: false
|
||||
|
||||
# Same as above, #find_by is not available until Rails 4
|
||||
Rails/FindBy:
|
||||
Enabled: false
|
||||
|
||||
# Same as above, #update! is not available until Rails 4
|
||||
Rails/ActiveRecordAliases:
|
||||
Enabled: false
|
||||
|
||||
# This should be the programmer's discretion, perhaps we should review all of
|
||||
# the uses of it an make specific exceptions though.
|
||||
Rails/SkipsModelValidations:
|
||||
Enabled: false
|
||||
|
||||
## Relaxed.Ruby.Style SETTINGS
|
||||
#
|
||||
# These styles are a starting point for the conversation around conventions
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# This configuration was generated by
|
||||
# `rubocop --auto-gen-config --exclude-limit 1400`
|
||||
# on 2020-02-22 11:23:29 +0000 using RuboCop version 0.80.0.
|
||||
# on 2020-01-09 11:26:09 +1100 using RuboCop version 0.79.0.
|
||||
# The point is for the user to remove these configuration records
|
||||
# one by one as the offenses are removed from the code base.
|
||||
# Note that changes in the inspected code, or installation of new
|
||||
@@ -14,11 +14,10 @@ Layout/EmptyLineAfterGuardClause:
|
||||
- 'lib/open_food_network/orders_and_fulfillments_report.rb'
|
||||
- 'lib/open_food_network/packing_report.rb'
|
||||
|
||||
# Offense count: 2
|
||||
# Offense count: 1
|
||||
# Cop supports --auto-correct.
|
||||
Layout/EmptyLines:
|
||||
Exclude:
|
||||
- 'app/models/spree/adjustment_decorator.rb'
|
||||
- 'spec/features/admin/order_cycles_spec.rb'
|
||||
|
||||
# Offense count: 1
|
||||
@@ -29,14 +28,6 @@ Layout/EmptyLinesAroundBlockBody:
|
||||
Exclude:
|
||||
- 'spec/controllers/api/orders_controller_spec.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: EnforcedStyleAlignWith, AutoCorrect, Severity.
|
||||
# SupportedStylesAlignWith: keyword, variable, start_of_line
|
||||
Layout/EndAlignment:
|
||||
Exclude:
|
||||
- 'lib/open_food_network/permalink_generator.rb'
|
||||
|
||||
# Offense count: 2
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
|
||||
@@ -47,27 +38,12 @@ Layout/HashAlignment:
|
||||
Exclude:
|
||||
- 'spec/lib/open_food_network/orders_and_fulfillments_report/customer_totals_report_spec.rb'
|
||||
|
||||
# Offense count: 8
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: AllowDoxygenCommentStyle, AllowGemfileRubyComment.
|
||||
Layout/LeadingCommentSpace:
|
||||
Exclude:
|
||||
- 'Gemfile'
|
||||
- 'app/helpers/application_helper.rb'
|
||||
- 'app/models/enterprise.rb'
|
||||
|
||||
# Offense count: 3
|
||||
# Offense count: 27
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
||||
# URISchemes: http, https
|
||||
Layout/LineLength:
|
||||
Max: 115
|
||||
|
||||
# Offense count: 1
|
||||
# Cop supports --auto-correct.
|
||||
Layout/SpaceAfterColon:
|
||||
Exclude:
|
||||
- 'lib/open_food_network/order_cycle_form_applicator.rb'
|
||||
Max: 129
|
||||
|
||||
# Offense count: 2
|
||||
# Cop supports --auto-correct.
|
||||
@@ -78,26 +54,14 @@ Layout/SpaceAroundOperators:
|
||||
- 'app/services/cart_service.rb'
|
||||
- 'spec/support/cancan_helper.rb'
|
||||
|
||||
# Offense count: 2
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces.
|
||||
# SupportedStyles: space, no_space, compact
|
||||
# SupportedStylesForEmptyBraces: space, no_space
|
||||
Layout/SpaceInsideHashLiteralBraces:
|
||||
Exclude:
|
||||
- 'spec/controllers/checkout_controller_spec.rb'
|
||||
|
||||
# Offense count: 2
|
||||
# Offense count: 4
|
||||
Lint/AmbiguousOperator:
|
||||
Exclude:
|
||||
- 'app/controllers/spree/admin/orders/customer_details_controller_decorator.rb'
|
||||
- 'app/controllers/spree/admin/orders_controller_decorator.rb'
|
||||
- 'spec/controllers/api/enterprise_fees_controller_spec.rb'
|
||||
- 'spec/controllers/spree/admin/payments_controller_spec.rb'
|
||||
|
||||
# Offense count: 2
|
||||
Lint/Debugger:
|
||||
Exclude:
|
||||
- 'app/services/order_factory.rb'
|
||||
|
||||
# Offense count: 1
|
||||
Lint/DuplicateHashKey:
|
||||
Exclude:
|
||||
@@ -107,6 +71,7 @@ Lint/DuplicateHashKey:
|
||||
Lint/DuplicateMethods:
|
||||
Exclude:
|
||||
- 'lib/discourse/single_sign_on.rb'
|
||||
- 'lib/open_food_network/subscription_summary.rb'
|
||||
|
||||
# Offense count: 10
|
||||
Lint/IneffectiveAccessModifier:
|
||||
@@ -152,32 +117,16 @@ Lint/UselessAccessModifier:
|
||||
- 'lib/open_food_network/reports/bulk_coop_report.rb'
|
||||
- 'spec/lib/open_food_network/reports/report_spec.rb'
|
||||
|
||||
# Offense count: 1
|
||||
Lint/UselessAssignment:
|
||||
Exclude:
|
||||
- 'spec/**/*'
|
||||
- 'app/models/enterprise.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# Configuration parameters: CheckForMethodsWithNoSideEffects.
|
||||
Lint/Void:
|
||||
Exclude:
|
||||
- 'app/serializers/api/enterprise_serializer.rb'
|
||||
|
||||
# Offense count: 1
|
||||
Metrics/AbcSize:
|
||||
Max: 16
|
||||
|
||||
# Offense count: 1
|
||||
# Configuration parameters: CountComments, ExcludedMethods.
|
||||
# ExcludedMethods: refine
|
||||
Metrics/BlockLength:
|
||||
Max: 27
|
||||
|
||||
# Offense count: 1
|
||||
# Configuration parameters: CountComments.
|
||||
Metrics/ModuleLength:
|
||||
Max: 121
|
||||
Max: 114
|
||||
|
||||
# Offense count: 8
|
||||
Naming/AccessorMethodName:
|
||||
@@ -195,20 +144,22 @@ Naming/HeredocDelimiterNaming:
|
||||
Exclude:
|
||||
- 'app/models/content_configuration.rb'
|
||||
|
||||
# Offense count: 3
|
||||
# Offense count: 4
|
||||
# Configuration parameters: EnforcedStyleForLeadingUnderscores.
|
||||
# SupportedStylesForLeadingUnderscores: disallowed, required, optional
|
||||
Naming/MemoizedInstanceVariableName:
|
||||
Exclude:
|
||||
- 'app/controllers/spree/admin/payments_controller_decorator.rb'
|
||||
- 'lib/open_food_network/address_finder.rb'
|
||||
|
||||
# Offense count: 7
|
||||
# Offense count: 8
|
||||
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
|
||||
# AllowedNames: io, id, to, by, on, in, at, ip, db, os, pp
|
||||
# AllowedNames: io, id, to, by, on, in, at, ip, db, os
|
||||
Naming/MethodParameterName:
|
||||
Exclude:
|
||||
- 'app/helpers/spree/admin/base_helper_decorator.rb'
|
||||
- 'app/helpers/spree/base_helper_decorator.rb'
|
||||
- 'engines/order_management/app/services/order_management/subscriptions/validator.rb'
|
||||
- 'app/services/subscription_validator.rb'
|
||||
- 'lib/open_food_network/reports/bulk_coop_report.rb'
|
||||
- 'lib/open_food_network/xero_invoices_report.rb'
|
||||
- 'spec/lib/open_food_network/reports/report_spec.rb'
|
||||
@@ -223,6 +174,7 @@ Naming/MethodParameterName:
|
||||
Naming/PredicateName:
|
||||
Exclude:
|
||||
- 'spec/**/*'
|
||||
- 'app/mailers/producer_mailer.rb'
|
||||
- 'app/models/enterprise.rb'
|
||||
- 'app/models/enterprise_relationship.rb'
|
||||
- 'app/models/order_cycle.rb'
|
||||
@@ -240,7 +192,7 @@ Naming/PredicateName:
|
||||
- 'lib/open_food_network/packing_report.rb'
|
||||
- 'lib/tasks/data.rake'
|
||||
|
||||
# Offense count: 154
|
||||
# Offense count: 152
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: EnforcedStyle, Include.
|
||||
# SupportedStyles: action, filter
|
||||
@@ -281,22 +233,22 @@ Rails/ActionFilter:
|
||||
- 'app/controllers/spree/admin/base_controller.rb'
|
||||
- 'app/controllers/spree/admin/images_controller.rb'
|
||||
- 'app/controllers/spree/admin/mail_methods_controller.rb'
|
||||
- 'app/controllers/spree/admin/orders/customer_details_controller.rb'
|
||||
- 'app/controllers/spree/admin/orders_controller.rb'
|
||||
- 'app/controllers/spree/admin/orders/customer_details_controller_decorator.rb'
|
||||
- 'app/controllers/spree/admin/orders_controller_decorator.rb'
|
||||
- 'app/controllers/spree/admin/payment_methods_controller.rb'
|
||||
- 'app/controllers/spree/admin/payments_controller.rb'
|
||||
- 'app/controllers/spree/admin/payments_controller_decorator.rb'
|
||||
- 'app/controllers/spree/admin/product_properties_controller.rb'
|
||||
- 'app/controllers/spree/admin/products_controller.rb'
|
||||
- 'app/controllers/spree/admin/products_controller_decorator.rb'
|
||||
- 'app/controllers/spree/admin/reports/enterprise_fee_summaries_controller.rb'
|
||||
- 'app/controllers/spree/admin/reports_controller.rb'
|
||||
- 'app/controllers/spree/admin/resource_controller.rb'
|
||||
- 'app/controllers/spree/admin/search_controller.rb'
|
||||
- 'app/controllers/spree/admin/shipping_methods_controller.rb'
|
||||
- 'app/controllers/spree/admin/states_controller.rb'
|
||||
- 'app/controllers/spree/admin/tax_rates_controller.rb'
|
||||
- 'app/controllers/spree/admin/users_controller.rb'
|
||||
- 'app/controllers/spree/admin/zones_controller.rb'
|
||||
- 'app/controllers/spree/checkout_controller.rb'
|
||||
- 'app/controllers/spree/orders_controller.rb'
|
||||
- 'app/controllers/spree/paypal_controller_decorator.rb'
|
||||
- 'app/controllers/spree/store_controller.rb'
|
||||
- 'app/controllers/spree/user_registrations_controller.rb'
|
||||
- 'app/controllers/spree/user_sessions_controller.rb'
|
||||
@@ -305,78 +257,6 @@ Rails/ActionFilter:
|
||||
- 'app/controllers/user_passwords_controller.rb'
|
||||
- 'app/controllers/user_registrations_controller.rb'
|
||||
|
||||
# Offense count: 192
|
||||
# Cop supports --auto-correct.
|
||||
Rails/ActiveRecordAliases:
|
||||
Exclude:
|
||||
- 'app/controllers/admin/bulk_line_items_controller.rb'
|
||||
- 'app/controllers/admin/enterprises_controller.rb'
|
||||
- 'app/controllers/admin/subscriptions_controller.rb'
|
||||
- 'app/controllers/api/customers_controller.rb'
|
||||
- 'app/controllers/api/enterprise_attachment_controller.rb'
|
||||
- 'app/controllers/api/enterprises_controller.rb'
|
||||
- 'app/controllers/api/product_images_controller.rb'
|
||||
- 'app/controllers/api/products_controller.rb'
|
||||
- 'app/controllers/api/shipments_controller.rb'
|
||||
- 'app/controllers/api/taxons_controller.rb'
|
||||
- 'app/controllers/api/variants_controller.rb'
|
||||
- 'app/controllers/checkout_controller.rb'
|
||||
- 'app/controllers/spree/admin/orders/customer_details_controller.rb'
|
||||
- 'app/controllers/spree/admin/orders_controller.rb'
|
||||
- 'app/controllers/spree/admin/payment_methods_controller.rb'
|
||||
- 'app/controllers/spree/admin/resource_controller.rb'
|
||||
- 'app/controllers/spree/admin/taxons_controller.rb'
|
||||
- 'app/controllers/spree/admin/users_controller.rb'
|
||||
- 'app/controllers/spree/credit_cards_controller.rb'
|
||||
- 'app/controllers/spree/orders_controller.rb'
|
||||
- 'app/controllers/spree/users_controller.rb'
|
||||
- 'app/helpers/i18n_helper.rb'
|
||||
- 'app/jobs/subscription_placement_job.rb'
|
||||
- 'app/models/spree/adjustment_decorator.rb'
|
||||
- 'app/models/spree/line_item_decorator.rb'
|
||||
- 'app/models/spree/product_set.rb'
|
||||
- 'app/services/line_item_syncer.rb'
|
||||
- 'app/services/order_factory.rb'
|
||||
- 'app/services/order_syncer.rb'
|
||||
- 'app/services/user_default_address_setter.rb'
|
||||
- 'lib/open_food_network/order_cycle_form_applicator.rb'
|
||||
- 'lib/open_food_network/subscription_payment_updater.rb'
|
||||
- 'lib/stripe/profile_storer.rb'
|
||||
- 'spec/controllers/admin/proxy_orders_controller_spec.rb'
|
||||
- 'spec/controllers/admin/subscriptions_controller_spec.rb'
|
||||
- 'spec/controllers/api/orders_controller_spec.rb'
|
||||
- 'spec/controllers/line_items_controller_spec.rb'
|
||||
- 'spec/controllers/spree/admin/payment_methods_controller_spec.rb'
|
||||
- 'spec/controllers/spree/orders_controller_spec.rb'
|
||||
- 'spec/features/admin/order_cycles_spec.rb'
|
||||
- 'spec/features/admin/subscriptions_spec.rb'
|
||||
- 'spec/features/admin/variant_overrides_spec.rb'
|
||||
- 'spec/features/admin/variants_spec.rb'
|
||||
- 'spec/features/consumer/account_spec.rb'
|
||||
- 'spec/features/consumer/registration_spec.rb'
|
||||
- 'spec/features/consumer/shopping/cart_spec.rb'
|
||||
- 'spec/features/consumer/shopping/orders_spec.rb'
|
||||
- 'spec/features/consumer/shopping/shopping_spec.rb'
|
||||
- 'spec/jobs/subscription_confirm_job_spec.rb'
|
||||
- 'spec/jobs/subscription_placement_job_spec.rb'
|
||||
- 'spec/lib/open_food_network/proxy_order_syncer_spec.rb'
|
||||
- 'spec/models/customer_spec.rb'
|
||||
- 'spec/models/enterprise_caching_spec.rb'
|
||||
- 'spec/models/exchange_spec.rb'
|
||||
- 'spec/models/order_cycle_spec.rb'
|
||||
- 'spec/models/producer_property_spec.rb'
|
||||
- 'spec/models/proxy_order_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/order_spec.rb'
|
||||
- 'spec/models/spree/product_spec.rb'
|
||||
- 'spec/models/spree/user_spec.rb'
|
||||
- 'spec/models/spree/variant_spec.rb'
|
||||
- 'spec/requests/checkout/stripe_connect_spec.rb'
|
||||
- 'spec/services/order_syncer_spec.rb'
|
||||
- 'spec/services/subscription_estimator_spec.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# Configuration parameters: EnforcedStyle.
|
||||
# SupportedStyles: strict, flexible
|
||||
@@ -384,18 +264,6 @@ Rails/Date:
|
||||
Exclude:
|
||||
- 'app/models/order_cycle.rb'
|
||||
|
||||
# Offense count: 5
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: Whitelist.
|
||||
# Whitelist: find_by_sql
|
||||
Rails/DynamicFindBy:
|
||||
Exclude:
|
||||
- 'app/controllers/spree/admin/orders/customer_details_controller.rb'
|
||||
- 'app/controllers/spree/admin/orders_controller.rb'
|
||||
- 'app/controllers/spree/admin/payments_controller.rb'
|
||||
- 'app/controllers/spree/admin/products_controller.rb'
|
||||
- 'spec/support/request/web_helper.rb'
|
||||
|
||||
# Offense count: 16
|
||||
# Configuration parameters: EnforcedStyle.
|
||||
# SupportedStyles: slashes, arguments
|
||||
@@ -414,18 +282,6 @@ Rails/FilePath:
|
||||
- 'spec/serializers/api/admin/enterprise_serializer_spec.rb'
|
||||
- 'spec/support/downloads_helper.rb'
|
||||
|
||||
# Offense count: 7
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: Include.
|
||||
# Include: app/models/**/*.rb
|
||||
Rails/FindBy:
|
||||
Exclude:
|
||||
- 'app/models/enterprise.rb'
|
||||
- 'app/models/product_import/entry_processor.rb'
|
||||
- 'app/models/product_import/entry_validator.rb'
|
||||
- 'app/models/product_import/spreadsheet_data.rb'
|
||||
- 'app/models/spree/user.rb'
|
||||
|
||||
# Offense count: 7
|
||||
# Configuration parameters: Include.
|
||||
# Include: app/models/**/*.rb
|
||||
@@ -438,7 +294,7 @@ Rails/HasAndBelongsToMany:
|
||||
- 'app/models/spree/concerns/payment_method_distributors.rb'
|
||||
- 'app/models/spree/line_item_decorator.rb'
|
||||
|
||||
# Offense count: 24
|
||||
# Offense count: 26
|
||||
# Configuration parameters: Include.
|
||||
# Include: app/models/**/*.rb
|
||||
Rails/HasManyOrHasOneDependent:
|
||||
@@ -455,7 +311,7 @@ Rails/HasManyOrHasOneDependent:
|
||||
- 'app/models/spree/variant_decorator.rb'
|
||||
- 'app/models/subscription.rb'
|
||||
|
||||
# Offense count: 83
|
||||
# Offense count: 78
|
||||
# Configuration parameters: Include.
|
||||
# Include: app/helpers/**/*.rb
|
||||
Rails/HelperInstanceVariable:
|
||||
@@ -467,27 +323,19 @@ Rails/HelperInstanceVariable:
|
||||
- 'app/helpers/injection_helper.rb'
|
||||
- 'app/helpers/order_cycles_helper.rb'
|
||||
- 'app/helpers/shared_helper.rb'
|
||||
- 'app/helpers/shop_helper.rb'
|
||||
- 'app/helpers/spree/admin/orders_helper.rb'
|
||||
- 'app/helpers/spree/admin/orders_helper_decorator.rb'
|
||||
- 'app/helpers/spree/orders_helper.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# Configuration parameters: Include.
|
||||
# Include: app/**/*.rb, config/**/*.rb, db/**/*.rb, lib/**/*.rb
|
||||
Rails/Output:
|
||||
Exclude:
|
||||
- 'app/services/order_factory.rb'
|
||||
|
||||
# Offense count: 12
|
||||
# Offense count: 6
|
||||
Rails/OutputSafety:
|
||||
Exclude:
|
||||
- 'app/controllers/spree/admin/reports_controller.rb'
|
||||
- 'app/helpers/angular_form_helper.rb'
|
||||
- 'app/helpers/spree/admin/base_helper.rb'
|
||||
- 'app/helpers/spree/admin/navigation_helper.rb'
|
||||
- 'app/helpers/spree/admin/orders_helper.rb'
|
||||
- 'app/helpers/spree/admin/zones_helper.rb'
|
||||
- 'app/helpers/spree/reports_helper.rb'
|
||||
- 'app/helpers/spree/admin/navigation_helper.rb'
|
||||
- 'app/helpers/spree/admin/orders_helper.rb'
|
||||
- 'app/serializers/api/product_serializer.rb'
|
||||
- 'lib/spree/money_decorator.rb'
|
||||
- 'spec/features/admin/orders_spec.rb'
|
||||
@@ -507,86 +355,6 @@ Rails/ReflectionClassName:
|
||||
- 'app/models/enterprise_role.rb'
|
||||
- 'app/models/subscription.rb'
|
||||
|
||||
# Offense count: 213
|
||||
# Configuration parameters: Blacklist, Whitelist.
|
||||
# Blacklist: decrement!, decrement_counter, increment!, increment_counter, toggle!, touch, update_all, update_attribute, update_column, update_columns, update_counters
|
||||
Rails/SkipsModelValidations:
|
||||
Exclude:
|
||||
- 'app/controllers/spree/admin/payment_methods_controller.rb'
|
||||
- 'app/controllers/spree/admin/resource_controller.rb'
|
||||
- 'app/controllers/spree/admin/shipping_methods_controller.rb'
|
||||
- 'app/controllers/spree/admin/taxons_controller.rb'
|
||||
- 'app/controllers/spree/orders_controller.rb'
|
||||
- 'app/jobs/subscription_confirm_job.rb'
|
||||
- 'app/jobs/subscription_placement_job.rb'
|
||||
- 'app/models/enterprise.rb'
|
||||
- 'app/models/enterprise_relationship.rb'
|
||||
- 'app/models/product_import/inventory_reset_strategy.rb'
|
||||
- 'app/models/proxy_order.rb'
|
||||
- 'app/models/spree/address_decorator.rb'
|
||||
- 'app/models/spree/credit_card_decorator.rb'
|
||||
- 'app/models/spree/order_decorator.rb'
|
||||
- 'app/models/spree/payment_decorator.rb'
|
||||
- 'app/models/subscription.rb'
|
||||
- 'app/models/variant_override.rb'
|
||||
- 'app/services/order_factory.rb'
|
||||
- 'engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/report_service_spec.rb'
|
||||
- 'lib/tasks/data/anonymize_data.rake'
|
||||
- 'lib/tasks/sample_data/product_factory.rb'
|
||||
- 'lib/tasks/users.rake'
|
||||
- 'spec/controllers/admin/subscription_line_items_controller_spec.rb'
|
||||
- 'spec/controllers/admin/variant_overrides_controller_spec.rb'
|
||||
- 'spec/controllers/api/order_cycles_controller_spec.rb'
|
||||
- 'spec/controllers/api/orders_controller_spec.rb'
|
||||
- 'spec/controllers/api/products_controller_spec.rb'
|
||||
- 'spec/controllers/api/shipments_controller_spec.rb'
|
||||
- 'spec/controllers/api/variants_controller_spec.rb'
|
||||
- 'spec/controllers/checkout_controller_spec.rb'
|
||||
- 'spec/controllers/enterprises_controller_spec.rb'
|
||||
- 'spec/controllers/spree/admin/orders_controller_spec.rb'
|
||||
- 'spec/controllers/spree/admin/overview_controller_spec.rb'
|
||||
- 'spec/controllers/spree/admin/payment_methods_controller_spec.rb'
|
||||
- 'spec/controllers/spree/credit_cards_controller_spec.rb'
|
||||
- 'spec/factories.rb'
|
||||
- 'spec/factories/order_factory.rb'
|
||||
- 'spec/features/admin/bulk_order_management_spec.rb'
|
||||
- 'spec/features/admin/bulk_product_update_spec.rb'
|
||||
- 'spec/features/admin/configuration/tax_rates_spec.rb'
|
||||
- 'spec/features/admin/order_cycles_spec.rb'
|
||||
- 'spec/features/admin/orders_spec.rb'
|
||||
- 'spec/features/admin/reports_spec.rb'
|
||||
- 'spec/features/consumer/shopping/checkout_spec.rb'
|
||||
- 'spec/features/consumer/shopping/products_spec.rb'
|
||||
- 'spec/features/consumer/shopping/shopping_spec.rb'
|
||||
- 'spec/helpers/enterprises_helper_spec.rb'
|
||||
- 'spec/helpers/order_cycles_helper_spec.rb'
|
||||
- 'spec/jobs/subscription_placement_job_spec.rb'
|
||||
- 'spec/lib/open_food_network/address_finder_spec.rb'
|
||||
- 'spec/lib/open_food_network/enterprise_fee_calculator_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/subscription_payment_updater_spec.rb'
|
||||
- 'spec/models/calculator/weight_spec.rb'
|
||||
- 'spec/models/concerns/variant_stock_spec.rb'
|
||||
- 'spec/models/enterprise_relationship_spec.rb'
|
||||
- 'spec/models/exchange_spec.rb'
|
||||
- 'spec/models/spree/adjustment_spec.rb'
|
||||
- 'spec/models/spree/line_item_spec.rb'
|
||||
- 'spec/models/spree/order_spec.rb'
|
||||
- 'spec/models/spree/product_spec.rb'
|
||||
- 'spec/models/spree/variant_spec.rb'
|
||||
- 'spec/models/tag_rule/discount_order_spec.rb'
|
||||
- 'spec/performance/proxy_order_syncer_spec.rb'
|
||||
- 'spec/serializers/api/admin/subscription_line_item_serializer_spec.rb'
|
||||
- 'spec/services/order_cycle_distributed_products_spec.rb'
|
||||
- 'spec/services/order_factory_spec.rb'
|
||||
- 'spec/services/order_syncer_spec.rb'
|
||||
- 'spec/services/product_tag_rules_filterer_spec.rb'
|
||||
- 'spec/services/products_renderer_spec.rb'
|
||||
- 'spec/services/restart_checkout_spec.rb'
|
||||
- 'spec/support/request/shop_workflow.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# Configuration parameters: Environments.
|
||||
# Environments: development, test, production
|
||||
@@ -707,10 +475,10 @@ Style/FormatStringToken:
|
||||
- 'lib/open_food_network/sales_tax_report.rb'
|
||||
- 'spec/features/admin/bulk_order_management_spec.rb'
|
||||
|
||||
# Offense count: 920
|
||||
# Offense count: 928
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: EnforcedStyle.
|
||||
# SupportedStyles: always, always_true, never
|
||||
# SupportedStyles: always, never
|
||||
Style/FrozenStringLiteralComment:
|
||||
Exclude:
|
||||
- 'Gemfile'
|
||||
@@ -745,6 +513,7 @@ Style/FrozenStringLiteralComment:
|
||||
- 'app/controllers/api/enterprise_attachment_controller.rb'
|
||||
- 'app/controllers/api/enterprise_fees_controller.rb'
|
||||
- 'app/controllers/api/enterprises_controller.rb'
|
||||
- 'app/controllers/api/exchange_products_controller.rb'
|
||||
- 'app/controllers/api/logos_controller.rb'
|
||||
- 'app/controllers/api/order_cycles_controller.rb'
|
||||
- 'app/controllers/api/orders_controller.rb'
|
||||
@@ -759,6 +528,7 @@ Style/FrozenStringLiteralComment:
|
||||
- 'app/controllers/application_controller.rb'
|
||||
- 'app/controllers/base_controller.rb'
|
||||
- 'app/controllers/cart_controller.rb'
|
||||
- 'app/controllers/checkout_controller.rb'
|
||||
- 'app/controllers/discourse_sso_controller.rb'
|
||||
- 'app/controllers/enterprises_controller.rb'
|
||||
- 'app/controllers/groups_controller.rb'
|
||||
@@ -779,18 +549,19 @@ Style/FrozenStringLiteralComment:
|
||||
- 'app/controllers/spree/admin/images_controller.rb'
|
||||
- 'app/controllers/spree/admin/invoices_controller.rb'
|
||||
- 'app/controllers/spree/admin/mail_methods_controller.rb'
|
||||
- 'app/controllers/spree/admin/orders/customer_details_controller.rb'
|
||||
- 'app/controllers/spree/admin/orders_controller.rb'
|
||||
- 'app/controllers/spree/admin/orders/customer_details_controller_decorator.rb'
|
||||
- 'app/controllers/spree/admin/orders_controller_decorator.rb'
|
||||
- 'app/controllers/spree/admin/overview_controller.rb'
|
||||
- 'app/controllers/spree/admin/payment_methods_controller.rb'
|
||||
- 'app/controllers/spree/admin/payments_controller_decorator.rb'
|
||||
- 'app/controllers/spree/admin/product_properties_controller.rb'
|
||||
- 'app/controllers/spree/admin/products_controller.rb'
|
||||
- 'app/controllers/spree/admin/products_controller_decorator.rb'
|
||||
- 'app/controllers/spree/admin/properties_controller.rb'
|
||||
- 'app/controllers/spree/admin/reports/enterprise_fee_summaries_controller.rb'
|
||||
- 'app/controllers/spree/admin/reports_controller.rb'
|
||||
- 'app/controllers/spree/admin/resource_controller.rb'
|
||||
- 'app/controllers/spree/admin/resource_controller_decorator.rb'
|
||||
- 'app/controllers/spree/admin/return_authorizations_controller.rb'
|
||||
- 'app/controllers/spree/admin/search_controller.rb'
|
||||
- 'app/controllers/spree/admin/search_controller_decorator.rb'
|
||||
- 'app/controllers/spree/admin/shipping_categories_controller.rb'
|
||||
- 'app/controllers/spree/admin/shipping_methods_controller.rb'
|
||||
- 'app/controllers/spree/admin/states_controller.rb'
|
||||
@@ -800,11 +571,13 @@ Style/FrozenStringLiteralComment:
|
||||
- 'app/controllers/spree/admin/taxonomies_controller.rb'
|
||||
- 'app/controllers/spree/admin/taxons_controller.rb'
|
||||
- 'app/controllers/spree/admin/users_controller.rb'
|
||||
- 'app/controllers/spree/admin/variants_controller.rb'
|
||||
- 'app/controllers/spree/admin/variants_controller_decorator.rb'
|
||||
- 'app/controllers/spree/admin/zones_controller.rb'
|
||||
- 'app/controllers/spree/checkout_controller.rb'
|
||||
- 'app/controllers/spree/credit_cards_controller.rb'
|
||||
- 'app/controllers/spree/home_controller.rb'
|
||||
- 'app/controllers/spree/orders_controller.rb'
|
||||
- 'app/controllers/spree/paypal_controller_decorator.rb'
|
||||
- 'app/controllers/spree/store_controller.rb'
|
||||
- 'app/controllers/spree/user_passwords_controller.rb'
|
||||
- 'app/controllers/spree/user_registrations_controller.rb'
|
||||
@@ -815,7 +588,6 @@ Style/FrozenStringLiteralComment:
|
||||
- 'app/controllers/user_confirmations_controller.rb'
|
||||
- 'app/controllers/user_passwords_controller.rb'
|
||||
- 'app/controllers/user_registrations_controller.rb'
|
||||
- 'app/helpers/admin/enterprises_helper.rb'
|
||||
- 'app/helpers/admin/image_settings_helper.rb'
|
||||
- 'app/helpers/admin/injection_helper.rb'
|
||||
- 'app/helpers/admin/orders_helper.rb'
|
||||
@@ -834,16 +606,16 @@ Style/FrozenStringLiteralComment:
|
||||
- 'app/helpers/injection_helper.rb'
|
||||
- 'app/helpers/map_helper.rb'
|
||||
- 'app/helpers/markdown_helper.rb'
|
||||
- 'app/helpers/order_cycles_helper.rb'
|
||||
- 'app/helpers/serializer_helper.rb'
|
||||
- 'app/helpers/shared_helper.rb'
|
||||
- 'app/helpers/shop_helper.rb'
|
||||
- 'app/helpers/shop_mail_helper.rb'
|
||||
- 'app/helpers/spree/admin/base_helper.rb'
|
||||
- 'app/helpers/spree/admin/base_helper_decorator.rb'
|
||||
- 'app/helpers/spree/admin/general_settings_helper.rb'
|
||||
- 'app/helpers/spree/admin/orders_helper.rb'
|
||||
- 'app/helpers/spree/admin/payments_helper.rb'
|
||||
- 'app/helpers/spree/admin/navigation_helper_decorator.rb'
|
||||
- 'app/helpers/spree/admin/orders_helper_decorator.rb'
|
||||
- 'app/helpers/spree/admin/taxons_helper.rb'
|
||||
- 'app/helpers/spree/admin/zones_helper.rb'
|
||||
- 'app/helpers/spree/api/api_helpers.rb'
|
||||
- 'app/helpers/spree/base_helper_decorator.rb'
|
||||
- 'app/helpers/spree/orders_helper.rb'
|
||||
@@ -859,6 +631,7 @@ Style/FrozenStringLiteralComment:
|
||||
- 'app/jobs/subscription_placement_job.rb'
|
||||
- 'app/jobs/welcome_enterprise_job.rb'
|
||||
- 'app/mailers/enterprise_mailer.rb'
|
||||
- 'app/mailers/producer_mailer.rb'
|
||||
- 'app/mailers/spree/base_mailer_decorator.rb'
|
||||
- 'app/mailers/spree/order_mailer_decorator.rb'
|
||||
- 'app/mailers/spree/user_mailer.rb'
|
||||
@@ -969,6 +742,7 @@ Style/FrozenStringLiteralComment:
|
||||
- 'app/models/tag_rule/filter_shipping_methods.rb'
|
||||
- 'app/models/variant_override.rb'
|
||||
- 'app/models/variant_override_set.rb'
|
||||
- 'app/presenters/variant_presenter.rb'
|
||||
- 'app/serializers/api/address_serializer.rb'
|
||||
- 'app/serializers/api/adjustment_serializer.rb'
|
||||
- 'app/serializers/api/admin/basic_enterprise_fee_serializer.rb'
|
||||
@@ -1048,7 +822,6 @@ Style/FrozenStringLiteralComment:
|
||||
- 'app/serializers/api/uncached_enterprise_serializer.rb'
|
||||
- 'app/serializers/api/user_serializer.rb'
|
||||
- 'app/serializers/api/variant_serializer.rb'
|
||||
- 'app/services/action_callbacks.rb'
|
||||
- 'app/services/advance_order_service.rb'
|
||||
- 'app/services/bulk_invoice_service.rb'
|
||||
- 'app/services/cart_service.rb'
|
||||
@@ -1057,6 +830,7 @@ Style/FrozenStringLiteralComment:
|
||||
- 'app/services/default_shipping_category.rb'
|
||||
- 'app/services/default_stock_location.rb'
|
||||
- 'app/services/embedded_page_service.rb'
|
||||
- 'app/services/exchange_products_renderer.rb'
|
||||
- 'app/services/exchange_variant_bulk_updater.rb'
|
||||
- 'app/services/exchange_variant_deleter.rb'
|
||||
- 'app/services/invoice_renderer.rb'
|
||||
@@ -1075,6 +849,11 @@ Style/FrozenStringLiteralComment:
|
||||
- 'app/services/reset_order_service.rb'
|
||||
- 'app/services/restart_checkout.rb'
|
||||
- 'app/services/search_orders.rb'
|
||||
- 'app/services/subscription_estimator.rb'
|
||||
- 'app/services/subscription_form.rb'
|
||||
- 'app/services/subscription_validator.rb'
|
||||
- 'app/services/subscription_variants_service.rb'
|
||||
- 'app/services/subscriptions_count.rb'
|
||||
- 'app/services/tax_rate_finder.rb'
|
||||
- 'app/services/upload_sanitizer.rb'
|
||||
- 'app/services/variant_deleter.rb'
|
||||
@@ -1082,6 +861,7 @@ Style/FrozenStringLiteralComment:
|
||||
- 'app/validators/date_time_string_validator.rb'
|
||||
- 'app/validators/distributors_validator.rb'
|
||||
- 'app/validators/integer_array_validator.rb'
|
||||
- 'app/views/spree/admin/taxons/search.rabl'
|
||||
- 'config.ru'
|
||||
- 'engines/order_management/app/controllers/order_management/application_controller.rb'
|
||||
- 'engines/order_management/app/services/order_management/reports/enterprise_fee_summary/authorizer.rb'
|
||||
@@ -1112,7 +892,6 @@ Style/FrozenStringLiteralComment:
|
||||
- 'engines/order_management/lib/order_management/engine.rb'
|
||||
- 'engines/order_management/lib/order_management/version.rb'
|
||||
- 'engines/order_management/order_management.gemspec'
|
||||
- 'engines/order_management/spec/performance/order_management/subscriptions/proxy_order_syncer_spec.rb'
|
||||
- 'engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/authorizer_spec.rb'
|
||||
- 'engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/parameters_spec.rb'
|
||||
- 'engines/order_management/spec/services/order_management/reports/enterprise_fee_summary/permissions_spec.rb'
|
||||
@@ -1150,6 +929,7 @@ Style/FrozenStringLiteralComment:
|
||||
- 'lib/open_food_network/lettuce_share_report.rb'
|
||||
- 'lib/open_food_network/locking.rb'
|
||||
- 'lib/open_food_network/model_class_from_controller_name.rb'
|
||||
- 'lib/open_food_network/option_value_namer.rb'
|
||||
- 'lib/open_food_network/order_and_distributor_report.rb'
|
||||
- 'lib/open_food_network/order_cycle_form_applicator.rb'
|
||||
- 'lib/open_food_network/order_cycle_management_report.rb'
|
||||
@@ -1169,6 +949,7 @@ Style/FrozenStringLiteralComment:
|
||||
- 'lib/open_food_network/products_and_inventory_report.rb'
|
||||
- 'lib/open_food_network/products_and_inventory_report_base.rb'
|
||||
- 'lib/open_food_network/property_merge.rb'
|
||||
- 'lib/open_food_network/proxy_order_syncer.rb'
|
||||
- 'lib/open_food_network/rack_request_blocker.rb'
|
||||
- 'lib/open_food_network/referer_parser.rb'
|
||||
- 'lib/open_food_network/reports/bulk_coop_allocation_report.rb'
|
||||
@@ -1185,6 +966,8 @@ Style/FrozenStringLiteralComment:
|
||||
- 'lib/open_food_network/scope_variants_for_search.rb'
|
||||
- 'lib/open_food_network/spree_api_key_loader.rb'
|
||||
- 'lib/open_food_network/subscription_payment_updater.rb'
|
||||
- 'lib/open_food_network/subscription_summarizer.rb'
|
||||
- 'lib/open_food_network/subscription_summary.rb'
|
||||
- 'lib/open_food_network/tag_rule_applicator.rb'
|
||||
- 'lib/open_food_network/user_balance_calculator.rb'
|
||||
- 'lib/open_food_network/users_and_enterprises_report.rb'
|
||||
@@ -1284,8 +1067,10 @@ Style/FrozenStringLiteralComment:
|
||||
- 'spec/controllers/spree/admin/shipping_methods_controller_spec.rb'
|
||||
- 'spec/controllers/spree/admin/users_controller_spec.rb'
|
||||
- 'spec/controllers/spree/admin/variants_controller_spec.rb'
|
||||
- 'spec/controllers/spree/checkout_controller_spec.rb'
|
||||
- 'spec/controllers/spree/credit_cards_controller_spec.rb'
|
||||
- 'spec/controllers/spree/orders_controller_spec.rb'
|
||||
- 'spec/controllers/spree/paypal_controller_spec.rb'
|
||||
- 'spec/controllers/spree/store_controller_spec.rb'
|
||||
- 'spec/controllers/spree/user_sessions_controller_spec.rb'
|
||||
- 'spec/controllers/spree/users_controller_spec.rb'
|
||||
@@ -1424,6 +1209,7 @@ Style/FrozenStringLiteralComment:
|
||||
- 'spec/lib/open_food_network/permissions_spec.rb'
|
||||
- 'spec/lib/open_food_network/products_and_inventory_report_spec.rb'
|
||||
- 'spec/lib/open_food_network/property_merge_spec.rb'
|
||||
- 'spec/lib/open_food_network/proxy_order_syncer_spec.rb'
|
||||
- 'spec/lib/open_food_network/referer_parser_spec.rb'
|
||||
- 'spec/lib/open_food_network/reports/report_spec.rb'
|
||||
- 'spec/lib/open_food_network/reports/row_spec.rb'
|
||||
@@ -1432,6 +1218,8 @@ Style/FrozenStringLiteralComment:
|
||||
- 'spec/lib/open_food_network/scope_variant_to_hub_spec.rb'
|
||||
- 'spec/lib/open_food_network/scope_variants_to_search_spec.rb'
|
||||
- 'spec/lib/open_food_network/subscription_payment_updater_spec.rb'
|
||||
- 'spec/lib/open_food_network/subscription_summarizer_spec.rb'
|
||||
- 'spec/lib/open_food_network/subscription_summary_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'
|
||||
@@ -1484,6 +1272,7 @@ Style/FrozenStringLiteralComment:
|
||||
- 'spec/models/spree/classification_spec.rb'
|
||||
- 'spec/models/spree/credit_card_spec.rb'
|
||||
- 'spec/models/spree/gateway/stripe_connect_spec.rb'
|
||||
- 'spec/models/spree/gateway_tagging_spec.rb'
|
||||
- 'spec/models/spree/image_spec.rb'
|
||||
- 'spec/models/spree/line_item_spec.rb'
|
||||
- 'spec/models/spree/order/checkout_spec.rb'
|
||||
@@ -1515,6 +1304,7 @@ Style/FrozenStringLiteralComment:
|
||||
- 'spec/models/variant_override_spec.rb'
|
||||
- 'spec/performance/injection_helper_spec.rb'
|
||||
- 'spec/performance/orders_controller_spec.rb'
|
||||
- 'spec/performance/proxy_order_syncer_spec.rb'
|
||||
- 'spec/performance/shop_controller_spec.rb'
|
||||
- 'spec/requests/checkout/failed_checkout_spec.rb'
|
||||
- 'spec/requests/checkout/paypal_spec.rb'
|
||||
@@ -1557,7 +1347,6 @@ Style/FrozenStringLiteralComment:
|
||||
- 'spec/services/order_cycle_distributed_products_spec.rb'
|
||||
- 'spec/services/order_cycle_distributed_variants_spec.rb'
|
||||
- 'spec/services/order_cycle_form_spec.rb'
|
||||
- 'spec/services/order_cycle_warning_spec.rb'
|
||||
- 'spec/services/order_factory_spec.rb'
|
||||
- 'spec/services/order_syncer_spec.rb'
|
||||
- 'spec/services/permissions/order_spec.rb'
|
||||
@@ -1566,6 +1355,11 @@ Style/FrozenStringLiteralComment:
|
||||
- 'spec/services/reset_order_service_spec.rb'
|
||||
- 'spec/services/restart_checkout_spec.rb'
|
||||
- 'spec/services/search_orders_spec.rb'
|
||||
- 'spec/services/subscription_estimator_spec.rb'
|
||||
- 'spec/services/subscription_form_spec.rb'
|
||||
- 'spec/services/subscription_validator_spec.rb'
|
||||
- 'spec/services/subscription_variants_service_spec.rb'
|
||||
- 'spec/services/subscriptions_count_spec.rb'
|
||||
- 'spec/services/tax_rate_finder_spec.rb'
|
||||
- 'spec/services/upload_sanitizer_spec.rb'
|
||||
- 'spec/services/variants_stock_levels_spec.rb'
|
||||
@@ -1614,7 +1408,7 @@ Style/FrozenStringLiteralComment:
|
||||
- 'spec/views/spree/admin/orders/edit.html.haml_spec.rb'
|
||||
- 'spec/views/spree/admin/orders/index.html.haml_spec.rb'
|
||||
|
||||
# Offense count: 50
|
||||
# Offense count: 58
|
||||
# Configuration parameters: MinBodyLength.
|
||||
Style/GuardClause:
|
||||
Exclude:
|
||||
@@ -1625,7 +1419,11 @@ Style/GuardClause:
|
||||
- 'app/controllers/base_controller.rb'
|
||||
- 'app/controllers/checkout_controller.rb'
|
||||
- 'app/controllers/home_controller.rb'
|
||||
- 'app/controllers/spree/admin/orders_controller_decorator.rb'
|
||||
- 'app/controllers/spree/admin/variants_controller_decorator.rb'
|
||||
- 'app/controllers/spree/checkout_controller.rb'
|
||||
- 'app/controllers/spree/orders_controller.rb'
|
||||
- 'app/controllers/spree/paypal_controller_decorator.rb'
|
||||
- 'app/models/enterprise.rb'
|
||||
- 'app/models/enterprise_group.rb'
|
||||
- 'app/models/producer_property.rb'
|
||||
@@ -1645,13 +1443,14 @@ Style/GuardClause:
|
||||
- 'spec/support/request/distribution_helper.rb'
|
||||
- 'spec/support/request/shop_workflow.rb'
|
||||
|
||||
# Offense count: 3
|
||||
# Offense count: 4
|
||||
# Configuration parameters: AllowIfModifier.
|
||||
Style/IfInsideElse:
|
||||
Exclude:
|
||||
- 'app/controllers/admin/column_preferences_controller.rb'
|
||||
- 'app/controllers/admin/variant_overrides_controller.rb'
|
||||
- 'app/controllers/api/taxons_controller.rb'
|
||||
- 'app/controllers/spree/admin/products_controller_decorator.rb'
|
||||
|
||||
# Offense count: 1
|
||||
# Cop supports --auto-correct.
|
||||
@@ -1719,17 +1518,16 @@ Style/NumericPredicate:
|
||||
- 'lib/spree/money_decorator.rb'
|
||||
- 'lib/tasks/sample_data.rake'
|
||||
|
||||
# Offense count: 16
|
||||
# Offense count: 15
|
||||
# Cop supports --auto-correct.
|
||||
# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods.
|
||||
# AllowedMethods: present?, blank?, presence, try, try!
|
||||
Style/SafeNavigation:
|
||||
Exclude:
|
||||
- 'app/controllers/spree/admin/payments_controller.rb'
|
||||
- 'app/controllers/checkout_controller.rb'
|
||||
- 'app/controllers/spree/credit_cards_controller.rb'
|
||||
- 'app/controllers/spree/orders_controller.rb'
|
||||
- 'app/helpers/i18n_helper.rb'
|
||||
- 'app/helpers/shop_helper.rb'
|
||||
- 'app/models/producer_property.rb'
|
||||
- 'app/models/product_import/entry_validator.rb'
|
||||
- 'app/models/product_import/product_importer.rb'
|
||||
@@ -1737,9 +1535,10 @@ Style/SafeNavigation:
|
||||
- 'lib/discourse/single_sign_on.rb'
|
||||
- 'spec/factories.rb'
|
||||
|
||||
# Offense count: 232
|
||||
# Offense count: 235
|
||||
Style/Send:
|
||||
Exclude:
|
||||
- 'app/controllers/spree/checkout_controller.rb'
|
||||
- 'app/models/spree/shipping_method_decorator.rb'
|
||||
- 'spec/controllers/admin/subscriptions_controller_spec.rb'
|
||||
- 'spec/controllers/checkout_controller_spec.rb'
|
||||
@@ -1758,6 +1557,7 @@ Style/Send:
|
||||
- 'spec/lib/open_food_network/products_and_inventory_report_spec.rb'
|
||||
- 'spec/lib/open_food_network/sales_tax_report_spec.rb'
|
||||
- 'spec/lib/open_food_network/subscription_payment_updater_spec.rb'
|
||||
- 'spec/lib/open_food_network/subscription_summarizer_spec.rb'
|
||||
- 'spec/lib/open_food_network/tag_rule_applicator_spec.rb'
|
||||
- 'spec/lib/open_food_network/xero_invoices_report_spec.rb'
|
||||
- 'spec/lib/stripe/webhook_handler_spec.rb'
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
# Contributing
|
||||
We love pull requests from everyone. Any contribution is valuable!
|
||||
We love pull requests from everyone. Any contribution is valuable, but there are two issue streams that we especially love people to work on:
|
||||
|
||||
If you have some time and are interested in working on some issues please make yourself known on the [#dev][slack-dev] channel on Slack.
|
||||
1) Our delivery backlog, is managed via a ZenHub board (ZenHub extensions are available for most major browsers). We use a Kanban-style approach, whereby devs pick issues from the top of the backlog which has been organised according to current priorities. If you have some time and are interested in working on some issues from the backlog, please make yourself known on the [#dev][slack-dev] channel on Slack and we can direct you to the most appropriate issue to pick up.
|
||||
|
||||
We have curated all issues we consider to be a good starting point for new members of the community within the [Welcome New Developers project board][welcome-dev]. Have a look and pick the one you would prefer working on!
|
||||
2) Our list of bugs and other self-contained issues that we consider to be a good starting point for new contributors, or devs who aren’t able to commit to seeing a whole feature through. These issues are marked with the `# good first issue` label.
|
||||
|
||||
## Set up
|
||||
|
||||
@@ -19,6 +19,10 @@ If you want to run the whole test suite, we recommend using a free CI service to
|
||||
|
||||
bundle exec rspec spec
|
||||
|
||||
## Which issue to pick first?
|
||||
|
||||
We have curated all issues interesting for new members of the community within the [Welcome New Developers project board][welcome-dev]. Have a look and pick the one you would prefer working on!
|
||||
|
||||
## Internationalisation (i18n)
|
||||
|
||||
The locale `en` is maintained in the source code, but other locales are managed at [Transifex][ofn-transifex]. Read more about [internationalisation][i18n] in the developer wiki.
|
||||
|
||||
13
DOCKER.md
@@ -35,22 +35,13 @@ Download the Docker images and build the containers:
|
||||
$ docker-compose build
|
||||
```
|
||||
|
||||
Setup the database and seed it with sample data:
|
||||
```sh
|
||||
$ docker-compose run web bundle exec rake db:reset
|
||||
$ docker-compose run web bundle exec rake db:test:prepare
|
||||
$ docker-compose run web bundle exec rake ofn:sample_data
|
||||
```
|
||||
|
||||
Finally, run the app with all the required containers:
|
||||
Run the app with all the required containers:
|
||||
|
||||
```sh
|
||||
$ docker-compose up
|
||||
```
|
||||
|
||||
The default admin user is 'ofn@example.com' with 'ofn123' password.
|
||||
This command will setup the database and seed it with sample data. The default admin user is 'ofn@example.com' with 'ofn123' password.
|
||||
Check the app in the browser at `http://localhost:3000`.
|
||||
|
||||
You will then get the trace of the containers in the terminal. You can stop the containers using Ctrl-C in the terminal.
|
||||
|
||||
You can find some useful tips and commands [here](https://github.com/openfoodfoundation/openfoodnetwork/wiki/Docker:-useful-tips-and-commands).
|
||||
|
||||
14
Dockerfile
@@ -12,24 +12,21 @@ ENV BUNDLE_PATH /bundles
|
||||
WORKDIR /usr/src/app
|
||||
COPY .ruby-version .
|
||||
|
||||
# Install Rbenv & Ruby
|
||||
RUN git clone --depth 1 --branch v1.1.2 https://github.com/rbenv/rbenv.git ${RBENV_ROOT} && \
|
||||
git clone --depth 1 --branch v20200520 https://github.com/rbenv/ruby-build.git ${RBENV_ROOT}/plugins/ruby-build && \
|
||||
# Rbenv & Ruby part
|
||||
RUN git clone https://github.com/rbenv/rbenv.git ${RBENV_ROOT} && \
|
||||
git clone https://github.com/rbenv/ruby-build.git ${RBENV_ROOT}/plugins/ruby-build && \
|
||||
${RBENV_ROOT}/plugins/ruby-build/install.sh && \
|
||||
echo 'eval "$(rbenv init -)"' >> /etc/profile.d/rbenv.sh && \
|
||||
rbenv install $(cat .ruby-version) && \
|
||||
rbenv global $(cat .ruby-version) && \
|
||||
gem install bundler --version=1.17.2
|
||||
|
||||
# Install Postgres
|
||||
# Postgres
|
||||
RUN sh -c "echo 'deb https://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main' > /etc/apt/sources.list.d/pgdg.list" && \
|
||||
wget --quiet -O - https://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | apt-key add - && \
|
||||
apt-get update && \
|
||||
apt-get install -yqq --no-install-recommends postgresql-client-9.5 libpq-dev
|
||||
|
||||
# Install node
|
||||
RUN apt-get install -y nodejs
|
||||
|
||||
# Install Chrome
|
||||
RUN wget --quiet -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
|
||||
sh -c "echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' >> /etc/apt/sources.list.d/google-chrome.list" && \
|
||||
@@ -41,7 +38,4 @@ RUN wget https://chromedriver.storage.googleapis.com/2.41/chromedriver_linux64.z
|
||||
unzip chromedriver_linux64.zip -d /usr/bin && \
|
||||
chmod u+x /usr/bin/chromedriver
|
||||
|
||||
# Copy code and install app dependencies
|
||||
COPY . /usr/src/app/
|
||||
# Run bundler install in parallel with the amount of available CPUs
|
||||
RUN bundle install --jobs="$(nproc)"
|
||||
|
||||
@@ -2,17 +2,19 @@
|
||||
|
||||
This is a general guide to setting up an Open Food Network development environment on your local machine.
|
||||
|
||||
### Requirements
|
||||
The following guides are located in the wiki and provide more OS-specific step-by-step instructions:
|
||||
|
||||
The fastest way to make it work locally is to use Docker, you only need to setup git, see the [Docker setup guide](DOCKER.md).
|
||||
Otherwise, for a local setup you will need:
|
||||
* Ruby 2.3.7 and bundler
|
||||
* PostgreSQL database
|
||||
* Chrome (for testing)
|
||||
|
||||
The following guides will provide OS-specific step-by-step instructions to get these requirements installed:
|
||||
- [Ubuntu Setup Guide][ubuntu]
|
||||
- [OSX Setup Guide][osx]
|
||||
- [macOS Sierra Setup Guide][sierra]
|
||||
- [OSX El Capitan Setup Guide][el-capitan]
|
||||
|
||||
### Dependencies
|
||||
|
||||
* Rails 3.2.x
|
||||
* Ruby 2.1.9
|
||||
* PostgreSQL database
|
||||
* PhantomJS (for testing)
|
||||
* See Gemfile for a list of gems required
|
||||
|
||||
If you are likely to need to manage multiple version of ruby on your local machine, we recommend version managers such as [rbenv](https://github.com/rbenv/rbenv) or [RVM](https://rvm.io/).
|
||||
|
||||
@@ -48,16 +50,18 @@ This will create the "ofn" user as superuser and allowing it to create databases
|
||||
|
||||
Once done, run `script/setup`. If the script succeeds you're ready to start developing. If not, take a look at the output as it should be informative enough to help you troubleshoot.
|
||||
|
||||
If you run into any other issues getting your local environment up and running please consult [the wiki][wiki].
|
||||
|
||||
If still you get stuck do not hesitate to open an issue reporting the full output of the script.
|
||||
|
||||
Now, your dreams of spinning up a development server can be realised:
|
||||
|
||||
bundle exec rails server
|
||||
|
||||
Go to [http://localhost:3000](http://localhost:3000) to play around!
|
||||
To login as Spree default user, use:
|
||||
|
||||
To login as the default user, use:
|
||||
|
||||
email: ofn@example.com
|
||||
password: ofn123
|
||||
email: spree@example.com
|
||||
password: spree123
|
||||
|
||||
### Testing
|
||||
|
||||
@@ -73,7 +77,7 @@ The tests of all custom engines can be run with:
|
||||
|
||||
bundle exec rake ofn:specs:engines:rspec
|
||||
|
||||
Note: If your OS is not explicitly supported in the setup guides then not all tests may pass. However, you may still be able to develop.
|
||||
Note: If your OS is not explicitly supported in the setup guides then not all tests may pass. However, you may still be able to develop. Get in touch with the [#dev][slack-dev] channel on Slack to troubleshoot issues and determine if they will preclude you from contributing to OFN.
|
||||
|
||||
Note: The time zone on your machine should match the one defined in `config/application.yml`.
|
||||
|
||||
@@ -114,7 +118,8 @@ $ createdb open_food_network_test --owner=ofn
|
||||
If these commands succeed, you should be able to [continue the setup process](#get-it-running).
|
||||
|
||||
[developer-wiki]: https://github.com/openfoodfoundation/openfoodnetwork/wiki
|
||||
[osx]: https://github.com/openfoodfoundation/openfoodnetwork/wiki/Development-Environment-Setup:-OS-X
|
||||
[sierra]: https://github.com/openfoodfoundation/openfoodnetwork/wiki/Development-Environment-Setup%3A-macOS-%28Sierra%2C-HighSierra-and-Mojave%29
|
||||
[el-capitan]: https://github.com/openfoodfoundation/openfoodnetwork/wiki/Development-Environment-Setup:-OS-X-(El-Capitan)
|
||||
[ubuntu]: https://github.com/openfoodfoundation/openfoodnetwork/wiki/Development-Environment-Setup:-Ubuntu
|
||||
[wiki]: https://github.com/openfoodfoundation/openfoodnetwork/wiki
|
||||
[zeus]: https://github.com/burke/zeus
|
||||
|
||||
76
Gemfile
@@ -3,15 +3,16 @@ ruby "2.3.7"
|
||||
git_source(:github) { |repo_name| "https://github.com/#{repo_name}.git" }
|
||||
|
||||
gem 'i18n', '~> 0.6.11'
|
||||
gem 'i18n-js', '~> 3.7.0'
|
||||
gem 'rails', '~> 4.0.13'
|
||||
gem 'rails-i18n', '~> 4.0'
|
||||
gem 'i18n-js', '~> 3.6.0'
|
||||
gem 'rails', '~> 3.2.22'
|
||||
gem 'rails-i18n', '~> 3.0.0'
|
||||
gem 'rails_safe_tasks', '~> 1.0'
|
||||
|
||||
gem "activerecord-import"
|
||||
# Patched version. See http://rubysec.com/advisories/CVE-2015-5312/.
|
||||
gem 'nokogiri', '>= 1.6.7.1'
|
||||
|
||||
gem "catalog", path: "./engines/catalog"
|
||||
gem 'dfc_provider', path: './engines/dfc_provider'
|
||||
gem "order_management", path: "./engines/order_management"
|
||||
gem 'web', path: './engines/web'
|
||||
|
||||
@@ -21,36 +22,22 @@ gem 'pg', '~> 0.21.0'
|
||||
# OFN-maintained and patched version of Spree v2.0.4. See
|
||||
# https://github.com/openfoodfoundation/openfoodnetwork/wiki/Tech-Doc:-OFN's-Spree-fork%F0%9F%8D%B4
|
||||
# for details.
|
||||
gem 'spree_core', github: 'openfoodfoundation/spree', branch: '2-1-0-stable'
|
||||
|
||||
### Dependencies brought from spree core
|
||||
gem 'acts_as_list', '= 0.2.0'
|
||||
gem 'awesome_nested_set', '~> 3.0.0.rc.1'
|
||||
gem 'cancan', '~> 1.6.10'
|
||||
gem 'ffaker', '~> 1.16'
|
||||
gem 'highline', '= 1.6.18' # Necessary for the install generator
|
||||
gem 'httparty', '~> 0.18' # Used to check alerts in spree_core, this is not used in OFN.
|
||||
gem 'json', '>= 1.7.7'
|
||||
gem 'money', '5.1.1'
|
||||
gem 'paranoia', '~> 2.0'
|
||||
gem 'ransack', '~> 1.2.3'
|
||||
gem 'state_machine', '1.2.0'
|
||||
gem 'stringex', '~> 1.5.1'
|
||||
gem 'spree_core', github: 'openfoodfoundation/spree', branch: '2-0-4-stable'
|
||||
|
||||
gem 'spree_i18n', github: 'spree/spree_i18n', branch: '1-3-stable'
|
||||
|
||||
# Our branch contains two changes
|
||||
# - Pass customer email and phone number to PayPal (merged to upstream master)
|
||||
# - Change type of password from string to password to hide it in the form
|
||||
gem 'spree_paypal_express', github: 'openfoodfoundation/better_spree_paypal_express', branch: '2-1-0-stable'
|
||||
gem 'spree_paypal_express', github: "openfoodfoundation/better_spree_paypal_express", branch: "2-0-stable"
|
||||
gem 'stripe'
|
||||
|
||||
# We need at least this version to have Digicert's root certificate
|
||||
# which is needed for Pin Payments (and possibly others).
|
||||
gem 'activemerchant', '~> 1.78.0'
|
||||
gem 'activemerchant', '~> 1.78'
|
||||
|
||||
gem 'devise', '~> 3.0.1'
|
||||
gem 'devise-encryptable'
|
||||
gem 'devise', '~> 2.2.5'
|
||||
gem 'devise-encryptable', '0.2.0'
|
||||
gem 'jwt', '~> 2.2'
|
||||
gem 'oauth2', '~> 1.4.4' # Used for Stripe Connect
|
||||
|
||||
@@ -58,32 +45,36 @@ gem 'daemons'
|
||||
gem 'delayed_job_active_record'
|
||||
gem 'delayed_job_web'
|
||||
|
||||
# Fix bug in simple_form preventing collection_check_boxes usage within form_for block
|
||||
# When merged, revert to upstream gem
|
||||
gem 'simple_form', github: 'RohanM/simple_form'
|
||||
|
||||
# Spree's default pagination gem (locked to the current version used by Spree)
|
||||
# We use it's methods in OFN code as well, so this is a direct dependency
|
||||
gem 'kaminari', '~> 0.14.1'
|
||||
|
||||
gem 'andand'
|
||||
gem 'angularjs-rails', '1.5.5'
|
||||
gem 'aws-sdk', '1.11.1' # temporarily locked down due to https://github.com/aws/aws-sdk-ruby/issues/273
|
||||
gem 'aws-sdk'
|
||||
gem 'bugsnag'
|
||||
gem 'db2fog'
|
||||
gem 'haml'
|
||||
gem 'rabl'
|
||||
gem 'redcarpet'
|
||||
gem 'sass'
|
||||
gem 'sass-rails'
|
||||
gem 'truncate_html', '0.9.2'
|
||||
gem 'sass', "~> 3.3"
|
||||
gem 'sass-rails', '~> 3.2.3'
|
||||
gem 'truncate_html'
|
||||
gem 'unicorn'
|
||||
|
||||
gem 'actionpack-action_caching'
|
||||
# AMS is pinned to 0.8.4 because 0.9.x is a complete re-write, as is 0.10.x
|
||||
# Once Rails is updated to 5.x we should bump directly to 0.10.x
|
||||
gem "active_model_serializers", "0.8.4"
|
||||
gem 'activerecord-session_store'
|
||||
gem 'acts-as-taggable-on', '~> 3.4'
|
||||
gem 'angularjs-file-upload-rails', '~> 2.4.1'
|
||||
gem 'blockenspiel'
|
||||
gem 'custom_error_message', github: 'jeremydurham/custom-err-msg'
|
||||
gem 'dalli'
|
||||
gem 'deface', '1.0.2'
|
||||
gem 'diffy'
|
||||
gem 'figaro'
|
||||
gem 'geocoder'
|
||||
@@ -94,6 +85,7 @@ gem 'paperclip', '~> 3.4.1'
|
||||
gem 'rack-rewrite'
|
||||
gem 'rack-ssl', require: 'rack/ssl'
|
||||
gem 'roadie-rails', '~> 1.3.0'
|
||||
gem 'spinjs-rails'
|
||||
|
||||
gem 'combine_pdf'
|
||||
gem 'wicked_pdf'
|
||||
@@ -107,38 +99,39 @@ gem 'whenever', require: false
|
||||
|
||||
gem 'test-unit', '~> 3.3'
|
||||
|
||||
gem 'coffee-rails', '~> 4.2.2'
|
||||
gem 'coffee-rails', '~> 3.2.1'
|
||||
gem 'compass-rails'
|
||||
|
||||
gem 'mini_racer', '0.2.14'
|
||||
gem 'mini_racer', '0.2.9'
|
||||
|
||||
gem 'uglifier', '>= 1.0.3'
|
||||
|
||||
gem 'angular-rails-templates', '~> 0.3.0'
|
||||
gem 'foundation-icons-sass-rails'
|
||||
gem 'momentjs-rails'
|
||||
gem 'turbo-sprockets-rails3'
|
||||
|
||||
gem 'foundation-rails', '= 5.5.2.1'
|
||||
gem "foundation-rails"
|
||||
gem 'foundation_rails_helper', github: 'willrjmarshall/foundation_rails_helper', branch: "rails3"
|
||||
|
||||
gem 'jquery-migrate-rails'
|
||||
gem 'jquery-rails', '3.1.5'
|
||||
gem 'jquery-ui-rails', '~> 4.2'
|
||||
gem 'jquery-ui-rails', '~> 4.0.0'
|
||||
gem 'select2-rails', '~> 3.4.7'
|
||||
|
||||
gem 'ofn-qz', github: 'openfoodfoundation/ofn-qz', branch: 'ofn-rails-4'
|
||||
gem 'ofn-qz', github: 'openfoodfoundation/ofn-qz', ref: '60da2ae4c44cbb4c8d602f59fb5fff8d0f21db3c'
|
||||
|
||||
group :production, :staging do
|
||||
gem 'ddtrace'
|
||||
gem 'unicorn-worker-killer'
|
||||
end
|
||||
|
||||
group :test, :development do
|
||||
# Pretty printed test output
|
||||
gem 'atomic'
|
||||
gem 'awesome_print'
|
||||
gem 'capybara', '>= 2.18.0' # 3.0 requires rack 1.6 that only works with Rails 4.2
|
||||
gem 'database_cleaner', require: false
|
||||
gem "factory_bot_rails", '4.10.0', require: false
|
||||
gem 'capybara', '>= 2.18.0' # 3.0 requires nokogiri 1.8
|
||||
gem 'database_cleaner', '0.7.1', require: false
|
||||
gem "factory_bot_rails", require: false
|
||||
gem 'fuubar', '~> 2.5.0'
|
||||
gem 'json_spec', '~> 1.1.4'
|
||||
gem 'knapsack'
|
||||
@@ -160,14 +153,13 @@ group :test do
|
||||
end
|
||||
|
||||
group :development do
|
||||
gem 'byebug', '~> 11.0.0' # 11.1 requires ruby 2.4
|
||||
gem 'byebug', '~> 9.0.0' # 9.1 requires ruby 2.2
|
||||
gem 'debugger-linecache'
|
||||
gem "newrelic_rpm", "~> 3.0"
|
||||
gem "pry", "~> 0.12.0" # pry 0.13 is not compatible with pry-byebug 3.7
|
||||
gem 'pry-byebug', '~> 3.7.0' # 3.8 requires ruby 2.4
|
||||
gem 'pry-byebug', '>= 3.4.3'
|
||||
gem 'rubocop'
|
||||
gem 'rubocop-rails'
|
||||
gem 'spring'
|
||||
gem 'spring', '1.7.2'
|
||||
gem 'spring-commands-rspec'
|
||||
|
||||
# 1.0.9 fixed openssl issues on macOS https://github.com/eventmachine/eventmachine/issues/602
|
||||
|
||||
424
Gemfile.lock
@@ -1,3 +1,11 @@
|
||||
GIT
|
||||
remote: https://github.com/RohanM/simple_form.git
|
||||
revision: 45f08a213b40f3d4bda5f5398db841137587160a
|
||||
specs:
|
||||
simple_form (2.0.2)
|
||||
actionpack (~> 3.0)
|
||||
activemodel (~> 3.0)
|
||||
|
||||
GIT
|
||||
remote: https://github.com/jeremydurham/custom-err-msg.git
|
||||
revision: 3a8ec9dddc7a5b0aab7c69a6060596de300c68f4
|
||||
@@ -6,41 +14,43 @@ GIT
|
||||
|
||||
GIT
|
||||
remote: https://github.com/openfoodfoundation/better_spree_paypal_express.git
|
||||
revision: e28e4a8c5cedba504eea9cdad4be440d277d7e68
|
||||
branch: 2-1-0-stable
|
||||
revision: 27ad7165ea4c6e8c5f120b42b676cb9c2c272100
|
||||
branch: 2-0-stable
|
||||
specs:
|
||||
spree_paypal_express (2.0.3)
|
||||
paypal-sdk-merchant (= 1.106.1)
|
||||
spree_core (~> 2.1.0)
|
||||
spree_core (~> 2.0.3)
|
||||
|
||||
GIT
|
||||
remote: https://github.com/openfoodfoundation/ofn-qz.git
|
||||
revision: 467f6ea1c44529c7c91cac4c8211bbd863588c0b
|
||||
branch: ofn-rails-4
|
||||
revision: 60da2ae4c44cbb4c8d602f59fb5fff8d0f21db3c
|
||||
ref: 60da2ae4c44cbb4c8d602f59fb5fff8d0f21db3c
|
||||
specs:
|
||||
ofn-qz (0.1.0)
|
||||
railties (~> 3.1)
|
||||
|
||||
GIT
|
||||
remote: https://github.com/openfoodfoundation/spree.git
|
||||
revision: 0b0c422369c82b6dd7e7cb627a24e3a9fca19a6c
|
||||
branch: 2-1-0-stable
|
||||
revision: 8a8585a43cd04d1a50dc65227f337a91b18d66d5
|
||||
branch: 2-0-4-stable
|
||||
specs:
|
||||
spree_core (2.1.0)
|
||||
activemerchant (= 1.78.0)
|
||||
spree_core (2.0.4)
|
||||
activemerchant (~> 1.34)
|
||||
acts_as_list (= 0.2.0)
|
||||
awesome_nested_set (~> 3.0.0.rc.1)
|
||||
aws-sdk (= 1.11.1)
|
||||
awesome_nested_set (= 2.1.5)
|
||||
aws-sdk (~> 1.11.1)
|
||||
cancan (~> 1.6.10)
|
||||
deface (>= 0.9.1)
|
||||
ffaker (~> 1.16)
|
||||
highline (= 1.6.18)
|
||||
httparty (~> 0.11)
|
||||
json (>= 1.7.7)
|
||||
kaminari (~> 0.14.1)
|
||||
money (= 5.1.1)
|
||||
paperclip (~> 3.4.1)
|
||||
paranoia (~> 2.0)
|
||||
rails (~> 4.0)
|
||||
ransack (~> 1.0)
|
||||
paperclip (~> 3.0)
|
||||
paranoia (~> 1.3)
|
||||
rails (~> 3.2.14)
|
||||
ransack (= 0.7.2)
|
||||
state_machine (= 1.2.0)
|
||||
stringex (~> 1.5.1)
|
||||
truncate_html (= 0.9.2)
|
||||
@@ -55,18 +65,21 @@ GIT
|
||||
rails-i18n
|
||||
spree_core (>= 1.1)
|
||||
|
||||
GIT
|
||||
remote: https://github.com/willrjmarshall/foundation_rails_helper.git
|
||||
revision: 4d5d53fdc4b1fb71e66524d298c5c635de82cfbb
|
||||
branch: rails3
|
||||
specs:
|
||||
foundation_rails_helper (0.4)
|
||||
actionpack (>= 3.0)
|
||||
activemodel (>= 3.0)
|
||||
railties (>= 3.0)
|
||||
|
||||
PATH
|
||||
remote: engines/catalog
|
||||
specs:
|
||||
catalog (0.0.1)
|
||||
|
||||
PATH
|
||||
remote: engines/dfc_provider
|
||||
specs:
|
||||
dfc_provider (0.0.1)
|
||||
jwt (~> 2.2)
|
||||
rspec (~> 3.9)
|
||||
|
||||
PATH
|
||||
remote: engines/order_management
|
||||
specs:
|
||||
@@ -81,17 +94,19 @@ GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
CFPropertyList (2.3.6)
|
||||
actionmailer (4.0.13)
|
||||
actionpack (= 4.0.13)
|
||||
mail (~> 2.5, >= 2.5.4)
|
||||
actionpack (4.0.13)
|
||||
activesupport (= 4.0.13)
|
||||
builder (~> 3.1.0)
|
||||
actionmailer (3.2.22.5)
|
||||
actionpack (= 3.2.22.5)
|
||||
mail (~> 2.5.4)
|
||||
actionpack (3.2.22.5)
|
||||
activemodel (= 3.2.22.5)
|
||||
activesupport (= 3.2.22.5)
|
||||
builder (~> 3.0.0)
|
||||
erubis (~> 2.7.0)
|
||||
rack (~> 1.5.2)
|
||||
rack-test (~> 0.6.2)
|
||||
actionpack-action_caching (1.2.1)
|
||||
actionpack (>= 4.0.0)
|
||||
journey (~> 1.0.4)
|
||||
rack (~> 1.4.5)
|
||||
rack-cache (~> 1.2)
|
||||
rack-test (~> 0.6.1)
|
||||
sprockets (~> 2.2.1)
|
||||
active_model_serializers (0.8.4)
|
||||
activemodel (>= 3.0)
|
||||
activemerchant (1.78.0)
|
||||
@@ -99,31 +114,24 @@ GEM
|
||||
builder (>= 2.1.2, < 4.0.0)
|
||||
i18n (>= 0.6.9)
|
||||
nokogiri (~> 1.4)
|
||||
activemodel (4.0.13)
|
||||
activesupport (= 4.0.13)
|
||||
builder (~> 3.1.0)
|
||||
activerecord (4.0.13)
|
||||
activemodel (= 4.0.13)
|
||||
activerecord-deprecated_finders (~> 1.0.2)
|
||||
activesupport (= 4.0.13)
|
||||
arel (~> 4.0.0)
|
||||
activerecord-deprecated_finders (1.0.4)
|
||||
activerecord-import (1.0.5)
|
||||
activemodel (3.2.22.5)
|
||||
activesupport (= 3.2.22.5)
|
||||
builder (~> 3.0.0)
|
||||
activerecord (3.2.22.5)
|
||||
activemodel (= 3.2.22.5)
|
||||
activesupport (= 3.2.22.5)
|
||||
arel (~> 3.0.2)
|
||||
tzinfo (~> 0.3.29)
|
||||
activerecord-import (1.0.4)
|
||||
activerecord (>= 3.2)
|
||||
activerecord-postgresql-adapter (0.0.1)
|
||||
pg
|
||||
activerecord-session_store (1.1.3)
|
||||
actionpack (>= 4.0)
|
||||
activerecord (>= 4.0)
|
||||
multi_json (~> 1.11, >= 1.11.2)
|
||||
rack (>= 1.5.2, < 3)
|
||||
railties (>= 4.0)
|
||||
activesupport (4.0.13)
|
||||
i18n (~> 0.6, >= 0.6.9)
|
||||
minitest (~> 4.2)
|
||||
multi_json (~> 1.3)
|
||||
thread_safe (~> 0.1)
|
||||
tzinfo (~> 0.3.37)
|
||||
activeresource (3.2.22.5)
|
||||
activemodel (= 3.2.22.5)
|
||||
activesupport (= 3.2.22.5)
|
||||
activesupport (3.2.22.5)
|
||||
i18n (~> 0.6, >= 0.6.4)
|
||||
multi_json (~> 1.0)
|
||||
acts-as-taggable-on (3.5.0)
|
||||
activerecord (>= 3.2, < 5)
|
||||
acts_as_list (0.2.0)
|
||||
@@ -137,11 +145,11 @@ GEM
|
||||
tilt
|
||||
angularjs-file-upload-rails (2.4.1)
|
||||
angularjs-rails (1.5.5)
|
||||
arel (4.0.2)
|
||||
arel (3.0.3)
|
||||
ast (2.4.0)
|
||||
atomic (1.1.101)
|
||||
awesome_nested_set (3.0.3)
|
||||
activerecord (>= 4.0.0, < 5)
|
||||
awesome_nested_set (2.1.5)
|
||||
activerecord (>= 3.0.0)
|
||||
awesome_print (1.8.0)
|
||||
aws-sdk (1.11.1)
|
||||
json (~> 1.4)
|
||||
@@ -151,10 +159,10 @@ GEM
|
||||
bcrypt-ruby (3.1.5)
|
||||
bcrypt (>= 3.1.3)
|
||||
blockenspiel (0.5.0)
|
||||
bugsnag (6.13.1)
|
||||
bugsnag (6.13.0)
|
||||
concurrent-ruby (~> 1.0)
|
||||
builder (3.1.4)
|
||||
byebug (11.0.1)
|
||||
builder (3.0.4)
|
||||
byebug (9.0.6)
|
||||
cancan (1.6.10)
|
||||
capybara (2.18.0)
|
||||
addressable
|
||||
@@ -165,18 +173,19 @@ GEM
|
||||
xpath (>= 2.0, < 4.0)
|
||||
childprocess (3.0.0)
|
||||
chronic (0.10.2)
|
||||
chunky_png (1.3.11)
|
||||
chunky_png (1.3.10)
|
||||
climate_control (0.2.0)
|
||||
cocaine (0.5.8)
|
||||
climate_control (>= 0.0.3, < 1.0)
|
||||
coderay (1.1.2)
|
||||
coffee-rails (4.2.2)
|
||||
coffee-rails (3.2.2)
|
||||
coffee-script (>= 2.2.0)
|
||||
railties (>= 4.0.0)
|
||||
railties (~> 3.2.0)
|
||||
coffee-script (2.4.1)
|
||||
coffee-script-source
|
||||
execjs
|
||||
coffee-script-source (1.12.2)
|
||||
coffee-script-source (1.10.0)
|
||||
colorize (0.8.1)
|
||||
combine_pdf (1.0.16)
|
||||
ruby-rc4 (>= 0.1.5)
|
||||
compass (1.0.3)
|
||||
@@ -191,25 +200,30 @@ GEM
|
||||
sass (>= 3.3.0, < 3.5)
|
||||
compass-import-once (1.0.5)
|
||||
sass (>= 3.2, < 3.5)
|
||||
compass-rails (4.0.0)
|
||||
compass-rails (3.1.0)
|
||||
compass (~> 1.0.0)
|
||||
sass-rails (< 5.1)
|
||||
sprockets (< 4.0)
|
||||
concurrent-ruby (1.1.6)
|
||||
concurrent-ruby (1.1.5)
|
||||
crack (0.4.3)
|
||||
safe_yaml (~> 1.0.0)
|
||||
css_parser (1.7.1)
|
||||
css_parser (1.7.0)
|
||||
addressable
|
||||
daemons (1.3.1)
|
||||
dalli (2.7.10)
|
||||
database_cleaner (1.7.0)
|
||||
database_cleaner (0.7.1)
|
||||
db2fog (0.9.0)
|
||||
activerecord (>= 3.2.0, < 5.0)
|
||||
fog (~> 1.0)
|
||||
rails (>= 3.2.0, < 5.0)
|
||||
ddtrace (0.36.0)
|
||||
ddtrace (0.33.1)
|
||||
msgpack
|
||||
debugger-linecache (1.2.0)
|
||||
deface (1.0.2)
|
||||
colorize (>= 0.5.8)
|
||||
nokogiri (~> 1.6.0)
|
||||
polyglot
|
||||
rails (>= 3.1)
|
||||
delayed_job (4.1.8)
|
||||
activesupport (>= 3.0, < 6.1)
|
||||
delayed_job_active_record (4.1.4)
|
||||
@@ -220,11 +234,11 @@ GEM
|
||||
delayed_job (> 2.0.3)
|
||||
rack-protection (>= 1.5.5)
|
||||
sinatra (>= 1.4.4)
|
||||
devise (3.0.4)
|
||||
devise (2.2.8)
|
||||
bcrypt-ruby (~> 3.0)
|
||||
orm_adapter (~> 0.1)
|
||||
railties (>= 3.2.6, < 5)
|
||||
warden (~> 1.2.3)
|
||||
railties (~> 3.1)
|
||||
warden (~> 1.2.1)
|
||||
devise-encryptable (0.2.0)
|
||||
devise (>= 2.1.0)
|
||||
diff-lcs (1.3)
|
||||
@@ -242,8 +256,8 @@ GEM
|
||||
railties (>= 3.0.0)
|
||||
faraday (1.0.0)
|
||||
multipart-post (>= 1.2, < 3)
|
||||
ffaker (1.32.1)
|
||||
ffi (1.12.2)
|
||||
ffaker (1.22.1)
|
||||
ffi (1.11.3)
|
||||
figaro (1.1.1)
|
||||
thor (~> 0.14)
|
||||
fission (0.5.0)
|
||||
@@ -282,7 +296,7 @@ GEM
|
||||
fog-xml (~> 0.1.1)
|
||||
ipaddress (~> 0.5)
|
||||
json (>= 1.8, < 2.0)
|
||||
fog-aliyun (0.3.5)
|
||||
fog-aliyun (0.3.2)
|
||||
fog-core
|
||||
fog-json
|
||||
ipaddress (~> 0.8)
|
||||
@@ -340,8 +354,8 @@ GEM
|
||||
multi_json (~> 1.10)
|
||||
fog-local (0.6.0)
|
||||
fog-core (>= 1.27, < 3.0)
|
||||
fog-openstack (0.3.10)
|
||||
fog-core (>= 1.45, <= 2.1.0)
|
||||
fog-openstack (0.1.25)
|
||||
fog-core (~> 1.40)
|
||||
fog-json (>= 1.0)
|
||||
ipaddress (>= 0.8)
|
||||
fog-powerdns (0.2.0)
|
||||
@@ -385,13 +399,12 @@ GEM
|
||||
fog-voxel (0.1.0)
|
||||
fog-core
|
||||
fog-xml
|
||||
fog-vsphere (3.2.1)
|
||||
fog-vsphere (2.3.0)
|
||||
fog-core
|
||||
rbvmomi (>= 1.9, < 3)
|
||||
fog-xenserver (1.0.0)
|
||||
rbvmomi (~> 1.9)
|
||||
fog-xenserver (0.3.0)
|
||||
fog-core
|
||||
fog-xml
|
||||
xmlrpc
|
||||
fog-xml (0.1.3)
|
||||
fog-core
|
||||
nokogiri (>= 1.5.11, < 2.0.0)
|
||||
@@ -407,32 +420,29 @@ GEM
|
||||
fuubar (2.5.0)
|
||||
rspec-core (~> 3.0)
|
||||
ruby-progressbar (~> 1.4)
|
||||
geocoder (1.5.2)
|
||||
get_process_mem (0.2.5)
|
||||
ffi (~> 1.0)
|
||||
gmaps4rails (2.1.2)
|
||||
haml (5.1.2)
|
||||
temple (>= 0.8.0)
|
||||
geocoder (1.1.8)
|
||||
gmaps4rails (1.5.6)
|
||||
haml (4.0.7)
|
||||
tilt
|
||||
hashdiff (1.0.1)
|
||||
highline (1.6.18)
|
||||
hike (1.2.3)
|
||||
httparty (0.18.1)
|
||||
mime-types (~> 3.0)
|
||||
httparty (0.16.2)
|
||||
multi_xml (>= 0.5.2)
|
||||
i18n (0.6.11)
|
||||
i18n-js (3.7.0)
|
||||
i18n-js (3.6.0)
|
||||
i18n (>= 0.6.6)
|
||||
immigrant (0.3.6)
|
||||
activerecord (>= 3.0)
|
||||
ipaddress (0.8.3)
|
||||
jaro_winkler (1.5.4)
|
||||
journey (1.0.4)
|
||||
jquery-migrate-rails (1.2.1)
|
||||
jquery-rails (3.1.5)
|
||||
railties (>= 3.0, < 5.0)
|
||||
thor (>= 0.14, < 2.0)
|
||||
jquery-ui-rails (4.2.1)
|
||||
railties (>= 3.2.16)
|
||||
jquery-ui-rails (4.0.5)
|
||||
railties (>= 3.1.0)
|
||||
json (1.8.6)
|
||||
json_spec (1.1.5)
|
||||
multi_json (~> 1.0)
|
||||
@@ -449,17 +459,15 @@ GEM
|
||||
letter_opener (1.7.0)
|
||||
launchy (~> 2.2)
|
||||
libv8 (7.3.492.27.1)
|
||||
mail (2.7.1)
|
||||
mini_mime (>= 0.1.1)
|
||||
mail (2.5.5)
|
||||
mime-types (~> 1.16)
|
||||
treetop (~> 1.4.8)
|
||||
method_source (0.9.2)
|
||||
mime-types (3.3.1)
|
||||
mime-types-data (~> 3.2015)
|
||||
mime-types-data (3.2020.0512)
|
||||
mini_mime (1.0.2)
|
||||
mini_portile2 (2.4.0)
|
||||
mini_racer (0.2.14)
|
||||
libv8 (> 7.3)
|
||||
minitest (4.7.5)
|
||||
mime-types (1.25.1)
|
||||
mini_mime (1.0.1)
|
||||
mini_portile2 (2.1.0)
|
||||
mini_racer (0.2.9)
|
||||
libv8 (>= 6.9.411)
|
||||
momentjs-rails (2.20.1)
|
||||
railties (>= 3.1)
|
||||
money (5.1.1)
|
||||
@@ -469,16 +477,15 @@ GEM
|
||||
multi_xml (0.6.0)
|
||||
multipart-post (2.1.1)
|
||||
newrelic_rpm (3.18.1.330)
|
||||
nokogiri (1.10.9)
|
||||
mini_portile2 (~> 2.4.0)
|
||||
nokogiri (1.6.8.1)
|
||||
mini_portile2 (~> 2.1.0)
|
||||
oauth2 (1.4.4)
|
||||
faraday (>= 0.8, < 2.0)
|
||||
jwt (>= 1.0, < 3.0)
|
||||
multi_json (~> 1.3)
|
||||
multi_xml (~> 0.5)
|
||||
rack (>= 1.2, < 3)
|
||||
oj (3.10.6)
|
||||
optimist (3.0.0)
|
||||
oj (3.10.5)
|
||||
orm_adapter (0.5.0)
|
||||
paper_trail (5.2.3)
|
||||
activerecord (>= 3.0, < 6.0)
|
||||
@@ -490,9 +497,9 @@ GEM
|
||||
cocaine (~> 0.5.0)
|
||||
mime-types
|
||||
parallel (1.19.1)
|
||||
paranoia (2.4.2)
|
||||
activerecord (>= 4.0, < 6.1)
|
||||
parser (2.7.1.0)
|
||||
paranoia (1.3.4)
|
||||
activerecord (~> 3.1)
|
||||
parser (2.7.0.5)
|
||||
ast (~> 2.4.0)
|
||||
paypal-sdk-core (0.2.10)
|
||||
multi_json (~> 1.0)
|
||||
@@ -500,60 +507,67 @@ GEM
|
||||
paypal-sdk-merchant (1.106.1)
|
||||
paypal-sdk-core (~> 0.2.3)
|
||||
pg (0.21.0)
|
||||
polyamorous (1.0.0)
|
||||
activerecord (>= 3.0)
|
||||
power_assert (1.2.0)
|
||||
polyamorous (0.5.0)
|
||||
activerecord (~> 3.0)
|
||||
polyglot (0.3.5)
|
||||
power_assert (1.1.5)
|
||||
pry (0.12.2)
|
||||
coderay (~> 1.1.0)
|
||||
method_source (~> 0.9.0)
|
||||
pry-byebug (3.7.0)
|
||||
byebug (~> 11.0)
|
||||
pry-byebug (3.4.3)
|
||||
byebug (>= 9.0, < 9.1)
|
||||
pry (~> 0.10)
|
||||
public_suffix (4.0.3)
|
||||
rack (1.5.5)
|
||||
rack-mini-profiler (2.0.2)
|
||||
rabl (0.8.4)
|
||||
activesupport (>= 2.3.14)
|
||||
rack (1.4.7)
|
||||
rack-cache (1.11.0)
|
||||
rack (>= 0.4)
|
||||
rack-mini-profiler (2.0.1)
|
||||
rack (>= 1.2.0)
|
||||
rack-protection (1.5.5)
|
||||
rack
|
||||
rack-rewrite (1.5.1)
|
||||
rack-ssl (1.4.1)
|
||||
rack-ssl (1.3.4)
|
||||
rack
|
||||
rack-test (0.6.3)
|
||||
rack (>= 1.0)
|
||||
rails (4.0.13)
|
||||
actionmailer (= 4.0.13)
|
||||
actionpack (= 4.0.13)
|
||||
activerecord (= 4.0.13)
|
||||
activesupport (= 4.0.13)
|
||||
bundler (>= 1.3.0, < 2.0)
|
||||
railties (= 4.0.13)
|
||||
sprockets-rails (~> 2.0)
|
||||
rails-i18n (4.0.5)
|
||||
i18n (~> 0.6)
|
||||
railties (~> 4.0)
|
||||
rails (3.2.22.5)
|
||||
actionmailer (= 3.2.22.5)
|
||||
actionpack (= 3.2.22.5)
|
||||
activerecord (= 3.2.22.5)
|
||||
activeresource (= 3.2.22.5)
|
||||
activesupport (= 3.2.22.5)
|
||||
bundler (~> 1.0)
|
||||
railties (= 3.2.22.5)
|
||||
rails-i18n (3.0.1)
|
||||
i18n (~> 0.5)
|
||||
rails (>= 3.0.0, < 4.0.0)
|
||||
rails_safe_tasks (1.0.0)
|
||||
railties (4.0.13)
|
||||
actionpack (= 4.0.13)
|
||||
activesupport (= 4.0.13)
|
||||
railties (3.2.22.5)
|
||||
actionpack (= 3.2.22.5)
|
||||
activesupport (= 3.2.22.5)
|
||||
rack-ssl (~> 1.3.2)
|
||||
rake (>= 0.8.7)
|
||||
thor (>= 0.18.1, < 2.0)
|
||||
rdoc (~> 3.4)
|
||||
thor (>= 0.14.6, < 2.0)
|
||||
rainbow (3.0.0)
|
||||
raindrops (0.19.1)
|
||||
rake (13.0.1)
|
||||
ransack (1.2.3)
|
||||
actionpack (>= 3.0)
|
||||
activerecord (>= 3.0)
|
||||
activesupport (>= 3.0)
|
||||
i18n
|
||||
polyamorous (~> 1.0.0)
|
||||
ransack (0.7.2)
|
||||
actionpack (~> 3.0)
|
||||
activerecord (~> 3.0)
|
||||
polyamorous (~> 0.5.0)
|
||||
rb-fsevent (0.10.3)
|
||||
rb-inotify (0.10.1)
|
||||
ffi (~> 1.0)
|
||||
rbvmomi (2.2.0)
|
||||
rb-inotify (0.9.10)
|
||||
ffi (>= 0.5.0, < 2)
|
||||
rbvmomi (1.13.0)
|
||||
builder (~> 3.0)
|
||||
json (>= 1.8)
|
||||
nokogiri (~> 1.5)
|
||||
optimist (~> 3.0)
|
||||
trollop (~> 2.1)
|
||||
rdoc (3.12.2)
|
||||
json (~> 1.4)
|
||||
redcarpet (3.5.0)
|
||||
request_store (1.4.1)
|
||||
rack (>= 1.4)
|
||||
@@ -590,15 +604,15 @@ GEM
|
||||
rspec-retry (0.6.2)
|
||||
rspec-core (> 3.3)
|
||||
rspec-support (3.9.2)
|
||||
rubocop (0.81.0)
|
||||
rubocop (0.80.1)
|
||||
jaro_winkler (~> 1.5.1)
|
||||
parallel (~> 1.10)
|
||||
parser (>= 2.7.0.1)
|
||||
rainbow (>= 2.2.2, < 4.0)
|
||||
rexml
|
||||
ruby-progressbar (~> 1.7)
|
||||
unicode-display_width (>= 1.4.0, < 2.0)
|
||||
rubocop-rails (2.5.2)
|
||||
unicode-display_width (>= 1.4.0, < 1.7)
|
||||
rubocop-rails (2.5.0)
|
||||
activesupport
|
||||
rack (>= 1.1)
|
||||
rubocop (>= 0.72.0)
|
||||
@@ -606,66 +620,64 @@ GEM
|
||||
ruby-rc4 (0.1.5)
|
||||
rubyzip (1.3.0)
|
||||
safe_yaml (1.0.5)
|
||||
sass (3.4.25)
|
||||
sass-rails (5.0.7)
|
||||
railties (>= 4.0.0, < 6)
|
||||
sass (~> 3.1)
|
||||
sprockets (>= 2.8, < 4.0)
|
||||
sprockets-rails (>= 2.0, < 4.0)
|
||||
tilt (>= 1.1, < 3)
|
||||
sass (3.3.14)
|
||||
sass-rails (3.2.6)
|
||||
railties (~> 3.2.0)
|
||||
sass (>= 3.1.10)
|
||||
tilt (~> 1.3)
|
||||
select2-rails (3.4.9)
|
||||
sass-rails
|
||||
thor (~> 0.14)
|
||||
selenium-webdriver (3.142.7)
|
||||
childprocess (>= 0.5, < 4.0)
|
||||
rubyzip (>= 1.2.2)
|
||||
shoulda-matchers (3.1.3)
|
||||
activesupport (>= 4.0.0)
|
||||
shoulda-matchers (2.8.0)
|
||||
activesupport (>= 3.0.0)
|
||||
simplecov (0.17.1)
|
||||
docile (~> 1.1)
|
||||
json (>= 1.8, < 3)
|
||||
simplecov-html (~> 0.10.0)
|
||||
simplecov-html (0.10.2)
|
||||
sinatra (1.4.8)
|
||||
rack (~> 1.5)
|
||||
sinatra (1.4.6)
|
||||
rack (~> 1.4)
|
||||
rack-protection (~> 1.4)
|
||||
tilt (>= 1.3, < 3)
|
||||
spinjs-rails (1.4)
|
||||
rails (>= 3.1)
|
||||
spring (1.7.2)
|
||||
spring-commands-rspec (1.0.4)
|
||||
spring (>= 0.9.1)
|
||||
sprockets (2.12.5)
|
||||
sprockets (2.2.3)
|
||||
hike (~> 1.2)
|
||||
multi_json (~> 1.0)
|
||||
rack (~> 1.0)
|
||||
tilt (~> 1.1, != 1.3.0)
|
||||
sprockets-rails (2.3.3)
|
||||
actionpack (>= 3.0)
|
||||
activesupport (>= 3.0)
|
||||
sprockets (>= 2.8, < 4.0)
|
||||
state_machine (1.2.0)
|
||||
stringex (1.5.1)
|
||||
stripe (5.22.0)
|
||||
temple (0.8.2)
|
||||
test-unit (3.3.6)
|
||||
stripe (5.15.0)
|
||||
test-unit (3.3.5)
|
||||
power_assert
|
||||
thor (0.20.3)
|
||||
thread_safe (0.3.6)
|
||||
tilt (1.4.1)
|
||||
timecop (0.9.1)
|
||||
treetop (1.4.15)
|
||||
polyglot
|
||||
polyglot (>= 0.3.1)
|
||||
trollop (2.9.9)
|
||||
truncate_html (0.9.2)
|
||||
tzinfo (0.3.57)
|
||||
turbo-sprockets-rails3 (0.3.14)
|
||||
railties (> 3.2.8, < 4.0.0)
|
||||
sprockets (>= 2.2.0)
|
||||
tzinfo (0.3.56)
|
||||
uglifier (4.2.0)
|
||||
execjs (>= 0.3.0, < 3)
|
||||
unicode-display_width (1.7.0)
|
||||
unicorn (5.5.5)
|
||||
unicode-display_width (1.6.1)
|
||||
unicorn (5.5.4)
|
||||
kgio (~> 2.6)
|
||||
raindrops (~> 0.7)
|
||||
unicorn-rails (2.2.1)
|
||||
rack
|
||||
unicorn
|
||||
unicorn-worker-killer (0.4.4)
|
||||
get_process_mem (~> 0)
|
||||
unicorn (>= 4, < 6)
|
||||
uuidtools (2.1.5)
|
||||
warden (1.2.7)
|
||||
rack (>= 1.0)
|
||||
@@ -677,13 +689,11 @@ GEM
|
||||
addressable (>= 2.3.6)
|
||||
crack (>= 0.3.2)
|
||||
hashdiff (>= 0.4.0, < 2.0.0)
|
||||
whenever (1.0.0)
|
||||
whenever (0.11.0)
|
||||
chronic (>= 0.6.3)
|
||||
wicked_pdf (1.4.0)
|
||||
activesupport
|
||||
wicked_pdf (1.1.0)
|
||||
wkhtmltopdf-binary (0.12.5)
|
||||
xml-simple (1.1.5)
|
||||
xmlrpc (0.3.0)
|
||||
xpath (2.1.0)
|
||||
nokogiri (~> 1.3)
|
||||
|
||||
@@ -691,90 +701,80 @@ PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
actionpack-action_caching
|
||||
active_model_serializers (= 0.8.4)
|
||||
activemerchant (~> 1.78.0)
|
||||
activemerchant (~> 1.78)
|
||||
activerecord-import
|
||||
activerecord-postgresql-adapter
|
||||
activerecord-session_store
|
||||
acts-as-taggable-on (~> 3.4)
|
||||
acts_as_list (= 0.2.0)
|
||||
andand
|
||||
angular-rails-templates (~> 0.3.0)
|
||||
angularjs-file-upload-rails (~> 2.4.1)
|
||||
angularjs-rails (= 1.5.5)
|
||||
atomic
|
||||
awesome_nested_set (~> 3.0.0.rc.1)
|
||||
awesome_print
|
||||
aws-sdk (= 1.11.1)
|
||||
aws-sdk
|
||||
blockenspiel
|
||||
bugsnag
|
||||
byebug (~> 11.0.0)
|
||||
cancan (~> 1.6.10)
|
||||
byebug (~> 9.0.0)
|
||||
capybara (>= 2.18.0)
|
||||
catalog!
|
||||
coffee-rails (~> 4.2.2)
|
||||
coffee-rails (~> 3.2.1)
|
||||
combine_pdf
|
||||
compass-rails
|
||||
custom_error_message!
|
||||
daemons
|
||||
dalli
|
||||
database_cleaner
|
||||
database_cleaner (= 0.7.1)
|
||||
db2fog
|
||||
ddtrace
|
||||
debugger-linecache
|
||||
deface (= 1.0.2)
|
||||
delayed_job_active_record
|
||||
delayed_job_web
|
||||
devise (~> 3.0.1)
|
||||
devise-encryptable
|
||||
dfc_provider!
|
||||
devise (~> 2.2.5)
|
||||
devise-encryptable (= 0.2.0)
|
||||
diffy
|
||||
eventmachine (>= 1.2.3)
|
||||
factory_bot_rails (= 4.10.0)
|
||||
ffaker (~> 1.16)
|
||||
factory_bot_rails
|
||||
figaro
|
||||
foreigner
|
||||
foundation-icons-sass-rails
|
||||
foundation-rails (= 5.5.2.1)
|
||||
foundation-rails
|
||||
foundation_rails_helper!
|
||||
fuubar (~> 2.5.0)
|
||||
geocoder
|
||||
gmaps4rails
|
||||
haml
|
||||
highline (= 1.6.18)
|
||||
httparty (~> 0.18)
|
||||
i18n (~> 0.6.11)
|
||||
i18n-js (~> 3.7.0)
|
||||
i18n-js (~> 3.6.0)
|
||||
immigrant
|
||||
jquery-migrate-rails
|
||||
jquery-rails (= 3.1.5)
|
||||
jquery-ui-rails (~> 4.2)
|
||||
json (>= 1.7.7)
|
||||
jquery-ui-rails (~> 4.0.0)
|
||||
json_spec (~> 1.1.4)
|
||||
jwt (~> 2.2)
|
||||
kaminari (~> 0.14.1)
|
||||
knapsack
|
||||
letter_opener (>= 1.4.1)
|
||||
mini_racer (= 0.2.14)
|
||||
mini_racer (= 0.2.9)
|
||||
momentjs-rails
|
||||
money (= 5.1.1)
|
||||
newrelic_rpm (~> 3.0)
|
||||
nokogiri (>= 1.6.7.1)
|
||||
oauth2 (~> 1.4.4)
|
||||
ofn-qz!
|
||||
oj
|
||||
order_management!
|
||||
paper_trail (~> 5.2.3)
|
||||
paperclip (~> 3.4.1)
|
||||
paranoia (~> 2.0)
|
||||
pg (~> 0.21.0)
|
||||
pry (~> 0.12.0)
|
||||
pry-byebug (~> 3.7.0)
|
||||
pry-byebug (>= 3.4.3)
|
||||
rabl
|
||||
rack-mini-profiler (< 3.0.0)
|
||||
rack-rewrite
|
||||
rack-ssl
|
||||
rails (~> 4.0.13)
|
||||
rails-i18n (~> 4.0)
|
||||
rails (~> 3.2.22)
|
||||
rails-i18n (~> 3.0.0)
|
||||
rails_safe_tasks (~> 1.0)
|
||||
ransack (~> 1.2.3)
|
||||
redcarpet
|
||||
roadie-rails (~> 1.3.0)
|
||||
roo (~> 2.8.3)
|
||||
@@ -782,27 +782,27 @@ DEPENDENCIES
|
||||
rspec-retry
|
||||
rubocop
|
||||
rubocop-rails
|
||||
sass
|
||||
sass-rails
|
||||
sass (~> 3.3)
|
||||
sass-rails (~> 3.2.3)
|
||||
select2-rails (~> 3.4.7)
|
||||
selenium-webdriver
|
||||
shoulda-matchers
|
||||
simple_form!
|
||||
simplecov
|
||||
spinjs-rails
|
||||
spree_core!
|
||||
spree_i18n!
|
||||
spree_paypal_express!
|
||||
spring
|
||||
spring (= 1.7.2)
|
||||
spring-commands-rspec
|
||||
state_machine (= 1.2.0)
|
||||
stringex (~> 1.5.1)
|
||||
stripe
|
||||
test-unit (~> 3.3)
|
||||
timecop
|
||||
truncate_html (= 0.9.2)
|
||||
truncate_html
|
||||
turbo-sprockets-rails3
|
||||
uglifier (>= 1.0.3)
|
||||
unicorn
|
||||
unicorn-rails
|
||||
unicorn-worker-killer
|
||||
web!
|
||||
webdrivers
|
||||
webmock
|
||||
@@ -814,4 +814,4 @@ RUBY VERSION
|
||||
ruby 2.3.7p456
|
||||
|
||||
BUNDLED WITH
|
||||
1.17.3
|
||||
1.17.2
|
||||
|
||||
1051
app/assets/images/home/groups-bg.svg
Normal file
|
After Width: | Height: | Size: 107 KiB |
BIN
app/assets/images/home/home-apples.jpg
Normal file
|
After Width: | Height: | Size: 138 KiB |
BIN
app/assets/images/home/home-oranges.jpg
Normal file
|
After Width: | Height: | Size: 105 KiB |
BIN
app/assets/images/home/home-strawberries.jpg
Normal file
|
After Width: | Height: | Size: 570 KiB |
BIN
app/assets/images/home/home1.jpg
Normal file
|
After Width: | Height: | Size: 206 KiB |
BIN
app/assets/images/home/home2.jpg
Normal file
|
After Width: | Height: | Size: 244 KiB |
BIN
app/assets/images/home/home3.jpg
Normal file
|
After Width: | Height: | Size: 195 KiB |
BIN
app/assets/images/home/macbook.png
Normal file
|
After Width: | Height: | Size: 34 KiB |
1090
app/assets/images/home/maps-bg.svg
Normal file
|
After Width: | Height: | Size: 123 KiB |
72
app/assets/images/home/producers-bg.svg
Normal file
@@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 17.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
width="386.638px" height="320px" viewBox="-31.319 2 386.638 320" enable-background="new -31.319 2 386.638 320"
|
||||
xml:space="preserve">
|
||||
<g>
|
||||
<path fill="#ABDBD0" d="M331.518,159.254c-13.147,0-23.805,26.723-23.805,59.69c0,32.96,10.658,59.685,23.805,59.685
|
||||
c13.142,0,23.801-26.725,23.801-59.685C355.319,185.977,344.66,159.254,331.518,159.254z M332.114,255.185
|
||||
c-8.06,0-14.593-15.746-14.593-35.167s6.533-35.165,14.593-35.165c8.059,0,14.594,15.743,14.594,35.165
|
||||
S340.173,255.185,332.114,255.185z"/>
|
||||
<path fill="#ABDBD0" d="M304.557,219.468c0-36.244,11.718-65.623,26.171-65.623c2.107,0,4.154,0.642,6.116,1.823
|
||||
c-10.469-8.709-35.108-4.515-46.498-2.514c-2.139,3.216-3.572,6.079-4.237,7.624c-3.91,9.023-7.063,22.001-7.063,22.001
|
||||
l-11.863-0.291l11.689,55.666h-17.909c2.54,25.911,10.809,43.072,25.314,46.94c0,0,30.567,4.944,45.693-0.081
|
||||
c-0.414,0.046-0.828,0.081-1.243,0.081C316.273,285.091,304.557,255.707,304.557,219.468z"/>
|
||||
<path fill="#ABDBD0" d="M64.393,237.666c0-46.574,34.058-84.332,76.072-84.332c1.812,0,3.605,0.095,5.386,0.234
|
||||
c-5.466-1.08-11.117-1.655-16.903-1.655c-47.453,0-85.919,38.074-85.919,85.044c0,46.967,38.467,85.042,85.919,85.042
|
||||
c2.052,0,4.08-0.097,6.096-0.238C95.562,318.679,64.393,282.219,64.393,237.666z"/>
|
||||
<path fill="#ABDBD0" d="M122.02,149.109c44.188-2.104,67.371,17.402,79.829,34.057l3.027-2.314l4.452-5.008l28.39,7.793
|
||||
l10.02,52.325h27.275l-11.689-55.667l11.861,0.291c0,0,3.157-12.974,7.066-22c1.977-4.57,10.576-20.597,24.492-23.378
|
||||
c13.917-2.784,26.31,15.218,26.31,15.218l-6.824-19.114l-25.606-9.464l-7.794-42.304l11.689-7.236l-1.114-11.69l-64.57-23.38
|
||||
l-82.387,19.483V66.74l13.361,3.341l-8.908,25.608c0,0-23.709-3.198-47.031-1.02c-27.244,2.543-54.707,10.521-54.707,10.521
|
||||
l-7.365,14.434l-5.009,66.242l2.983,0.565l5.182-59.414l70.49-6.662L122.02,149.109L122.02,149.109z M65.958,118.276
|
||||
c-3.541,0.556-6.775-1.29-7.219-4.123c-0.446-2.835,2.065-5.583,5.606-6.139c3.543-0.556,6.776,1.288,7.22,4.124
|
||||
C72.011,114.972,69.5,117.719,65.958,118.276z M107.793,115.428c-4.711,0.741-9.011-1.713-9.603-5.483
|
||||
c-0.592-3.77,2.748-7.425,7.458-8.167c4.713-0.741,9.014,1.717,9.604,5.484C115.845,111.034,112.505,114.689,107.793,115.428z
|
||||
M225.388,109.481h-19.989L166.472,98.96l7.715-25.25l57.162-10.17L225.388,109.481z M252.39,181.723l-17.886-0.702l7.015-117.482
|
||||
l30.508,9.469l5.612,49.447L252.39,181.723z M282.025,122.017l-6.135-47.956l14.378,7.715l7.015,43.925L282.025,122.017z"/>
|
||||
<path fill="#ABDBD0" d="M147.008,91.476V57.053h-6.84V41.534c-0.001-8.57-6.945-15.515-15.517-15.519v6.314
|
||||
c5.083,0.008,9.198,4.123,9.206,9.204v15.519h-6.312v33.7C134.962,90.733,141.75,91.082,147.008,91.476z"/>
|
||||
<path fill="#ABDBD0" d="M-22.811,227.408c0-33.523,28.628-60.694,63.942-60.694c1.17,0,2.333,0.034,3.487,0.094l0.406-5.338
|
||||
c-2.084-0.176-4.193-0.274-6.325-0.274c-38.67-0.001-70.018,29.602-70.018,66.12c0,36.522,31.348,66.125,70.018,66.125
|
||||
c6.585,0,12.95-0.877,18.994-2.483c-1.019-1.387-1.98-2.814-2.918-4.26c-4.397,0.909-8.959,1.4-13.642,1.4
|
||||
C5.817,288.099-22.811,260.925-22.811,227.408z"/>
|
||||
<path fill="#ABDBD0" d="M10.539,226.003c0-18.358,16.222-33.24,36.233-33.24c2.119,0,4.189,0.176,6.207,0.497
|
||||
c0.214-0.435,0.437-0.864,0.675-1.295l-10.952-2.055l1.408-18.469c-1.078-0.059-2.159-0.087-3.249-0.087
|
||||
c-32.898,0-59.568,25.249-59.568,56.395c0,31.139,26.67,56.388,59.568,56.388c4.363,0,8.614-0.457,12.71-1.299
|
||||
c-4.71-7.248-8.31-15.242-10.552-23.764C24.771,257.346,10.539,243.2,10.539,226.003z"/>
|
||||
<g>
|
||||
<polygon fill="#ABDBD0" points="121.189,130.962 56.135,136.089 56.662,129.208 122.02,123.859 "/>
|
||||
<polygon fill="#ABDBD0" points="120.531,141.218 55.478,146.347 56.004,139.465 121.364,134.116 "/>
|
||||
<path fill="#ABDBD0" d="M120.311,143.455l-65.36,5.348l-0.526,6.882l50.139-3.953c4.875-1.368,9.922-2.336,15.109-2.83
|
||||
L120.311,143.455z"/>
|
||||
<path fill="#ABDBD0" d="M54.293,159.059l-0.527,6.883l24.851-1.96c4.491-3.131,9.296-5.842,14.364-8.088L54.293,159.059z"/>
|
||||
<path fill="#ABDBD0" d="M72.954,168.275l-19.187,1.571l-0.526,6.882l11.721-0.926C67.461,173.128,70.129,170.612,72.954,168.275z"
|
||||
/>
|
||||
<path fill="#ABDBD0" d="M52.847,179.313l-0.526,6.882l4.571-0.362c1.745-2.542,3.636-4.978,5.641-7.313L52.847,179.313z"/>
|
||||
</g>
|
||||
<circle fill="#ABDBD0" cx="140.958" cy="239.852" r="19.726"/>
|
||||
<ellipse fill="#ABDBD0" cx="328.491" cy="218.807" rx="4.487" ry="12.775"/>
|
||||
<g>
|
||||
<circle fill="#ABDBD0" cx="162.134" cy="223.81" r="2.781"/>
|
||||
<circle fill="#ABDBD0" cx="133.371" cy="215.827" r="2.781"/>
|
||||
<circle fill="#ABDBD0" cx="115.492" cy="239.462" r="2.781"/>
|
||||
<circle fill="#ABDBD0" cx="131.915" cy="265.616" r="2.781"/>
|
||||
<circle fill="#ABDBD0" cx="161.682" cy="255.915" r="2.783"/>
|
||||
</g>
|
||||
<path fill="#ABDBD0" d="M126.341,6.21c-9.103,0-16.483,7.379-16.483,16.482c0,2.76,0.686,5.357,1.886,7.641
|
||||
c-2.135-2.062-3.7-4.699-4.48-7.655l0,0c-0.538,0.587-1.051,1.203-1.509,1.884c-5.088,7.548-3.096,17.791,4.454,22.881
|
||||
c2.287,1.542,4.825,2.424,7.39,2.708c-4.22,0.898-8.783,0.158-12.644-2.444c-7.548-5.088-9.542-15.333-4.452-22.881
|
||||
c1.634-2.423,3.81-4.247,6.245-5.472c-0.014-0.289-0.046-0.574-0.046-0.869c0-3.665,1.211-7.038,3.233-9.775l-0.001,0.001
|
||||
c-0.855-0.185-1.731-0.312-2.642-0.312c-7.101,0-12.857,5.756-12.857,12.858c0,2.152,0.535,4.177,1.472,5.959
|
||||
c-2.421-2.337-3.933-5.611-3.933-9.241c0-7.101,5.756-12.857,12.856-12.857c2.414,0,4.663,0.675,6.591,1.833
|
||||
c-0.004,0.002-0.004,0.004-0.006,0.005C114.405,3.9,118.571,2,123.185,2c6.343,0,11.841,3.588,14.598,8.842
|
||||
C134.817,7.98,130.789,6.21,126.341,6.21z"/>
|
||||
<path fill="#ABDBD0" d="M188.32,300.982c-0.004,0-0.006,0.002-0.008,0.004c19.094-15.154,31.275-38.079,31.275-63.757
|
||||
c0-40.085-29.659-73.5-69.016-81.055c-1.782-0.134-3.574-0.227-5.385-0.227c-42.013,0-76.072,36.7-76.072,81.97
|
||||
c0,43.31,31.169,78.747,70.65,81.743c7.991-0.539,15.673-2.145,22.914-4.642L188.32,300.982z M144.663,286.068
|
||||
c-23.696,0-42.907-20.166-42.907-45.041c0-24.878,19.211-45.042,42.907-45.042c23.697,0,42.908,20.166,42.908,45.042
|
||||
C187.571,265.902,168.359,286.068,144.663,286.068z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 6.3 KiB |
|
Before Width: | Height: | Size: 540 B |
|
Before Width: | Height: | Size: 534 B |
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="28px" height="33px" enable-background="new 0 0 28 33" version="1.1" viewBox="0 0 28 33" xmlns="http://www.w3.org/2000/svg"><path d="M14,25c-6.059,0-10.988,1.679-10.988,3.333c0,2.485,10.307,4.542,10.746,4.643 C13.828,32.992,13.914,33,14,33c0.084,0,0.17-0.008,0.239-0.023c0.439-0.099,10.749-2.114,10.749-4.643 C24.988,26.679,20.059,25,14,25z" fill="#282828" opacity=".25"/><path d="M14,0C6.28,0,0,6.717,0,13.332c0,9.941,13.132,18.169,13.691,18.572C13.78,31.968,13.891,32,14,32 c0.107,0,0.217-0.031,0.305-0.094C14.864,31.511,28,23.45,28,13.332C28,6.717,21.72,0,14,0z" fill="#fff"/><g><g fill="#0b8c61"><path d="m14 0c-7.72 0-14 6.717-14 13.333 0 9.941 13.132 18.169 13.691 18.571 0.089 0.064 0.2 0.096 0.309 0.096 0.107 0 0.217-0.031 0.305-0.094 0.559-0.395 13.695-8.456 13.695-18.573 0-6.616-6.28-13.333-14-13.333zm9.5 12.057c0 0.863-0.567 1.661-1.325 1.942l-1.025 5.889c-0.015 0.976-0.889 1.831-1.94 1.831h-10.466c-1.052 0-1.925-0.855-1.947-1.906l-1.024-5.828c-0.737-0.294-1.273-1.075-1.273-1.928v-0.827c0-1.074 0.874-1.948 1.948-1.948h2.302l1.396-2.247c0.4-0.698 1.417-0.978 2.145-0.555 0.755 0.435 1.015 1.403 0.58 2.159l-0.41 0.642h2.662l-0.39-0.61c-0.227-0.391-0.284-0.823-0.174-1.235 0.109-0.406 0.37-0.745 0.734-0.955 0.716-0.417 1.739-0.148 2.159 0.579l1.381 2.223h2.718c1.074 0 1.948 0.874 1.948 1.948v0.826z"/><rect x="3.6006" y="6.9915" width="20.415" height="15.521"/><rect x="8.9841" y="5.6631" width="10.487" height="3.6356"/></g><text x="5.0698848" y="20.243376" fill="#000000" font-family="sans-serif" font-size="16px" style="line-height:1.25" xml:space="preserve"><tspan x="5.0698848" y="20.243376" fill="#ffffff" font-family="Arial" font-size="16px" font-weight="bold">1+</tspan></text></g></svg>
|
||||
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 759 B |
@@ -30,6 +30,7 @@
|
||||
//= require spree
|
||||
//= require admin/spree/spree-select2
|
||||
//= require modernizr
|
||||
//= require spin
|
||||
//= require equalize
|
||||
//= require css_browser_selector_dev
|
||||
//= require responsive-tables
|
||||
|
||||
@@ -105,7 +105,6 @@ angular.module("ofn.admin").controller "AdminProductEditCtrl", ($scope, $timeout
|
||||
$scope.producerFilter = "0"
|
||||
$scope.categoryFilter = "0"
|
||||
$scope.importDateFilter = "0"
|
||||
$scope.fetchProducts()
|
||||
|
||||
$scope.$watch 'sortOptions', (sort) ->
|
||||
return unless sort && sort.predicate != ""
|
||||
|
||||
@@ -29,7 +29,7 @@ angular.module("admin.enterprises")
|
||||
# from a directive "nav-check" in the page - if we pass it here it will be called in the test suite,
|
||||
# and on all new uses of this contoller, and we might not want that.
|
||||
enterpriseNavCallback = ->
|
||||
if $scope.enterprise_form?.$dirty
|
||||
if $scope.enterprise_form != undefined && $scope.enterprise_form.$dirty
|
||||
t('admin.unsaved_confirm_leave')
|
||||
|
||||
# Register the NavigationCheck callback
|
||||
|
||||
@@ -2,24 +2,19 @@ angular.module("admin.indexUtils").factory "PagedFetcher", (dataFetcher) ->
|
||||
new class PagedFetcher
|
||||
# Given a URL like http://example.com/foo?page=::page::&per_page=20
|
||||
# And the response includes an attribute pages with the number of pages to fetch
|
||||
# Fetch each page async, and call the pageCallback callback with the resulting data
|
||||
# Developer note: this class should not be re-used!
|
||||
page: 1
|
||||
last_page: 1
|
||||
# Fetch each page async, and call the processData callback with the resulting data
|
||||
fetch: (url, processData, onLastPageComplete) ->
|
||||
dataFetcher(@urlForPage(url, 1)).then (data) =>
|
||||
processData data
|
||||
|
||||
fetch: (url, pageCallback) ->
|
||||
@fetchPages(url, @page, pageCallback)
|
||||
if data.pages > 1
|
||||
for page in [2..data.pages]
|
||||
lastPromise = dataFetcher(@urlForPage(url, page)).then (data) ->
|
||||
processData data
|
||||
onLastPageComplete && lastPromise.then onLastPageComplete
|
||||
return
|
||||
else
|
||||
onLastPageComplete && onLastPageComplete()
|
||||
|
||||
urlForPage: (url, page) ->
|
||||
url.replace("::page::", page)
|
||||
|
||||
fetchPages: (url, page, pageCallback) ->
|
||||
dataFetcher(@urlForPage(url, page)).then (data) =>
|
||||
@page++
|
||||
@last_page = data.pages
|
||||
|
||||
pageCallback(data) if pageCallback
|
||||
|
||||
if @page <= @last_page
|
||||
@fetchPages(url, @page, pageCallback)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
angular.module("admin.lineItems").controller 'LineItemsCtrl', ($scope, $timeout, $http, $q, StatusMessage, Columns, SortOptions, Dereferencer, Orders, LineItems, Enterprises, OrderCycles, VariantUnitManager, RequestMonitor) ->
|
||||
$scope.initialized = false
|
||||
$scope.RequestMonitor = RequestMonitor
|
||||
$scope.line_items = LineItems.all
|
||||
$scope.filteredLineItems = []
|
||||
$scope.confirmDelete = true
|
||||
$scope.startDate = moment().startOf('day').subtract(7, 'days').format('YYYY-MM-DD')
|
||||
$scope.endDate = moment().startOf('day').format('YYYY-MM-DD')
|
||||
@@ -15,77 +15,50 @@ angular.module("admin.lineItems").controller 'LineItemsCtrl', ($scope, $timeout,
|
||||
$scope.confirmRefresh = ->
|
||||
LineItems.allSaved() || confirm(t("unsaved_changes_warning"))
|
||||
|
||||
$scope.resetFilters = ->
|
||||
$scope.distributorFilter = ''
|
||||
$scope.supplierFilter = ''
|
||||
$scope.orderCycleFilter = ''
|
||||
$scope.quickSearch = ''
|
||||
|
||||
$scope.resetSelectFilters = ->
|
||||
$scope.resetFilters()
|
||||
$scope.refreshData()
|
||||
$scope.distributorFilter = 0
|
||||
$scope.supplierFilter = 0
|
||||
$scope.orderCycleFilter = 0
|
||||
$scope.quickSearch = ""
|
||||
|
||||
$scope.refreshData = ->
|
||||
unless !$scope.orderCycleFilter? || $scope.orderCycleFilter == ''
|
||||
$scope.setOrderCycleDateRange()
|
||||
unless !$scope.orderCycleFilter? || $scope.orderCycleFilter == 0
|
||||
$scope.startDate = moment(OrderCycles.byID[$scope.orderCycleFilter].orders_open_at).format('YYYY-MM-DD')
|
||||
$scope.endDate = moment(OrderCycles.byID[$scope.orderCycleFilter].orders_close_at).startOf('day').format('YYYY-MM-DD')
|
||||
|
||||
$scope.formattedStartDate = moment($scope.startDate).format()
|
||||
$scope.formattedEndDate = moment($scope.endDate).add(1,'day').format()
|
||||
formatted_start_date = moment($scope.startDate).format()
|
||||
formatted_end_date = moment($scope.endDate).add(1,'day').format()
|
||||
|
||||
return unless moment($scope.formattedStartDate).isValid() and moment($scope.formattedEndDate).isValid()
|
||||
|
||||
$scope.loadOrders()
|
||||
$scope.loadLineItems()
|
||||
|
||||
unless $scope.initialized
|
||||
$scope.loadAssociatedData()
|
||||
|
||||
$scope.dereferenceLoadedData()
|
||||
|
||||
$scope.setOrderCycleDateRange = ->
|
||||
start_date = OrderCycles.byID[$scope.orderCycleFilter].orders_open_at
|
||||
end_date = OrderCycles.byID[$scope.orderCycleFilter].orders_close_at
|
||||
format = "YYYY-MM-DD HH:mm:ss Z"
|
||||
$scope.startDate = moment(start_date, format).format('YYYY-MM-DD')
|
||||
$scope.endDate = moment(end_date, format).startOf('day').format('YYYY-MM-DD')
|
||||
|
||||
$scope.loadOrders = ->
|
||||
RequestMonitor.load $scope.orders = Orders.index(
|
||||
"q[state_not_eq]": "canceled",
|
||||
"q[completed_at_not_null]": "true",
|
||||
"q[distributor_id_eq]": $scope.distributorFilter,
|
||||
"q[order_cycle_id_eq]": $scope.orderCycleFilter,
|
||||
"q[completed_at_gteq]": $scope.formattedStartDate,
|
||||
"q[completed_at_lt]": $scope.formattedEndDate
|
||||
"q[completed_at_gteq]": formatted_start_date,
|
||||
"q[completed_at_lt]": formatted_end_date
|
||||
)
|
||||
|
||||
$scope.loadLineItems = ->
|
||||
RequestMonitor.load LineItems.index(
|
||||
"q[order_state_not_eq]": "canceled",
|
||||
"q[order_completed_at_not_null]": "true",
|
||||
"q[order_distributor_id_eq]": $scope.distributorFilter,
|
||||
"q[variant_product_supplier_id_eq]": $scope.supplierFilter,
|
||||
"q[order_order_cycle_id_eq]": $scope.orderCycleFilter,
|
||||
"q[order_completed_at_gteq]": $scope.formattedStartDate,
|
||||
"q[order_completed_at_lt]": $scope.formattedEndDate
|
||||
RequestMonitor.load $scope.lineItems = LineItems.index(
|
||||
"q[order][state_not_eq]": "canceled",
|
||||
"q[order][completed_at_not_null]": "true",
|
||||
"q[order][completed_at_gteq]": formatted_start_date,
|
||||
"q[order][completed_at_lt]": formatted_end_date
|
||||
)
|
||||
|
||||
$scope.loadAssociatedData = ->
|
||||
RequestMonitor.load $scope.distributors = Enterprises.index(action: "visible", ams_prefix: "basic", "q[sells_in][]": ["own", "any"])
|
||||
RequestMonitor.load $scope.orderCycles = OrderCycles.index(ams_prefix: "basic", as: "distributor", "q[orders_close_at_gt]": "#{moment().subtract(90,'days').format()}")
|
||||
RequestMonitor.load $scope.suppliers = Enterprises.index(action: "visible", ams_prefix: "basic", "q[is_primary_producer_eq]": "true")
|
||||
unless $scope.initialized
|
||||
RequestMonitor.load $scope.distributors = Enterprises.index(action: "visible", ams_prefix: "basic", "q[sells_in][]": ["own", "any"])
|
||||
RequestMonitor.load $scope.orderCycles = OrderCycles.index(ams_prefix: "basic", as: "distributor", "q[orders_close_at_gt]": "#{moment().subtract(90,'days').format()}")
|
||||
RequestMonitor.load $scope.suppliers = Enterprises.index(action: "visible", ams_prefix: "basic", "q[is_primary_producer_eq]": "true")
|
||||
|
||||
$scope.dereferenceLoadedData = ->
|
||||
RequestMonitor.load $q.all([$scope.orders.$promise, $scope.distributors.$promise, $scope.orderCycles.$promise, $scope.suppliers.$promise, $scope.line_items.$promise]).then ->
|
||||
RequestMonitor.load $q.all([$scope.orders.$promise, $scope.distributors.$promise, $scope.orderCycles.$promise, $scope.suppliers.$promise, $scope.lineItems.$promise]).then ->
|
||||
Dereferencer.dereferenceAttr $scope.orders, "distributor", Enterprises.byID
|
||||
Dereferencer.dereferenceAttr $scope.orders, "order_cycle", OrderCycles.byID
|
||||
Dereferencer.dereferenceAttr $scope.line_items, "supplier", Enterprises.byID
|
||||
Dereferencer.dereferenceAttr $scope.line_items, "order", Orders.byID
|
||||
Dereferencer.dereferenceAttr $scope.lineItems, "supplier", Enterprises.byID
|
||||
Dereferencer.dereferenceAttr $scope.lineItems, "order", Orders.byID
|
||||
$scope.bulk_order_form.$setPristine()
|
||||
StatusMessage.clear()
|
||||
|
||||
unless $scope.initialized
|
||||
$scope.initialized = true
|
||||
$timeout ->
|
||||
$scope.resetSelectFilters()
|
||||
|
||||
$scope.$watch 'bulk_order_form.$dirty', (newVal, oldVal) ->
|
||||
if newVal == true
|
||||
@@ -104,12 +77,13 @@ angular.module("admin.lineItems").controller 'LineItemsCtrl', ($scope, $timeout,
|
||||
|
||||
$scope.deleteLineItem = (lineItem) ->
|
||||
if ($scope.confirmDelete && confirm(t "are_you_sure")) || !$scope.confirmDelete
|
||||
LineItems.delete lineItem
|
||||
LineItems.delete lineItem, =>
|
||||
$scope.lineItems.splice $scope.lineItems.indexOf(lineItem), 1
|
||||
|
||||
$scope.deleteLineItems = (lineItemsToDelete) ->
|
||||
$scope.deleteLineItems = (lineItems) ->
|
||||
existingState = $scope.confirmDelete
|
||||
$scope.confirmDelete = false
|
||||
$scope.deleteLineItem lineItem for lineItem in lineItemsToDelete when lineItem.checked
|
||||
$scope.deleteLineItem lineItem for lineItem in lineItems when lineItem.checked
|
||||
$scope.confirmDelete = existingState
|
||||
|
||||
$scope.allBoxesChecked = ->
|
||||
@@ -180,5 +154,4 @@ angular.module("admin.lineItems").controller 'LineItemsCtrl', ($scope, $timeout,
|
||||
lineItem.final_weight_volume = LineItems.pristineByID[lineItem.id].final_weight_volume * lineItem.quantity / LineItems.pristineByID[lineItem.id].quantity
|
||||
$scope.weightAdjustedPrice(lineItem)
|
||||
|
||||
$scope.resetFilters()
|
||||
$scope.refreshData()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
angular.module('admin.orderCycles')
|
||||
.controller 'AdminEditOrderCycleCtrl', ($scope, $controller, $filter, $location, $window, OrderCycle, Enterprise, EnterpriseFee, StatusMessage, Schedules, RequestMonitor, NavigationCheck, ocInstance) ->
|
||||
.controller 'AdminEditOrderCycleCtrl', ($scope, $controller, $filter, $location, $window, OrderCycle, Enterprise, EnterpriseFee, StatusMessage, Schedules, RequestMonitor, ocInstance) ->
|
||||
$controller('AdminOrderCycleBasicCtrl', {$scope: $scope, ocInstance: ocInstance})
|
||||
|
||||
order_cycle_id = $location.absUrl().match(/\/admin\/order_cycles\/(\d+)/)[1]
|
||||
@@ -18,12 +18,5 @@ angular.module('admin.orderCycles')
|
||||
|
||||
$scope.submit = ($event, destination) ->
|
||||
$event.preventDefault()
|
||||
NavigationCheck.clear()
|
||||
StatusMessage.display 'progress', t('js.saving')
|
||||
OrderCycle.update(destination, $scope.order_cycle_form)
|
||||
|
||||
warnAboutUnsavedChanges = ->
|
||||
if $scope.order_cycle_form?.$dirty
|
||||
t('admin.unsaved_confirm_leave')
|
||||
|
||||
NavigationCheck.register(warnAboutUnsavedChanges)
|
||||
@@ -34,10 +34,10 @@ angular.module("admin.orders").controller "ordersCtrl", ($scope, $timeout, Reque
|
||||
'q[bill_address_lastname_start]': $scope['q']['bill_address_lastname_start'],
|
||||
# Set default checkbox values to null. See: https://github.com/openfoodfoundation/openfoodnetwork/pull/3076#issuecomment-440010498
|
||||
'q[completed_at_not_null]': $scope['q']['completed_at_not_null'] || null,
|
||||
'q[distributor_id_in][]': $scope['q']['distributor_id_in'],
|
||||
'q[order_cycle_id_in][]': $scope['q']['order_cycle_id_in'],
|
||||
'q[distributor_id_in]': $scope['q']['distributor_id_in'],
|
||||
'q[order_cycle_id_in]': $scope['q']['order_cycle_id_in'],
|
||||
'q[order_cycle_id_in]': $scope['q']['order_cycle_id_in'],
|
||||
'q[s]': $scope.sorting || 'completed_at desc',
|
||||
shipping_method_id: $scope.shipping_method_id,
|
||||
per_page: $scope.per_page,
|
||||
page: page
|
||||
}
|
||||
@@ -67,7 +67,7 @@ angular.module("admin.orders").controller "ordersCtrl", ($scope, $timeout, Reque
|
||||
return unless sort && sort.predicate != ""
|
||||
|
||||
$scope.sorting = sort.getSortingExpr()
|
||||
$scope.fetchResults()
|
||||
$scope.fetchProducts()
|
||||
, true
|
||||
|
||||
$scope.capturePayment = (order) ->
|
||||
|
||||
@@ -14,10 +14,9 @@ angular.module("admin.payments").factory 'AdminStripeElements', ($rootScope, Sta
|
||||
@stripe.createToken(@card, cardData).then (response) =>
|
||||
if(response.error)
|
||||
StatusMessage.display 'error', response.error.message
|
||||
console.error(JSON.stringify(response.error))
|
||||
else
|
||||
secrets.token = response.token.id
|
||||
secrets.cc_type = @mapTokenApiCardBrand(response.token.card.brand)
|
||||
secrets.cc_type = @mapCC(response.token.card.brand)
|
||||
secrets.card = response.token.card
|
||||
submit()
|
||||
|
||||
@@ -30,16 +29,15 @@ angular.module("admin.payments").factory 'AdminStripeElements', ($rootScope, Sta
|
||||
@stripe.createPaymentMethod({ type: 'card', card: @card }, @card, cardData).then (response) =>
|
||||
if(response.error)
|
||||
StatusMessage.display 'error', response.error.message
|
||||
console.error(JSON.stringify(response.error))
|
||||
else
|
||||
secrets.token = response.paymentMethod.id
|
||||
secrets.cc_type = @mapPaymentMethodsApiCardBrand(response.paymentMethod.card.brand)
|
||||
secrets.cc_type = response.paymentMethod.card.brand
|
||||
secrets.card = response.paymentMethod.card
|
||||
submit()
|
||||
|
||||
# Maps the brand returned by Stripe's tokenAPI to that required by activemerchant
|
||||
mapTokenApiCardBrand: (cardBrand) ->
|
||||
switch cardBrand
|
||||
# Maps the brand returned by Stripe to that required by activemerchant
|
||||
mapCC: (ccType) ->
|
||||
switch ccType
|
||||
when 'MasterCard' then return 'master'
|
||||
when 'Visa' then return 'visa'
|
||||
when 'American Express' then return 'american_express'
|
||||
@@ -47,14 +45,6 @@ angular.module("admin.payments").factory 'AdminStripeElements', ($rootScope, Sta
|
||||
when 'JCB' then return 'jcb'
|
||||
when 'Diners Club' then return 'diners_club'
|
||||
|
||||
# Maps the brand returned by Stripe's paymentMethodsAPI to that required by activemerchant
|
||||
mapPaymentMethodsApiCardBrand: (cardBrand) ->
|
||||
switch cardBrand
|
||||
when 'mastercard' then return 'master'
|
||||
when 'amex' then return 'american_express'
|
||||
when 'diners' then return 'diners_club'
|
||||
else return cardBrand # a few brands are equal, for example, visa
|
||||
|
||||
# It doesn't matter if any of these are nil, all are optional.
|
||||
makeCardData: (secrets) ->
|
||||
{'name': secrets.name,
|
||||
|
||||
@@ -2,6 +2,7 @@ angular.module("admin.resources").factory 'LineItemResource', ($resource) ->
|
||||
$resource('/admin/bulk_line_items/:id.json', {}, {
|
||||
'index':
|
||||
method: 'GET'
|
||||
isArray: true
|
||||
'update':
|
||||
method: 'PUT'
|
||||
transformRequest: (data, headersGetter) =>
|
||||
|
||||
@@ -1,27 +1,20 @@
|
||||
angular.module("admin.resources").factory 'LineItems', ($q, LineItemResource) ->
|
||||
new class LineItems
|
||||
all: []
|
||||
byID: {}
|
||||
pristineByID: {}
|
||||
pagination: {}
|
||||
|
||||
index: (params={}, callback=null) ->
|
||||
request = LineItemResource.index params, (data) =>
|
||||
LineItemResource.index params, (data) =>
|
||||
@load(data)
|
||||
(callback || angular.noop)(data)
|
||||
@all.$promise = request.$promise
|
||||
@all
|
||||
|
||||
resetData: ->
|
||||
@all.length = 0
|
||||
@byID = {}
|
||||
@pristineByID = {}
|
||||
|
||||
load: (data) ->
|
||||
angular.extend(@pagination, data.pagination)
|
||||
load: (lineItems) ->
|
||||
@resetData()
|
||||
for lineItem in data.line_items
|
||||
@all.push lineItem
|
||||
for lineItem in lineItems
|
||||
@byID[lineItem.id] = lineItem
|
||||
@pristineByID[lineItem.id] = angular.copy(lineItem)
|
||||
|
||||
@@ -32,9 +25,8 @@ angular.module("admin.resources").factory 'LineItems', ($q, LineItemResource) ->
|
||||
|
||||
save: (lineItem) ->
|
||||
deferred = $q.defer()
|
||||
lineItemResource = new LineItemResource(lineItem)
|
||||
lineItem.errors = {}
|
||||
lineItemResource.$update({id: lineItem.id})
|
||||
lineItem.$update({id: lineItem.id})
|
||||
.then( (data) =>
|
||||
@pristineByID[lineItem.id] = angular.copy(lineItem)
|
||||
deferred.resolve(data)
|
||||
@@ -62,10 +54,8 @@ angular.module("admin.resources").factory 'LineItems', ($q, LineItemResource) ->
|
||||
|
||||
delete: (lineItem, callback=null) ->
|
||||
deferred = $q.defer()
|
||||
lineItemResource = new LineItemResource(lineItem)
|
||||
lineItemResource.$delete({id: lineItem.id})
|
||||
lineItem.$delete({id: lineItem.id})
|
||||
.then( (data) =>
|
||||
@all.splice(@all.indexOf(lineItem),1)
|
||||
delete @byID[lineItem.id]
|
||||
delete @pristineByID[lineItem.id]
|
||||
(callback || angular.noop)(data)
|
||||
|
||||
@@ -4,6 +4,7 @@ angular.module("admin.side_menu")
|
||||
items: []
|
||||
selected: null
|
||||
|
||||
|
||||
# Checks for path and uses it to set the view
|
||||
# If no path, loads first view
|
||||
init: =>
|
||||
@@ -30,3 +31,11 @@ angular.module("admin.side_menu")
|
||||
for item in @items when item.name is name
|
||||
return item
|
||||
null
|
||||
|
||||
hide_item_by_name: (name) =>
|
||||
item = @find_by_name(name)
|
||||
item.visible = false if item
|
||||
|
||||
show_item_by_name: (name) =>
|
||||
item = @find_by_name(name)
|
||||
item.visible = true if item
|
||||
|
||||
@@ -1,7 +1,27 @@
|
||||
$(document).ready ->
|
||||
opts =
|
||||
lines: 11
|
||||
length: 2
|
||||
width: 3
|
||||
radius: 9
|
||||
corners: 1
|
||||
rotate: 0
|
||||
color: '#fff'
|
||||
speed: 0.8
|
||||
trail: 48
|
||||
shadow: false
|
||||
hwaccel: true
|
||||
className: 'spinner'
|
||||
zIndex: 2e9
|
||||
top: 'auto'
|
||||
left: 'auto'
|
||||
|
||||
target = document.getElementById("spinner")
|
||||
|
||||
$(document).ajaxStart ->
|
||||
$("#progress").fadeIn()
|
||||
spinner = new Spinner(opts).spin(target)
|
||||
|
||||
$(document).ajaxStop ->
|
||||
$("#progress").fadeOut()
|
||||
$("#progress").fadeOut()
|
||||
|
||||
|
||||
@@ -43,11 +43,12 @@ angular.module("admin.variantOverrides").controller "AdminVariantOverridesCtrl",
|
||||
|
||||
$scope.fetchProducts = ->
|
||||
url = "/api/products/overridable?page=::page::;per_page=100"
|
||||
PagedFetcher.fetch url, $scope.addProducts
|
||||
PagedFetcher.fetch url, (data) => $scope.addProducts data.products
|
||||
|
||||
$scope.addProducts = (data) ->
|
||||
$scope.products = $scope.products.concat data.products
|
||||
VariantOverrides.ensureDataFor hubs, data.products
|
||||
|
||||
$scope.addProducts = (products) ->
|
||||
$scope.products = $scope.products.concat products
|
||||
VariantOverrides.ensureDataFor hubs, products
|
||||
|
||||
$scope.displayDirty = ->
|
||||
if DirtyVariantOverrides.count() > 0
|
||||
|
||||
@@ -1,18 +1,14 @@
|
||||
#= require jquery
|
||||
#= require jquery_ujs
|
||||
#= require jquery.ui.all
|
||||
#= require spin
|
||||
#
|
||||
#= require angular
|
||||
#= require angular-cookies
|
||||
#= require angular-sanitize
|
||||
#= require angular-animate
|
||||
#= require angular-resource
|
||||
#= require autocomplete.min.js
|
||||
#= require leaflet-1.6.0.js
|
||||
#= require leaflet-providers.js
|
||||
#= require lodash.underscore.js
|
||||
# bluebird.js is a dependency of angular-google-maps.js 2.0.0
|
||||
#= require bluebird.js
|
||||
#= require angular-scroll.min.js
|
||||
#= require angular-google-maps.min.js
|
||||
#= require ../shared/mm-foundation-tpls-0.9.0-20180826174721.min.js
|
||||
|
||||
@@ -1,4 +1,2 @@
|
||||
Darkswarm.controller "CartCtrl", ($scope, Cart, CurrentHub) ->
|
||||
Darkswarm.controller "CartCtrl", ($scope, Cart, $timeout) ->
|
||||
$scope.Cart = Cart
|
||||
$scope.CurrentHub = CurrentHub
|
||||
$scope.max_characters = 20
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
Darkswarm.controller "CartDropdownCtrl", ($scope, Cart, BodyScroll) ->
|
||||
$scope.Cart = Cart
|
||||
$scope.showCartSidebar = false
|
||||
|
||||
$scope.toggleCartSidebar = ->
|
||||
$scope.showCartSidebar = !$scope.showCartSidebar
|
||||
BodyScroll.toggle()
|
||||
@@ -1,2 +0,0 @@
|
||||
Darkswarm.controller "CartFormCtrl", ($scope) ->
|
||||
|
||||
@@ -9,13 +9,8 @@ Darkswarm.controller "EnterprisesCtrl", ($scope, $rootScope, $timeout, $location
|
||||
$scope.show_closed = false
|
||||
$scope.filtersActive = false
|
||||
$scope.distanceMatchesShown = false
|
||||
$scope.closed_shops_loading = false
|
||||
$scope.closed_shops_loaded = false
|
||||
|
||||
$scope.$watch "query", (query)->
|
||||
$scope.resetSearch(query)
|
||||
|
||||
$scope.resetSearch = (query) ->
|
||||
Enterprises.flagMatching query
|
||||
Search.search query
|
||||
$rootScope.$broadcast 'enterprisesChanged'
|
||||
@@ -24,7 +19,6 @@ Darkswarm.controller "EnterprisesCtrl", ($scope, $rootScope, $timeout, $location
|
||||
$timeout ->
|
||||
Enterprises.calculateDistance query, $scope.firstNameMatch()
|
||||
$rootScope.$broadcast 'enterprisesChanged'
|
||||
$scope.closed_shops_loading = false
|
||||
|
||||
$timeout ->
|
||||
if $location.search()['show_closed']?
|
||||
@@ -79,12 +73,6 @@ Darkswarm.controller "EnterprisesCtrl", ($scope, $rootScope, $timeout, $location
|
||||
undefined
|
||||
|
||||
$scope.showClosedShops = ->
|
||||
unless $scope.closed_shops_loaded
|
||||
$scope.closed_shops_loading = true
|
||||
$scope.closed_shops_loaded = true
|
||||
Enterprises.loadClosedEnterprises().then ->
|
||||
$scope.resetSearch($scope.query)
|
||||
|
||||
$scope.show_closed = true
|
||||
$location.search('show_closed', '1')
|
||||
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
Darkswarm.controller "GroupPageCtrl", ($scope, enterprises, Enterprises) ->
|
||||
Darkswarm.controller "GroupPageCtrl", ($scope, enterprises, Enterprises, MapConfiguration, OfnMap) ->
|
||||
$scope.Enterprises = Enterprises
|
||||
|
||||
$scope.map = angular.copy MapConfiguration.options
|
||||
$scope.mapMarkers = OfnMap.enterprise_markers enterprises
|
||||
$scope.embedded_layout = window.location.search.indexOf("embedded_shopfront=true") != -1
|
||||
|
||||
@@ -24,7 +24,7 @@ Darkswarm.controller "HubNodeCtrl", ($scope, HashNavigation, CurrentHub, $http,
|
||||
$scope.shopfront_loading = true
|
||||
$scope.toggle_tab(event)
|
||||
|
||||
$http.get("/api/shops/" + $scope.hub.id)
|
||||
$http.get("/api/enterprises/" + $scope.hub.id + "/shopfront")
|
||||
.success (data) ->
|
||||
$scope.shopfront_loading = false
|
||||
$scope.hub = data
|
||||
|
||||
@@ -24,7 +24,7 @@ Darkswarm.controller "ProducerNodeCtrl", ($scope, HashNavigation, $anchorScroll,
|
||||
$scope.shopfront_loading = true
|
||||
$scope.toggle_tab(event)
|
||||
|
||||
$http.get("/api/shops/" + $scope.producer.id)
|
||||
$http.get("/api/enterprises/" + $scope.producer.id + "/shopfront")
|
||||
.success (data) ->
|
||||
$scope.shopfront_loading = false
|
||||
$scope.producer = data
|
||||
|
||||
@@ -2,5 +2,6 @@ Darkswarm.controller "ProductNodeCtrl", ($scope, $modal, FilterSelectorsService)
|
||||
$scope.enterprise = $scope.product.supplier # For the modal, so it's consistent
|
||||
|
||||
$scope.triggerProductModal = ->
|
||||
$scope.productTaxonSelectors = FilterSelectorsService.createSelectors()
|
||||
$scope.productPropertySelectors = FilterSelectorsService.createSelectors()
|
||||
$modal.open(templateUrl: "product_modal.html", scope: $scope)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.controller "ProductsCtrl", ($scope, $sce, $filter, $rootScope, Products, OrderCycle, OrderCycleResource, FilterSelectorsService, Cart, Dereferencer, Taxons, Properties, currentHub, $timeout) ->
|
||||
Darkswarm.controller "ProductsCtrl", ($scope, $filter, $rootScope, Products, OrderCycle, OrderCycleResource, FilterSelectorsService, Cart, Dereferencer, Taxons, Properties, currentHub, $timeout) ->
|
||||
$scope.Products = Products
|
||||
$scope.Cart = Cart
|
||||
$scope.query = ""
|
||||
@@ -10,7 +10,6 @@ Darkswarm.controller "ProductsCtrl", ($scope, $sce, $filter, $rootScope, Product
|
||||
$scope.order_cycle = OrderCycle.order_cycle
|
||||
$scope.supplied_taxons = null
|
||||
$scope.supplied_properties = null
|
||||
$scope.showFilterSidebar = false
|
||||
|
||||
$rootScope.$on "orderCycleSelected", ->
|
||||
$scope.update_filters()
|
||||
@@ -76,24 +75,15 @@ Darkswarm.controller "ProductsCtrl", ($scope, $sce, $filter, $rootScope, Product
|
||||
$scope.appliedTaxonsList = ->
|
||||
$scope.activeTaxons.map( (taxon_id) ->
|
||||
Taxons.taxons_by_id[taxon_id].name
|
||||
).join($scope.filtersJoinWord()) if $scope.activeTaxons?
|
||||
).join(" #{t('products_or')} ") if $scope.activeTaxons?
|
||||
|
||||
$scope.appliedPropertiesList = ->
|
||||
$scope.activeProperties.map( (property_id) ->
|
||||
Properties.properties_by_id[property_id].name
|
||||
).join($scope.filtersJoinWord()) if $scope.activeProperties?
|
||||
|
||||
$scope.filtersJoinWord = ->
|
||||
$sce.trustAsHtml(" <span class='join-word'>#{t('products_or')}</span> ")
|
||||
).join(" #{t('products_or')} ") if $scope.activeProperties?
|
||||
|
||||
$scope.clearAll = ->
|
||||
$scope.clearQuery()
|
||||
$scope.clearFilters()
|
||||
|
||||
$scope.clearQuery = ->
|
||||
$scope.query = ""
|
||||
|
||||
$scope.clearFilters = ->
|
||||
$scope.taxonSelectors.clearAll()
|
||||
$scope.propertySelectors.clearAll()
|
||||
|
||||
@@ -104,9 +94,3 @@ Darkswarm.controller "ProductsCtrl", ($scope, $sce, $filter, $rootScope, Product
|
||||
$scope.Products.products = []
|
||||
$scope.update_filters()
|
||||
$scope.loadProducts()
|
||||
|
||||
$scope.filtersCount = () ->
|
||||
$scope.taxonSelectors.totalActive() + $scope.propertySelectors.totalActive()
|
||||
|
||||
$scope.toggleFilterSidebar = ->
|
||||
$scope.showFilterSidebar = !$scope.showFilterSidebar
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
Darkswarm.controller "ProducersTabCtrl", ($scope, Shopfront) ->
|
||||
Darkswarm.controller "ProducersTabCtrl", ($scope, Shopfront, EnterpriseModal) ->
|
||||
$scope.shopfront = Shopfront.shopfront
|
||||
|
||||
@@ -7,7 +7,7 @@ window.Darkswarm = angular.module("Darkswarm", [
|
||||
'templates',
|
||||
'ngSanitize',
|
||||
'ngAnimate',
|
||||
'uiGmapgoogle-maps',
|
||||
'google-maps',
|
||||
'duScroll',
|
||||
'angularFileUpload',
|
||||
'angularSlideables'
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
Darkswarm.directive "bodyScroll", ($rootScope, BodyScroll) ->
|
||||
restrict: 'A'
|
||||
scope: true
|
||||
link: (scope, elem, attrs) ->
|
||||
$rootScope.$on "toggleBodyScroll", ->
|
||||
if BodyScroll.disabled
|
||||
elem.addClass "disable-scroll"
|
||||
else
|
||||
elem.removeClass "disable-scroll"
|
||||
@@ -0,0 +1,19 @@
|
||||
Darkswarm.directive "cartToggle", ($document) ->
|
||||
# Toggles visibility of the "cart" popover
|
||||
restrict: 'A'
|
||||
link: (scope, elem, attr)->
|
||||
scope.open = false
|
||||
|
||||
$document.bind 'click', (event) ->
|
||||
cart_button = elem[0]
|
||||
element_and_parents = [event.target, event.target.parentElement, event.target.parentElement.parentElement]
|
||||
cart_button_clicked = (element_and_parents.indexOf(cart_button) != -1)
|
||||
|
||||
if cart_button_clicked
|
||||
scope.$apply ->
|
||||
scope.open = !scope.open
|
||||
else
|
||||
scope.$apply ->
|
||||
scope.open = false
|
||||
|
||||
return
|
||||
@@ -1,11 +0,0 @@
|
||||
Darkswarm.directive "darkerBackground", ->
|
||||
restrict: "A"
|
||||
link: (scope, elm, attr)->
|
||||
toggleClass = (value) ->
|
||||
elm.closest('.page-view').toggleClass("with-darker-background", value)
|
||||
|
||||
toggleClass(true)
|
||||
|
||||
# if an OrderCycle is selected, disable darker background
|
||||
scope.$watch 'order_cycle.order_cycle_id', (newvalue, oldvalue) ->
|
||||
toggleClass(false) if newvalue
|
||||
@@ -1,12 +0,0 @@
|
||||
# Allows disabling of link buttons via disabled attribute.
|
||||
# This is normally ignored, ie the link appears disabled but is still clickable.
|
||||
|
||||
Darkswarm.directive "disableDynamically", ->
|
||||
restrict: 'A'
|
||||
|
||||
link: (scope, element, attrs) ->
|
||||
element.on 'click', (e) ->
|
||||
if attrs.disabled
|
||||
e.preventDefault()
|
||||
return
|
||||
|
||||
@@ -7,4 +7,4 @@ Darkswarm.directive "enterpriseModal", (EnterpriseModal) ->
|
||||
elem.on "click", (event) =>
|
||||
event.stopPropagation()
|
||||
|
||||
scope.modalInstance = EnterpriseModal.open scope.enterprise
|
||||
scope.modalInstance = EnterpriseModal.open scope.enterprise
|
||||
@@ -1,6 +0,0 @@
|
||||
Darkswarm.directive "focusSearch", ->
|
||||
restrict: 'A'
|
||||
link: (scope, element, attr)->
|
||||
element.bind 'click', (event) ->
|
||||
# Focus seach field, ready for typing
|
||||
$(element).siblings('#search').focus()
|
||||
@@ -1,6 +1,6 @@
|
||||
Darkswarm.directive 'mapOsmTiles', ($timeout) ->
|
||||
restrict: 'E'
|
||||
require: '^uiGmapGoogleMap'
|
||||
require: '^googleMap'
|
||||
scope: {}
|
||||
link: (scope, elem, attrs, ctrl) ->
|
||||
$timeout =>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Darkswarm.directive 'mapSearch', ($timeout, Search) ->
|
||||
# Install a basic search field in a map
|
||||
restrict: 'E'
|
||||
require: ['^uiGmapGoogleMap', 'ngModel']
|
||||
require: ['^googleMap', 'ngModel']
|
||||
replace: true
|
||||
template: '<input id="pac-input" ng-model="query" placeholder="' + t('location_placeholder') + '"></input>'
|
||||
scope: {}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
Darkswarm.directive "ofnOnHand", (StockQuantity) ->
|
||||
Darkswarm.directive "ofnOnHand", ->
|
||||
restrict: 'A'
|
||||
require: "ngModel"
|
||||
scope: true
|
||||
|
||||
link: (scope, elem, attr, ngModel) ->
|
||||
# In cases where this field gets its value from the HTML element rather than the model,
|
||||
@@ -24,4 +23,6 @@ Darkswarm.directive "ofnOnHand", (StockQuantity) ->
|
||||
viewValue
|
||||
|
||||
scope.available_quantity = ->
|
||||
StockQuantity.available_quantity(attr.ofnOnHand, attr.finalizedquantity)
|
||||
on_hand = parseInt(attr.ofnOnHand)
|
||||
finalized_quantity = parseInt(attr.finalizedquantity) || 0 # finalizedquantity is optional
|
||||
on_hand + finalized_quantity
|
||||
|
||||
@@ -1,100 +0,0 @@
|
||||
Darkswarm.directive 'ofnOpenStreetMap', ($window, Enterprises, EnterpriseModal, availableCountries, openStreetMapConfig) ->
|
||||
restrict: 'E'
|
||||
replace: true
|
||||
scope: true
|
||||
template: "<div></div>"
|
||||
|
||||
link: (scope, element, attrs, ctrl, transclude)->
|
||||
map = null
|
||||
markers = []
|
||||
enterpriseNames = []
|
||||
openStreetMapProviderName = openStreetMapConfig.open_street_map_provider_name
|
||||
openStreetMapProviderOptions = JSON.parse(openStreetMapConfig.open_street_map_provider_options)
|
||||
|
||||
average = (values) ->
|
||||
total = values.reduce (sum, value) ->
|
||||
sum = sum + value
|
||||
, 0
|
||||
total / values.length
|
||||
|
||||
averageAngle = (angleName) ->
|
||||
positiveAngles = []
|
||||
negativeAngles = []
|
||||
for enterprise in Enterprises.enterprises
|
||||
if enterprise.latitude? && enterprise.longitude?
|
||||
if enterprise[angleName] > 0
|
||||
positiveAngles.push(enterprise[angleName])
|
||||
else
|
||||
negativeAngles.push(enterprise[angleName])
|
||||
|
||||
averageNegativeAngle = average(negativeAngles)
|
||||
averagePositiveAngle = average(positiveAngles)
|
||||
|
||||
if negativeAngles.length == 0
|
||||
averagePositiveAngle
|
||||
else if positiveAngles.length == 0
|
||||
averageNegativeAngle
|
||||
else if averagePositiveAngle > averageNegativeAngle
|
||||
averagePositiveAngle - averageNegativeAngle
|
||||
else
|
||||
averageNegativeAngle - averagePositiveAngle
|
||||
|
||||
buildMarker = (enterprise, latlng, title) ->
|
||||
icon = L.icon
|
||||
iconUrl: enterprise.icon
|
||||
marker = L.marker latlng,
|
||||
draggable: true,
|
||||
icon: icon,
|
||||
riseOnHover: true,
|
||||
title: title
|
||||
marker.on "click", ->
|
||||
EnterpriseModal.open enterprise
|
||||
marker
|
||||
|
||||
enterpriseName = (enterprise) ->
|
||||
return enterprise.name + " (" + enterprise.address.address1 + ", " + enterprise.address.city + ", " + enterprise.address.state_name + ")";
|
||||
|
||||
goToEnterprise = (selectedEnterpriseName) ->
|
||||
enterprise = Enterprises.enterprises.find (enterprise) ->
|
||||
enterpriseName(enterprise) == selectedEnterpriseName
|
||||
map.setView([enterprise.latitude, enterprise.longitude], 12)
|
||||
|
||||
displayMap = ->
|
||||
setMapDimensions()
|
||||
averageLatitude = averageAngle("latitude")
|
||||
averageLongitude = averageAngle("longitude")
|
||||
zoomLevel = 6
|
||||
map = L.map('open-street-map')
|
||||
L.tileLayer.provider(openStreetMapProviderName, openStreetMapProviderOptions).addTo(map)
|
||||
map.setView([averageLatitude, averageLongitude], zoomLevel)
|
||||
|
||||
displayEnterprises = ->
|
||||
for enterprise in Enterprises.enterprises
|
||||
if enterprise.latitude? && enterprise.longitude?
|
||||
marker = buildMarker(enterprise, { lat: enterprise.latitude, lng: enterprise.longitude }, enterprise.name).addTo(map)
|
||||
enterpriseNames.push(enterpriseName(enterprise))
|
||||
markers.push(marker)
|
||||
|
||||
displaySearchField = () ->
|
||||
new Autocomplete('#open-street-map--search',
|
||||
onSubmit: goToEnterprise
|
||||
search: searchEnterprises
|
||||
)
|
||||
overwriteInlinePositionRelativeToPositionSearchField = ->
|
||||
$('#open-street-map--search').css("position", "absolute")
|
||||
overwriteInlinePositionRelativeToPositionSearchField()
|
||||
|
||||
searchEnterprises = (input) ->
|
||||
if input.length < 1
|
||||
return []
|
||||
enterpriseNames.filter (country) ->
|
||||
country.toLowerCase().includes input.toLowerCase()
|
||||
|
||||
setMapDimensions = ->
|
||||
height = $window.innerHeight - element.offset().top
|
||||
element.css "width", "100%"
|
||||
element.css "height", (height + "px")
|
||||
|
||||
displayMap()
|
||||
displayEnterprises()
|
||||
displaySearchField()
|
||||
@@ -14,8 +14,8 @@ Darkswarm.directive "ofnPageAlert", ($timeout) ->
|
||||
# Wait a moment after page load before showing the alert. Otherwise we often miss the
|
||||
# start of the animation.
|
||||
$timeout ->
|
||||
container_elems.addClass("move-up")
|
||||
container_elems.addClass("move-down")
|
||||
, 1000
|
||||
|
||||
scope.close = ->
|
||||
container_elems.removeClass("move-up")
|
||||
container_elems.removeClass("move-down")
|
||||
|
||||
@@ -5,9 +5,5 @@ Darkswarm.directive "shopVariant", ->
|
||||
scope:
|
||||
variant: '='
|
||||
controller: ($scope, Cart) ->
|
||||
$scope.$watchGroup [
|
||||
'variant.line_item.quantity',
|
||||
'variant.line_item.max_quantity'
|
||||
], (new_value, old_value) ->
|
||||
return if old_value[0] == null && new_value[0] == null
|
||||
$scope.$watchGroup ['variant.line_item.quantity', 'variant.line_item.max_quantity'], ->
|
||||
Cart.adjust($scope.variant.line_item)
|
||||
|
||||
@@ -10,5 +10,6 @@ Darkswarm.directive "ofnSmoothScrollTo", ($location, $document)->
|
||||
# Scrolling is confused by our position:fixed top bar and page alert bar
|
||||
# - add an offset to scroll to the correct location, plus 5px buffer
|
||||
offset = $("nav.top-bar").height()
|
||||
offset += $(".page-alert.move-down").height()
|
||||
offset += 5
|
||||
$document.scrollTo target, offset, 1000
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
Darkswarm.directive "validateStockQuantity", (StockQuantity) ->
|
||||
restrict: 'A'
|
||||
require: "ngModel"
|
||||
scope: true
|
||||
|
||||
link: (scope, element, attr, ngModel) ->
|
||||
ngModel.$parsers.push (selectedQuantity) ->
|
||||
valid_number = parseInt(selectedQuantity) != NaN
|
||||
valid_quantity = parseInt(selectedQuantity) <= scope.available_quantity()
|
||||
|
||||
ngModel.$setValidity('stock', (valid_number && valid_quantity) );
|
||||
|
||||
selectedQuantity
|
||||
|
||||
scope.available_quantity = ->
|
||||
StockQuantity.available_quantity(attr.ofnOnHand, attr.finalizedquantity)
|
||||
@@ -1,7 +0,0 @@
|
||||
angular.module("Darkswarm").factory "BodyScroll", ($rootScope) ->
|
||||
new class BodyScroll
|
||||
disabled: false
|
||||
|
||||
toggle: ->
|
||||
@disabled = !@disabled
|
||||
$rootScope.$broadcast "toggleBodyScroll"
|
||||
@@ -1,4 +1,4 @@
|
||||
Darkswarm.factory 'Cart', (CurrentOrder, Variants, $timeout, $http, $modal, $rootScope, $resource, localStorageService, RailsFlashLoader) ->
|
||||
Darkswarm.factory 'Cart', (CurrentOrder, Variants, $timeout, $http, $modal, $rootScope, $resource, localStorageService) ->
|
||||
# Handles syncing of current cart/order state to server
|
||||
new class Cart
|
||||
dirty: false
|
||||
@@ -50,7 +50,7 @@ Darkswarm.factory 'Cart', (CurrentOrder, Variants, $timeout, $http, $modal, $roo
|
||||
@popQueue() if @update_enqueued
|
||||
|
||||
.error (response, status)=>
|
||||
RailsFlashLoader.loadFlash({error: t('js.cart.add_to_cart_failed')})
|
||||
@scheduleRetry(status)
|
||||
@update_running = false
|
||||
|
||||
compareAndNotifyStockLevels: (stockLevels) =>
|
||||
@@ -87,6 +87,13 @@ Darkswarm.factory 'Cart', (CurrentOrder, Variants, $timeout, $http, $modal, $roo
|
||||
max_quantity: li.max_quantity
|
||||
{variants: variants}
|
||||
|
||||
scheduleRetry: (status) =>
|
||||
console.log "Error updating cart: #{status}. Retrying in 3 seconds..."
|
||||
$timeout =>
|
||||
console.log "Retrying cart update"
|
||||
@orderChanged()
|
||||
, 3000
|
||||
|
||||
saved: =>
|
||||
@dirty = false
|
||||
$(window).unbind "beforeunload"
|
||||
|
||||
@@ -14,32 +14,15 @@ Darkswarm.factory 'Checkout', ($injector, CurrentOrder, ShippingMethods, StripeE
|
||||
|
||||
submit: =>
|
||||
Loading.message = t 'submitting_order'
|
||||
$http.put('/checkout.json', {order: @preprocess()})
|
||||
.then (response) =>
|
||||
Navigation.go response.data.path
|
||||
.catch (response) =>
|
||||
try
|
||||
@handle_checkout_error_response(response)
|
||||
catch error
|
||||
try
|
||||
@loadFlash(error: t("checkout.failed")) # inform the user about the unexpected error
|
||||
finally
|
||||
throw error # generate a BugsnagJS alert
|
||||
|
||||
handle_checkout_error_response: (response) =>
|
||||
throw response unless response.data?
|
||||
|
||||
if response.data.path?
|
||||
Navigation.go response.data.path
|
||||
else
|
||||
throw response unless response.data.flash?
|
||||
|
||||
@errors = response.data.errors
|
||||
@loadFlash(response.data.flash)
|
||||
|
||||
loadFlash: (flash) =>
|
||||
Loading.clear()
|
||||
RailsFlashLoader.loadFlash(flash)
|
||||
$http.put('/checkout.json', {order: @preprocess()}).success (data, status)=>
|
||||
Navigation.go data.path
|
||||
.error (response, status)=>
|
||||
if response.path
|
||||
Navigation.go response.path
|
||||
else
|
||||
Loading.clear()
|
||||
@errors = response.errors
|
||||
RailsFlashLoader.loadFlash(response.flash)
|
||||
|
||||
# Rails wants our Spree::Address data to be provided with _attributes
|
||||
preprocess: ->
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
Darkswarm.factory "EnterpriseListModal", ($modal, $rootScope, $http, EnterpriseModal)->
|
||||
new class EnterpriseListModal
|
||||
open: (enterprises)->
|
||||
scope = $rootScope.$new(true)
|
||||
scope.enterprises = enterprises
|
||||
scope.openModal = EnterpriseModal.open
|
||||
if Object.keys(enterprises).length > 1
|
||||
$modal.open(templateUrl: "enterprise_list_modal.html", scope: scope)
|
||||
else
|
||||
EnterpriseModal.open enterprises[Object.keys(enterprises)[0]]
|
||||
@@ -5,7 +5,7 @@ Darkswarm.factory "EnterpriseModal", ($modal, $rootScope, $http)->
|
||||
scope = $rootScope.$new(true) # Spawn an isolate to contain the enterprise
|
||||
scope.embedded_layout = window.location.search.indexOf("embedded_shopfront=true") != -1
|
||||
|
||||
$http.get("/api/shops/" + enterprise.id).success (data) ->
|
||||
$http.get("/api/enterprises/" + enterprise.id + "/shopfront").success (data) ->
|
||||
scope.enterprise = data
|
||||
$modal.open(templateUrl: "enterprise_modal.html", scope: scope)
|
||||
.error (data) ->
|
||||
|
||||
@@ -1,30 +1,27 @@
|
||||
Darkswarm.factory 'Enterprises', (enterprises, ShopsResource, CurrentHub, Taxons, Dereferencer, Matcher, GmapsGeo, $rootScope) ->
|
||||
Darkswarm.factory 'Enterprises', (enterprises, CurrentHub, Taxons, Dereferencer, Matcher, Geo, $rootScope) ->
|
||||
new class Enterprises
|
||||
enterprises: []
|
||||
enterprises_by_id: {}
|
||||
|
||||
constructor: ->
|
||||
# Populate Enterprises.enterprises from json in page.
|
||||
@initEnterprises(enterprises)
|
||||
@enterprises = enterprises
|
||||
|
||||
initEnterprises: (enterprises) ->
|
||||
# Map enterprises to id/object pairs for lookup.
|
||||
for enterprise in enterprises
|
||||
@enterprises.push enterprise
|
||||
@enterprises_by_id[enterprise.id] = enterprise
|
||||
|
||||
# Replace enterprise and taxons ids with actual objects.
|
||||
@dereferenceEnterprises(enterprises)
|
||||
@dereferenceEnterprises()
|
||||
|
||||
@producers = @enterprises.filter (enterprise)->
|
||||
enterprise.category in ["producer_hub", "producer_shop", "producer"]
|
||||
@hubs = @enterprises.filter (enterprise)->
|
||||
enterprise.category in ["hub", "hub_profile", "producer_hub", "producer_shop"]
|
||||
|
||||
dereferenceEnterprises: (enteprises) ->
|
||||
dereferenceEnterprises: ->
|
||||
if CurrentHub.hub?.id
|
||||
CurrentHub.hub = @enterprises_by_id[CurrentHub.hub.id]
|
||||
for enterprise in enterprises
|
||||
for enterprise in @enterprises
|
||||
@dereferenceEnterprise enterprise
|
||||
|
||||
dereferenceEnterprise: (enterprise) ->
|
||||
@@ -45,12 +42,6 @@ Darkswarm.factory 'Enterprises', (enterprises, ShopsResource, CurrentHub, Taxons
|
||||
for enterprise in new_enterprises
|
||||
@enterprises_by_id[enterprise.id] = enterprise
|
||||
|
||||
loadClosedEnterprises: ->
|
||||
request = ShopsResource.closed_shops {}, (data) =>
|
||||
@initEnterprises(data)
|
||||
|
||||
request.$promise
|
||||
|
||||
flagMatching: (query) ->
|
||||
for enterprise in @enterprises
|
||||
enterprise.matches_name_query = if query? && query.length > 0
|
||||
@@ -59,7 +50,7 @@ Darkswarm.factory 'Enterprises', (enterprises, ShopsResource, CurrentHub, Taxons
|
||||
false
|
||||
|
||||
calculateDistance: (query, firstMatching) ->
|
||||
if query?.length > 0 and GmapsGeo.OK
|
||||
if query?.length > 0
|
||||
if firstMatching?
|
||||
@setDistanceFrom firstMatching
|
||||
else
|
||||
@@ -68,9 +59,9 @@ Darkswarm.factory 'Enterprises', (enterprises, ShopsResource, CurrentHub, Taxons
|
||||
@resetDistance()
|
||||
|
||||
calculateDistanceGeo: (query) ->
|
||||
GmapsGeo.geocode query, (results, status) =>
|
||||
Geo.geocode query, (results, status) =>
|
||||
$rootScope.$apply =>
|
||||
if status == GmapsGeo.OK
|
||||
if status == Geo.OK
|
||||
#console.log "Geocoded #{query} -> #{results[0].geometry.location}."
|
||||
@setDistanceFrom results[0].geometry.location
|
||||
else
|
||||
@@ -79,7 +70,7 @@ Darkswarm.factory 'Enterprises', (enterprises, ShopsResource, CurrentHub, Taxons
|
||||
|
||||
setDistanceFrom: (locatable) ->
|
||||
for enterprise in @enterprises
|
||||
enterprise.distance = GmapsGeo.distanceBetween enterprise, locatable
|
||||
enterprise.distance = Geo.distanceBetween enterprise, locatable
|
||||
$rootScope.$broadcast 'enterprisesChanged'
|
||||
|
||||
resetDistance: ->
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Darkswarm.service "GmapsGeo", ->
|
||||
new class GmapsGeo
|
||||
OK: google?.maps?.GeocoderStatus?.OK
|
||||
Darkswarm.service "Geo", ->
|
||||
new class Geo
|
||||
OK: google.maps.GeocoderStatus.OK
|
||||
|
||||
# Usage:
|
||||
# Geo.geocode address, (results, status) ->
|
||||
@@ -10,7 +10,7 @@ Darkswarm.service "GmapsGeo", ->
|
||||
# console.log "Error: #{status}"
|
||||
geocode: (address, callback) ->
|
||||
geocoder = new google.maps.Geocoder()
|
||||
geocoder.geocode {'address': address, 'region': "<%= Spree::Country.find_by(id: Spree::Config[:default_country_id]).iso %>"}, callback
|
||||
geocoder.geocode {'address': address, 'region': "<%= Spree::Country.find_by_id(Spree::Config[:default_country_id]).iso %>"}, callback
|
||||
|
||||
distanceBetween: (src, dst) ->
|
||||
google.maps.geometry.spherical.computeDistanceBetween @toLatLng(src), @toLatLng(dst)
|
||||
@@ -1,39 +1,21 @@
|
||||
Darkswarm.factory "OfnMap", (Enterprises, EnterpriseListModal, MapConfiguration) ->
|
||||
Darkswarm.factory "OfnMap", (Enterprises, EnterpriseModal) ->
|
||||
new class OfnMap
|
||||
constructor: ->
|
||||
@coordinates = {}
|
||||
@enterprises = Enterprises.enterprises.filter (enterprise) ->
|
||||
# Remove enterprises w/o lat or long
|
||||
enterprise.latitude != null || enterprise.longitude != null
|
||||
@enterprises = @enterprise_markers(@enterprises)
|
||||
@enterprises = @enterprise_markers(Enterprises.enterprises)
|
||||
@enterprises = @enterprises.filter (enterprise) ->
|
||||
enterprise.latitude != null || enterprise.longitude != null # Remove enterprises w/o lat or long
|
||||
|
||||
enterprise_markers: (enterprises) ->
|
||||
@extend(enterprise) for enterprise in enterprises
|
||||
|
||||
enterprise_hash: (hash, enterprise) ->
|
||||
hash[enterprise.id] = { id: enterprise.id, name: enterprise.name, icon: enterprise.icon_font }
|
||||
hash
|
||||
|
||||
extend_marker: (marker, enterprise) ->
|
||||
marker.latitude = enterprise.latitude
|
||||
marker.longitude = enterprise.longitude
|
||||
marker.icon = enterprise.icon
|
||||
marker.id = [enterprise.id]
|
||||
marker.enterprises = @enterprise_hash({}, enterprise)
|
||||
|
||||
# Adding methods to each enterprise
|
||||
extend: (enterprise) ->
|
||||
marker = @coordinates[[enterprise.latitude, enterprise.longitude]]
|
||||
if marker
|
||||
marker.icon = MapConfiguration.options.cluster_icon
|
||||
@enterprise_hash(marker.enterprises, enterprise)
|
||||
marker.id.push(enterprise.id)
|
||||
else
|
||||
marker = new class MapMarker
|
||||
# We cherry-pick attributes because GMaps tries to crawl
|
||||
# our data, and our data is cyclic, so it breaks
|
||||
reveal: =>
|
||||
EnterpriseListModal.open this.enterprises
|
||||
@extend_marker(marker, enterprise)
|
||||
@coordinates[[enterprise.latitude, enterprise.longitude]] = marker
|
||||
marker
|
||||
new class MapMarker
|
||||
# We cherry-pick attributes because GMaps tries to crawl
|
||||
# our data, and our data is cyclic, so it breaks
|
||||
latitude: enterprise.latitude
|
||||
longitude: enterprise.longitude
|
||||
icon: enterprise.icon
|
||||
id: enterprise.id
|
||||
reveal: =>
|
||||
EnterpriseModal.open enterprise
|
||||
|
||||
@@ -4,7 +4,6 @@ Darkswarm.factory "MapConfiguration", ->
|
||||
center:
|
||||
latitude: -37.4713077
|
||||
longitude: 144.7851531
|
||||
cluster_icon: "<%= image_path('map_009-cluster.svg') %>"
|
||||
zoom: 12
|
||||
additional_options:
|
||||
# mapTypeId: 'satellite'
|
||||
@@ -1,6 +1,6 @@
|
||||
Darkswarm.factory 'OrderCycle', ($resource, orderCycleData) ->
|
||||
class OrderCycle
|
||||
@order_cycle = orderCycleData # Object or {}
|
||||
@order_cycle = orderCycleData # Object or {} due to RABL
|
||||
@push_order_cycle: (callback) ->
|
||||
new $resource("/shop/order_cycle").save {order_cycle_id: @order_cycle.order_cycle_id}, (order_data)->
|
||||
OrderCycle.order_cycle.orders_close_at = order_data.orders_close_at
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
Darkswarm.factory 'ShopsResource', ($resource) ->
|
||||
$resource('/api/shops/:id.json', {}, {
|
||||
'closed_shops':
|
||||
method: 'GET'
|
||||
isArray: true
|
||||
url: '/api/shops/closed_shops.json'
|
||||
})
|
||||
@@ -1,7 +0,0 @@
|
||||
Darkswarm.factory "StockQuantity", ->
|
||||
new class StockQuantity
|
||||
available_quantity: (on_hand, finalized_quantity) ->
|
||||
on_hand = parseInt(on_hand)
|
||||
finalized_quantity = parseInt(finalized_quantity) || 0 # finalized_quantity is optional
|
||||
|
||||
on_hand + finalized_quantity
|
||||
@@ -15,11 +15,9 @@ Darkswarm.factory 'StripeElements', ($rootScope, Loading, RailsFlashLoader) ->
|
||||
if(response.error)
|
||||
Loading.clear()
|
||||
RailsFlashLoader.loadFlash({error: t("error") + ": #{response.error.message}"})
|
||||
@triggerAngularDigest()
|
||||
console.error(JSON.stringify(response.error))
|
||||
else
|
||||
secrets.token = response.token.id
|
||||
secrets.cc_type = @mapTokenApiCardBrand(response.token.card.brand)
|
||||
secrets.cc_type = @mapCC(response.token.card.brand)
|
||||
secrets.card = response.token.card
|
||||
submit()
|
||||
|
||||
@@ -34,21 +32,15 @@ Darkswarm.factory 'StripeElements', ($rootScope, Loading, RailsFlashLoader) ->
|
||||
if(response.error)
|
||||
Loading.clear()
|
||||
RailsFlashLoader.loadFlash({error: t("error") + ": #{response.error.message}"})
|
||||
@triggerAngularDigest()
|
||||
console.error(JSON.stringify(response.error))
|
||||
else
|
||||
secrets.token = response.paymentMethod.id
|
||||
secrets.cc_type = @mapPaymentMethodsApiCardBrand(response.paymentMethod.card.brand)
|
||||
secrets.cc_type = response.paymentMethod.card.brand
|
||||
secrets.card = response.paymentMethod.card
|
||||
submit()
|
||||
|
||||
triggerAngularDigest: ->
|
||||
# $evalAsync is improved way of triggering a digest without calling $apply
|
||||
$rootScope.$evalAsync()
|
||||
|
||||
# Maps the brand returned by Stripe's tokenAPI to that required by activemerchant
|
||||
mapTokenApiCardBrand: (cardBrand) ->
|
||||
switch cardBrand
|
||||
# Maps the brand returned by Stripe to that required by activemerchant
|
||||
mapCC: (ccType) ->
|
||||
switch ccType
|
||||
when 'MasterCard' then return 'master'
|
||||
when 'Visa' then return 'visa'
|
||||
when 'American Express' then return 'american_express'
|
||||
@@ -56,14 +48,6 @@ Darkswarm.factory 'StripeElements', ($rootScope, Loading, RailsFlashLoader) ->
|
||||
when 'JCB' then return 'jcb'
|
||||
when 'Diners Club' then return 'diners_club'
|
||||
|
||||
# Maps the brand returned by Stripe's paymentMethodsAPI to that required by activemerchant
|
||||
mapPaymentMethodsApiCardBrand: (cardBrand) ->
|
||||
switch cardBrand
|
||||
when 'mastercard' then return 'master'
|
||||
when 'amex' then return 'american_express'
|
||||
when 'diners' then return 'diners_club'
|
||||
else return cardBrand # a few brands are equal, for example, visa
|
||||
|
||||
# It doesn't matter if any of these are nil, all are optional.
|
||||
makeCardData: (secrets) ->
|
||||
{'name': secrets.name,
|
||||
|
||||
@@ -20,6 +20,7 @@ Darkswarm.factory 'Variants', ->
|
||||
name = variant.product_name
|
||||
else
|
||||
name = "#{variant.product_name} - #{variant.name_to_display}"
|
||||
name += " (#{variant.options_text})" if variant.options_text
|
||||
name
|
||||
|
||||
lineItemFor: (variant) ->
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
%div.menu{ 'ng-show' => "expanded" }
|
||||
%div.menu_item{ ng: { repeat: "column in columns", click: "toggle(column)", class: "{selected: column.visible}" } }
|
||||
%span.check
|
||||
%span.name {{ column.name }}
|
||||
%span.name {{column.name }}
|
||||
%hr
|
||||
%div.menu_item.text-center
|
||||
%input.fullwidth.orange{ type: "button", ng: { value: "saved() ? 'Saved': 'Saving'", show: "saved() || saving", disabled: "saved()" } }
|
||||
%input.fullwidth.red{ type: "button", :value => t('admin.column_save_as_default').html_safe, ng: { show: "!saved() && !saving", click: "saveColumnPreferences(action)"} }
|
||||
%input.fullwidth.red{ type: "button", value: 'Save As Default', ng: { show: "!saved() && !saving", click: "saveColumnPreferences(action)"} }
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
%ng-include{src: "'partials/enterprise_listing.html'"}
|
||||
%ng-include{src: "'partials/close.html'"}
|
||||
@@ -1,3 +1,4 @@
|
||||
%ul
|
||||
%active-selector{ ng: { repeat: "selector in allSelectors", show: "ifDefined(selector.fits, true)" } }
|
||||
%render-svg{path: "{{selector.object.icon}}", ng: { if: "selector.object.icon"} }
|
||||
%span{"ng-bind" => "::selector.object.name"}
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
type: "email",
|
||||
id: "email",
|
||||
tabindex: 1,
|
||||
inputmode: "email",
|
||||
"ng-model" => "spree_user.email"}
|
||||
.row
|
||||
.large-12.columns
|
||||
@@ -28,4 +27,3 @@
|
||||
tabindex: "3",
|
||||
type: "submit",
|
||||
value: "{{'reset_password' | t}}"}
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
type: "email",
|
||||
id: "email",
|
||||
tabindex: 1,
|
||||
inputmode: "email",
|
||||
"ng-model" => "spree_user.email"}
|
||||
.row
|
||||
.large-12.columns
|
||||
@@ -25,7 +24,6 @@
|
||||
id: "password",
|
||||
autocomplete: "off",
|
||||
tabindex: 2,
|
||||
inputmode: "password",
|
||||
"ng-model" => "spree_user.password"}
|
||||
.row
|
||||
.large-12.columns
|
||||
@@ -41,4 +39,3 @@
|
||||
tabindex: "3",
|
||||
type: "submit",
|
||||
value: "{{'label_login' | t}}"}
|
||||
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
.modal-list
|
||||
.row{"ng-repeat" => "(id, enterprise) in ::enterprises"}
|
||||
.highlight
|
||||
.highlight-top.row.enterprise
|
||||
.small-12.medium-12.large-12.columns
|
||||
%h4
|
||||
%a.heading{"ng-click" => "::openModal(enterprise)"}
|
||||
%i{"ng-class" => "enterprise.icon"}
|
||||
%span{"ng-bind" => "enterprise.name"}
|
||||
%img.hero-img{"ng-src" => "{{::enterprise.promo_image}}"}
|
||||
@@ -6,8 +6,6 @@
|
||||
min: 0,
|
||||
placeholder: "0",
|
||||
"ofn-disable-scroll" => true,
|
||||
"ng-debounce" => "500",
|
||||
onwheel: "this.blur()",
|
||||
"ng-model" => "variant.line_item.quantity",
|
||||
"ofn-on-hand" => "{{variant.on_demand && 9999 || variant.on_hand }}",
|
||||
"ng-disabled" => "!variant.on_demand && variant.on_hand == 0",
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
"ng-model" => "variant.line_item.quantity",
|
||||
placeholder: "{{::'shop_variant_quantity_min' | t}}",
|
||||
"ofn-disable-scroll" => true,
|
||||
"ng-debounce" => "500",
|
||||
onwheel: "this.blur()",
|
||||
"ofn-on-hand" => "{{variant.on_demand && 9999 || variant.on_hand }}",
|
||||
name: "variants[{{::variant.id}}]", id: "variants_{{::variant.id}}"}
|
||||
%span.bulk-input
|
||||
@@ -21,8 +19,6 @@
|
||||
"ng-model" => "variant.line_item.max_quantity",
|
||||
placeholder: "{{::'shop_variant_quantity_max' | t}}",
|
||||
"ofn-disable-scroll" => true,
|
||||
"ng-debounce" => "500",
|
||||
onwheel: "this.blur()",
|
||||
min: "{{variant.line_item.quantity}}",
|
||||
name: "variant_attributes[{{::variant.id}}][max_quantity]",
|
||||
id: "variants_{{::variant.id}}_max"}
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
%button.graph-button{"ng-class" => "{open: tt_isOpen}", type: 'button'}
|
||||
%button.graph-button{"ng-class" => "{open: tt_isOpen}"}
|
||||
/ %i.ofn-i_058-graph
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
.row
|
||||
.columns.small-12.medium-6.large-6.product-header
|
||||
|
||||
.columns.small-12.large-6.product-header
|
||||
%h3{"ng-bind" => "::product.name"}
|
||||
%span
|
||||
%em {{'products_from' | t}}
|
||||
@@ -7,14 +8,19 @@
|
||||
|
||||
%br
|
||||
|
||||
.filter-shopfront.taxon-selectors.inline-block
|
||||
%filter-selector{ 'selector-set' => "productTaxonSelectors", objects: "[product] | taxonsOf" }
|
||||
|
||||
.filter-shopfront.property-selectors.inline-block
|
||||
%filter-selector{ 'selector-set' => "productPropertySelectors", objects: "[product] | propertiesWithValuesOf" }
|
||||
|
||||
.product-description{"ng-if" => "product.description_html"}
|
||||
%div{"ng-if" => "product.description_html"}
|
||||
%hr
|
||||
%p.text-small{"ng-bind-html" => "::product.description_html"}
|
||||
%hr
|
||||
|
||||
.columns.small-12.medium-6.large-6.product-img
|
||||
%img{"ng-src" => "{{::product.largeImage}}", "ng-if" => "::product.largeImage"}
|
||||
%img.placeholder{ src: "/assets/noimage/large.png", "ng-if" => "::!product.largeImage"}
|
||||
.columns.small-12.large-6
|
||||
%img.product-img{"ng-src" => "{{::product.largeImage}}", "ng-if" => "::product.largeImage"}
|
||||
%img.product-img.placeholder{ src: "/assets/noimage/large.png", "ng-if" => "::!product.largeImage"}
|
||||
|
||||
%ng-include{src: "'partials/close.html'"}
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
type: "email",
|
||||
id: "email",
|
||||
tabindex: 1,
|
||||
inputmode: "email",
|
||||
"ng-model" => "spree_user.email"}
|
||||
%span.error{"ng-show" => "errors.email != null"}
|
||||
{{ errors.email.join(' ') }}
|
||||
@@ -26,7 +25,6 @@
|
||||
id: "password",
|
||||
autocomplete: "off",
|
||||
tabindex: 2,
|
||||
inputmode: "password",
|
||||
"ng-model" => "spree_user.password"}
|
||||
%span.error{"ng-show" => "errors.password != null"}
|
||||
{{ errors.password.join(' ') }}
|
||||
@@ -38,14 +36,10 @@
|
||||
id: "password_confirmation",
|
||||
autocomplete: "off",
|
||||
tabindex: 2,
|
||||
inputmode: "password",
|
||||
"ng-model" => "spree_user.password_confirmation"}
|
||||
%span.error{"ng-show" => "errors.password_confirmation != null"}
|
||||
{{ errors.password_confirmation.join(' ') }}
|
||||
.row
|
||||
.large-12.columns
|
||||
%input.button.primary{name: "commit",
|
||||
tabindex: "3",
|
||||
type: "submit",
|
||||
value: "{{'action_signup' | t}}"}
|
||||
|
||||
|
||||
@@ -1,31 +1,38 @@
|
||||
@import 'admin/globals/variables';
|
||||
@import 'admin/globals/mixins';
|
||||
|
||||
#progress {
|
||||
@include border-radius(10px);
|
||||
#progress {
|
||||
display: none;
|
||||
position: fixed;
|
||||
top: -10px;
|
||||
left: 50%;
|
||||
top: 0;
|
||||
z-index: 1000;
|
||||
opacity: 0.8;
|
||||
width: 200px;
|
||||
background-color: $spree-blue;
|
||||
color: $color-1;
|
||||
display: none;
|
||||
font-size: 120%;
|
||||
font-weight: bold;
|
||||
line-height: 40px;
|
||||
margin-left: -100px;
|
||||
padding-top: 15px;
|
||||
text-align: center;
|
||||
text-transform: uppercase;
|
||||
width: 100%;
|
||||
|
||||
.spinner {
|
||||
.wrapper {
|
||||
@include border-radius(10px);
|
||||
top: -10px;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
top: -5px;
|
||||
margin-left: -15px;
|
||||
width: 200px;
|
||||
margin-left: -100px;
|
||||
padding: 11px 0;
|
||||
background-color: $color-3;
|
||||
color: $color-1;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
#spinner {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
left: 50%;
|
||||
margin-left: -5px;
|
||||
}
|
||||
|
||||
.progress-message {
|
||||
font-size: 120%;
|
||||
font-weight: $font-weight-bold;
|
||||
margin-top: 20px;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,5 @@
|
||||
@import '../plugins/font-awesome';
|
||||
|
||||
.todolist{
|
||||
.todo {
|
||||
&.done {
|
||||
@@ -16,6 +18,10 @@
|
||||
.steps {
|
||||
display: none;
|
||||
}
|
||||
|
||||
i {
|
||||
@extend .icon-check
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
@import 'plugins/font-awesome';
|
||||
|
||||
.icon-refund:before { @extend .icon-ok:before }
|
||||
.icon-credit:before { @extend .icon-ok:before }
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
@import "variables";
|
||||
|
||||
form.order_cycle {
|
||||
margin-bottom: 5em;
|
||||
}
|
||||
|
||||
#schedule-dialog {
|
||||
table {
|
||||
border: none;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
@include fullbg;
|
||||
background-color: black;
|
||||
background-image: image-url("home/tagline-bg.jpg");
|
||||
background-image: url("/assets/home/tagline-bg.jpg");
|
||||
background-repeat: no-repeat;
|
||||
background-position: center center;
|
||||
margin-bottom: 2em;
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
@import "branding";
|
||||
@import "big-input";
|
||||
@import "animations";
|
||||
@import "variables";
|
||||
|
||||
@mixin filter-selector($base-clr, $border-clr, $hover-clr) {
|
||||
&.inline-block, ul.inline-block {
|
||||
@@ -15,7 +14,7 @@
|
||||
@include border-radius(0);
|
||||
|
||||
padding: 0;
|
||||
margin: 0 0.5rem 0.5rem 0;
|
||||
margin: 0 0 0.25rem 0.25rem;
|
||||
|
||||
&:hover, &:focus {
|
||||
background: transparent;
|
||||
@@ -27,11 +26,13 @@
|
||||
|
||||
a, a.button {
|
||||
display: block;
|
||||
padding-top: 0.5rem;
|
||||
|
||||
@include border-radius(0.5em);
|
||||
|
||||
border: 1px solid $border-clr;
|
||||
padding: 0.5em 0.625em;
|
||||
font-size: 0.875em;
|
||||
color: $base-clr;
|
||||
font-size: 0.75em;
|
||||
background: white;
|
||||
@@ -106,63 +107,26 @@
|
||||
// Alert when search, taxon, filter is triggered
|
||||
|
||||
.alert-box.search-alert {
|
||||
background-color: $white;
|
||||
background-color: $clr-yellow-light;
|
||||
border-color: $clr-yellow-light;
|
||||
color: #777;
|
||||
font-size: 1em;
|
||||
padding: 0.35em 0 0;
|
||||
border: 0;
|
||||
margin: 0;
|
||||
font-size: 0.75rem;
|
||||
padding: 0.5rem 0.75rem;
|
||||
|
||||
.clear-all {
|
||||
color: $grey-500;
|
||||
margin-left: 1.5em;
|
||||
|
||||
&:hover {
|
||||
color: $grey-600;
|
||||
}
|
||||
span.applied-properties {
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.no-results-bar {
|
||||
@include breakpoint(desktop) {
|
||||
text-align: center;
|
||||
}
|
||||
span.applied-taxons {
|
||||
color: $clr-blue;
|
||||
}
|
||||
|
||||
.no-results {
|
||||
color: $grey-800;
|
||||
font-style: italic;
|
||||
font-size: 1.25em;
|
||||
span.applied-search {
|
||||
color: $clr-brick;
|
||||
}
|
||||
|
||||
.clear-search {
|
||||
background-color: transparent;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
color: $orange-500;
|
||||
font-size: 1.25em;
|
||||
|
||||
&:hover {
|
||||
color: $orange-400;
|
||||
}
|
||||
}
|
||||
|
||||
span {
|
||||
color: $grey-800;
|
||||
font-style: italic;
|
||||
|
||||
&.applied-taxons, &.applied-properties {
|
||||
color: $clr-blue;
|
||||
font-weight: bold;
|
||||
|
||||
.join-word {
|
||||
font-weight: normal;
|
||||
}
|
||||
}
|
||||
|
||||
&.applied-search {
|
||||
font-weight: bold;
|
||||
color: $teal-500;
|
||||
}
|
||||
span.filter-label {
|
||||
opacity: 0.75;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -176,6 +140,25 @@
|
||||
.filter-shopfront {
|
||||
&.taxon-selectors, &.property-selectors {
|
||||
background: transparent;
|
||||
|
||||
single-line-selectors {
|
||||
overflow-x: hidden;
|
||||
white-space: nowrap;
|
||||
|
||||
.f-dropdown {
|
||||
overflow-x: auto;
|
||||
white-space: normal;
|
||||
}
|
||||
}
|
||||
|
||||
ul {
|
||||
margin: 0;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
ul, ul li {
|
||||
list-style: none;
|
||||
}
|
||||
}
|
||||
|
||||
// Shopfront taxons
|
||||
@@ -187,8 +170,4 @@
|
||||
&.property-selectors {
|
||||
@include filter-selector(#666, #ccc, #777);
|
||||
}
|
||||
|
||||
ul {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,10 @@
|
||||
// #search
|
||||
@include placeholder(rgba(0, 0, 0, 0.4), #777);
|
||||
|
||||
input#search {
|
||||
@include medium-input(rgba(0, 0, 0, 0.3), #777, $clr-brick);
|
||||
}
|
||||
|
||||
// ordering
|
||||
product {
|
||||
input {
|
||||
@@ -23,22 +27,22 @@
|
||||
border-color: #b3b3b3;
|
||||
text-align: right;
|
||||
|
||||
@include breakpoint(desktop) {
|
||||
@media all and (max-width: 1024px) {
|
||||
width: 8rem;
|
||||
}
|
||||
|
||||
@include breakpoint(tablet) {
|
||||
@media all and (max-width: 768px) {
|
||||
width: 7rem;
|
||||
}
|
||||
|
||||
@include breakpoint(phablet) {
|
||||
@media all and (max-width: 640px) {
|
||||
float: left !important;
|
||||
font-size: 0.75rem;
|
||||
padding-left: 0.25rem;
|
||||
padding-right: 0.25rem;
|
||||
}
|
||||
|
||||
@include breakpoint(mobile) {
|
||||
@media all and (max-width: 480px) {
|
||||
width: 5.8rem;
|
||||
}
|
||||
|
||||
@@ -62,15 +66,15 @@
|
||||
input.bulk {
|
||||
width: 5rem;
|
||||
|
||||
@include breakpoint(desktop) {
|
||||
@media all and (max-width: 1024px) {
|
||||
width: 4rem;
|
||||
}
|
||||
|
||||
@include breakpoint(tablet) {
|
||||
@media all and (max-width: 768px) {
|
||||
width: 3.5rem;
|
||||
}
|
||||
|
||||
@include breakpoint(mobile) {
|
||||
@media all and (max-width: 480px) {
|
||||
width: 2.8rem;
|
||||
}
|
||||
}
|
||||
@@ -86,7 +90,7 @@
|
||||
.bulk-input-container {
|
||||
float: right;
|
||||
|
||||
@include breakpoint(phablet) {
|
||||
@media all and (max-width: 640px) {
|
||||
float: left !important;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,30 +1,9 @@
|
||||
.product-header {
|
||||
padding-left: 1.5rem;
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
margin: 0.2rem 1.5rem 0 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
span {
|
||||
color: $grey-500;
|
||||
}
|
||||
|
||||
.product-description {
|
||||
margin: 1rem 0.25rem 0.25rem 0;
|
||||
}
|
||||
|
||||
.property-selectors li {
|
||||
margin: 0 0.25rem 0.25rem 0;
|
||||
padding: 0.4rem 0 0;
|
||||
|
||||
a {
|
||||
border: 1px solid $grey-300;
|
||||
font-weight: normal;
|
||||
padding: 0.15rem 0.5rem;
|
||||
}
|
||||
|
||||
span {
|
||||
color: $grey-600;
|
||||
}
|
||||
hr {
|
||||
margin: 0.5em 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
@import "mixins";
|
||||
@import "typography";
|
||||
@import "variables";
|
||||
|
||||
ordercycle {
|
||||
float: right;
|
||||
background: $grey-050;
|
||||
color: $grey-800;
|
||||
width: 100%;
|
||||
border-radius: $radius-medium $radius-medium 0 0;
|
||||
border-radius: 0.5em 0.5em 0 0;
|
||||
margin-top: 1em;
|
||||
padding: 1em 1.25em 0;
|
||||
|
||||
@@ -19,7 +17,7 @@ ordercycle {
|
||||
margin-right: 0.3rem;
|
||||
}
|
||||
|
||||
@include breakpoint(desktop) {
|
||||
@media all and (max-width: 1024px) {
|
||||
float: none;
|
||||
padding: 0.5em 1em;
|
||||
width: 100%;
|
||||
@@ -35,7 +33,7 @@ ordercycle {
|
||||
}
|
||||
}
|
||||
|
||||
@include breakpoint(mobile) {
|
||||
@media all and (max-width: 480px) {
|
||||
padding: 0.5em 1em 0.75em;
|
||||
}
|
||||
|
||||
@@ -43,15 +41,15 @@ ordercycle {
|
||||
border: 1px solid $teal-300;
|
||||
display: inline-block;
|
||||
font-size: 1em;
|
||||
border-radius: $radius-small;
|
||||
border-radius: 0.25em;
|
||||
|
||||
.select-label {
|
||||
background-color: rgba($teal-300, 0.5);
|
||||
display: inline-block;
|
||||
border-radius: $radius-small 0 0 $radius-small;
|
||||
border-radius: 0.25em 0 0 0.25em;
|
||||
float: left;
|
||||
font-size: 1em;
|
||||
line-height: 1.3em;
|
||||
line-height: 1.5em;
|
||||
padding: 0.5em 0.75em;
|
||||
height: 2.35em;
|
||||
|
||||
@@ -62,57 +60,37 @@ ordercycle {
|
||||
}
|
||||
|
||||
select {
|
||||
background-image: image-url('white-caret.svg');
|
||||
background-size: 30px auto;
|
||||
background-position-x: 102%;
|
||||
}
|
||||
|
||||
p {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
select,
|
||||
p {
|
||||
width: inherit;
|
||||
display: inline-block;
|
||||
color: $white;
|
||||
background-color: transparent;
|
||||
border: 0;
|
||||
border-radius: 0 $radius-small $radius-small 0;
|
||||
margin-bottom: 0;
|
||||
padding: 0.5em 1.25em 0.5em 0.75em;
|
||||
font-size: 1em;
|
||||
line-height: 1.3em;
|
||||
line-height: 1.5em;
|
||||
padding: 0.5em 1.25em 0.5em 0.75em;
|
||||
height: 2.35em;
|
||||
background-image: url('/assets/white-caret.svg');
|
||||
background-size: 30px auto;
|
||||
border-radius: 0 0.25em 0.25em 0;
|
||||
min-width: 13em;
|
||||
width: 200px;
|
||||
|
||||
@include breakpoint(mobile) {
|
||||
@media all and (max-width: 480px) {
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
@media all and (min-width: 640px) and (max-width: 1024px), (min-width: 1200px) {
|
||||
width: 250px;
|
||||
}
|
||||
}
|
||||
|
||||
option {
|
||||
color: $grey-700;
|
||||
}
|
||||
|
||||
@include breakpoint(desktop) {
|
||||
@media all and (max-width: 1024px) {
|
||||
float: none;
|
||||
margin-right: 1em;
|
||||
}
|
||||
|
||||
@include breakpoint(tablet) {
|
||||
@media all and (max-width: 768px) {
|
||||
float: none;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
@include breakpoint(mobile) {
|
||||
@media all and (max-width: 480px) {
|
||||
display: flex;
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,7 +102,7 @@ ordercycle {
|
||||
padding: 0.5em 0;
|
||||
|
||||
span {
|
||||
@include breakpoint(tablet) {
|
||||
@media all and (max-width: 768px) {
|
||||
font-size: 0.875em;
|
||||
}
|
||||
}
|
||||
@@ -147,7 +125,7 @@ shop ordercycle {
|
||||
|
||||
select {
|
||||
background-color: $white;
|
||||
background-image: image-url('black-caret.svg');
|
||||
background-image: url('/assets/black-caret.svg');
|
||||
color: $grey-500;
|
||||
font-style: italic;
|
||||
}
|
||||
@@ -158,7 +136,7 @@ shop ordercycle {
|
||||
color: $white;
|
||||
padding: 0 0 12px;
|
||||
|
||||
@include breakpoint(desktop) {
|
||||
@media all and (max-width: 1024px) {
|
||||
float: none;
|
||||
display: inline-block;
|
||||
padding: 0.2em 0 0;
|
||||
@@ -166,9 +144,9 @@ shop ordercycle {
|
||||
margin-right: 1em;
|
||||
}
|
||||
|
||||
@include breakpoint(tablet) {
|
||||
@media all and (max-width: 768px) {
|
||||
float: none;
|
||||
padding: 0;
|
||||
padding: 0 0 10px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ button.graph-button {
|
||||
}
|
||||
}
|
||||
|
||||
@include breakpoint(tablet) {
|
||||
@media all and (max-width: 768px) {
|
||||
// Hide for small
|
||||
display: none;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
@import "mixins";
|
||||
@import "branding";
|
||||
@import "animations";
|
||||
|
||||
@@ -15,11 +14,11 @@
|
||||
|
||||
// outline: 1px solid red
|
||||
|
||||
@include breakpoint(tablet) {
|
||||
@media all and (max-width: 768px) {
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
@include breakpoint(phablet) {
|
||||
@media all and (max-width: 640px) {
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
}
|
||||
@@ -57,13 +56,13 @@
|
||||
.variant-name {
|
||||
padding-left: 7.9375rem;
|
||||
|
||||
@include breakpoint(tablet) {
|
||||
@media all and (max-width: 768px) {
|
||||
padding-left: 4.9375rem;
|
||||
}
|
||||
}
|
||||
|
||||
.variant-name {
|
||||
@include breakpoint(phablet) {
|
||||
@media all and (max-width: 640px) {
|
||||
background: #333;
|
||||
color: white;
|
||||
padding-left: 0.9375rem;
|
||||
@@ -83,7 +82,7 @@
|
||||
font-size: 0.875rem;
|
||||
overflow: hidden;
|
||||
|
||||
@include breakpoint(tablet) {
|
||||
@media all and (max-width: 768px) {
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
}
|
||||
@@ -93,7 +92,7 @@
|
||||
padding-left: 0.25rem;
|
||||
padding-right: 0.25rem;
|
||||
|
||||
@include breakpoint(phablet) {
|
||||
@media all and (max-width: 640px) {
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
@@ -107,7 +106,7 @@
|
||||
color: $med-drk-grey;
|
||||
}
|
||||
|
||||
@include breakpoint(phablet) {
|
||||
@media all and (max-width: 640px) {
|
||||
background: #777;
|
||||
color: $disabled-med;
|
||||
|
||||
@@ -133,7 +132,7 @@
|
||||
padding-bottom: 1em;
|
||||
line-height: 1;
|
||||
|
||||
@include breakpoint(tablet) {
|
||||
@media all and (max-width: 768px) {
|
||||
padding-top: 0.65rem;
|
||||
padding-bottom: 0.65rem;
|
||||
}
|
||||
@@ -142,11 +141,11 @@
|
||||
.summary-header {
|
||||
padding-left: 7.9375rem;
|
||||
|
||||
@include breakpoint(tablet) {
|
||||
@media all and (max-width: 768px) {
|
||||
padding-left: 4.9375rem;
|
||||
}
|
||||
|
||||
@include breakpoint(phablet) {
|
||||
@media all and (max-width: 640px) {
|
||||
padding-left: 0.9375rem;
|
||||
}
|
||||
|
||||
|
||||