spree_frontend 2.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/LICENSE +26 -0
- data/README.md +21 -0
- data/app/assets/images/credit_cards/amex_cid.gif +0 -0
- data/app/assets/images/credit_cards/credit_card.gif +0 -0
- data/app/assets/images/credit_cards/discover_cid.gif +0 -0
- data/app/assets/images/credit_cards/icons/american_express.png +0 -0
- data/app/assets/images/credit_cards/icons/cirrus.png +0 -0
- data/app/assets/images/credit_cards/icons/delta.png +0 -0
- data/app/assets/images/credit_cards/icons/diners_club.png +0 -0
- data/app/assets/images/credit_cards/icons/directdebit.png +0 -0
- data/app/assets/images/credit_cards/icons/discover.png +0 -0
- data/app/assets/images/credit_cards/icons/egold.png +0 -0
- data/app/assets/images/credit_cards/icons/maestro.png +0 -0
- data/app/assets/images/credit_cards/icons/master.png +0 -0
- data/app/assets/images/credit_cards/icons/paypal.png +0 -0
- data/app/assets/images/credit_cards/icons/solo.png +0 -0
- data/app/assets/images/credit_cards/icons/switch.png +0 -0
- data/app/assets/images/credit_cards/icons/visa.png +0 -0
- data/app/assets/images/credit_cards/icons/visaelectron.png +0 -0
- data/app/assets/images/credit_cards/icons/westernunion.png +0 -0
- data/app/assets/images/credit_cards/icons/wirecard.png +0 -0
- data/app/assets/images/credit_cards/icons/worldpay.png +0 -0
- data/app/assets/images/credit_cards/master_cid.jpg +0 -0
- data/app/assets/images/credit_cards/visa_cid.gif +0 -0
- data/app/assets/images/favicon.ico +0 -0
- data/app/assets/images/icons/add-to-cart.png +0 -0
- data/app/assets/images/icons/checkout.png +0 -0
- data/app/assets/images/icons/delete.png +0 -0
- data/app/assets/images/icons/update.png +0 -0
- data/app/assets/images/noimage/large.png +0 -0
- data/app/assets/images/noimage/mini.png +0 -0
- data/app/assets/images/noimage/product.png +0 -0
- data/app/assets/images/noimage/small.png +0 -0
- data/app/assets/images/spinner.gif +0 -0
- data/app/assets/images/store/cart.png +0 -0
- data/app/assets/images/store/select_arrow.gif +0 -0
- data/app/assets/javascripts/store/cart.js.coffee +9 -0
- data/app/assets/javascripts/store/checkout.js.coffee +105 -0
- data/app/assets/javascripts/store/product.js.coffee +42 -0
- data/app/assets/javascripts/store/spree_frontend.js +5 -0
- data/app/assets/stylesheets/admin/plugins/font-awesome.scss +303 -0
- data/app/assets/stylesheets/store/_variables.scss +61 -0
- data/app/assets/stylesheets/store/screen.css.scss +1272 -0
- data/app/assets/stylesheets/store/spree_frontend.css +6 -0
- data/app/controllers/spree/checkout_controller.rb +166 -0
- data/app/controllers/spree/content_controller.rb +29 -0
- data/app/controllers/spree/home_controller.rb +13 -0
- data/app/controllers/spree/locale_controller.rb +16 -0
- data/app/controllers/spree/orders_controller.rb +100 -0
- data/app/controllers/spree/products_controller.rb +50 -0
- data/app/controllers/spree/store_controller.rb +70 -0
- data/app/controllers/spree/taxons_controller.rb +29 -0
- data/app/models/spree/frontend_configuration.rb +5 -0
- data/app/views/spree/address/_form.html.erb +75 -0
- data/app/views/spree/checkout/_address.html.erb +25 -0
- data/app/views/spree/checkout/_confirm.html.erb +12 -0
- data/app/views/spree/checkout/_delivery.html.erb +100 -0
- data/app/views/spree/checkout/_payment.html.erb +37 -0
- data/app/views/spree/checkout/_summary.html.erb +33 -0
- data/app/views/spree/checkout/edit.html.erb +28 -0
- data/app/views/spree/checkout/payment/_check.html.erb +0 -0
- data/app/views/spree/checkout/payment/_gateway.html.erb +26 -0
- data/app/views/spree/checkout/registration.html.erb +20 -0
- data/app/views/spree/content/cvv.html.erb +13 -0
- data/app/views/spree/home/index.html.erb +10 -0
- data/app/views/spree/layouts/spree_application.html.erb +38 -0
- data/app/views/spree/orders/_adjustments.html.erb +14 -0
- data/app/views/spree/orders/_form.html.erb +18 -0
- data/app/views/spree/orders/_line_item.html.erb +31 -0
- data/app/views/spree/orders/edit.html.erb +48 -0
- data/app/views/spree/orders/new.html.erb +9 -0
- data/app/views/spree/orders/show.html.erb +22 -0
- data/app/views/spree/products/_cart_form.html.erb +48 -0
- data/app/views/spree/products/_image.html.erb +5 -0
- data/app/views/spree/products/_promotions.html.erb +19 -0
- data/app/views/spree/products/_properties.html.erb +15 -0
- data/app/views/spree/products/_taxons.html.erb +14 -0
- data/app/views/spree/products/_thumbnails.html.erb +19 -0
- data/app/views/spree/products/index.html.erb +27 -0
- data/app/views/spree/products/show.html.erb +49 -0
- data/app/views/spree/shared/_filters.html.erb +28 -0
- data/app/views/spree/shared/_footer.html.erb +6 -0
- data/app/views/spree/shared/_google_analytics.html.erb +39 -0
- data/app/views/spree/shared/_head.html.erb +14 -0
- data/app/views/spree/shared/_header.html.erb +5 -0
- data/app/views/spree/shared/_main_nav_bar.html.erb +6 -0
- data/app/views/spree/shared/_nav_bar.html.erb +7 -0
- data/app/views/spree/shared/_order_details.html.erb +110 -0
- data/app/views/spree/shared/_products.html.erb +28 -0
- data/app/views/spree/shared/_search.html.erb +9 -0
- data/app/views/spree/shared/_shipment_tracking.html.erb +9 -0
- data/app/views/spree/shared/_sidebar.html.erb +3 -0
- data/app/views/spree/shared/_taxonomies.html.erb +6 -0
- data/app/views/spree/shared/unauthorized.html.erb +0 -0
- data/app/views/spree/taxons/_taxon.html.erb +4 -0
- data/app/views/spree/taxons/show.html.erb +19 -0
- data/config/initializers/check_for_orphaned_preferences.rb +9 -0
- data/config/initializers/deprecation_checker.rb +7 -0
- data/config/initializers/rails_5868.rb +8 -0
- data/config/initializers/spree.rb +6 -0
- data/config/routes.rb +39 -0
- data/lib/spree/frontend.rb +22 -0
- data/lib/spree/frontend/engine.rb +19 -0
- data/lib/spree/frontend/middleware/seo_assist.rb +51 -0
- data/lib/spree/frontend/preference_rescue.rb +25 -0
- data/lib/spree/scopes/dynamic.rb +33 -0
- data/lib/spree_frontend.rb +1 -0
- data/lib/tasks/rake_util.rb +19 -0
- data/lib/tasks/taxon.rake +14 -0
- data/vendor/assets/images/datepicker/cal.gif +0 -0
- data/vendor/assets/images/flags/ad.png +0 -0
- data/vendor/assets/images/flags/ae.png +0 -0
- data/vendor/assets/images/flags/af.png +0 -0
- data/vendor/assets/images/flags/ag.png +0 -0
- data/vendor/assets/images/flags/ai.png +0 -0
- data/vendor/assets/images/flags/al.png +0 -0
- data/vendor/assets/images/flags/am.png +0 -0
- data/vendor/assets/images/flags/an.png +0 -0
- data/vendor/assets/images/flags/ao.png +0 -0
- data/vendor/assets/images/flags/ar.png +0 -0
- data/vendor/assets/images/flags/as.png +0 -0
- data/vendor/assets/images/flags/at.png +0 -0
- data/vendor/assets/images/flags/au.png +0 -0
- data/vendor/assets/images/flags/aw.png +0 -0
- data/vendor/assets/images/flags/ax.png +0 -0
- data/vendor/assets/images/flags/az.png +0 -0
- data/vendor/assets/images/flags/ba.png +0 -0
- data/vendor/assets/images/flags/bb.png +0 -0
- data/vendor/assets/images/flags/bd.png +0 -0
- data/vendor/assets/images/flags/be.png +0 -0
- data/vendor/assets/images/flags/bf.png +0 -0
- data/vendor/assets/images/flags/bg.png +0 -0
- data/vendor/assets/images/flags/bh.png +0 -0
- data/vendor/assets/images/flags/bi.png +0 -0
- data/vendor/assets/images/flags/bj.png +0 -0
- data/vendor/assets/images/flags/bm.png +0 -0
- data/vendor/assets/images/flags/bn.png +0 -0
- data/vendor/assets/images/flags/bo.png +0 -0
- data/vendor/assets/images/flags/br.png +0 -0
- data/vendor/assets/images/flags/bs.png +0 -0
- data/vendor/assets/images/flags/bt.png +0 -0
- data/vendor/assets/images/flags/bv.png +0 -0
- data/vendor/assets/images/flags/bw.png +0 -0
- data/vendor/assets/images/flags/by.png +0 -0
- data/vendor/assets/images/flags/bz.png +0 -0
- data/vendor/assets/images/flags/ca.png +0 -0
- data/vendor/assets/images/flags/catalonia.png +0 -0
- data/vendor/assets/images/flags/cc.png +0 -0
- data/vendor/assets/images/flags/cd.png +0 -0
- data/vendor/assets/images/flags/cf.png +0 -0
- data/vendor/assets/images/flags/cg.png +0 -0
- data/vendor/assets/images/flags/ch.png +0 -0
- data/vendor/assets/images/flags/ci.png +0 -0
- data/vendor/assets/images/flags/ck.png +0 -0
- data/vendor/assets/images/flags/cl.png +0 -0
- data/vendor/assets/images/flags/cm.png +0 -0
- data/vendor/assets/images/flags/cn.png +0 -0
- data/vendor/assets/images/flags/co.png +0 -0
- data/vendor/assets/images/flags/cr.png +0 -0
- data/vendor/assets/images/flags/cs.png +0 -0
- data/vendor/assets/images/flags/cu.png +0 -0
- data/vendor/assets/images/flags/cv.png +0 -0
- data/vendor/assets/images/flags/cx.png +0 -0
- data/vendor/assets/images/flags/cy.png +0 -0
- data/vendor/assets/images/flags/cz.png +0 -0
- data/vendor/assets/images/flags/de.png +0 -0
- data/vendor/assets/images/flags/dj.png +0 -0
- data/vendor/assets/images/flags/dk.png +0 -0
- data/vendor/assets/images/flags/dm.png +0 -0
- data/vendor/assets/images/flags/do.png +0 -0
- data/vendor/assets/images/flags/dz.png +0 -0
- data/vendor/assets/images/flags/ec.png +0 -0
- data/vendor/assets/images/flags/ee.png +0 -0
- data/vendor/assets/images/flags/eg.png +0 -0
- data/vendor/assets/images/flags/eh.png +0 -0
- data/vendor/assets/images/flags/england.png +0 -0
- data/vendor/assets/images/flags/er.png +0 -0
- data/vendor/assets/images/flags/es.png +0 -0
- data/vendor/assets/images/flags/et.png +0 -0
- data/vendor/assets/images/flags/europeanunion.png +0 -0
- data/vendor/assets/images/flags/fam.png +0 -0
- data/vendor/assets/images/flags/fi.png +0 -0
- data/vendor/assets/images/flags/fj.png +0 -0
- data/vendor/assets/images/flags/fk.png +0 -0
- data/vendor/assets/images/flags/fm.png +0 -0
- data/vendor/assets/images/flags/fo.png +0 -0
- data/vendor/assets/images/flags/fr.png +0 -0
- data/vendor/assets/images/flags/ga.png +0 -0
- data/vendor/assets/images/flags/gb.png +0 -0
- data/vendor/assets/images/flags/gd.png +0 -0
- data/vendor/assets/images/flags/ge.png +0 -0
- data/vendor/assets/images/flags/gf.png +0 -0
- data/vendor/assets/images/flags/gh.png +0 -0
- data/vendor/assets/images/flags/gi.png +0 -0
- data/vendor/assets/images/flags/gl.png +0 -0
- data/vendor/assets/images/flags/gm.png +0 -0
- data/vendor/assets/images/flags/gn.png +0 -0
- data/vendor/assets/images/flags/gp.png +0 -0
- data/vendor/assets/images/flags/gq.png +0 -0
- data/vendor/assets/images/flags/gr.png +0 -0
- data/vendor/assets/images/flags/gs.png +0 -0
- data/vendor/assets/images/flags/gt.png +0 -0
- data/vendor/assets/images/flags/gu.png +0 -0
- data/vendor/assets/images/flags/gw.png +0 -0
- data/vendor/assets/images/flags/gy.png +0 -0
- data/vendor/assets/images/flags/hk.png +0 -0
- data/vendor/assets/images/flags/hm.png +0 -0
- data/vendor/assets/images/flags/hn.png +0 -0
- data/vendor/assets/images/flags/hr.png +0 -0
- data/vendor/assets/images/flags/ht.png +0 -0
- data/vendor/assets/images/flags/hu.png +0 -0
- data/vendor/assets/images/flags/id.png +0 -0
- data/vendor/assets/images/flags/ie.png +0 -0
- data/vendor/assets/images/flags/il.png +0 -0
- data/vendor/assets/images/flags/in.png +0 -0
- data/vendor/assets/images/flags/io.png +0 -0
- data/vendor/assets/images/flags/iq.png +0 -0
- data/vendor/assets/images/flags/ir.png +0 -0
- data/vendor/assets/images/flags/is.png +0 -0
- data/vendor/assets/images/flags/it.png +0 -0
- data/vendor/assets/images/flags/ja.png +0 -0
- data/vendor/assets/images/flags/jm.png +0 -0
- data/vendor/assets/images/flags/jo.png +0 -0
- data/vendor/assets/images/flags/ke.png +0 -0
- data/vendor/assets/images/flags/kg.png +0 -0
- data/vendor/assets/images/flags/kh.png +0 -0
- data/vendor/assets/images/flags/ki.png +0 -0
- data/vendor/assets/images/flags/km.png +0 -0
- data/vendor/assets/images/flags/kn.png +0 -0
- data/vendor/assets/images/flags/kp.png +0 -0
- data/vendor/assets/images/flags/kr.png +0 -0
- data/vendor/assets/images/flags/kw.png +0 -0
- data/vendor/assets/images/flags/ky.png +0 -0
- data/vendor/assets/images/flags/kz.png +0 -0
- data/vendor/assets/images/flags/la.png +0 -0
- data/vendor/assets/images/flags/lb.png +0 -0
- data/vendor/assets/images/flags/lc.png +0 -0
- data/vendor/assets/images/flags/li.png +0 -0
- data/vendor/assets/images/flags/lk.png +0 -0
- data/vendor/assets/images/flags/lr.png +0 -0
- data/vendor/assets/images/flags/ls.png +0 -0
- data/vendor/assets/images/flags/lt.png +0 -0
- data/vendor/assets/images/flags/lu.png +0 -0
- data/vendor/assets/images/flags/lv.png +0 -0
- data/vendor/assets/images/flags/ly.png +0 -0
- data/vendor/assets/images/flags/ma.png +0 -0
- data/vendor/assets/images/flags/mc.png +0 -0
- data/vendor/assets/images/flags/md.png +0 -0
- data/vendor/assets/images/flags/me.png +0 -0
- data/vendor/assets/images/flags/mg.png +0 -0
- data/vendor/assets/images/flags/mh.png +0 -0
- data/vendor/assets/images/flags/mk.png +0 -0
- data/vendor/assets/images/flags/ml.png +0 -0
- data/vendor/assets/images/flags/mm.png +0 -0
- data/vendor/assets/images/flags/mn.png +0 -0
- data/vendor/assets/images/flags/mo.png +0 -0
- data/vendor/assets/images/flags/mp.png +0 -0
- data/vendor/assets/images/flags/mq.png +0 -0
- data/vendor/assets/images/flags/mr.png +0 -0
- data/vendor/assets/images/flags/ms.png +0 -0
- data/vendor/assets/images/flags/mt.png +0 -0
- data/vendor/assets/images/flags/mu.png +0 -0
- data/vendor/assets/images/flags/mv.png +0 -0
- data/vendor/assets/images/flags/mw.png +0 -0
- data/vendor/assets/images/flags/mx.png +0 -0
- data/vendor/assets/images/flags/my.png +0 -0
- data/vendor/assets/images/flags/mz.png +0 -0
- data/vendor/assets/images/flags/na.png +0 -0
- data/vendor/assets/images/flags/nc.png +0 -0
- data/vendor/assets/images/flags/ne.png +0 -0
- data/vendor/assets/images/flags/nf.png +0 -0
- data/vendor/assets/images/flags/ng.png +0 -0
- data/vendor/assets/images/flags/ni.png +0 -0
- data/vendor/assets/images/flags/nl.png +0 -0
- data/vendor/assets/images/flags/no.png +0 -0
- data/vendor/assets/images/flags/np.png +0 -0
- data/vendor/assets/images/flags/nr.png +0 -0
- data/vendor/assets/images/flags/nu.png +0 -0
- data/vendor/assets/images/flags/nz.png +0 -0
- data/vendor/assets/images/flags/om.png +0 -0
- data/vendor/assets/images/flags/pa.png +0 -0
- data/vendor/assets/images/flags/pe.png +0 -0
- data/vendor/assets/images/flags/pf.png +0 -0
- data/vendor/assets/images/flags/pg.png +0 -0
- data/vendor/assets/images/flags/ph.png +0 -0
- data/vendor/assets/images/flags/pk.png +0 -0
- data/vendor/assets/images/flags/pl.png +0 -0
- data/vendor/assets/images/flags/pm.png +0 -0
- data/vendor/assets/images/flags/pn.png +0 -0
- data/vendor/assets/images/flags/pr.png +0 -0
- data/vendor/assets/images/flags/ps.png +0 -0
- data/vendor/assets/images/flags/pt.png +0 -0
- data/vendor/assets/images/flags/pw.png +0 -0
- data/vendor/assets/images/flags/py.png +0 -0
- data/vendor/assets/images/flags/qa.png +0 -0
- data/vendor/assets/images/flags/re.png +0 -0
- data/vendor/assets/images/flags/ro.png +0 -0
- data/vendor/assets/images/flags/rs.png +0 -0
- data/vendor/assets/images/flags/ru.png +0 -0
- data/vendor/assets/images/flags/rw.png +0 -0
- data/vendor/assets/images/flags/sa.png +0 -0
- data/vendor/assets/images/flags/sb.png +0 -0
- data/vendor/assets/images/flags/sc.png +0 -0
- data/vendor/assets/images/flags/scotland.png +0 -0
- data/vendor/assets/images/flags/sd.png +0 -0
- data/vendor/assets/images/flags/se.png +0 -0
- data/vendor/assets/images/flags/sg.png +0 -0
- data/vendor/assets/images/flags/sh.png +0 -0
- data/vendor/assets/images/flags/si.png +0 -0
- data/vendor/assets/images/flags/sj.png +0 -0
- data/vendor/assets/images/flags/sk.png +0 -0
- data/vendor/assets/images/flags/sl.png +0 -0
- data/vendor/assets/images/flags/sm.png +0 -0
- data/vendor/assets/images/flags/sn.png +0 -0
- data/vendor/assets/images/flags/so.png +0 -0
- data/vendor/assets/images/flags/sr.png +0 -0
- data/vendor/assets/images/flags/st.png +0 -0
- data/vendor/assets/images/flags/sv.png +0 -0
- data/vendor/assets/images/flags/sy.png +0 -0
- data/vendor/assets/images/flags/sz.png +0 -0
- data/vendor/assets/images/flags/tc.png +0 -0
- data/vendor/assets/images/flags/td.png +0 -0
- data/vendor/assets/images/flags/tf.png +0 -0
- data/vendor/assets/images/flags/tg.png +0 -0
- data/vendor/assets/images/flags/th.png +0 -0
- data/vendor/assets/images/flags/tj.png +0 -0
- data/vendor/assets/images/flags/tk.png +0 -0
- data/vendor/assets/images/flags/tl.png +0 -0
- data/vendor/assets/images/flags/tm.png +0 -0
- data/vendor/assets/images/flags/tn.png +0 -0
- data/vendor/assets/images/flags/to.png +0 -0
- data/vendor/assets/images/flags/tr.png +0 -0
- data/vendor/assets/images/flags/tt.png +0 -0
- data/vendor/assets/images/flags/tv.png +0 -0
- data/vendor/assets/images/flags/tw.png +0 -0
- data/vendor/assets/images/flags/tz.png +0 -0
- data/vendor/assets/images/flags/ua.png +0 -0
- data/vendor/assets/images/flags/ug.png +0 -0
- data/vendor/assets/images/flags/um.png +0 -0
- data/vendor/assets/images/flags/us.png +0 -0
- data/vendor/assets/images/flags/uy.png +0 -0
- data/vendor/assets/images/flags/uz.png +0 -0
- data/vendor/assets/images/flags/va.png +0 -0
- data/vendor/assets/images/flags/vc.png +0 -0
- data/vendor/assets/images/flags/ve.png +0 -0
- data/vendor/assets/images/flags/vg.png +0 -0
- data/vendor/assets/images/flags/vi.png +0 -0
- data/vendor/assets/images/flags/vn.png +0 -0
- data/vendor/assets/images/flags/vu.png +0 -0
- data/vendor/assets/images/flags/wales.png +0 -0
- data/vendor/assets/images/flags/wf.png +0 -0
- data/vendor/assets/images/flags/ws.png +0 -0
- data/vendor/assets/images/flags/ye.png +0 -0
- data/vendor/assets/images/flags/yt.png +0 -0
- data/vendor/assets/images/flags/za.png +0 -0
- data/vendor/assets/images/flags/zm.png +0 -0
- data/vendor/assets/images/flags/zw.png +0 -0
- data/vendor/assets/images/jquery.formalize/button.png +0 -0
- data/vendor/assets/images/jquery.formalize/select_arrow.gif +0 -0
- data/vendor/assets/javascripts/jquery.formalize.min.js +1 -0
- data/vendor/assets/javascripts/jquery.validate/additional-methods.min.js +28 -0
- data/vendor/assets/javascripts/jquery.validate/jquery.validate.min.js +51 -0
- data/vendor/assets/javascripts/jquery.validate/localization/messages_ar.js +24 -0
- data/vendor/assets/javascripts/jquery.validate/localization/messages_bg.js +23 -0
- data/vendor/assets/javascripts/jquery.validate/localization/messages_ca.js +23 -0
- data/vendor/assets/javascripts/jquery.validate/localization/messages_cn.js +23 -0
- data/vendor/assets/javascripts/jquery.validate/localization/messages_cs.js +23 -0
- data/vendor/assets/javascripts/jquery.validate/localization/messages_da.js +20 -0
- data/vendor/assets/javascripts/jquery.validate/localization/messages_de.js +21 -0
- data/vendor/assets/javascripts/jquery.validate/localization/messages_el.js +24 -0
- data/vendor/assets/javascripts/jquery.validate/localization/messages_es.js +23 -0
- data/vendor/assets/javascripts/jquery.validate/localization/messages_fa.js +23 -0
- data/vendor/assets/javascripts/jquery.validate/localization/messages_fi.js +21 -0
- data/vendor/assets/javascripts/jquery.validate/localization/messages_fr.js +23 -0
- data/vendor/assets/javascripts/jquery.validate/localization/messages_ge.js +23 -0
- data/vendor/assets/javascripts/jquery.validate/localization/messages_he.js +23 -0
- data/vendor/assets/javascripts/jquery.validate/localization/messages_hu.js +21 -0
- data/vendor/assets/javascripts/jquery.validate/localization/messages_it.js +23 -0
- data/vendor/assets/javascripts/jquery.validate/localization/messages_ja.js +23 -0
- data/vendor/assets/javascripts/jquery.validate/localization/messages_kk.js +23 -0
- data/vendor/assets/javascripts/jquery.validate/localization/messages_lt.js +23 -0
- data/vendor/assets/javascripts/jquery.validate/localization/messages_lv.js +23 -0
- data/vendor/assets/javascripts/jquery.validate/localization/messages_nl.js +23 -0
- data/vendor/assets/javascripts/jquery.validate/localization/messages_no.js +23 -0
- data/vendor/assets/javascripts/jquery.validate/localization/messages_pl.js +23 -0
- data/vendor/assets/javascripts/jquery.validate/localization/messages_ptbr.js +30 -0
- data/vendor/assets/javascripts/jquery.validate/localization/messages_ptpt.js +23 -0
- data/vendor/assets/javascripts/jquery.validate/localization/messages_ro.js +23 -0
- data/vendor/assets/javascripts/jquery.validate/localization/messages_ru.js +23 -0
- data/vendor/assets/javascripts/jquery.validate/localization/messages_se.js +23 -0
- data/vendor/assets/javascripts/jquery.validate/localization/messages_si.js +23 -0
- data/vendor/assets/javascripts/jquery.validate/localization/messages_sk.js +21 -0
- data/vendor/assets/javascripts/jquery.validate/localization/messages_sr.js +23 -0
- data/vendor/assets/javascripts/jquery.validate/localization/messages_th.js +23 -0
- data/vendor/assets/javascripts/jquery.validate/localization/messages_tr.js +24 -0
- data/vendor/assets/javascripts/jquery.validate/localization/messages_tw.js +24 -0
- data/vendor/assets/javascripts/jquery.validate/localization/messages_ua.js +24 -0
- data/vendor/assets/javascripts/jquery.validate/localization/messages_vi.js +23 -0
- data/vendor/assets/javascripts/jquery.validate/localization/methods_de.js +12 -0
- data/vendor/assets/javascripts/jquery.validate/localization/methods_nl.js +9 -0
- data/vendor/assets/javascripts/jquery.validate/localization/methods_pt.js +9 -0
- data/vendor/assets/stylesheets/jquery.formalize.css.erb +364 -0
- metadata +557 -0
@@ -0,0 +1,166 @@
|
|
1
|
+
module Spree
|
2
|
+
# This is somewhat contrary to standard REST convention since there is not
|
3
|
+
# actually a Checkout object. There's enough distinct logic specific to
|
4
|
+
# checkout which has nothing to do with updating an order that this approach
|
5
|
+
# is waranted.
|
6
|
+
class CheckoutController < Spree::StoreController
|
7
|
+
ssl_required
|
8
|
+
|
9
|
+
before_filter :load_order
|
10
|
+
|
11
|
+
before_filter :ensure_order_not_completed
|
12
|
+
before_filter :ensure_checkout_allowed
|
13
|
+
before_filter :ensure_sufficient_stock_lines
|
14
|
+
before_filter :ensure_valid_state
|
15
|
+
|
16
|
+
before_filter :associate_user
|
17
|
+
before_filter :check_authorization
|
18
|
+
|
19
|
+
helper 'spree/orders'
|
20
|
+
|
21
|
+
rescue_from Spree::Core::GatewayError, :with => :rescue_from_spree_gateway_error
|
22
|
+
|
23
|
+
# Updates the order and advances to the next state (when possible.)
|
24
|
+
def update
|
25
|
+
if @order.update_attributes(object_params)
|
26
|
+
fire_event('spree.checkout.update')
|
27
|
+
return if after_update_attributes
|
28
|
+
|
29
|
+
unless @order.next
|
30
|
+
flash[:error] = Spree.t(:payment_processing_failed)
|
31
|
+
redirect_to checkout_state_path(@order.state) and return
|
32
|
+
end
|
33
|
+
|
34
|
+
if @order.completed?
|
35
|
+
session[:order_id] = nil
|
36
|
+
flash.notice = Spree.t(:order_processed_successfully)
|
37
|
+
flash[:commerce_tracking] = "nothing special"
|
38
|
+
redirect_to completion_route
|
39
|
+
else
|
40
|
+
redirect_to checkout_state_path(@order.state)
|
41
|
+
end
|
42
|
+
else
|
43
|
+
render :edit
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
private
|
48
|
+
def ensure_valid_state
|
49
|
+
unless skip_state_validation?
|
50
|
+
if (params[:state] && !@order.has_checkout_step?(params[:state])) ||
|
51
|
+
(!params[:state] && !@order.has_checkout_step?(@order.state))
|
52
|
+
@order.state = 'cart'
|
53
|
+
redirect_to checkout_state_path(@order.checkout_steps.first)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
# Should be overriden if you have areas of your checkout that don't match
|
59
|
+
# up to a step within checkout_steps, such as a registration step
|
60
|
+
def skip_state_validation?
|
61
|
+
false
|
62
|
+
end
|
63
|
+
|
64
|
+
def load_order
|
65
|
+
@order = current_order
|
66
|
+
redirect_to spree.cart_path and return unless @order
|
67
|
+
|
68
|
+
if params[:state]
|
69
|
+
redirect_to checkout_state_path(@order.state) if @order.can_go_to_state?(params[:state]) && !skip_state_validation?
|
70
|
+
@order.state = params[:state]
|
71
|
+
end
|
72
|
+
setup_for_current_state
|
73
|
+
end
|
74
|
+
|
75
|
+
def ensure_checkout_allowed
|
76
|
+
unless @order.checkout_allowed?
|
77
|
+
redirect_to spree.cart_path
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
def ensure_order_not_completed
|
82
|
+
redirect_to spree.cart_path if @order.completed?
|
83
|
+
end
|
84
|
+
|
85
|
+
def ensure_sufficient_stock_lines
|
86
|
+
if @order.insufficient_stock_lines.present?
|
87
|
+
flash[:error] = Spree.t(:inventory_error_flash_for_insufficient_quantity)
|
88
|
+
redirect_to spree.cart_path
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
# Provides a route to redirect after order completion
|
93
|
+
def completion_route
|
94
|
+
spree.order_path(@order)
|
95
|
+
end
|
96
|
+
|
97
|
+
# For payment step, filter order parameters to produce the expected nested
|
98
|
+
# attributes for a single payment and its source, discarding attributes
|
99
|
+
# for payment methods other than the one selected
|
100
|
+
def object_params
|
101
|
+
# respond_to check is necessary due to issue described in #2910
|
102
|
+
if @order.has_checkout_step?("payment") && @order.payment?
|
103
|
+
if params[:payment_source].present?
|
104
|
+
source_params = params.delete(:payment_source)[params[:order][:payments_attributes].first[:payment_method_id].underscore]
|
105
|
+
|
106
|
+
if source_params
|
107
|
+
params[:order][:payments_attributes].first[:source_attributes] = source_params
|
108
|
+
end
|
109
|
+
end
|
110
|
+
|
111
|
+
if (params[:order][:payments_attributes])
|
112
|
+
params[:order][:payments_attributes].first[:amount] = @order.total
|
113
|
+
end
|
114
|
+
end
|
115
|
+
params[:order]
|
116
|
+
end
|
117
|
+
|
118
|
+
def setup_for_current_state
|
119
|
+
method_name = :"before_#{@order.state}"
|
120
|
+
send(method_name) if respond_to?(method_name, true)
|
121
|
+
end
|
122
|
+
|
123
|
+
def before_address
|
124
|
+
@order.bill_address ||= Address.default
|
125
|
+
@order.ship_address ||= Address.default
|
126
|
+
end
|
127
|
+
|
128
|
+
def before_delivery
|
129
|
+
return if params[:order].present?
|
130
|
+
|
131
|
+
@order.create_proposed_shipments
|
132
|
+
|
133
|
+
packages = @order.shipments.map { |s| s.to_package }
|
134
|
+
@differentiator = Spree::Stock::Differentiator.new(@order, packages)
|
135
|
+
end
|
136
|
+
|
137
|
+
def before_payment
|
138
|
+
packages = @order.shipments.map { |s| s.to_package }
|
139
|
+
@differentiator = Spree::Stock::Differentiator.new(@order, packages)
|
140
|
+
@differentiator.missing.each do |variant, quantity|
|
141
|
+
@order.contents.remove(variant, quantity)
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
def rescue_from_spree_gateway_error
|
146
|
+
flash[:error] = Spree.t(:spree_gateway_error_flash_for_checkout)
|
147
|
+
render :edit
|
148
|
+
end
|
149
|
+
|
150
|
+
def check_authorization
|
151
|
+
authorize!(:edit, current_order, session[:access_token])
|
152
|
+
end
|
153
|
+
|
154
|
+
def after_update_attributes
|
155
|
+
coupon_result = Spree::Promo::CouponApplicator.new(@order).apply
|
156
|
+
if coupon_result[:coupon_applied?]
|
157
|
+
flash[:success] = coupon_result[:success] if coupon_result[:success].present?
|
158
|
+
return false
|
159
|
+
else
|
160
|
+
flash[:error] = coupon_result[:error]
|
161
|
+
respond_with(@order) { |format| format.html { render :edit } }
|
162
|
+
return true
|
163
|
+
end
|
164
|
+
end
|
165
|
+
end
|
166
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module Spree
|
2
|
+
class ContentController < Spree::StoreController
|
3
|
+
# Don't serve local files or static assets
|
4
|
+
before_filter { render_404 if params[:path] =~ /(\.|\\)/ }
|
5
|
+
after_filter :fire_visited_path, :only => :show
|
6
|
+
after_filter :fire_visited_action, :except => :show
|
7
|
+
|
8
|
+
rescue_from ActionView::MissingTemplate, :with => :render_404
|
9
|
+
caches_page :show, :index, :if => Proc.new { Spree::Config[:cache_static_content] }
|
10
|
+
|
11
|
+
respond_to :html
|
12
|
+
|
13
|
+
def show
|
14
|
+
render :action => params[:path]
|
15
|
+
end
|
16
|
+
|
17
|
+
def cvv
|
18
|
+
render :layout => false
|
19
|
+
end
|
20
|
+
|
21
|
+
def fire_visited_path
|
22
|
+
fire_event('spree.content.visited', :path => "content/#{params[:path]}")
|
23
|
+
end
|
24
|
+
|
25
|
+
def fire_visited_action
|
26
|
+
fire_event('spree.content.visited', :path => "content/#{params[:action]}")
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Spree
|
2
|
+
class HomeController < Spree::StoreController
|
3
|
+
helper 'spree/products'
|
4
|
+
respond_to :html
|
5
|
+
|
6
|
+
def index
|
7
|
+
@searcher = Spree::Config.searcher_class.new(params)
|
8
|
+
@searcher.current_user = try_spree_current_user
|
9
|
+
@searcher.current_currency = current_currency
|
10
|
+
@products = @searcher.retrieve_products
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Spree
|
2
|
+
class LocaleController < Spree::StoreController
|
3
|
+
def set
|
4
|
+
if request.referer && request.referer.starts_with?('http://' + request.host)
|
5
|
+
session['user_return_to'] = request.referer
|
6
|
+
end
|
7
|
+
if params[:locale] && I18n.available_locales.map(&:to_s).include?(params[:locale])
|
8
|
+
session[:locale] = I18n.locale = params[:locale]
|
9
|
+
flash.notice = Spree.t(:locale_changed)
|
10
|
+
else
|
11
|
+
flash[:error] = Spree.t(:locale_not_changed)
|
12
|
+
end
|
13
|
+
redirect_back_or_default(spree.root_path)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,100 @@
|
|
1
|
+
module Spree
|
2
|
+
class OrdersController < Spree::StoreController
|
3
|
+
ssl_required :show
|
4
|
+
|
5
|
+
before_filter :check_authorization
|
6
|
+
rescue_from ActiveRecord::RecordNotFound, :with => :render_404
|
7
|
+
helper 'spree/products', 'spree/orders'
|
8
|
+
|
9
|
+
respond_to :html
|
10
|
+
|
11
|
+
def show
|
12
|
+
@order = Order.find_by_number!(params[:id])
|
13
|
+
end
|
14
|
+
|
15
|
+
def update
|
16
|
+
@order = current_order
|
17
|
+
unless @order
|
18
|
+
flash[:error] = Spree.t(:order_not_found)
|
19
|
+
redirect_to root_path and return
|
20
|
+
end
|
21
|
+
|
22
|
+
if @order.update_attributes(params[:order])
|
23
|
+
return if after_update_attributes
|
24
|
+
@order.line_items = @order.line_items.select {|li| li.quantity > 0 }
|
25
|
+
fire_event('spree.order.contents_changed')
|
26
|
+
respond_with(@order) do |format|
|
27
|
+
format.html do
|
28
|
+
if params.has_key?(:checkout)
|
29
|
+
@order.next_transition.run_callbacks if @order.cart?
|
30
|
+
redirect_to checkout_state_path(@order.checkout_steps.first)
|
31
|
+
else
|
32
|
+
redirect_to cart_path
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
else
|
37
|
+
respond_with(@order)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
|
42
|
+
# Shows the current incomplete order from the session
|
43
|
+
def edit
|
44
|
+
@order = current_order(true)
|
45
|
+
associate_user
|
46
|
+
end
|
47
|
+
|
48
|
+
# Adds a new item to the order (creating a new order if none already exists)
|
49
|
+
def populate
|
50
|
+
populator = Spree::OrderPopulator.new(current_order(true), current_currency)
|
51
|
+
if populator.populate(params.slice(:products, :variants, :quantity))
|
52
|
+
fire_event('spree.cart.add')
|
53
|
+
fire_event('spree.order.contents_changed')
|
54
|
+
respond_with(@order) do |format|
|
55
|
+
format.html { redirect_to cart_path }
|
56
|
+
end
|
57
|
+
else
|
58
|
+
flash[:error] = populator.errors.full_messages.join(" ")
|
59
|
+
redirect_to :back
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
def empty
|
64
|
+
if @order = current_order
|
65
|
+
@order.empty!
|
66
|
+
end
|
67
|
+
|
68
|
+
redirect_to spree.cart_path
|
69
|
+
end
|
70
|
+
|
71
|
+
def accurate_title
|
72
|
+
@order && @order.completed? ? "#{Spree.t(:order)} #{@order.number}" : Spree.t(:shopping_cart)
|
73
|
+
end
|
74
|
+
|
75
|
+
def check_authorization
|
76
|
+
session[:access_token] ||= params[:token]
|
77
|
+
order = Spree::Order.find_by_number(params[:id]) || current_order
|
78
|
+
|
79
|
+
if order
|
80
|
+
authorize! :edit, order, session[:access_token]
|
81
|
+
else
|
82
|
+
authorize! :create, Spree::Order
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
private
|
87
|
+
|
88
|
+
def after_update_attributes
|
89
|
+
coupon_result = Spree::Promo::CouponApplicator.new(@order).apply
|
90
|
+
if coupon_result[:coupon_applied?]
|
91
|
+
flash[:success] = coupon_result[:success] if coupon_result[:success].present?
|
92
|
+
return false
|
93
|
+
else
|
94
|
+
flash[:error] = coupon_result[:error]
|
95
|
+
respond_with(@order) { |format| format.html { render :edit } }
|
96
|
+
return true
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
module Spree
|
2
|
+
class ProductsController < Spree::StoreController
|
3
|
+
before_filter :load_product, :only => :show
|
4
|
+
rescue_from ActiveRecord::RecordNotFound, :with => :render_404
|
5
|
+
helper 'spree/taxons'
|
6
|
+
|
7
|
+
respond_to :html
|
8
|
+
|
9
|
+
def index
|
10
|
+
@searcher = Config.searcher_class.new(params)
|
11
|
+
@searcher.current_user = try_spree_current_user
|
12
|
+
@searcher.current_currency = current_currency
|
13
|
+
@products = @searcher.retrieve_products
|
14
|
+
end
|
15
|
+
|
16
|
+
def show
|
17
|
+
return unless @product
|
18
|
+
|
19
|
+
@variants = @product.variants_including_master.active(current_currency).includes([:option_values, :images])
|
20
|
+
@product_properties = @product.product_properties.includes(:property)
|
21
|
+
|
22
|
+
referer = request.env['HTTP_REFERER']
|
23
|
+
if referer
|
24
|
+
begin
|
25
|
+
referer_path = URI.parse(request.env['HTTP_REFERER']).path
|
26
|
+
# Fix for #2249
|
27
|
+
rescue URI::InvalidURIError
|
28
|
+
# Do nothing
|
29
|
+
else
|
30
|
+
if referer_path && referer_path.match(/\/t\/(.*)/)
|
31
|
+
@taxon = Taxon.find_by_permalink($1)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
private
|
38
|
+
def accurate_title
|
39
|
+
@product ? @product.name : super
|
40
|
+
end
|
41
|
+
|
42
|
+
def load_product
|
43
|
+
if try_spree_current_user.try(:has_spree_role?, "admin")
|
44
|
+
@product = Product.find_by_permalink!(params[:id])
|
45
|
+
else
|
46
|
+
@product = Product.active(current_currency).find_by_permalink!(params[:id])
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
module Spree
|
2
|
+
class StoreController < Spree::BaseController
|
3
|
+
include Spree::Core::ControllerHelpers::Order
|
4
|
+
|
5
|
+
def unauthorized
|
6
|
+
render 'spree/shared/unauthorized', :layout => Spree::Config[:layout], :status => 401
|
7
|
+
end
|
8
|
+
|
9
|
+
protected
|
10
|
+
# This method is placed here so that the CheckoutController
|
11
|
+
# and OrdersController can both reference it.
|
12
|
+
def apply_coupon_code
|
13
|
+
if @order.coupon_code.present?
|
14
|
+
# check if coupon code is already applied
|
15
|
+
if @order.adjustments.promotion.eligible.detect { |p| p.originator.promotion.code == @order.coupon_code }.present?
|
16
|
+
flash[:notice] = Spree.t(:coupon_code_already_applied)
|
17
|
+
true
|
18
|
+
else
|
19
|
+
event_name = "spree.checkout.coupon_code_added"
|
20
|
+
promotion = Spree::Promotion.where("event_name = ? AND lower(code) = ?", event_name, @order.coupon_code).first
|
21
|
+
|
22
|
+
if promotion.present?
|
23
|
+
if promotion.expired?
|
24
|
+
flash[:error] = Spree.t(:coupon_code_expired)
|
25
|
+
return false
|
26
|
+
end
|
27
|
+
|
28
|
+
if promotion.usage_limit_exceeded?
|
29
|
+
flash[:error] = Spree.t(:coupon_code_max_usage)
|
30
|
+
return false
|
31
|
+
end
|
32
|
+
|
33
|
+
eligible_promos = @order.adjustments.promotion.eligible
|
34
|
+
|
35
|
+
previous_promo = eligible_promos.first
|
36
|
+
fire_event(event_name, :coupon_code => @order.coupon_code)
|
37
|
+
promo = eligible_promos.detect { |p| p.originator.promotion.code == @order.coupon_code }
|
38
|
+
ineligible_promos = @order.adjustments.promotion.where(:eligible => false)
|
39
|
+
ineligible_promo = ineligible_promos.detect { |p| p.originator.promotion.code == @order.coupon_code }
|
40
|
+
|
41
|
+
if promo.present? and promo.eligible?
|
42
|
+
flash[:success] = Spree.t(:coupon_code_applied)
|
43
|
+
true
|
44
|
+
elsif previous_promo.present?
|
45
|
+
flash[:error] = Spree.t(:coupon_code_better_exists)
|
46
|
+
false
|
47
|
+
elsif ineligible_promo.present?
|
48
|
+
flash[:error] = Spree.t(:coupon_code_not_eligible)
|
49
|
+
false
|
50
|
+
else
|
51
|
+
# if the promotion was created after the order
|
52
|
+
flash[:error] = Spree.t(:coupon_code_not_found)
|
53
|
+
false
|
54
|
+
end
|
55
|
+
else
|
56
|
+
flash[:error] = Spree.t(:coupon_code_not_found)
|
57
|
+
false
|
58
|
+
end
|
59
|
+
end
|
60
|
+
else
|
61
|
+
true
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
def config_locale
|
66
|
+
Spree::Frontend::Config[:locale]
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|