forgeos_commerce 1.9.0
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +339 -0
- data/COPYING.LESSER +165 -0
- data/Gemfile +2 -0
- data/LICENSE +2 -0
- data/MIT-LICENSE +20 -0
- data/README.textile +27 -0
- data/app/assets/images/forgeos/admin/favicon.gif +0 -0
- data/app/assets/images/forgeos/jstree/themes/association_product/bubble-quantity-products.png +0 -0
- data/app/assets/images/forgeos/jstree/themes/association_product/check-checked.png +0 -0
- data/app/assets/images/forgeos/jstree/themes/association_product/check-unchecked.png +0 -0
- data/app/assets/images/forgeos/jstree/themes/association_product/context.gif +0 -0
- data/app/assets/images/forgeos/jstree/themes/association_product/create.png +0 -0
- data/app/assets/images/forgeos/jstree/themes/association_product/dark-blue-minus.png +0 -0
- data/app/assets/images/forgeos/jstree/themes/association_product/dark-blue-plus.png +0 -0
- data/app/assets/images/forgeos/jstree/themes/association_product/dot.gif +0 -0
- data/app/assets/images/forgeos/jstree/themes/association_product/f.png +0 -0
- data/app/assets/images/forgeos/jstree/themes/association_product/fminus.gif +0 -0
- data/app/assets/images/forgeos/jstree/themes/association_product/fminus_rtl.gif +0 -0
- data/app/assets/images/forgeos/jstree/themes/association_product/folder.png +0 -0
- data/app/assets/images/forgeos/jstree/themes/association_product/fplus.gif +0 -0
- data/app/assets/images/forgeos/jstree/themes/association_product/fplus_rtl.gif +0 -0
- data/app/assets/images/forgeos/jstree/themes/association_product/lastli.gif +0 -0
- data/app/assets/images/forgeos/jstree/themes/association_product/lastli_rtl.gif +0 -0
- data/app/assets/images/forgeos/jstree/themes/association_product/li.gif +0 -0
- data/app/assets/images/forgeos/jstree/themes/association_product/remove.png +0 -0
- data/app/assets/images/forgeos/jstree/themes/association_product/rename.png +0 -0
- data/app/assets/images/forgeos/jstree/themes/association_product/throbber.gif +0 -0
- data/app/assets/images/forgeos/jstree/themes/product-types/bubble-quantity-products.png +0 -0
- data/app/assets/images/forgeos/jstree/themes/product-types/check-checked.png +0 -0
- data/app/assets/images/forgeos/jstree/themes/product-types/check-unchecked.png +0 -0
- data/app/assets/images/forgeos/jstree/themes/product-types/context.gif +0 -0
- data/app/assets/images/forgeos/jstree/themes/product-types/create.png +0 -0
- data/app/assets/images/forgeos/jstree/themes/product-types/dark-blue-minus.png +0 -0
- data/app/assets/images/forgeos/jstree/themes/product-types/dark-blue-plus.png +0 -0
- data/app/assets/images/forgeos/jstree/themes/product-types/dot.gif +0 -0
- data/app/assets/images/forgeos/jstree/themes/product-types/drag-drop.png +0 -0
- data/app/assets/images/forgeos/jstree/themes/product-types/f.png +0 -0
- data/app/assets/images/forgeos/jstree/themes/product-types/fminus.gif +0 -0
- data/app/assets/images/forgeos/jstree/themes/product-types/fminus_rtl.gif +0 -0
- data/app/assets/images/forgeos/jstree/themes/product-types/folder.png +0 -0
- data/app/assets/images/forgeos/jstree/themes/product-types/fplus.gif +0 -0
- data/app/assets/images/forgeos/jstree/themes/product-types/fplus_rtl.gif +0 -0
- data/app/assets/images/forgeos/jstree/themes/product-types/grey-drag-drop.png +0 -0
- data/app/assets/images/forgeos/jstree/themes/product-types/lastli.gif +0 -0
- data/app/assets/images/forgeos/jstree/themes/product-types/lastli_rtl.gif +0 -0
- data/app/assets/images/forgeos/jstree/themes/product-types/li.gif +0 -0
- data/app/assets/images/forgeos/jstree/themes/product-types/remove.png +0 -0
- data/app/assets/images/forgeos/jstree/themes/product-types/rename.png +0 -0
- data/app/assets/images/forgeos/jstree/themes/product-types/throbber.gif +0 -0
- data/app/assets/images/forgeos/jstree/themes/product_category/brown-minus.png +0 -0
- data/app/assets/images/forgeos/jstree/themes/product_category/brown-plus.png +0 -0
- data/app/assets/images/forgeos/jstree/themes/product_category/bubble-quantity-products.png +0 -0
- data/app/assets/images/forgeos/jstree/themes/product_category/context.gif +0 -0
- data/app/assets/images/forgeos/jstree/themes/product_category/create.png +0 -0
- data/app/assets/images/forgeos/jstree/themes/product_category/dot.gif +0 -0
- data/app/assets/images/forgeos/jstree/themes/product_category/f.png +0 -0
- data/app/assets/images/forgeos/jstree/themes/product_category/fminus.gif +0 -0
- data/app/assets/images/forgeos/jstree/themes/product_category/fminus_rtl.gif +0 -0
- data/app/assets/images/forgeos/jstree/themes/product_category/fplus.gif +0 -0
- data/app/assets/images/forgeos/jstree/themes/product_category/fplus_rtl.gif +0 -0
- data/app/assets/images/forgeos/jstree/themes/product_category/lastli.gif +0 -0
- data/app/assets/images/forgeos/jstree/themes/product_category/lastli_rtl.gif +0 -0
- data/app/assets/images/forgeos/jstree/themes/product_category/li.gif +0 -0
- data/app/assets/images/forgeos/jstree/themes/product_category/remove.png +0 -0
- data/app/assets/images/forgeos/jstree/themes/product_category/rename.png +0 -0
- data/app/assets/images/forgeos/jstree/themes/product_category/throbber.gif +0 -0
- data/app/assets/images/forgeos/jstree/themes/zone-tree/bubble-quantity-products.png +0 -0
- data/app/assets/images/forgeos/jstree/themes/zone-tree/check-checked.png +0 -0
- data/app/assets/images/forgeos/jstree/themes/zone-tree/check-unchecked.png +0 -0
- data/app/assets/images/forgeos/jstree/themes/zone-tree/context.gif +0 -0
- data/app/assets/images/forgeos/jstree/themes/zone-tree/create.png +0 -0
- data/app/assets/images/forgeos/jstree/themes/zone-tree/dark-blue-minus.png +0 -0
- data/app/assets/images/forgeos/jstree/themes/zone-tree/dark-blue-plus.png +0 -0
- data/app/assets/images/forgeos/jstree/themes/zone-tree/dot.gif +0 -0
- data/app/assets/images/forgeos/jstree/themes/zone-tree/f.png +0 -0
- data/app/assets/images/forgeos/jstree/themes/zone-tree/fminus.gif +0 -0
- data/app/assets/images/forgeos/jstree/themes/zone-tree/fminus_rtl.gif +0 -0
- data/app/assets/images/forgeos/jstree/themes/zone-tree/folder.png +0 -0
- data/app/assets/images/forgeos/jstree/themes/zone-tree/fplus.gif +0 -0
- data/app/assets/images/forgeos/jstree/themes/zone-tree/fplus_rtl.gif +0 -0
- data/app/assets/images/forgeos/jstree/themes/zone-tree/lastli.gif +0 -0
- data/app/assets/images/forgeos/jstree/themes/zone-tree/lastli_rtl.gif +0 -0
- data/app/assets/images/forgeos/jstree/themes/zone-tree/li.gif +0 -0
- data/app/assets/images/forgeos/jstree/themes/zone-tree/remove.png +0 -0
- data/app/assets/images/forgeos/jstree/themes/zone-tree/rename.png +0 -0
- data/app/assets/images/forgeos/jstree/themes/zone-tree/throbber.gif +0 -0
- data/app/assets/javascripts/forgeos/admin/functions.js +3 -0
- data/app/assets/javascripts/forgeos/admin/functions/forgeos_commerce/all.js +1 -0
- data/app/assets/javascripts/forgeos/admin/functions/forgeos_commerce/attributes.js +18 -0
- data/app/assets/javascripts/forgeos/admin/functions/forgeos_commerce/cross-sellings.js +18 -0
- data/app/assets/javascripts/forgeos/admin/functions/forgeos_commerce/orders.js +88 -0
- data/app/assets/javascripts/forgeos/admin/functions/forgeos_commerce/products.js +46 -0
- data/app/assets/javascripts/forgeos/admin/functions/forgeos_commerce/rules.js +98 -0
- data/app/assets/javascripts/forgeos/admin/functions/forgeos_commerce/transporters.js +60 -0
- data/app/assets/javascripts/forgeos/admin/functions/forgeos_commerce/trees.js +35 -0
- data/app/assets/javascripts/forgeos/admin/functions/forgeos_commerce/uploads.js +10 -0
- data/app/assets/javascripts/forgeos/admin/inits.js +3 -0
- data/app/assets/javascripts/forgeos/admin/inits/forgeos_commerce/all.js +1 -0
- data/app/assets/javascripts/forgeos/admin/inits/forgeos_commerce/clicks.js +25 -0
- data/app/assets/javascripts/forgeos/admin/inits/forgeos_commerce/cross-sellings.js +69 -0
- data/app/assets/javascripts/forgeos/admin/inits/forgeos_commerce/customer.js +64 -0
- data/app/assets/javascripts/forgeos/admin/inits/forgeos_commerce/orders.js +83 -0
- data/app/assets/javascripts/forgeos/admin/inits/forgeos_commerce/overlays.js +45 -0
- data/app/assets/javascripts/forgeos/admin/inits/forgeos_commerce/products.js +103 -0
- data/app/assets/javascripts/forgeos/admin/inits/forgeos_commerce/settings.js +15 -0
- data/app/assets/javascripts/forgeos/admin/inits/forgeos_commerce/special-offers.js +23 -0
- data/app/assets/javascripts/forgeos/admin/inits/forgeos_commerce/trees.js +71 -0
- data/app/assets/stylesheets/forgeos/admin/base.css.sass +3 -0
- data/app/assets/stylesheets/forgeos/admin/forgeos_commerce/_all.css.sass +9 -0
- data/app/assets/stylesheets/forgeos/admin/forgeos_commerce/_attributes.css.sass +59 -0
- data/app/assets/stylesheets/forgeos/admin/forgeos_commerce/_customer.css.sass +84 -0
- data/app/assets/stylesheets/forgeos/admin/forgeos_commerce/_delivery.css.sass +81 -0
- data/app/assets/stylesheets/forgeos/admin/forgeos_commerce/_dropdowns.css.sass +171 -0
- data/app/assets/stylesheets/forgeos/admin/forgeos_commerce/_order.css.sass +208 -0
- data/app/assets/stylesheets/forgeos/admin/forgeos_commerce/_payment.css.sass +34 -0
- data/app/assets/stylesheets/forgeos/admin/forgeos_commerce/_products.css.sass +341 -0
- data/app/assets/stylesheets/forgeos/admin/forgeos_commerce/_special_offers.css.sass +198 -0
- data/app/assets/stylesheets/forgeos/admin/forgeos_commerce/_transporters.css.sass +5 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/association_product/style.css.sass +50 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/product-types/style.css.sass +129 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/product_category/style.css.sass +109 -0
- data/app/assets/stylesheets/forgeos/jstree/themes/zone-tree/style.css.sass +103 -0
- data/app/controllers/addresses_controller.rb +51 -0
- data/app/controllers/admin/attributes_controller.rb +161 -0
- data/app/controllers/admin/base_controller.rb +5 -0
- data/app/controllers/admin/brands_controller.rb +119 -0
- data/app/controllers/admin/forms_controller.rb +66 -0
- data/app/controllers/admin/geo_zones_controller.rb +74 -0
- data/app/controllers/admin/import_controller.rb +50 -0
- data/app/controllers/admin/orders_controller.rb +248 -0
- data/app/controllers/admin/product_types_controller.rb +122 -0
- data/app/controllers/admin/products_controller.rb +204 -0
- data/app/controllers/admin/special_offers_controller.rb +236 -0
- data/app/controllers/admin/statistics_controller.rb +64 -0
- data/app/controllers/admin/transporter_rules_controller.rb +307 -0
- data/app/controllers/admin/users_controller.rb +100 -0
- data/app/controllers/admin/vouchers_controller.rb +207 -0
- data/app/controllers/application_controller.rb +75 -0
- data/app/controllers/order_controller.rb +229 -0
- data/app/helpers/admin/payment_fields_helper.rb +31 -0
- data/app/helpers/application_helper.rb +7 -0
- data/app/helpers/cart_helper.rb +40 -0
- data/app/helpers/category_helper.rb +36 -0
- data/app/helpers/product_helper.rb +118 -0
- data/app/helpers/routes_helper.rb +60 -0
- data/app/helpers/wishlist_helper.rb +142 -0
- data/app/models/address_delivery.rb +2 -0
- data/app/models/address_invoice.rb +2 -0
- data/app/models/attribute.rb +38 -0
- data/app/models/attribute_category.rb +3 -0
- data/app/models/attribute_value.rb +10 -0
- data/app/models/brand.rb +22 -0
- data/app/models/brand_category.rb +3 -0
- data/app/models/cart.rb +190 -0
- data/app/models/cart_item.rb +21 -0
- data/app/models/checkbox_attribute.rb +2 -0
- data/app/models/country.rb +4 -0
- data/app/models/cross_sellings_product.rb +4 -0
- data/app/models/currencies_exchanges_rate.rb +2 -0
- data/app/models/currency.rb +13 -0
- data/app/models/date_attribute.rb +2 -0
- data/app/models/dynamic_attribute.rb +6 -0
- data/app/models/dynamic_attribute_value.rb +5 -0
- data/app/models/form.rb +7 -0
- data/app/models/form_attribute.rb +3 -0
- data/app/models/geo_zone.rb +6 -0
- data/app/models/longtext_attribute.rb +2 -0
- data/app/models/number_attribute.rb +2 -0
- data/app/models/order.rb +483 -0
- data/app/models/order_detail.rb +129 -0
- data/app/models/order_shipping.rb +25 -0
- data/app/models/pack.rb +9 -0
- data/app/models/picklist_attribute.rb +2 -0
- data/app/models/product.rb +294 -0
- data/app/models/product_attribute.rb +4 -0
- data/app/models/product_category.rb +9 -0
- data/app/models/product_link.rb +9 -0
- data/app/models/product_price_variation.rb +3 -0
- data/app/models/product_sold_counter.rb +2 -0
- data/app/models/product_sweeper.rb +30 -0
- data/app/models/product_type.rb +27 -0
- data/app/models/product_type_category.rb +3 -0
- data/app/models/product_viewed_counter.rb +2 -0
- data/app/models/products_wishlist.rb +25 -0
- data/app/models/radio_attribute.rb +2 -0
- data/app/models/radiobutton_attribute.rb +2 -0
- data/app/models/setting.rb +46 -0
- data/app/models/size.rb +5 -0
- data/app/models/special_offer_category.rb +3 -0
- data/app/models/special_offer_rule.rb +21 -0
- data/app/models/text_attribute.rb +2 -0
- data/app/models/text_field_attribute.rb +2 -0
- data/app/models/transporter_category.rb +3 -0
- data/app/models/transporter_rule.rb +3 -0
- data/app/models/url_attribute.rb +2 -0
- data/app/models/user.rb +45 -0
- data/app/models/user_address.rb +6 -0
- data/app/models/voucher_category.rb +3 -0
- data/app/models/voucher_rule.rb +3 -0
- data/app/models/wishlist.rb +134 -0
- data/app/views/admin/addresses/_form.html.haml +42 -0
- data/app/views/admin/attributes/_categories.html.haml +7 -0
- data/app/views/admin/attributes/_choice.html.haml +24 -0
- data/app/views/admin/attributes/_date.html.haml +5 -0
- data/app/views/admin/attributes/_form.html.haml +36 -0
- data/app/views/admin/attributes/_longtext.html.haml +5 -0
- data/app/views/admin/attributes/_number.html.haml +5 -0
- data/app/views/admin/attributes/_tabs.html.haml +6 -0
- data/app/views/admin/attributes/_text.html.haml +5 -0
- data/app/views/admin/attributes/_url.html.haml +5 -0
- data/app/views/admin/attributes/destroy.js.erb +1 -0
- data/app/views/admin/attributes/edit.html.haml +2 -0
- data/app/views/admin/attributes/index.html.haml +33 -0
- data/app/views/admin/attributes/index.json.erb +24 -0
- data/app/views/admin/attributes/new.html.haml +2 -0
- data/app/views/admin/attributes/show.html.haml +51 -0
- data/app/views/admin/brands/_form.html.haml +29 -0
- data/app/views/admin/brands/_tabs.html.haml +6 -0
- data/app/views/admin/brands/destroy.js.erb +1 -0
- data/app/views/admin/brands/edit.html.haml +2 -0
- data/app/views/admin/brands/index.html.haml +15 -0
- data/app/views/admin/brands/index.json.erb +23 -0
- data/app/views/admin/brands/new.html.haml +2 -0
- data/app/views/admin/dashboard/index.html.haml +230 -0
- data/app/views/admin/forms/_form.html.haml +38 -0
- data/app/views/admin/forms/_tabs.html.haml +6 -0
- data/app/views/admin/forms/destroy.js.erb +1 -0
- data/app/views/admin/forms/edit.html.haml +2 -0
- data/app/views/admin/forms/index.html.haml +11 -0
- data/app/views/admin/forms/index.json.erb +20 -0
- data/app/views/admin/forms/new.html.haml +2 -0
- data/app/views/admin/geo_zones/_form.html.haml +20 -0
- data/app/views/admin/geo_zones/_list.html.haml +9 -0
- data/app/views/admin/geo_zones/edit.html.haml +3 -0
- data/app/views/admin/geo_zones/index.html.haml +49 -0
- data/app/views/admin/geo_zones/new.html.haml +3 -0
- data/app/views/admin/geo_zones/show.html.haml +4 -0
- data/app/views/admin/import/create_product.html.haml +2 -0
- data/app/views/admin/menus/_types_popups.html.haml +22 -0
- data/app/views/admin/orders/_address_form.html.haml +29 -0
- data/app/views/admin/orders/_form.html.haml +198 -0
- data/app/views/admin/orders/_list.html.haml +29 -0
- data/app/views/admin/orders/_products_popup.html.haml +15 -0
- data/app/views/admin/orders/create.html.haml +1 -0
- data/app/views/admin/orders/destroy.js.erb +1 -0
- data/app/views/admin/orders/edit.html.haml +1 -0
- data/app/views/admin/orders/index.html.haml +24 -0
- data/app/views/admin/orders/index.json.erb +48 -0
- data/app/views/admin/orders/show.html.haml +130 -0
- data/app/views/admin/product_types/_form.html.haml +46 -0
- data/app/views/admin/product_types/_list.html.haml +6 -0
- data/app/views/admin/product_types/_options_categories.html.haml +19 -0
- data/app/views/admin/product_types/_tabs.html.haml +6 -0
- data/app/views/admin/product_types/destroy.js.erb +1 -0
- data/app/views/admin/product_types/edit.html.haml +3 -0
- data/app/views/admin/product_types/index.html.haml +14 -0
- data/app/views/admin/product_types/index.json.erb +24 -0
- data/app/views/admin/product_types/new.html.haml +3 -0
- data/app/views/admin/product_types/show.html.haml +23 -0
- data/app/views/admin/products/_attributes.html.haml +37 -0
- data/app/views/admin/products/_cross_popup.html.haml +56 -0
- data/app/views/admin/products/_cross_sell_tr.html.haml +13 -0
- data/app/views/admin/products/_cross_sells.html.haml +1 -0
- data/app/views/admin/products/_form.html.haml +26 -0
- data/app/views/admin/products/_general.html.haml +153 -0
- data/app/views/admin/products/_list.html.haml +18 -0
- data/app/views/admin/products/_prices.html.haml +17 -0
- data/app/views/admin/products/_products_popup.html.haml +41 -0
- data/app/views/admin/products/_seo.html.haml +75 -0
- data/app/views/admin/products/_shippings.html.haml +0 -0
- data/app/views/admin/products/_sizes.html.haml +23 -0
- data/app/views/admin/products/_tabs.html.haml +2 -0
- data/app/views/admin/products/activate.js.erb +1 -0
- data/app/views/admin/products/destroy.js.erb +1 -0
- data/app/views/admin/products/edit.html.haml +1 -0
- data/app/views/admin/products/index.html.haml +20 -0
- data/app/views/admin/products/index.json.erb +65 -0
- data/app/views/admin/products/new.html.haml +1 -0
- data/app/views/admin/products/show.html.haml +158 -0
- data/app/views/admin/settings/_colissimo.html.haml +7 -0
- data/app/views/admin/settings/_godfather.html.haml +11 -0
- data/app/views/admin/settings/_google_shopping.html.haml +5 -0
- data/app/views/admin/settings/_payment.html.haml +63 -0
- data/app/views/admin/settings/_tabs.html.haml +5 -0
- data/app/views/admin/settings/edit.html.haml +33 -0
- data/app/views/admin/special_offers/_form.html.haml +88 -0
- data/app/views/admin/special_offers/_patterns.html.haml +151 -0
- data/app/views/admin/special_offers/_tabs.html.haml +5 -0
- data/app/views/admin/special_offers/_top_links.html.haml +6 -0
- data/app/views/admin/special_offers/activate.js.erb +1 -0
- data/app/views/admin/special_offers/destroy.js.erb +1 -0
- data/app/views/admin/special_offers/edit.html.haml +4 -0
- data/app/views/admin/special_offers/index.html.haml +15 -0
- data/app/views/admin/special_offers/index.json.erb +28 -0
- data/app/views/admin/special_offers/new.html.haml +2 -0
- data/app/views/admin/special_offers/show.html.haml +28 -0
- data/app/views/admin/special_offers/special_offer.html.haml +166 -0
- data/app/views/admin/statistics/index.html.haml +158 -0
- data/app/views/admin/transporter_rules/_delivery_rules.html.haml +83 -0
- data/app/views/admin/transporter_rules/_form.html.haml +90 -0
- data/app/views/admin/transporter_rules/_left_sidebar.html.haml +9 -0
- data/app/views/admin/transporter_rules/_sidebar.html.haml +10 -0
- data/app/views/admin/transporter_rules/_tabs.html.haml +8 -0
- data/app/views/admin/transporter_rules/activate.js.erb +1 -0
- data/app/views/admin/transporter_rules/destroy.js.erb +1 -0
- data/app/views/admin/transporter_rules/edit.html.haml +1 -0
- data/app/views/admin/transporter_rules/index.html.haml +13 -0
- data/app/views/admin/transporter_rules/index.json.erb +30 -0
- data/app/views/admin/transporter_rules/new.html.haml +1 -0
- data/app/views/admin/transporter_rules/show.html.haml +30 -0
- data/app/views/admin/users/_fields_for_addresses_deliveries.html.haml +38 -0
- data/app/views/admin/users/_fields_for_addresses_invoices.html.haml +34 -0
- data/app/views/admin/users/_form.html.haml +88 -0
- data/app/views/admin/users/edit.json.erb +35 -0
- data/app/views/admin/users/index.html.haml +12 -0
- data/app/views/admin/users/index.json.erb +32 -0
- data/app/views/admin/users/index2.html.haml +33 -0
- data/app/views/admin/users/show.html.haml +72 -0
- data/app/views/admin/vouchers/_form.html.haml +92 -0
- data/app/views/admin/vouchers/_tabs.html.haml +3 -0
- data/app/views/admin/vouchers/activate.js.erb +1 -0
- data/app/views/admin/vouchers/destroy.js.erb +1 -0
- data/app/views/admin/vouchers/index.html.haml +15 -0
- data/app/views/admin/vouchers/index.json.erb +28 -0
- data/app/views/admin/vouchers/new.html.haml +2 -0
- data/config/locales/activerecord/en.yml +6 -0
- data/config/locales/activerecord/fr.yml +18 -0
- data/config/locales/admin/address/en.yml +3 -0
- data/config/locales/admin/address/fr.yml +3 -0
- data/config/locales/admin/attribute/en.yml +76 -0
- data/config/locales/admin/attribute/fr.yml +75 -0
- data/config/locales/admin/brands/en.yml +24 -0
- data/config/locales/admin/brands/fr.yml +27 -0
- data/config/locales/admin/dashboard/en.yml +6 -0
- data/config/locales/admin/dashboard/fr.yml +6 -0
- data/config/locales/admin/order/en.yml +54 -0
- data/config/locales/admin/order/fr.yml +54 -0
- data/config/locales/admin/product/en.yml +105 -0
- data/config/locales/admin/product/fr.yml +106 -0
- data/config/locales/admin/settings/en.yml +90 -0
- data/config/locales/admin/settings/fr.yml +87 -0
- data/config/locales/admin/special_offer/en.yml +59 -0
- data/config/locales/admin/special_offer/fr.yml +60 -0
- data/config/locales/admin/transporter/en.yml +36 -0
- data/config/locales/admin/transporter/fr.yml +36 -0
- data/config/locales/admin/voucher/en.yml +3 -0
- data/config/locales/admin/voucher/fr.yml +3 -0
- data/config/locales/admin/wishlist/en.yml +89 -0
- data/config/locales/admin/wishlist/fr.yml +89 -0
- data/config/locales/common/en.yml +424 -0
- data/config/locales/common/fr.yml +422 -0
- data/config/routes.rb +109 -0
- data/config/search.example.yml +8 -0
- data/db/fixtures/currencies.yml +10 -0
- data/db/fixtures/currencies_exchanges_rates.yml +9 -0
- data/db/fixtures/page_translations.yml +11 -0
- data/db/fixtures/pages.yml +5 -0
- data/db/fixtures/people.yml +11 -0
- data/db/fixtures/product_type_translations.yml +11 -0
- data/db/fixtures/product_types.yml +2 -0
- data/db/migrate/20091009134433_create_attribute_values.rb +15 -0
- data/db/migrate/20091009134440_create_attribute_values_products.rb +14 -0
- data/db/migrate/20091009134448_create_attributes.rb +17 -0
- data/db/migrate/20091009134455_create_attributes_product_types.rb +14 -0
- data/db/migrate/20091009134525_create_carts.rb +15 -0
- data/db/migrate/20091009134532_create_cart_items.rb +14 -0
- data/db/migrate/20091009134609_create_cross_sellings_products.rb +11 -0
- data/db/migrate/20091009134616_create_currencies.rb +15 -0
- data/db/migrate/20091009134624_create_currencies_exchanges_rates.rb +13 -0
- data/db/migrate/20091009134631_create_dynamic_attribute_values.rb +17 -0
- data/db/migrate/20091009134659_create_order_details.rb +24 -0
- data/db/migrate/20091009134706_create_order_shippings.rb +16 -0
- data/db/migrate/20091009134714_create_orders.rb +21 -0
- data/db/migrate/20091009134721_create_packs_products.rb +13 -0
- data/db/migrate/20091009134805_create_product_types.rb +11 -0
- data/db/migrate/20091009134813_create_products.rb +37 -0
- data/db/migrate/20091009134821_create_products_wishlists.rb +13 -0
- data/db/migrate/20091009134947_create_wishlists.rb +12 -0
- data/db/migrate/20100323143123_create_geo_zones_transporter_rules.rb +12 -0
- data/db/migrate/20100414090950_create_brands.rb +15 -0
- data/db/migrate/20100414091706_create_sizes.rb +15 -0
- data/db/migrate/20100928123009_add_patronage_to_people.rb +20 -0
- data/db/migrate/20101007074306_create_product_price_variations.rb +13 -0
- data/db/migrate/20110311111210_create_forms.rb +13 -0
- data/db/migrate/20110311112646_attributes_forms.rb +13 -0
- data/db/migrate/20110322165950_add_payment_methods_to_settings.rb +13 -0
- data/db/migrate/20110405084454_add_colissimo_methods_to_settings.rb +13 -0
- data/db/migrate/20110516075553_add_google_infos_to_settings.rb +11 -0
- data/db/migrate/20110831164213_add_order_fields_to_addresses.rb +9 -0
- data/lib/CMCIC_Config.rb +16 -0
- data/lib/CMCIC_Tpe.rb +227 -0
- data/lib/forgeos/commerce.rb +9 -0
- data/lib/forgeos/commerce/admin_menu.rb +28 -0
- data/lib/forgeos/commerce/engine.rb +11 -0
- data/lib/forgeos/commerce/float.rb +10 -0
- data/lib/forgeos/commerce/statistics.rb +62 -0
- data/lib/forgeos/commerce/version.rb +5 -0
- data/lib/forgeos_commerce.rb +1 -0
- data/lib/special_offer.rb +61 -0
- data/lib/tasks/install.rake +9 -0
- data/lib/transporter.rb +26 -0
- data/lib/voucher.rb +41 -0
- data/recipes/deploy.rb +15 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/assets/javascripts/application.js +9 -0
- data/test/dummy/app/assets/stylesheets/application.css +7 -0
- data/test/dummy/app/controllers/application_controller.rb +3 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +42 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +27 -0
- data/test/dummy/config/environments/production.rb +51 -0
- data/test/dummy/config/environments/test.rb +39 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/inflections.rb +10 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +58 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +26 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/forgeos_commerce_test.rb +7 -0
- data/test/test_helper.rb +10 -0
- metadata +539 -0
@@ -0,0 +1,24 @@
|
|
1
|
+
.attribute-type
|
2
|
+
%span{ :class => ['small-icons', attribute.class.to_s.underscore] }=t label
|
3
|
+
.choices
|
4
|
+
%h2=t 'attribute.value', :count => 2
|
5
|
+
%ul.nested_sortable.sortable-choices.grid_10.omega.alpha
|
6
|
+
= form.fields_for :attribute_values do |attribute_value|
|
7
|
+
%li.block-container
|
8
|
+
%span.block-type
|
9
|
+
%span.handler
|
10
|
+
%span.inner
|
11
|
+
%span.block-image
|
12
|
+
- link_id = "item_#{attribute_value.object.id}"
|
13
|
+
- carousel_image = image_tag attribute_value.object.pictures.first ? attribute_value.object.pictures.first.public_filename(:thumb) : 'forgeos/admin/no-image_50x50.png', :id => "#{link_id}_image"
|
14
|
+
= carousel_image
|
15
|
+
= attribute_value.hidden_field "picture_ids"
|
16
|
+
= link_to('', '#', :class => 'big-icons edit change-picture', :id => "change_picture_#{link_id}")
|
17
|
+
%span.block-name
|
18
|
+
= attribute_value.text_field :value
|
19
|
+
= attribute_value.hidden_field :id
|
20
|
+
= attribute_value.hidden_field :_destroy, :class => 'delete'
|
21
|
+
= attribute_value.hidden_field :position
|
22
|
+
%span.small-icons.red-delete-icon
|
23
|
+
%span.small-icons.green-add-icon
|
24
|
+
.clear
|
@@ -0,0 +1,36 @@
|
|
1
|
+
= form_for [forgeos_commerce, :admin , attribute], :html => { :id => 'wrap', "data-object_name" => attribute.class.model_name.singular } do |f|
|
2
|
+
.backgrounds.big-header
|
3
|
+
= f.text_field :name, :class => 'field_name'
|
4
|
+
= Forgeos_save_buttons [forgeos_commerce, :admin, :attributes]
|
5
|
+
#content.grid_16.alpha.omega
|
6
|
+
.grid_12.alpha
|
7
|
+
.inner-content
|
8
|
+
- case attribute.class.to_s
|
9
|
+
- when 'CheckboxAttribute'
|
10
|
+
= render :partial => 'choice', :locals => { :attribute => attribute, :form => f, :label => 'checkbox_attribute.field' }
|
11
|
+
- when 'PicklistAttribute'
|
12
|
+
= render :partial => 'choice', :locals => { :attribute => attribute, :form => f, :label => 'picklist_attribute.field' }
|
13
|
+
- when 'RadiobuttonAttribute'
|
14
|
+
= render :partial => 'choice', :locals => { :attribute => attribute, :form => f, :label => 'radiobutton_attribute.field' }
|
15
|
+
- when 'TextAttribute'
|
16
|
+
= render :partial => 'text', :locals => { :attribute => attribute, :form => f }
|
17
|
+
- when 'LongtextAttribute'
|
18
|
+
= render :partial => 'longtext', :locals => { :attribute => attribute, :form => f }
|
19
|
+
- when 'DateAttribute'
|
20
|
+
= render :partial => 'date', :locals => { :attribute => attribute, :form => f }
|
21
|
+
- when 'UrlAttribute'
|
22
|
+
= render :partial => 'url', :locals => { :attribute => attribute, :form => f }
|
23
|
+
- when 'NumberAttribute'
|
24
|
+
= render :partial => 'number', :locals => { :attribute => attribute, :form => f }
|
25
|
+
- unless attribute.kind_of?(DynamicAttribute)
|
26
|
+
%a{:href =>"#", :class => "small-icons add-link choice"}
|
27
|
+
= I18n.t('attribute.value.new')
|
28
|
+
#right-sidebar.grid_4.omega
|
29
|
+
- unless attribute.new_record?
|
30
|
+
.step
|
31
|
+
= link_to I18n.t('attribute.duplicate.action').capitalize, [forgeos_commerce, :duplicate, :admin, attribute], :class => 'small-icons duplicate'
|
32
|
+
= link_to I18n.t('attribute.destroy.action').capitalize, [forgeos_commerce, :admin, attribute], :confirm => I18n.t('attribute.destroy.confirm').capitalize, :method => :delete, :class => 'small-icons delete'
|
33
|
+
.step
|
34
|
+
= I18n.t('attribute.access_method')
|
35
|
+
= f.text_field :access_method, :class => 'field'
|
36
|
+
= render :partial => 'attachments_popups'
|
@@ -0,0 +1,6 @@
|
|
1
|
+
%ul.ui-tabs-nav.ui-helper-reset.ui-helper-clearfix.ui-widget-header.ui-corner-all
|
2
|
+
%li.ui-state-default.ui-corner-top= link_to I18n.t('product_type', :count => 2).capitalize, [forgeos_commerce, :admin, :product_types]
|
3
|
+
%li.ui-state-default.ui-corner-top= link_to I18n.t('brand.other').capitalize, [forgeos_commerce, :admin, :brands]
|
4
|
+
%li.ui-state-default.ui-corner-top.ui-tabs-selected.ui-state-active= link_to I18n.t('attribute', :count => 2).capitalize, '#content'
|
5
|
+
%li.ui-state-default.ui-corner-top= link_to I18n.t('graphic_template', :count => 2).capitalize, ''
|
6
|
+
%li.ui-state-default.ui-corner-top= link_to "Formulaires", [forgeos_commerce, :admin, :forms]
|
@@ -0,0 +1 @@
|
|
1
|
+
removedataTablesRow('#<%= polymorphic_html_id @attribute, 'destroy' -%>');
|
@@ -0,0 +1,33 @@
|
|
1
|
+
= render :partial => 'tabs'
|
2
|
+
= render :partial => 'admin/sidebars/left_sidebar', :locals => { :icon_class => 'attributes', :sidebar_title => 'attribute.all', :tree_id =>'attribute-tree' }
|
3
|
+
#content.grid_12.alpha.omega
|
4
|
+
.backgrounds.header
|
5
|
+
%span.backgrounds.action-button.attribute-text-action.select_choice
|
6
|
+
%span.big-icons.create-text-attribute
|
7
|
+
= I18n.t('attribute.create.text').capitalize
|
8
|
+
%span.small-icons.arrow
|
9
|
+
%span.choices_list
|
10
|
+
- %w(text longtext url number date).each do |type|
|
11
|
+
%span.widget-item
|
12
|
+
- attribute = "#{type}_attribute"
|
13
|
+
= link_to [forgeos_commerce, :new, :admin, attribute] do
|
14
|
+
%span{ :class => "small-icons #{attribute}"}= t(attribute, :count => 1)
|
15
|
+
|
16
|
+
%span.backgrounds.action-button.attribute-choice-action.select_choice
|
17
|
+
%span.big-icons.create-choice-attribute
|
18
|
+
= I18n.t('attribute.create.choice').capitalize
|
19
|
+
%span.small-icons.arrow
|
20
|
+
%span.choices_list
|
21
|
+
- %w(picklist checkbox radiobutton).each do |type|
|
22
|
+
%span.widget-item
|
23
|
+
- attribute = "#{type}_attribute"
|
24
|
+
= link_to [forgeos_commerce, :new, :admin, attribute] do
|
25
|
+
%span{ :class => "small-icons #{attribute}"}= t(attribute, :count => 1)
|
26
|
+
|
27
|
+
#search.right
|
28
|
+
= link_to content_tag(:span, I18n.t('search').capitalize, :class => 'small-icons search-span'), '#', :class =>'small-icons left search-link'
|
29
|
+
.backgrounds.search-form
|
30
|
+
.content-background
|
31
|
+
%table#table.datatable.draggable_rows
|
32
|
+
|
33
|
+
= dataTables_tag :url => forgeos_commerce.admin_attributes_path(:format => :json), :columns => ["{'bSearchable':false}","{'sTitle':'#{I18n.t :name}'}","{'sTitle':\"#{I18n.t 'attribute.access_method'}\"}","{'sClass':'actions-td','bSearchable':false,'bSortable':false}"]
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<%
|
2
|
+
output = {
|
3
|
+
:sEcho => params[:sEcho],
|
4
|
+
:iTotalRecords => @attributes.total_entries || 0,
|
5
|
+
:iTotalDisplayRecords => @attributes.size,
|
6
|
+
:aaData => @attributes.map do |attribute|
|
7
|
+
[
|
8
|
+
content_tag(:div, content_tag(:div, '', :class=>'handler') + content_tag(:div, '', :class=> "small-icons #{attribute.class.to_s.underscore}"), :id => polymorphic_html_id(attribute), :class => 'handler_container'),
|
9
|
+
content_tag(:div, link_to(attribute.name, [forgeos_commerce, :edit, :admin, attribute]), :class => 'product-name'),
|
10
|
+
attribute.access_method,
|
11
|
+
link_to('', [forgeos_commerce, :duplicate, :admin, attribute], :class => 'small-icons duplicate-link') +
|
12
|
+
link_to('', [forgeos_commerce, :edit, :admin, attribute], :class => 'small-icons edit-link') +
|
13
|
+
link_to('', [forgeos_commerce, :admin, attribute],
|
14
|
+
:remote => true,
|
15
|
+
:method => :delete,
|
16
|
+
:confirm => I18n.t('attribute.destroy.confirm').capitalize,
|
17
|
+
:class => 'small-icons destroy-link',
|
18
|
+
:id => polymorphic_html_id(attribute, 'destroy')
|
19
|
+
)
|
20
|
+
]
|
21
|
+
end
|
22
|
+
}
|
23
|
+
-%>
|
24
|
+
<%= raw output.to_json -%>
|
@@ -0,0 +1,51 @@
|
|
1
|
+
= render :partial => 'tabs'
|
2
|
+
#wrap
|
3
|
+
.backgrounds.big-header
|
4
|
+
%h1= @attribute.name
|
5
|
+
.interact-links
|
6
|
+
= link_to I18n.t('attribute.update.action').capitalize, [forgeos_commerce, :edit, :admin, @attribute ], :class => 'backgrounds interact-button'
|
7
|
+
= I18n.t('or')
|
8
|
+
= link_to I18n.t('attribute.back').capitalize, [forgeos_core, :admin, :attributes], :class => 'back-link'
|
9
|
+
#content.grid_16.alpha.omega
|
10
|
+
.grid_12.alpha
|
11
|
+
.inner-content
|
12
|
+
- attribute_type = @attribute.class.to_s
|
13
|
+
.attribute-type
|
14
|
+
%span.small-icons{:class => attribute_type.underscore}= I18n.t "#{attribute_type.underscore}.field"
|
15
|
+
- unless @attribute.dynamic?
|
16
|
+
.choices
|
17
|
+
%h2= I18n.t 'attribute.value', :count => 2
|
18
|
+
%ul.sortable.sortable-choices.grid_10.omega.alpha
|
19
|
+
- @attribute.attribute_values.each do |attribute_value|
|
20
|
+
%li.block-container
|
21
|
+
%span.block-name
|
22
|
+
= attribute_value.name
|
23
|
+
.clear
|
24
|
+
- else
|
25
|
+
.attribute-preview
|
26
|
+
%h2= I18n.t "#{attribute_type.underscore}.preview"
|
27
|
+
- case attribute_type
|
28
|
+
- when 'TextAttribute'
|
29
|
+
= text_field_tag ''
|
30
|
+
|
31
|
+
- when 'LongtextAttribute'
|
32
|
+
= text_area_tag '', '', :rows => 20, :cols => 70, :class => 'mceEditor'
|
33
|
+
|
34
|
+
- when 'DateAttribute'
|
35
|
+
= text_field_tag :date_attribute_preview
|
36
|
+
|
37
|
+
- when 'UrlAttribute'
|
38
|
+
= text_field_tag :url_attribute_preview
|
39
|
+
|
40
|
+
- when 'NumberAttribute'
|
41
|
+
= text_field_tag :number_attribute_preview
|
42
|
+
|
43
|
+
#right-sidebar.grid_4.omega
|
44
|
+
- unless @attribute.new_record?
|
45
|
+
.step
|
46
|
+
= link_to I18n.t('attribute.duplicate.action'), [forgeos_commerce, :duplicate, :admin, @attribute], :class => 'small-icons duplicate'
|
47
|
+
= link_to I18n.t('attribute.destroy.action').capitalize, [forgeos_commerce, :admin, @attribute], :confirm => I18n.t('attribute.destroy.confirm').capitalize, :method => :delete, :class => 'small-icons delete'
|
48
|
+
.step
|
49
|
+
= I18n.t('attribute.access_method')
|
50
|
+
\:
|
51
|
+
= @attribute.access_method
|
@@ -0,0 +1,29 @@
|
|
1
|
+
= form_for [forgeos_commerce, :admin , brand], :html => { :id => 'wrap', "data-object_name" => brand.class.model_name.singular } do |f|
|
2
|
+
.backgrounds.big-header
|
3
|
+
= f.text_field :name, :class => 'field_name'
|
4
|
+
= Forgeos_save_buttons [forgeos_commerce, :admin, :brands]
|
5
|
+
#content.grid_16.alpha.omega
|
6
|
+
.grid_12.omega
|
7
|
+
= display_visual(f.object_name, brand.picture)
|
8
|
+
%br
|
9
|
+
= f.label :description
|
10
|
+
= f.text_area :description, :class => 'mceEditor'
|
11
|
+
|
12
|
+
#right-sidebar.grid_4.omega
|
13
|
+
.step
|
14
|
+
= f.label :code
|
15
|
+
= f.text_field :code, :size => 25
|
16
|
+
%br
|
17
|
+
- if respond_to?(:brand_url)
|
18
|
+
= brand_url(Brand.new(:url => '', :name => ''))
|
19
|
+
- else
|
20
|
+
\/brands/
|
21
|
+
= f.text_field :url, :size => 10
|
22
|
+
.step.open
|
23
|
+
= link_to(t('product.associated_collection', :count => 2), '#', :class => 'small-icons step-title')
|
24
|
+
= hidden_field_tag "#{f.object_name}[category_ids][]"
|
25
|
+
#association-brand-tree.inner-step
|
26
|
+
%ul
|
27
|
+
= render :partial => 'admin/categories/associated_elements', :locals => { :association_id => 'category_ids', :element => f.object, :category_ids => f.object.category_ids, :categories => BrandCategory.roots }
|
28
|
+
|
29
|
+
= render :partial => 'attachments_popups'
|
@@ -0,0 +1,6 @@
|
|
1
|
+
%ul.ui-tabs-nav.ui-helper-reset.ui-helper-clearfix.ui-widget-header.ui-corner-all
|
2
|
+
%li.ui-state-default.ui-corner-top= link_to I18n.t('product_type', :count => 2).capitalize, [forgeos_commerce, :admin, :product_types]
|
3
|
+
%li.ui-state-default.ui-corner-top.ui-tabs-selected.ui-state-active= link_to I18n.t('brand.other').capitalize,'#content'
|
4
|
+
%li.ui-state-default.ui-corner-top= link_to I18n.t('attribute', :count => 2).capitalize, [forgeos_commerce, :admin, :attributes]
|
5
|
+
%li.ui-state-default.ui-corner-top= link_to I18n.t('graphic_template', :count => 2).capitalize, ''
|
6
|
+
%li.ui-state-default.ui-corner-top= link_to "Formulaires", [forgeos_commerce, :admin, :forms]
|
@@ -0,0 +1 @@
|
|
1
|
+
removedataTablesRow('#<%= polymorphic_html_id @brand, 'destroy' -%>');
|
@@ -0,0 +1,15 @@
|
|
1
|
+
= render :partial => 'tabs'
|
2
|
+
= render :partial => 'admin/sidebars/left_sidebar', :locals => { :icon_class => 'brands', :sidebar_title => 'brand.all', :tree_id =>'brand-tree' }
|
3
|
+
|
4
|
+
#content.grid_12.alpha.omega
|
5
|
+
.backgrounds.header
|
6
|
+
= link_to content_tag(:span,I18n.t('brand.create.action').capitalize, :class=>'big-icons create-brand'), [forgeos_commerce, :new, :admin, :brand], :class=>'backgrounds action-button'
|
7
|
+
#search.right
|
8
|
+
= link_to content_tag(:span, I18n.t('search').capitalize, :class => 'small-icons search-span'), '#', :class => 'small-icons left search-link'
|
9
|
+
.backgrounds.search-form
|
10
|
+
.content-background
|
11
|
+
%table#table.datatable.draggable_rows
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
= dataTables_tag :url => forgeos_commerce.admin_brands_path(:format => :json), :columns => ["{'bSearchable':false,'bSortable':false}","{'sTitle':'#{I18n.t :name}'}", "{'sClass':'actions-td','bSearchable':false,'bSortable':false}"]
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<%
|
2
|
+
output = {
|
3
|
+
:sEcho => params[:sEcho],
|
4
|
+
:iTotalRecords => @brands.total_entries || 0,
|
5
|
+
:iTotalDisplayRecords => @brands.size,
|
6
|
+
:aaData => @brands.collect do |brand|
|
7
|
+
[
|
8
|
+
content_tag(:div, content_tag(:div, '', :class=>'handler') + content_tag(:div, '', :class => 'small-icons brands'), :id => polymorphic_html_id(brand), :class => 'handler_container'),
|
9
|
+
content_tag(:div, link_to(brand.name, [forgeos_commerce, :edit, :admin, brand]), :class => 'brand-name'),
|
10
|
+
link_to('', [forgeos_commerce, :edit, :admin, brand], :class => 'small-icons edit-link') +
|
11
|
+
link_to('', [forgeos_commerce, :admin, brand],
|
12
|
+
:remote => true,
|
13
|
+
:method => :delete,
|
14
|
+
:confirm => I18n.t('brand.destroy.confirm').capitalize,
|
15
|
+
:class => 'small-icons destroy-link',
|
16
|
+
:id => polymorphic_html_id(brand, 'destroy')
|
17
|
+
)
|
18
|
+
]
|
19
|
+
end
|
20
|
+
}
|
21
|
+
-%>
|
22
|
+
|
23
|
+
<%= raw output.to_json -%>
|
@@ -0,0 +1,230 @@
|
|
1
|
+
:ruby
|
2
|
+
currency = current_currency.code.upcase
|
3
|
+
total_for_today = Forgeos::Commerce::Statistics.total_of_sales(Date.current).to_f
|
4
|
+
total_for_yesterday = Forgeos::Commerce::Statistics.total_of_sales(Date.current.yesterday).to_f
|
5
|
+
total_for_week = Forgeos::Commerce::Statistics.total_of_sales(Date.current.ago(1.week)..Date.current).to_f
|
6
|
+
total_for_last_week = Forgeos::Commerce::Statistics.total_of_sales(Date.current.ago(2.week)..Date.current.ago(1.week)).to_f
|
7
|
+
week_diff = total_for_week.diff(total_for_last_week)
|
8
|
+
total_for_month = Forgeos::Commerce::Statistics.total_of_sales(Date.current.ago(1.month)..Date.current).to_f
|
9
|
+
total_for_last_month = Forgeos::Commerce::Statistics.total_of_sales(Date.current.ago(2.month)..Date.current.ago(1.month)).to_f
|
10
|
+
month_diff = total_for_month.diff(total_for_last_month)
|
11
|
+
lifetime_sales = Forgeos::Commerce::Statistics.total_of_sales.to_f
|
12
|
+
online_users = User.where{{ :updated_at.gt => (Time.now - 10.minutes) }}.count
|
13
|
+
today_users = User.count(:conditions => { :updated_at => Date.current.beginning_of_day..Date.current.end_of_day })
|
14
|
+
online_visitors = Forgeos::Statistics.total_of_visitors(Date.current)
|
15
|
+
out_of_stock_products = Product.where{{ :deleted => false, :active => true, :stock.lt => 5 }}.count
|
16
|
+
pages_viewed_today = Forgeos::Cms::Statistics.total_of_pages(Date.current)
|
17
|
+
products_sales_today = Forgeos::Commerce::Statistics.total_of_sold_products(Date.current)
|
18
|
+
|
19
|
+
|
20
|
+
#dashboard.grid_16.alpha.omega
|
21
|
+
.left-dashboard.grid_12.alpha.omega
|
22
|
+
.padding-wrap
|
23
|
+
%p.summary
|
24
|
+
= raw t('dashboard.intro', :visitors => online_visitors, :customers => today_users, :pages => pages_viewed_today, :products => products_sales_today, :total => price_with_currency(total_for_today.to_i))
|
25
|
+
- if out_of_stock_products > 0
|
26
|
+
= raw t('dashboard.out_of_stock', :products => out_of_stock_products)
|
27
|
+
.quick-actions
|
28
|
+
= link_to [forgeos_cms, :new, :admin, :page], :class => 'quick-action-button' do
|
29
|
+
%span.big-icons.create-page
|
30
|
+
= t('page.create.action').capitalize
|
31
|
+
= link_to [forgeos_commerce, :new, :admin, :product], :class => 'quick-action-button' do
|
32
|
+
%span.big-icons.create-product
|
33
|
+
= t('product.create.action').capitalize
|
34
|
+
= link_to [forgeos_commerce, :new, :admin, :special_offer], :class => 'quick-action-button' do
|
35
|
+
%span.big-icons.create-offer
|
36
|
+
= t('special_offer.create.action').capitalize
|
37
|
+
= link_to [forgeos_core, :admin, :statistics], :class => 'quick-action-button' do
|
38
|
+
%span.small-icons.see-stats
|
39
|
+
= t('statistic.show.all').capitalize
|
40
|
+
.clear
|
41
|
+
|
42
|
+
- pending_orders = Order.all(:order => 'created_at DESC', :conditions => { :status => %w(unpaid accepted)})
|
43
|
+
- lastest_orders_count = 5
|
44
|
+
- lastest_orders = Order.all(:order => 'created_at DESC', :limit => lastest_orders_count)
|
45
|
+
%h2.small-icons.orders
|
46
|
+
= t('order', :count => 2).capitalize
|
47
|
+
#to-tab.ui-tabs.ui-widget.ui-widget-content.ui-corner-all
|
48
|
+
%ul.ui-tabs-nav.ui-helper-reset.ui-helper-clearfix.ui-widget-header.ui-corner-all
|
49
|
+
%li.ui-state-default.ui-corner-top.ui-tabs-selected.ui-state-active
|
50
|
+
%a{ :href => "#last-orders" }
|
51
|
+
= t('order.lastest', :count => lastest_orders_count).capitalize
|
52
|
+
%li.ui-state-default.ui-corner-top
|
53
|
+
%a{ :href => "#pending-orders" }
|
54
|
+
= pending_orders.size
|
55
|
+
= t('order.pendings', :count => pending_orders.size).capitalize
|
56
|
+
#last-orders.ui-tabs-panel.ui-widget-content.ui-corner-bottom
|
57
|
+
%table
|
58
|
+
%tbody
|
59
|
+
- lastest_orders.each do |order|
|
60
|
+
%tr{ :class => cycle('','even')}
|
61
|
+
%td.table-price= price_with_currency order.total
|
62
|
+
%td.table-product
|
63
|
+
= order.order_details.count
|
64
|
+
= t(:product, :count => order.order_details.count).capitalize
|
65
|
+
%td{ :class => "table-state #{order.status}"}
|
66
|
+
= t(order.status, :scope => [:order,:status]).capitalize
|
67
|
+
%td.table-customer
|
68
|
+
=h order.user.fullname if order.user
|
69
|
+
%td.table-time
|
70
|
+
= t(:ago, :time => time_ago_in_words(order.created_at))
|
71
|
+
= link_to t('order.show.all').capitalize, [forgeos_commerce, :admin, :orders], :class => 'see-all-orders'
|
72
|
+
#pending-orders.ui-tabs-panel.ui-widget-content.ui-corner-bottom.ui-tabs-hide
|
73
|
+
%table
|
74
|
+
%tbody
|
75
|
+
- pending_orders.each do |order|
|
76
|
+
%tr{ :class => cycle('','even')}
|
77
|
+
%td.table-price= price_with_currency order.total
|
78
|
+
%td.table-product
|
79
|
+
= order.order_details.count
|
80
|
+
= t(:product, :count => order.order_details.count).capitalize
|
81
|
+
%td{ :class => "table-state #{order.status}"}
|
82
|
+
= t(order.status, :scope => [:order,:status]).capitalize
|
83
|
+
%td.table-customer
|
84
|
+
=h order.user.fullname if order.user
|
85
|
+
%td.table-time
|
86
|
+
= t(:ago, :time => time_ago_in_words(order.created_at))
|
87
|
+
= link_to t('order.show.all').capitalize, [forgeos_commerce, :admin, :orders], :class => 'see-all-orders'
|
88
|
+
|
89
|
+
/
|
90
|
+
%h2.small-icons.activity
|
91
|
+
Latest activity
|
92
|
+
.latest-activity
|
93
|
+
%table
|
94
|
+
%tbody
|
95
|
+
%tr
|
96
|
+
%td.table-product
|
97
|
+
%span.big-icons.create-page
|
98
|
+
Page "About us" created
|
99
|
+
%td
|
100
|
+
by Quentin Tousart
|
101
|
+
%td
|
102
|
+
2 hours before
|
103
|
+
%tr.even
|
104
|
+
%td
|
105
|
+
%span.big-icons.create-page
|
106
|
+
Page "About us" created
|
107
|
+
%td
|
108
|
+
by Quentin Tousart
|
109
|
+
%td
|
110
|
+
2 hours before
|
111
|
+
%tr
|
112
|
+
%td
|
113
|
+
%span.big-icons.create-page
|
114
|
+
Page "About us" created
|
115
|
+
%td
|
116
|
+
by Quentin Tousart
|
117
|
+
%td
|
118
|
+
2 hours before
|
119
|
+
%tr.even
|
120
|
+
%td
|
121
|
+
%span.big-icons.create-product
|
122
|
+
Page "About us" created
|
123
|
+
%td
|
124
|
+
by Quentin Tousart
|
125
|
+
%td
|
126
|
+
2 hours before
|
127
|
+
%tr
|
128
|
+
%td
|
129
|
+
%span.big-icons.create-page
|
130
|
+
Page "About us" created
|
131
|
+
%td
|
132
|
+
by Quentin Tousart
|
133
|
+
%td
|
134
|
+
2 hours before
|
135
|
+
.right-dahsboard.grid_4
|
136
|
+
%h2.small-icons.sales
|
137
|
+
= t(:sale, :count => 2).capitalize
|
138
|
+
.sales-info-block
|
139
|
+
.today-sales.first-block
|
140
|
+
%span.left
|
141
|
+
= t('sale.day.current').capitalize
|
142
|
+
%span.right
|
143
|
+
= total_for_today.floor
|
144
|
+
%sup
|
145
|
+
- decimal = total_for_today.decimal
|
146
|
+
= "#{t(:separator, :scope => :number)}#{decimal}" if decimal > 0
|
147
|
+
= currency
|
148
|
+
.clear
|
149
|
+
.yesterday-sales.second-block
|
150
|
+
%span.left
|
151
|
+
= t('sale.day.previous').capitalize
|
152
|
+
%span.right
|
153
|
+
= total_for_yesterday.floor
|
154
|
+
%sup
|
155
|
+
- decimal = total_for_yesterday.decimal
|
156
|
+
= "#{t(:separator, :scope => [:number, :format])}#{decimal}" if decimal > 0
|
157
|
+
= currency
|
158
|
+
.clear
|
159
|
+
.sales-info-block
|
160
|
+
.week-sales.first-block
|
161
|
+
%span.left
|
162
|
+
= t('sale.week.current').capitalize
|
163
|
+
%span.right
|
164
|
+
= total_for_week.floor
|
165
|
+
%sup
|
166
|
+
- decimal = total_for_week.decimal
|
167
|
+
= "#{t(:separator, :scope => [:number, :format])}#{decimal}" if decimal > 0
|
168
|
+
= currency
|
169
|
+
.clear
|
170
|
+
.last-week-sales.second-block
|
171
|
+
%span.left
|
172
|
+
= t('sale.week.previous').capitalize
|
173
|
+
%span.right
|
174
|
+
= total_for_last_week.floor
|
175
|
+
%sup
|
176
|
+
- decimal = total_for_last_week.decimal
|
177
|
+
= "#{t(:separator, :scope => [:number, :format])}#{decimal}" if decimal > 0
|
178
|
+
= currency
|
179
|
+
- if week_diff >= 0
|
180
|
+
%div{ :class => 'diff-positive' }
|
181
|
+
= "+#{week_diff}%"
|
182
|
+
- else
|
183
|
+
%div{ :class => 'diff-negative' }
|
184
|
+
= "#{week_diff}%"
|
185
|
+
.clear
|
186
|
+
.sales-info-block
|
187
|
+
.month-sales.first-block
|
188
|
+
%span.left
|
189
|
+
= t('sale.month.current').capitalize
|
190
|
+
%span.right
|
191
|
+
= total_for_month.floor
|
192
|
+
%sup
|
193
|
+
- decimal = total_for_month.decimal
|
194
|
+
= "#{t(:separator, :scope => [:number, :format])}#{decimal}" if decimal > 0
|
195
|
+
= currency
|
196
|
+
.clear
|
197
|
+
.last-month-sales.second-block
|
198
|
+
%span.left
|
199
|
+
= t('sale.month.previous').capitalize
|
200
|
+
%span.right
|
201
|
+
= total_for_last_month.floor
|
202
|
+
%sup
|
203
|
+
- decimal = total_for_last_month.decimal
|
204
|
+
= "#{t(:separator, :scope => [:number, :format])}#{decimal}" if decimal > 0
|
205
|
+
= currency
|
206
|
+
- if month_diff >= 0
|
207
|
+
%div{ :class => 'diff-positive' }
|
208
|
+
= "+#{month_diff}%"
|
209
|
+
- else
|
210
|
+
%div{ :class => 'diff-negative' }
|
211
|
+
= "#{month_diff}%"
|
212
|
+
.clear
|
213
|
+
.sales-info-block
|
214
|
+
.life-time-sales
|
215
|
+
%span.left
|
216
|
+
= t('sale.lifetime').capitalize
|
217
|
+
%span.right
|
218
|
+
= lifetime_sales.floor
|
219
|
+
%sup
|
220
|
+
- decimal = lifetime_sales.decimal
|
221
|
+
= "#{t(:separator, :scope => [:number, :format])}#{decimal}" if decimal > 0
|
222
|
+
= currency
|
223
|
+
.clear
|
224
|
+
%h2.small-icons.live-stats
|
225
|
+
= t('statistic.live', :count => 2).capitalize
|
226
|
+
.live-stats-content
|
227
|
+
%span= t('visitor.online', :count => online_visitors)
|
228
|
+
%span= t('user.online', :count => online_users)
|
229
|
+
%span= t('cart.created', :count => Cart.count(:conditions => '`products`.`id` IS NOT NULL', :include => :products))
|
230
|
+
.clear
|