spree 0.10.2 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of spree might be problematic. Click here for more details.
- data/CHANGELOG +81 -4
- data/CONTRIBUTORS +18 -10
- data/Rakefile +5 -4
- data/app/controllers/admin/adjustments_controller.rb +17 -3
- data/app/controllers/admin/base_controller.rb +2 -2
- data/app/controllers/admin/checkouts_controller.rb +43 -34
- data/app/controllers/admin/line_items_controller.rb +32 -18
- data/app/controllers/admin/option_types_controller.rb +1 -1
- data/app/controllers/admin/orders_controller.rb +28 -7
- data/app/controllers/admin/payments_controller.rb +7 -7
- data/app/controllers/admin/products_controller.rb +12 -23
- data/app/controllers/admin/reports_controller.rb +19 -7
- data/app/controllers/admin/return_authorizations_controller.rb +1 -1
- data/app/controllers/admin/shipments_controller.rb +9 -9
- data/app/controllers/admin/users_controller.rb +3 -1
- data/app/controllers/admin/variants_controller.rb +2 -2
- data/app/controllers/checkouts_controller.rb +29 -18
- data/app/controllers/content_controller.rb +1 -1
- data/{vendor/extensions/localization/app → app}/controllers/locale_controller.rb +1 -1
- data/app/controllers/orders_controller.rb +33 -30
- data/app/controllers/password_resets_controller.rb +4 -4
- data/app/controllers/products_controller.rb +0 -6
- data/app/controllers/spree/base_controller.rb +9 -2
- data/app/controllers/user_sessions_controller.rb +18 -18
- data/app/controllers/users_controller.rb +2 -2
- data/app/helpers/admin/base_helper.rb +5 -2
- data/app/helpers/admin/navigation_helper.rb +1 -1
- data/app/helpers/admin/orders_helper.rb +0 -13
- data/app/helpers/admin/products_helper.rb +0 -8
- data/app/helpers/checkouts_helper.rb +5 -5
- data/app/helpers/products_helper.rb +0 -12
- data/app/helpers/spree/base_helper.rb +10 -39
- data/app/helpers/taxons_helper.rb +1 -0
- data/app/models/address.rb +6 -1
- data/app/models/app_configuration.rb +15 -14
- data/app/models/calculator/flexi_rate.rb +2 -1
- data/app/models/calculator/vat.rb +1 -1
- data/app/models/checkout.rb +1 -1
- data/app/models/creditcard.rb +26 -20
- data/app/models/inventory_unit.rb +70 -21
- data/app/models/line_item.rb +25 -11
- data/app/models/order.rb +16 -10
- data/app/models/payment.rb +4 -1
- data/app/models/payment_method.rb +14 -5
- data/app/models/product.rb +12 -4
- data/app/models/role.rb +2 -2
- data/app/models/shipment.rb +21 -2
- data/app/models/tax_category.rb +8 -0
- data/app/models/taxon.rb +8 -0
- data/app/models/user.rb +2 -3
- data/app/models/variant.rb +18 -13
- data/config/boot.rb +1 -5
- data/config/cucumber.yml +7 -0
- data/config/database.yml +20 -37
- data/config/database.yml.example +5 -6
- data/config/environment.rb +6 -5
- data/config/environments/cucumber.rb +30 -0
- data/config/environments/production.rb +1 -4
- data/config/environments/staging.rb +3 -0
- data/config/environments/test.rb +1 -1
- data/config/initializers/cookie_verification_secret.rb +7 -0
- data/config/initializers/locales.rb +4 -2
- data/config/initializers/new_rails_defaults.rb +2 -0
- data/config/initializers/spree.rb +1 -0
- data/config/initializers/workarounds_for_ruby19.rb +0 -25
- data/config/locales/{en-US.yml → en_spree.yml} +18 -4
- data/config/routes.rb +2 -1
- data/db/migrate/20100317120946_add_alt_text_to_images.rb +9 -0
- data/db/migrate/20100427121301_add_display_to_payment_methods.rb +9 -0
- data/db/migrate/20100504142133_add_addresses_checkouts_indexes.rb +16 -0
- data/db/migrate/20100506180619_add_icon_to_taxons.rb +18 -0
- data/db/migrate/20100506185838_add_description_to_taxons.rb +11 -0
- data/db/migrate/20100528155333_index_for_shipments_number.rb +9 -0
- data/db/migrate/20100528185820_add_index_on_users_persistence_token.rb +9 -0
- data/db/migrate/20100605152042_add_default_to_tax_categories.rb +9 -0
- data/db/sample/payment_methods.yml +8 -1
- data/db/sample/shipments.yml +2 -2
- data/db/schema.rb +54 -21
- data/features/checkout.feature +98 -0
- data/features/create_admin_user.feature +18 -0
- data/features/search.feature +35 -0
- data/features/sign_in.feature +25 -0
- data/features/sign_out.feature +12 -0
- data/features/sign_up.feature +20 -0
- data/features/step_definitions/error_steps.rb +3 -0
- data/features/step_definitions/model_steps.rb +3 -0
- data/features/step_definitions/pickle_steps.rb +73 -0
- data/features/step_definitions/role_steps.rb +8 -0
- data/features/step_definitions/session_steps.rb +14 -0
- data/features/step_definitions/user_steps.rb +67 -0
- data/features/step_definitions/web_steps.rb +197 -0
- data/features/support/create_admin_user.rb +6 -0
- data/features/support/env.rb +89 -0
- data/features/support/paths.rb +32 -0
- data/features/support/pickle.rb +24 -0
- data/features/work_with_cart.feature +41 -0
- data/lib/generators/extension_model/extension_model_generator.rb +10 -10
- data/lib/generators/instance/templates/databases/mysql.yml +11 -0
- data/lib/scopes/variant.rb +10 -0
- data/lib/spree.rb +3 -3
- data/lib/spree/extensions.rb +1 -1
- data/lib/tasks/cucumber.rake +47 -0
- data/lib/tasks/database.rake +29 -29
- data/public/images/admin/bg/spree_50.png +0 -0
- data/public/images/tile-header.png +0 -0
- data/public/images/tile-slider.png +0 -0
- data/public/javascripts/admin/checkouts/edit.js +33 -0
- data/public/javascripts/dashboard.js +2 -2
- data/public/javascripts/taxonomy.js +2 -2
- data/public/stylesheets/admin/admin-tables.css +4 -0
- data/public/stylesheets/admin/admin.css +31 -16
- data/public/stylesheets/screen.css +16 -3
- data/script/about +3 -2
- data/script/console +2 -2
- data/script/cucumber +10 -0
- data/script/dbconsole +1 -1
- data/script/destroy +2 -2
- data/script/generate +2 -2
- data/script/performance/benchmarker +1 -1
- data/script/performance/profiler +1 -1
- data/script/plugin +2 -2
- data/script/runner +2 -2
- data/script/server +2 -2
- data/test/fixtures/payment_methods.yml +12 -0
- data/test/functional/admin/checkouts_controller_test.rb +0 -2
- data/test/functional/admin/line_items_controller_test.rb +78 -39
- data/test/functional/admin/products_controller_test.rb +4 -5
- data/test/integration/checkout_test.rb +1 -0
- data/test/test_helper.rb +114 -86
- data/test/unit/creditcard_test.rb +28 -7
- data/test/unit/flexi_rate_calculator_test.rb +75 -0
- data/test/unit/helpers/products_helper_test.rb +4 -4
- data/test/unit/inventory_unit_test.rb +39 -5
- data/test/unit/line_item_test.rb +60 -1
- data/test/unit/order_state_test.rb +85 -58
- data/test/unit/order_test.rb +144 -123
- data/test/unit/product_test.rb +21 -0
- data/test/unit/return_authorization_test.rb +22 -28
- data/test/unit/shipment_test.rb +19 -7
- data/test/unit/variant_test.rb +100 -24
- data/vendor/extensions/api/api_extension.rb +2 -2
- data/vendor/extensions/api/app/controllers/api/base_controller.rb +14 -6
- data/vendor/extensions/api/app/controllers/api/countries_controller.rb +4 -0
- data/vendor/extensions/api/app/controllers/api/orders_controller.rb +4 -4
- data/vendor/extensions/api/app/controllers/api/products_controller.rb +5 -1
- data/vendor/extensions/api/app/controllers/api/shipments_controller.rb +7 -7
- data/vendor/extensions/api/app/controllers/api/states_controller.rb +5 -0
- data/vendor/extensions/api/config/locales/{en-US.yml → en.yml} +2 -2
- data/vendor/extensions/api/config/routes.rb +5 -0
- data/vendor/extensions/api/test/integration/orders_api_test.rb +4 -4
- data/vendor/extensions/overview_dashboard/app/views/admin/overview/index.html.erb +1 -1
- data/vendor/extensions/payment_gateway/app/models/gateway.rb +1 -1
- data/vendor/extensions/payment_gateway/app/models/gateway/authorize_net_cim.rb +41 -29
- data/vendor/extensions/payment_gateway/app/models/gateway/bogus.rb +3 -3
- data/vendor/extensions/payment_gateway/app/models/gateway/eway.rb +11 -0
- data/vendor/extensions/payment_gateway/app/models/gateway/sage_pay.rb +9 -0
- data/vendor/extensions/payment_gateway/config/locales/{en-US.yml → en.yml} +1 -1
- data/vendor/extensions/payment_gateway/lib/spree/payment_gateway.rb +46 -56
- data/vendor/extensions/payment_gateway/payment_gateway_extension.rb +9 -10
- data/vendor/extensions/payment_gateway/test/unit/authorize_net_cim_test.rb +7 -6
- data/vendor/extensions/theme_default/app/stylesheets/_checkout.less +10 -3
- data/vendor/extensions/theme_default/app/views/admin/adjustments/index.html.erb +1 -1
- data/vendor/extensions/theme_default/app/views/admin/checkouts/_form.html.erb +31 -5
- data/vendor/extensions/theme_default/app/views/admin/checkouts/show.html.erb +27 -16
- data/vendor/extensions/theme_default/app/views/admin/images/_form.html.erb +4 -0
- data/vendor/extensions/theme_default/app/views/admin/images/index.html.erb +16 -13
- data/vendor/extensions/theme_default/app/views/admin/orders/_add_product.html.erb +1 -1
- data/vendor/extensions/theme_default/app/views/admin/orders/_form.html.erb +7 -0
- data/vendor/extensions/theme_default/app/views/admin/orders/index.html.erb +5 -5
- data/vendor/extensions/theme_default/app/views/admin/payment_methods/_form.html.erb +12 -6
- data/vendor/extensions/theme_default/app/views/admin/payment_methods/index.html.erb +22 -11
- data/vendor/extensions/theme_default/app/views/admin/product_groups/update.js.erb +2 -2
- data/vendor/extensions/theme_default/app/views/admin/products/_form.html.erb +6 -4
- data/vendor/extensions/theme_default/app/views/admin/shared/_address_form.html.erb +64 -55
- data/vendor/extensions/theme_default/app/views/admin/shared/_configuration_menu.html.erb +1 -1
- data/vendor/extensions/theme_default/app/views/admin/shared/_order_tabs.html.erb +11 -3
- data/vendor/extensions/theme_default/app/views/admin/shared/_product_tabs.html.erb +1 -1
- data/vendor/extensions/theme_default/app/views/admin/shipments/_form.html.erb +32 -29
- data/vendor/extensions/theme_default/app/views/admin/shipments/index.html.erb +2 -1
- data/vendor/extensions/theme_default/app/views/admin/tax_categories/_form.html.erb +6 -3
- data/vendor/extensions/theme_default/app/views/admin/tax_categories/index.html.erb +4 -2
- data/vendor/extensions/theme_default/app/views/admin/taxonomies/_taxon.html.erb +2 -2
- data/vendor/extensions/theme_default/app/views/admin/taxons/_form.html.erb +11 -1
- data/vendor/extensions/theme_default/app/views/admin/taxons/edit.html.erb +2 -2
- data/vendor/extensions/theme_default/app/views/admin/users/_form.html.erb +1 -1
- data/vendor/extensions/theme_default/app/views/admin/variants/_form.html.erb +4 -2
- data/vendor/extensions/theme_default/app/views/checkouts/_confirm.html.erb +1 -1
- data/vendor/extensions/theme_default/app/views/checkouts/_delivery.html.erb +1 -1
- data/vendor/extensions/theme_default/app/views/checkouts/_summary.html.erb +6 -6
- data/vendor/extensions/theme_default/app/views/checkouts/edit.html.erb +3 -3
- data/vendor/extensions/theme_default/app/views/layouts/admin.html.erb +7 -5
- data/vendor/extensions/theme_default/app/views/layouts/spree_application.html.erb +8 -4
- data/vendor/extensions/theme_default/app/views/orders/_line_item.html.erb +1 -1
- data/vendor/extensions/theme_default/app/views/products/index.html.erb +0 -1
- data/vendor/extensions/theme_default/app/views/shared/_footer.html.erb +4 -2
- data/vendor/extensions/theme_default/app/views/shared/_products.html.erb +3 -1
- data/vendor/extensions/theme_default/app/views/shared/_user_form.html.erb +1 -1
- data/vendor/extensions/theme_default/public/images/admin/bg/spree_50.png +0 -0
- data/vendor/extensions/theme_default/public/images/tile-header.png +0 -0
- data/vendor/extensions/theme_default/public/images/tile-slider.png +0 -0
- data/vendor/extensions/theme_default/public/javascripts/admin/checkouts/edit.js +50 -0
- data/vendor/extensions/theme_default/public/javascripts/taxonomy.js +2 -2
- data/vendor/extensions/theme_default/public/stylesheets/admin/admin-tables.css +8 -0
- data/vendor/extensions/theme_default/public/stylesheets/admin/admin.css +31 -16
- data/vendor/extensions/theme_default/public/stylesheets/screen.css +16 -3
- data/vendor/plugins/attribute_fu/{tasks → lib/tasks}/attribute_fu_tasks.rake +0 -0
- data/vendor/plugins/enumerable_constants/{tasks → lib/tasks}/enumerable_constants_tasks.rake +0 -0
- data/vendor/plugins/find_by_param/lib/find_by_param.rb +9 -5
- data/vendor/plugins/find_by_param/{tasks → lib/tasks}/find_by_param_tasks.rake +0 -0
- data/vendor/plugins/jrails/{tasks → lib/tasks}/jrails.rake +0 -0
- data/vendor/plugins/jrails_auto_complete/{tasks → lib/tasks}/jrails_auto_complete_tasks.rake +0 -0
- data/vendor/plugins/mail_queue/{tasks → lib/tasks}/mailer_queue_tasks.rake +0 -0
- data/vendor/plugins/open_id_authentication/{tasks → lib/tasks}/open_id_authentication_tasks.rake +0 -0
- data/vendor/plugins/resource_controller/lib/resource_controller/helpers/internal.rb +2 -2
- data/vendor/plugins/ssl_requirement/lib/ssl_requirement.rb +7 -7
- data/vendor/plugins/unobtrusive_date_picker/{tasks → lib/tasks}/datepicker_tasks.rake +0 -0
- metadata +82 -342
- data/app/helpers/admin/adjustments_helper.rb +0 -2
- data/app/helpers/admin/checkouts_helper.rb +0 -2
- data/app/helpers/admin/line_items_helper.rb +0 -2
- data/app/helpers/admin/properties_helper.rb +0 -9
- data/app/helpers/admin/prototypes_helper.rb +0 -18
- data/app/helpers/admin/return_authorizations_helper.rb +0 -2
- data/config/locales/cs-CZ.yml +0 -924
- data/config/locales/cs-CZ_rails.yml +0 -202
- data/config/locales/da.yml +0 -924
- data/config/locales/da_rails.yml +0 -197
- data/config/locales/de-CH.yml +0 -924
- data/config/locales/de-CH_rails.yml +0 -142
- data/config/locales/de.yml +0 -924
- data/config/locales/de_rails.yml +0 -140
- data/config/locales/en-AU.yml +0 -924
- data/config/locales/en-AU_rails.yml +0 -202
- data/config/locales/en-GB.yml +0 -924
- data/config/locales/en-GB_rails.yml +0 -196
- data/config/locales/en-US_rails.yml +0 -200
- data/config/locales/es.yml +0 -924
- data/config/locales/es_rails.yml +0 -173
- data/config/locales/fi.yml +0 -924
- data/config/locales/fi_rails.yml +0 -143
- data/config/locales/fr-FR.yml +0 -924
- data/config/locales/fr-FR_rails.yml +0 -123
- data/config/locales/il.yml +0 -924
- data/config/locales/il_rails.yml +0 -103
- data/config/locales/it.yml +0 -924
- data/config/locales/it_rails.yml +0 -146
- data/config/locales/jp.yml +0 -924
- data/config/locales/jp_rails.yml +0 -135
- data/config/locales/mx.yml +0 -924
- data/config/locales/mx_rails.yml +0 -181
- data/config/locales/nb-NO.yml +0 -924
- data/config/locales/nb-NO_rails.yml +0 -105
- data/config/locales/nl-BE.yml +0 -924
- data/config/locales/nl-BE_rails.yml +0 -155
- data/config/locales/nl-NL.yml +0 -924
- data/config/locales/nl-NL_rails.yml +0 -172
- data/config/locales/pl.yml +0 -924
- data/config/locales/pl_rails.yml +0 -118
- data/config/locales/pt-BR.yml +0 -924
- data/config/locales/pt-BR_rails.yml +0 -138
- data/config/locales/pt-PT.yml +0 -924
- data/config/locales/pt-PT_rails.yml +0 -133
- data/config/locales/ru-RU.yml +0 -924
- data/config/locales/ru-RU_rails.yml +0 -206
- data/config/locales/th.yml +0 -924
- data/config/locales/th_rails.yml +0 -195
- data/config/locales/vn.yml +0 -924
- data/config/locales/vn_rails.yml +0 -202
- data/lib/tasks/translation.rake +0 -102
- data/vendor/extensions/localization/README.rdoc +0 -5
- data/vendor/extensions/localization/Rakefile +0 -120
- data/vendor/extensions/localization/app/controllers/admin/localization_controller.rb +0 -2
- data/vendor/extensions/localization/app/helpers/locale_helper.rb +0 -2
- data/vendor/extensions/localization/app/helpers/localization_helper.rb +0 -2
- data/vendor/extensions/localization/app/views/shared/_language_bar.html.erb +0 -8
- data/vendor/extensions/localization/config/routes.rb +0 -4
- data/vendor/extensions/localization/lib/localization/user_preferences.rb +0 -9
- data/vendor/extensions/localization/lib/tasks/localization_extension_tasks.rake +0 -17
- data/vendor/extensions/localization/localization_extension.rb +0 -21
- data/vendor/extensions/localization/public/images/flags/ad.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ae.png +0 -0
- data/vendor/extensions/localization/public/images/flags/af.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ag.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ai.png +0 -0
- data/vendor/extensions/localization/public/images/flags/al.png +0 -0
- data/vendor/extensions/localization/public/images/flags/am.png +0 -0
- data/vendor/extensions/localization/public/images/flags/an.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ao.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ar.png +0 -0
- data/vendor/extensions/localization/public/images/flags/as.png +0 -0
- data/vendor/extensions/localization/public/images/flags/at.png +0 -0
- data/vendor/extensions/localization/public/images/flags/au.png +0 -0
- data/vendor/extensions/localization/public/images/flags/aw.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ax.png +0 -0
- data/vendor/extensions/localization/public/images/flags/az.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ba.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bb.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bd.png +0 -0
- data/vendor/extensions/localization/public/images/flags/be.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bf.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bg.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bh.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bi.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bj.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bm.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bn.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bo.png +0 -0
- data/vendor/extensions/localization/public/images/flags/br.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bs.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bt.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bv.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bw.png +0 -0
- data/vendor/extensions/localization/public/images/flags/by.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bz.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ca.png +0 -0
- data/vendor/extensions/localization/public/images/flags/catalonia.png +0 -0
- data/vendor/extensions/localization/public/images/flags/cc.png +0 -0
- data/vendor/extensions/localization/public/images/flags/cd.png +0 -0
- data/vendor/extensions/localization/public/images/flags/cf.png +0 -0
- data/vendor/extensions/localization/public/images/flags/cg.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ch.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ci.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ck.png +0 -0
- data/vendor/extensions/localization/public/images/flags/cl.png +0 -0
- data/vendor/extensions/localization/public/images/flags/cm.png +0 -0
- data/vendor/extensions/localization/public/images/flags/cn.png +0 -0
- data/vendor/extensions/localization/public/images/flags/co.png +0 -0
- data/vendor/extensions/localization/public/images/flags/cr.png +0 -0
- data/vendor/extensions/localization/public/images/flags/cs.png +0 -0
- data/vendor/extensions/localization/public/images/flags/cu.png +0 -0
- data/vendor/extensions/localization/public/images/flags/cv.png +0 -0
- data/vendor/extensions/localization/public/images/flags/cx.png +0 -0
- data/vendor/extensions/localization/public/images/flags/cy.png +0 -0
- data/vendor/extensions/localization/public/images/flags/cz.png +0 -0
- data/vendor/extensions/localization/public/images/flags/da.png +0 -0
- data/vendor/extensions/localization/public/images/flags/de.png +0 -0
- data/vendor/extensions/localization/public/images/flags/de_CH.png +0 -0
- data/vendor/extensions/localization/public/images/flags/dj.png +0 -0
- data/vendor/extensions/localization/public/images/flags/dm.png +0 -0
- data/vendor/extensions/localization/public/images/flags/do.png +0 -0
- data/vendor/extensions/localization/public/images/flags/dz.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ec.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ee.png +0 -0
- data/vendor/extensions/localization/public/images/flags/eg.png +0 -0
- data/vendor/extensions/localization/public/images/flags/eh.png +0 -0
- data/vendor/extensions/localization/public/images/flags/england.png +0 -0
- data/vendor/extensions/localization/public/images/flags/er.png +0 -0
- data/vendor/extensions/localization/public/images/flags/es.png +0 -0
- data/vendor/extensions/localization/public/images/flags/et.png +0 -0
- data/vendor/extensions/localization/public/images/flags/europeanunion.png +0 -0
- data/vendor/extensions/localization/public/images/flags/fam.png +0 -0
- data/vendor/extensions/localization/public/images/flags/fi.png +0 -0
- data/vendor/extensions/localization/public/images/flags/fj.png +0 -0
- data/vendor/extensions/localization/public/images/flags/fk.png +0 -0
- data/vendor/extensions/localization/public/images/flags/fm.png +0 -0
- data/vendor/extensions/localization/public/images/flags/fo.png +0 -0
- data/vendor/extensions/localization/public/images/flags/fr.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ga.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gb.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gd.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ge.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gf.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gh.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gi.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gl.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gm.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gn.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gp.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gq.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gr.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gs.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gt.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gu.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gw.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gy.png +0 -0
- data/vendor/extensions/localization/public/images/flags/hk.png +0 -0
- data/vendor/extensions/localization/public/images/flags/hm.png +0 -0
- data/vendor/extensions/localization/public/images/flags/hn.png +0 -0
- data/vendor/extensions/localization/public/images/flags/hr.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ht.png +0 -0
- data/vendor/extensions/localization/public/images/flags/hu.png +0 -0
- data/vendor/extensions/localization/public/images/flags/id.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ie.png +0 -0
- data/vendor/extensions/localization/public/images/flags/il.png +0 -0
- data/vendor/extensions/localization/public/images/flags/in.png +0 -0
- data/vendor/extensions/localization/public/images/flags/io.png +0 -0
- data/vendor/extensions/localization/public/images/flags/iq.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ir.png +0 -0
- data/vendor/extensions/localization/public/images/flags/is.png +0 -0
- data/vendor/extensions/localization/public/images/flags/it.png +0 -0
- data/vendor/extensions/localization/public/images/flags/jm.png +0 -0
- data/vendor/extensions/localization/public/images/flags/jo.png +0 -0
- data/vendor/extensions/localization/public/images/flags/jp.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ke.png +0 -0
- data/vendor/extensions/localization/public/images/flags/kg.png +0 -0
- data/vendor/extensions/localization/public/images/flags/kh.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ki.png +0 -0
- data/vendor/extensions/localization/public/images/flags/km.png +0 -0
- data/vendor/extensions/localization/public/images/flags/kn.png +0 -0
- data/vendor/extensions/localization/public/images/flags/kp.png +0 -0
- data/vendor/extensions/localization/public/images/flags/kr.png +0 -0
- data/vendor/extensions/localization/public/images/flags/kw.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ky.png +0 -0
- data/vendor/extensions/localization/public/images/flags/kz.png +0 -0
- data/vendor/extensions/localization/public/images/flags/la.png +0 -0
- data/vendor/extensions/localization/public/images/flags/lb.png +0 -0
- data/vendor/extensions/localization/public/images/flags/lc.png +0 -0
- data/vendor/extensions/localization/public/images/flags/li.png +0 -0
- data/vendor/extensions/localization/public/images/flags/lk.png +0 -0
- data/vendor/extensions/localization/public/images/flags/lr.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ls.png +0 -0
- data/vendor/extensions/localization/public/images/flags/lt.png +0 -0
- data/vendor/extensions/localization/public/images/flags/lu.png +0 -0
- data/vendor/extensions/localization/public/images/flags/lv.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ly.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ma.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mc.png +0 -0
- data/vendor/extensions/localization/public/images/flags/md.png +0 -0
- data/vendor/extensions/localization/public/images/flags/me.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mg.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mh.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mk.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ml.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mm.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mn.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mo.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mp.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mq.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mr.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ms.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mt.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mu.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mv.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mw.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mx.png +0 -0
- data/vendor/extensions/localization/public/images/flags/my.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mz.png +0 -0
- data/vendor/extensions/localization/public/images/flags/na.png +0 -0
- data/vendor/extensions/localization/public/images/flags/nc.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ne.png +0 -0
- data/vendor/extensions/localization/public/images/flags/nf.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ng.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ni.png +0 -0
- data/vendor/extensions/localization/public/images/flags/nl.png +0 -0
- data/vendor/extensions/localization/public/images/flags/no.png +0 -0
- data/vendor/extensions/localization/public/images/flags/np.png +0 -0
- data/vendor/extensions/localization/public/images/flags/nr.png +0 -0
- data/vendor/extensions/localization/public/images/flags/nu.png +0 -0
- data/vendor/extensions/localization/public/images/flags/nz.png +0 -0
- data/vendor/extensions/localization/public/images/flags/om.png +0 -0
- data/vendor/extensions/localization/public/images/flags/pa.png +0 -0
- data/vendor/extensions/localization/public/images/flags/pe.png +0 -0
- data/vendor/extensions/localization/public/images/flags/pf.png +0 -0
- data/vendor/extensions/localization/public/images/flags/pg.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ph.png +0 -0
- data/vendor/extensions/localization/public/images/flags/pk.png +0 -0
- data/vendor/extensions/localization/public/images/flags/pl.png +0 -0
- data/vendor/extensions/localization/public/images/flags/pm.png +0 -0
- data/vendor/extensions/localization/public/images/flags/pn.png +0 -0
- data/vendor/extensions/localization/public/images/flags/pr.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ps.png +0 -0
- data/vendor/extensions/localization/public/images/flags/pt.png +0 -0
- data/vendor/extensions/localization/public/images/flags/pw.png +0 -0
- data/vendor/extensions/localization/public/images/flags/py.png +0 -0
- data/vendor/extensions/localization/public/images/flags/qa.png +0 -0
- data/vendor/extensions/localization/public/images/flags/re.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ro.png +0 -0
- data/vendor/extensions/localization/public/images/flags/rs.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ru.png +0 -0
- data/vendor/extensions/localization/public/images/flags/rw.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sa.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sb.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sc.png +0 -0
- data/vendor/extensions/localization/public/images/flags/scotland.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sd.png +0 -0
- data/vendor/extensions/localization/public/images/flags/se.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sg.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sh.png +0 -0
- data/vendor/extensions/localization/public/images/flags/si.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sj.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sk.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sl.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sm.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sn.png +0 -0
- data/vendor/extensions/localization/public/images/flags/so.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sr.png +0 -0
- data/vendor/extensions/localization/public/images/flags/st.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sv.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sy.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sz.png +0 -0
- data/vendor/extensions/localization/public/images/flags/tc.png +0 -0
- data/vendor/extensions/localization/public/images/flags/td.png +0 -0
- data/vendor/extensions/localization/public/images/flags/tf.png +0 -0
- data/vendor/extensions/localization/public/images/flags/tg.png +0 -0
- data/vendor/extensions/localization/public/images/flags/th.png +0 -0
- data/vendor/extensions/localization/public/images/flags/tj.png +0 -0
- data/vendor/extensions/localization/public/images/flags/tk.png +0 -0
- data/vendor/extensions/localization/public/images/flags/tl.png +0 -0
- data/vendor/extensions/localization/public/images/flags/tm.png +0 -0
- data/vendor/extensions/localization/public/images/flags/tn.png +0 -0
- data/vendor/extensions/localization/public/images/flags/to.png +0 -0
- data/vendor/extensions/localization/public/images/flags/tr.png +0 -0
- data/vendor/extensions/localization/public/images/flags/tt.png +0 -0
- data/vendor/extensions/localization/public/images/flags/tv.png +0 -0
- data/vendor/extensions/localization/public/images/flags/tw.png +0 -0
- data/vendor/extensions/localization/public/images/flags/tz.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ua.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ug.png +0 -0
- data/vendor/extensions/localization/public/images/flags/um.png +0 -0
- data/vendor/extensions/localization/public/images/flags/us.png +0 -0
- data/vendor/extensions/localization/public/images/flags/uy.png +0 -0
- data/vendor/extensions/localization/public/images/flags/uz.png +0 -0
- data/vendor/extensions/localization/public/images/flags/va.png +0 -0
- data/vendor/extensions/localization/public/images/flags/vc.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ve.png +0 -0
- data/vendor/extensions/localization/public/images/flags/vg.png +0 -0
- data/vendor/extensions/localization/public/images/flags/vi.png +0 -0
- data/vendor/extensions/localization/public/images/flags/vn.png +0 -0
- data/vendor/extensions/localization/public/images/flags/vu.png +0 -0
- data/vendor/extensions/localization/public/images/flags/wales.png +0 -0
- data/vendor/extensions/localization/public/images/flags/wf.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ws.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ye.png +0 -0
- data/vendor/extensions/localization/public/images/flags/yt.png +0 -0
- data/vendor/extensions/localization/public/images/flags/za.png +0 -0
- data/vendor/extensions/localization/public/images/flags/zm.png +0 -0
- data/vendor/extensions/localization/public/images/flags/zw.png +0 -0
- data/vendor/extensions/localization/spec/controllers/admin/localization_controller_spec.rb +0 -10
- data/vendor/extensions/localization/spec/controllers/locale_controller_spec.rb +0 -35
- data/vendor/extensions/localization/spec/helpers/locale_helper_spec.rb +0 -5
- data/vendor/extensions/localization/spec/helpers/localization_helper_spec.rb +0 -5
- data/vendor/extensions/localization/spec/spec.opts +0 -6
- data/vendor/extensions/localization/spec/spec_helper.rb +0 -37
- data/vendor/extensions/payment_gateway/app/models/gateway/protx.rb +0 -9
- data/vendor/extensions/theme_default/app/views/admin/taxonomies/_manage_products.rhtml +0 -31
- data/vendor/extensions/theme_default/app/views/admin/taxonomies/_success.rhtml +0 -1
@@ -10,10 +10,10 @@ class PasswordResetsController < Spree::BaseController
|
|
10
10
|
@user = User.find_by_email(params[:email])
|
11
11
|
if @user
|
12
12
|
@user.deliver_password_reset_instructions!
|
13
|
-
|
13
|
+
self.notice = t("password_reset_instructions_are_mailed")
|
14
14
|
redirect_to root_url
|
15
15
|
else
|
16
|
-
flash[:
|
16
|
+
flash[:error] = t("no_user_found")
|
17
17
|
render :action => :new
|
18
18
|
end
|
19
19
|
end
|
@@ -26,7 +26,7 @@ class PasswordResetsController < Spree::BaseController
|
|
26
26
|
@user.password = params[:user][:password]
|
27
27
|
@user.password_confirmation = params[:user][:password_confirmation]
|
28
28
|
if @user.save
|
29
|
-
|
29
|
+
self.notice = t("password_updated")
|
30
30
|
redirect_to account_url
|
31
31
|
else
|
32
32
|
render :action => :edit
|
@@ -37,7 +37,7 @@ class PasswordResetsController < Spree::BaseController
|
|
37
37
|
def load_user_using_perishable_token
|
38
38
|
@user = User.find_using_perishable_token(params[:id])
|
39
39
|
unless @user
|
40
|
-
|
40
|
+
self.notice = t("password_reset_token_not_found")
|
41
41
|
redirect_to root_url
|
42
42
|
end
|
43
43
|
end
|
@@ -10,12 +10,6 @@ class ProductsController < Spree::BaseController
|
|
10
10
|
|
11
11
|
include Spree::Search
|
12
12
|
|
13
|
-
def change_image
|
14
|
-
@product = Product.available.find_by_param(params[:id])
|
15
|
-
img = Image.find(params[:image_id])
|
16
|
-
render :partial => 'image', :locals => {:image => img}
|
17
|
-
end
|
18
|
-
|
19
13
|
private
|
20
14
|
|
21
15
|
def load_data
|
@@ -3,6 +3,7 @@ class Spree::BaseController < ActionController::Base
|
|
3
3
|
helper :application, :hook
|
4
4
|
before_filter :instantiate_controller_and_action_names
|
5
5
|
before_filter :touch_sti_subclasses
|
6
|
+
before_filter :set_user_language
|
6
7
|
filter_parameter_logging :password, :password_confirmation, :number, :verification_value
|
7
8
|
helper_method :current_user_session, :current_user, :title, :title=, :get_taxonomies, :current_gateway
|
8
9
|
|
@@ -106,7 +107,7 @@ class Spree::BaseController < ActionController::Base
|
|
106
107
|
def require_user
|
107
108
|
unless current_user
|
108
109
|
store_location
|
109
|
-
|
110
|
+
self.notice = I18n.t("page_only_viewable_when_logged_in")
|
110
111
|
redirect_to new_user_session_url
|
111
112
|
return false
|
112
113
|
end
|
@@ -115,7 +116,7 @@ class Spree::BaseController < ActionController::Base
|
|
115
116
|
def require_no_user
|
116
117
|
if current_user
|
117
118
|
store_location
|
118
|
-
|
119
|
+
self.notice = I18n.t("page_only_viewable_when_logged_out")
|
119
120
|
redirect_to root_url
|
120
121
|
return false
|
121
122
|
end
|
@@ -183,4 +184,10 @@ class Spree::BaseController < ActionController::Base
|
|
183
184
|
end
|
184
185
|
end
|
185
186
|
|
187
|
+
def set_user_language
|
188
|
+
locale = session[:locale] || Spree::Config[:default_locale] || I18n.default_locale
|
189
|
+
locale = AVAILABLE_LOCALES.keys.include?(locale) ? locale : I18n.default_locale
|
190
|
+
I18n.locale = locale
|
191
|
+
end
|
192
|
+
|
186
193
|
end
|
@@ -3,19 +3,19 @@ class UserSessionsController < Spree::BaseController
|
|
3
3
|
before_filter :require_user, :only => :destroy
|
4
4
|
ssl_required :new, :create, :destroy, :update
|
5
5
|
ssl_allowed :login_bar
|
6
|
-
|
6
|
+
|
7
7
|
def new
|
8
8
|
@user_session = UserSession.new
|
9
9
|
end
|
10
10
|
|
11
11
|
def create
|
12
|
-
not_need_user_auto_creation =
|
12
|
+
not_need_user_auto_creation =
|
13
13
|
user_without_openid(params[:user_session]) ||
|
14
14
|
user_with_openid_exists?(:openid_identifier => params['openid.identity']) ||
|
15
|
-
user_with_openid_exists?(params[:user_session])
|
15
|
+
user_with_openid_exists?(params[:user_session])
|
16
16
|
|
17
17
|
if not_need_user_auto_creation
|
18
|
-
create_user_session(params[:user_session])
|
18
|
+
create_user_session(params[:user_session])
|
19
19
|
else
|
20
20
|
create_user(params[:user_session])
|
21
21
|
end
|
@@ -24,25 +24,25 @@ class UserSessionsController < Spree::BaseController
|
|
24
24
|
def destroy
|
25
25
|
current_user_session.destroy
|
26
26
|
session.clear
|
27
|
-
|
27
|
+
self.notice = t("logged_out")
|
28
28
|
redirect_to products_path
|
29
29
|
end
|
30
|
-
|
30
|
+
|
31
31
|
def nav_bar
|
32
32
|
render :partial => "shared/nav_bar"
|
33
33
|
end
|
34
|
-
|
34
|
+
|
35
35
|
private
|
36
|
-
|
36
|
+
|
37
37
|
def user_with_openid_exists?(data)
|
38
38
|
data && !data[:openid_identifier].blank? &&
|
39
39
|
!!User.find(:first, :conditions => ["openid_identifier LIKE ?", "%#{data[:openid_identifier]}%"])
|
40
40
|
end
|
41
|
-
|
41
|
+
|
42
42
|
def user_without_openid(data)
|
43
43
|
data && data[:openid_identifier].blank?
|
44
44
|
end
|
45
|
-
|
45
|
+
|
46
46
|
def create_user_session(data)
|
47
47
|
@user_session = UserSession.new(data)
|
48
48
|
@user_session.save do |result|
|
@@ -50,10 +50,10 @@ class UserSessionsController < Spree::BaseController
|
|
50
50
|
# Should restore last uncompleted order and add current(guest) order to it, if exists.
|
51
51
|
order = @user_session.record.orders.last(:conditions => {:completed_at => nil})
|
52
52
|
if order
|
53
|
-
if (session[:order_token] && guest_order = Order.
|
53
|
+
if (session[:order_token] && guest_order = Order.find(:first, :conditions => {:token => session[:order_token], :user_id => nil, :completed_at => nil}))
|
54
54
|
guest_order.line_items.each do |line_item|
|
55
55
|
order.add_variant(line_item.variant, line_item.quantity)
|
56
|
-
end
|
56
|
+
end
|
57
57
|
order.save
|
58
58
|
session[:return_to].gsub!(guest_order.number, order.number) if session[:return_to]
|
59
59
|
guest_order.destroy
|
@@ -61,10 +61,10 @@ class UserSessionsController < Spree::BaseController
|
|
61
61
|
session[:order_token] = order.token
|
62
62
|
session[:order_id] = order.id
|
63
63
|
end
|
64
|
-
|
64
|
+
|
65
65
|
respond_to do |format|
|
66
66
|
format.html {
|
67
|
-
|
67
|
+
self.notice = t("logged_in_succesfully") unless session[:return_to]
|
68
68
|
redirect_back_or_default products_path
|
69
69
|
}
|
70
70
|
format.js {
|
@@ -84,16 +84,16 @@ class UserSessionsController < Spree::BaseController
|
|
84
84
|
end
|
85
85
|
redirect_back_or_default(products_path) unless performed?
|
86
86
|
end
|
87
|
-
|
87
|
+
|
88
88
|
def create_user(data)
|
89
89
|
@user = User.new(data)
|
90
90
|
|
91
91
|
@user.save do |result|
|
92
92
|
if result
|
93
|
-
|
93
|
+
self.notice = t(:user_created_successfully) unless session[:return_to]
|
94
94
|
redirect_back_or_default products_url
|
95
95
|
else
|
96
|
-
|
96
|
+
self.notice = t(:missing_required_information)
|
97
97
|
redirect_to :controller => :users, :action => :new, :user => {:openid_identifier => @user.openid_identifier}
|
98
98
|
end
|
99
99
|
end
|
@@ -102,5 +102,5 @@ class UserSessionsController < Spree::BaseController
|
|
102
102
|
def accurate_title
|
103
103
|
I18n.t(:log_in)
|
104
104
|
end
|
105
|
-
|
105
|
+
|
106
106
|
end
|
@@ -14,7 +14,7 @@ class UsersController < Spree::BaseController
|
|
14
14
|
@user = User.new(params[:user])
|
15
15
|
@user.save do |result|
|
16
16
|
if result
|
17
|
-
|
17
|
+
self.notice = t(:user_created_successfully) unless session[:return_to]
|
18
18
|
@user.roles << Role.find_by_name("admin") unless admin_created?
|
19
19
|
respond_to do |format|
|
20
20
|
format.html { redirect_back_or_default products_url }
|
@@ -35,7 +35,7 @@ class UsersController < Spree::BaseController
|
|
35
35
|
def update
|
36
36
|
@user = current_user
|
37
37
|
if @user.update_attributes(params[:user])
|
38
|
-
|
38
|
+
self.notice = t("account_updated")
|
39
39
|
redirect_to account_url
|
40
40
|
else
|
41
41
|
render :action => :edit
|
@@ -27,7 +27,10 @@ module Admin::BaseHelper
|
|
27
27
|
if error_message_on :product, :name
|
28
28
|
end
|
29
29
|
end
|
30
|
-
|
30
|
+
|
31
|
+
#You can add additional_fields to the product and variant models. See section 4.2 here: http://spreecommerce.com/documentation/extensions.html
|
32
|
+
#If you do choose to add additional_fields, you can utilize the :use parameter to set the input type for any such fields. For example, :use => 'check_box'
|
33
|
+
#In the event that you add this functionality, the following method takes care of rendering the proper input type and logic for the supported input-types, which are text_field, check_box, radio_button, and select.
|
31
34
|
def get_additional_field_value(controller, field)
|
32
35
|
attribute = attribute_name_for(field[:name])
|
33
36
|
|
@@ -75,7 +78,7 @@ module Admin::BaseHelper
|
|
75
78
|
|
76
79
|
def remove_nested(fields)
|
77
80
|
out = ''
|
78
|
-
out << fields.hidden_field(:
|
81
|
+
out << fields.hidden_field(:_destroy) unless fields.object.new_record?
|
79
82
|
out << (link_to icon("delete"), "#", :class => "remove")
|
80
83
|
out
|
81
84
|
end
|
@@ -106,7 +106,7 @@ module Admin::NavigationHelper
|
|
106
106
|
def text_for_button_link(text, html_options)
|
107
107
|
s = ''
|
108
108
|
if html_options[:icon]
|
109
|
-
s << icon(html_options.delete(:icon)) + '
|
109
|
+
s << icon(html_options.delete(:icon)) + ' '
|
110
110
|
end
|
111
111
|
s << text
|
112
112
|
content_tag('span', s)
|
@@ -19,17 +19,4 @@ module Admin::OrdersHelper
|
|
19
19
|
links.join(' ')
|
20
20
|
end
|
21
21
|
|
22
|
-
def generate_html(form_builder, method, options = {})
|
23
|
-
options[:object] ||= form_builder.object.class.reflect_on_association(method).klass.new
|
24
|
-
options[:partial] ||= method.to_s.singularize
|
25
|
-
options[:form_builder_local] ||= :f
|
26
|
-
|
27
|
-
form_builder.fields_for(method, options[:object], :child_index => 'NEW_RECORD') do |f|
|
28
|
-
render(:partial => options[:partial], :locals => { options[:form_builder_local] => f })
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
def generate_template(form_builder, method, options = {})
|
33
|
-
escape_javascript generate_html(form_builder, method, options)
|
34
|
-
end
|
35
22
|
end
|
@@ -8,12 +8,4 @@ module Admin::ProductsHelper
|
|
8
8
|
def pv_tag_id(product_value)
|
9
9
|
"product-property-value-#{product_value.id}"
|
10
10
|
end
|
11
|
-
|
12
|
-
def exclusive_properties(product, properties)
|
13
|
-
product.property_values.each do |pv|
|
14
|
-
properties.delete(pv.property)
|
15
|
-
end
|
16
|
-
properties
|
17
|
-
end
|
18
|
-
|
19
11
|
end
|
@@ -1,7 +1,8 @@
|
|
1
1
|
module CheckoutsHelper
|
2
2
|
|
3
3
|
def checkout_progress
|
4
|
-
steps = Checkout.state_names.reject { |n| n == "complete" }
|
4
|
+
steps = Checkout.state_names.reject { |n| n == "complete" }
|
5
|
+
items = steps.map do |state|
|
5
6
|
next if state == "confirm" and not Gateway.current.payment_profiles_supported?
|
6
7
|
text = t("checkout_steps.#{state}")
|
7
8
|
|
@@ -17,14 +18,13 @@ module CheckoutsHelper
|
|
17
18
|
css_classes << 'next' if state_index == current_index + 1
|
18
19
|
css_classes << 'current' if state == @checkout.state
|
19
20
|
css_classes << 'first' if state_index == 0
|
20
|
-
css_classes << 'last' if state_index ==
|
21
|
-
|
21
|
+
css_classes << 'last' if state_index == steps.length - 1
|
22
22
|
# It'd be nice to have separate classes but combining them with a dash helps out for IE6 which only sees the last class
|
23
23
|
content_tag('li', content_tag('span', text), :class => css_classes.join('-'))
|
24
24
|
end
|
25
|
-
content_tag('ol',
|
25
|
+
content_tag('ol', items.join("\n"), :class => 'progress-steps', :id => "checkout-step-#{@checkout.state}")
|
26
26
|
end
|
27
|
-
|
27
|
+
|
28
28
|
def billing_firstname
|
29
29
|
@checkout.bill_address.firstname rescue ''
|
30
30
|
end
|
@@ -46,16 +46,4 @@ module ProductsHelper
|
|
46
46
|
return product_url(product)
|
47
47
|
end
|
48
48
|
|
49
|
-
# Generate taxon breadcrumbs for searching related products
|
50
|
-
def taxon_crumbs(taxon, separator=" » ")
|
51
|
-
crumbs = []
|
52
|
-
|
53
|
-
crumbs << taxon.ancestors.collect { |ancestor|
|
54
|
-
content_tag(:li, link_to(ancestor.name , seo_url(ancestor)) + separator)
|
55
|
-
} unless taxon.ancestors.empty?
|
56
|
-
|
57
|
-
crumbs << content_tag(:li, link_to(taxon.name , seo_url(taxon)))
|
58
|
-
crumb_list = content_tag(:ul, crumbs)
|
59
|
-
content_tag(:div, crumb_list + content_tag(:br, nil, :class => 'clear'), :class => 'breadcrumbs')
|
60
|
-
end
|
61
49
|
end
|
@@ -39,24 +39,6 @@ module Spree::BaseHelper
|
|
39
39
|
options.delete(:format_as_currency) ? number_to_currency(amount) : amount
|
40
40
|
end
|
41
41
|
|
42
|
-
|
43
|
-
def add_product_link(text, product)
|
44
|
-
link_to_remote text, {:url => {:controller => "cart",
|
45
|
-
:action => "add", :id => product}},
|
46
|
-
{:title => "Add to Cart",
|
47
|
-
:href => url_for( :controller => "cart",
|
48
|
-
:action => "add", :id => product)}
|
49
|
-
end
|
50
|
-
|
51
|
-
def remove_product_link(text, product)
|
52
|
-
link_to_remote text, {:url => {:controller => "cart",
|
53
|
-
:action => "remove",
|
54
|
-
:id => product}},
|
55
|
-
{:title => "Remove item",
|
56
|
-
:href => url_for( :controller => "cart",
|
57
|
-
:action => "remove", :id => product)}
|
58
|
-
end
|
59
|
-
|
60
42
|
def todays_short_date
|
61
43
|
utc_to_local(Time.now.utc).to_ordinalized_s(:stub)
|
62
44
|
end
|
@@ -73,27 +55,16 @@ module Spree::BaseHelper
|
|
73
55
|
list
|
74
56
|
end
|
75
57
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
image_tag "noimage/small.jpg", options
|
87
|
-
else
|
88
|
-
image_tag product.images.first.attachment.url(:small), options
|
89
|
-
end
|
90
|
-
end
|
91
|
-
|
92
|
-
def product_image(product, options={})
|
93
|
-
if product.images.empty?
|
94
|
-
image_tag "noimage/product.jpg", options
|
95
|
-
else
|
96
|
-
image_tag product.images.first.attachment.url(:product), options
|
58
|
+
[:mini, :small, :product, :large].each do |style|
|
59
|
+
define_method "#{style}_image" do |product, *options|
|
60
|
+
options = options.first || {}
|
61
|
+
if product.images.empty?
|
62
|
+
image_tag "noimage/#{style}.jpg", options
|
63
|
+
else
|
64
|
+
image = product.images.first
|
65
|
+
options.reverse_merge! :alt => image.alt.blank? ? product.name : image.alt
|
66
|
+
image_tag image.attachment.url(style), options
|
67
|
+
end
|
97
68
|
end
|
98
69
|
end
|
99
70
|
|
@@ -1,6 +1,7 @@
|
|
1
1
|
module TaxonsHelper
|
2
2
|
def breadcrumbs(taxon, separator=" » ")
|
3
3
|
return "" if current_page?("/")
|
4
|
+
separator = raw(separator)
|
4
5
|
crumbs = [content_tag(:li, link_to(t(:home) , root_path) + separator)]
|
5
6
|
if taxon
|
6
7
|
crumbs << content_tag(:li, link_to(t('products') , products_path) + separator)
|
data/app/models/address.rb
CHANGED
@@ -2,7 +2,8 @@ class Address < ActiveRecord::Base
|
|
2
2
|
belongs_to :country
|
3
3
|
belongs_to :state
|
4
4
|
|
5
|
-
has_many :
|
5
|
+
has_many :billing_checkouts, :foreign_key => "bill_address_id", :class_name => "Checkout"
|
6
|
+
has_many :shipping_checkouts, :foreign_key => "ship_address_id", :class_name => "Checkout"
|
6
7
|
has_many :shipments
|
7
8
|
|
8
9
|
validates_presence_of :firstname
|
@@ -16,6 +17,10 @@ class Address < ActiveRecord::Base
|
|
16
17
|
validates_presence_of :phone
|
17
18
|
validate :state_name_validate, :if => Proc.new { |address| address.state.blank? && Spree::Config[:address_requires_state] }
|
18
19
|
|
20
|
+
def checkouts
|
21
|
+
(billing_checkouts + shipping_checkouts).uniq
|
22
|
+
end
|
23
|
+
|
19
24
|
# disconnected since there's no code to display error messages yet OR matching client-side validation
|
20
25
|
def phone_validate
|
21
26
|
return if phone.blank?
|
@@ -9,47 +9,48 @@ class AppConfiguration < Configuration
|
|
9
9
|
preference :mail_host, :string, :default => 'localhost'
|
10
10
|
preference :mail_domain, :string, :default => 'localhost'
|
11
11
|
preference :mail_port, :integer, :default => 25
|
12
|
-
preference :mail_auth_type, :string, :default => MAIL_AUTH[0]
|
12
|
+
preference :mail_auth_type, :string, :default => MAIL_AUTH[0]
|
13
13
|
preference :smtp_username, :string
|
14
14
|
preference :smtp_password, :string
|
15
|
-
preference :secure_connection_type, :string, :default => SECURE_CONNECTION_TYPES[0]
|
15
|
+
preference :secure_connection_type, :string, :default => SECURE_CONNECTION_TYPES[0]
|
16
16
|
preference :mails_from, :string
|
17
17
|
preference :mail_bcc, :string
|
18
18
|
preference :order_from, :string, :default => "orders@example.com"
|
19
19
|
preference :order_bcc, :string
|
20
20
|
preference :store_cc, :boolean, :default => false
|
21
21
|
preference :store_cvv, :boolean, :default => false
|
22
|
-
preference :default_locale, :string, :default => 'en
|
22
|
+
preference :default_locale, :string, :default => 'en'
|
23
23
|
preference :allow_locale_switching, :boolean, :default => true
|
24
24
|
preference :default_country_id, :integer, :default => 214
|
25
25
|
preference :allow_backorders, :boolean, :default => true
|
26
26
|
preference :allow_backorder_shipping, :boolean, :default => false # should only be true if you don't need to track inventory
|
27
|
+
preference :track_inventory_levels, :boolean, :default => true #
|
27
28
|
preference :show_descendents, :boolean, :default => true
|
28
29
|
preference :show_zero_stock_products, :boolean, :default => true
|
29
|
-
preference :orders_per_page, :integer, :default => 15
|
30
|
-
preference :admin_products_per_page, :integer, :default => 10
|
31
|
-
preference :admin_pgroup_preview_size, :integer, :default => 10
|
30
|
+
preference :orders_per_page, :integer, :default => 15
|
31
|
+
preference :admin_products_per_page, :integer, :default => 10
|
32
|
+
preference :admin_pgroup_preview_size, :integer, :default => 10
|
32
33
|
preference :products_per_page, :integer, :default => 10
|
33
|
-
preference :default_tax_category, :string, :default => nil # Use the name (exact case) of the tax category if you wish to specify
|
34
34
|
preference :logo, :string, :default => '/images/admin/bg/spree_50.png'
|
35
35
|
preference :stylesheets, :string, :default => 'screen' # Comma separate multiple stylesheets, e.g. 'screen,mystyle'
|
36
36
|
preference :admin_interface_logo, :string, :default => "spree/spree.jpg"
|
37
37
|
preference :allow_ssl_in_production, :boolean, :default => true
|
38
38
|
preference :allow_ssl_in_development_and_test, :boolean, :default => false
|
39
|
-
preference :allow_guest_checkout, :boolean, :default => true
|
40
|
-
preference :allow_anonymous_checkout, :boolean, :default => false
|
39
|
+
preference :allow_guest_checkout, :boolean, :default => true
|
40
|
+
preference :allow_anonymous_checkout, :boolean, :default => false
|
41
41
|
preference :alternative_billing_phone, :boolean, :default => false # Request extra phone for bill addr
|
42
42
|
preference :alternative_shipping_phone, :boolean, :default => false # Request extra phone for ship addr
|
43
|
-
preference :shipping_instructions, :boolean, :default => false # Request instructions/info for shipping
|
44
|
-
preference :show_price_inc_vat, :boolean, :default => false
|
43
|
+
preference :shipping_instructions, :boolean, :default => false # Request instructions/info for shipping
|
44
|
+
preference :show_price_inc_vat, :boolean, :default => false
|
45
45
|
preference :auto_capture, :boolean, :default => false # automatically capture the creditcard (as opposed to just authorize and capture later)
|
46
46
|
preference :address_requires_state, :boolean, :default => true # should state/state_name be required
|
47
47
|
preference :use_mail_queue, :boolean, :default => false #send mail immediately or use a mail queue.
|
48
|
-
preference :allow_openid, :boolean, :default => true # allow use OpenID for registrations
|
48
|
+
preference :allow_openid, :boolean, :default => true # allow use OpenID for registrations
|
49
49
|
preference :checkout_zone, :string, :default => nil # replace with the name of a zone if you would like to limit the countries
|
50
50
|
preference :always_put_site_name_in_title, :boolean, :default => true
|
51
|
-
|
51
|
+
preference :cache_static_content, :boolean, :default => true
|
52
|
+
|
52
53
|
validates_presence_of :name
|
53
54
|
validates_uniqueness_of :name
|
54
|
-
|
55
|
+
|
55
56
|
end
|