diff --git a/addons/website/static/src/img/content_here.png b/addons/website/static/src/img/content_here.png new file mode 100644 index 00000000000..d236e67a7d0 Binary files /dev/null and b/addons/website/static/src/img/content_here.png differ diff --git a/addons/website/static/src/xml/website.editor.xml b/addons/website/static/src/xml/website.editor.xml index 15f1fec8bbd..0497d2d574c 100644 --- a/addons/website/static/src/xml/website.editor.xml +++ b/addons/website/static/src/xml/website.editor.xml @@ -6,7 +6,7 @@ or - Discard + Discard diff --git a/addons/website_sale/controllers/main.py b/addons/website_sale/controllers/main.py index 991084e80fd..0e3fedb1814 100644 --- a/addons/website_sale/controllers/main.py +++ b/addons/website_sale/controllers/main.py @@ -378,9 +378,14 @@ class Ecommerce(http.Controller): } return request.website.render("website_sale.mycart", values) - @website.route(['/shop/add_cart/', '/shop/add_cart//'], type='http', auth="public", multilang=True, methods=['POST']) - def add_cart(self, product=None, product_id=None, remove=None, **kw): - self.add_product_to_cart(product_id=int(product_id or product.id)) + @website.route(['/shop/add_cart/'], type='http', auth="public", multilang=True, methods=['POST']) + def add_cart(self, product_id, remove=None, **kw): + self.add_product_to_cart(product_id=int(product_id)) + return request.redirect("/shop/mycart/") + + @website.route(['/shop/add_cart//'], type='http', auth="public", multilang=True) + def add_cart_product(self, product=None, product_id=None, remove=None, **kw): + self.add_product_to_cart(product_id=product.id) return request.redirect("/shop/mycart/") @website.route(['/shop/change_cart//'], type='http', auth="public", multilang=True) diff --git a/addons/website_sale/static/src/css/website_sale.css b/addons/website_sale/static/src/css/website_sale.css index 15047ab7271..7d988d5c79e 100644 --- a/addons/website_sale/static/src/css/website_sale.css +++ b/addons/website_sale/static/src/css/website_sale.css @@ -4,38 +4,6 @@ border: 1px solid rgba(100, 100, 100, 0.2); } -.oe_product_description { - background: rgba(255, 255, 255, 0.8); - padding: 5px 0 5px 0; - z-index: 5; -} - -.oe_subdescription { - line-height: 1.2; - margin-bottom: 4px; -} - -.oe_product_image { - position: absolute; -} -.oe_product_image img { - max-width: 100%; - max-height: 100%; - margin: auto; - position: absolute; - top: 0; - left: 0; - bottom: 0; - right: 0; - z-index: 4; -} - -.oe_product .oe_product_cart { - position: relative; - width: 100%; - height: 100%; -} - .products_pager { text-align: center; } @@ -56,32 +24,62 @@ margin-right: auto; } -/* ---- Default Styles Description ---- */ +/* ---- Default Styles ---- */ +.oe_product { + position: relative; +} .oe_product .oe_product_image { position: absolute; left: 15px; right: 15px; top: 15px; - bottom: 50px; + bottom: 55px; + text-align: center; } -.oe_product .oe_product_description { - bottom: 0; +.oe_product .oe_product_image img { + max-width: 100%; + max-height: 100%; + margin: auto; position: absolute; - left: 15px; - right: 15px; - border-top: 1px solid #dddddd; - max-height: 120px; + top: 0; + left: 0; + bottom: 0; + right: 0; + z-index: 4; +} +.oe_product section { + position: absolute; + left: 0; + right: 0; + bottom: 0; overflow: hidden; - padding-bottom: 24px; + padding: 0 15px; + max-height: 110px; + min-height: 56px; + border-top: 1px solid rgba(255, 255, 255, 0.2); + background: rgba(100, 100, 100, 0.1); + z-index: 5; } .oe_product .product_price { - position: absolute; - right: 15px; - left: 15px; - bottom: 0; - z-index: 6; - background: rgba(255, 255, 255, 0.6); padding: 5px 0; + position: absolute; + bottom: 0; +} +.oe_product .oe_product_cart { + position: relative; + width: 100%; + height: 100%; +} +.oe_product .oe_subdescription { + font-size: 0.8em; + max-height: 42px; + overflow: hidden; + margin-bottom: 30px; +} +.oe_product .oe_subdescription.oe_shadow { + position: absolute; + opacity: 0.3; + max-height: none; } .oe_mycart .input-group-addon { @@ -89,21 +87,6 @@ padding-right: 6px; } -.oe_shop_top .oe_product_description { - top: 0; - bottom: auto; - border-top-style: none; -} -.oe_shop_top .oe_product_image { - top: 15px; - bottom: 50px; -} - -.oe_shop_center .oe_product_description { - text-align: center; - border-top-style: none; -} - /* Products Options */ .oe_product.oe_image_full .oe_product_image { left: 0; @@ -112,13 +95,34 @@ bottom: 0; } -/* ---- Grid Style ---- */ -.style1 .oe_product .oe_product_image { +/* Ribbon for promotionso on products */ +.oe_product.oe_ribbon_promo .ribbon-wrapper { + display: block; +} +.oe_product .ribbon-wrapper { + display: none; + width: 85px; + height: 88px; + z-index: 5; + overflow: hidden; position: absolute; - left: 0; - right: 0; top: 0; - bottom: 0; + right: 0; +} +.oe_product .ribbon { + font: bold 15px Sans-Serif; + color: white; + text-align: center; + -webkit-transform: rotate(45deg); + -moz-transform: rotate(45deg); + -ms-transform: rotate(45deg); + -o-transform: rotate(45deg); + position: relative; + padding: 7px 0; + left: -5px; + top: 15px; + width: 120px; + cursor: default; } /* ---- Product Sizes ---- */ @@ -173,7 +177,18 @@ } @media (max-width: 400px) { #products_grid .oe_product { - height: 200px; + height: 270px; + } + #products_grid .oe_product section { + background: rgba(100, 100, 100, 0.2); + } + #products_grid .oe_product .oe_product_image { + top: 0; + bottom: 65px; + } + + #products_grid .oe_product.oe_image_full .oe_product_image { + bottom: 50px; } } @media (min-width: 992px) { @@ -243,37 +258,41 @@ } } /* ---- Product list style ---- */ -.oe_list_products { - border: none; - border-bottom: 1px solid rgba(100, 100, 100, 0.2); - width: 100%; - min-height: 140px; +@media (min-width: 400px) { + .oe_product.oe_list { + border: none; + border-bottom: 1px solid rgba(100, 100, 100, 0.2); + width: 100%; + min-height: 100px; + position: relative; + padding-bottom: 5px; + } + .oe_product.oe_list .oe_product_image { + top: 0; + bottom: 0; + left: 0; + right: 0; + width: 170px; + } + .oe_product.oe_list section { + position: relative; + border: 0; + top: 0; + bottom: auto; + left: 180px; + background: transparent; + } } -.oe_list_products .oe_product_image { - position: absolute; - left: 15px; - right: 15px; - top: 0; - bottom: 0; - width: 150px; -} -.oe_list_products .oe_product_description { - bottom: auto; - position: absolute; - left: 180px; - right: 0; - border-top: none; - top: 15px; - max-height: 94px; -} -.oe_list_products .product_price { - left: 180px; -} - .oe_website_sale .row .row .col-md-12 { float: none; } +/* product detail */ +.product_detail_img { + min-width: 128px; + max-height: 500px; +} + /* ---- Publish managment and options ---- */ #products_grid .css_options { display: none; @@ -311,47 +330,6 @@ display: block; } -/* Ribbon for promotionso on products */ -.oe_ribbon_promo .ribbon-wrapper { - display: block; -} - -.ribbon-wrapper { - display: none; - width: 85px; - height: 88px; - z-index: 5; - overflow: hidden; - position: absolute; - top: 0; - right: 0; -} - -.ribbon { - font: bold 15px Sans-Serif; - color: white; - text-align: center; - text-shadow: rgba(0, 0, 0, 0.5) 0px 1px 0px; - -webkit-transform: rotate(45deg); - -moz-transform: rotate(45deg); - -ms-transform: rotate(45deg); - -o-transform: rotate(45deg); - position: relative; - padding: 7px 0; - left: -5px; - top: 15px; - width: 120px; - background-color: #aa0000; - background-image: -webkit-gradient(linear, left top, left bottom, from(#880000), to(#aa0000)); - background-image: -webkit-linear-gradient(top, #880000, #aa0000); - background-image: -moz-linear-gradient(top, #880000, #aa0000); - background-image: -ms-linear-gradient(top, #880000, #aa0000); - background-image: -o-linear-gradient(top, #880000, #aa0000); - -webkit-box-shadow: 0px 0px 3px rgba(0, 0, 0, 0.3); - -moz-box-shadow: 0px 0px 3px rgba(0, 0, 0, 0.3); - box-shadow: 0px 0px 3px rgba(0, 0, 0, 0.3); -} - /* Wizard */ ul.wizard { padding: 0; @@ -418,9 +396,3 @@ ul.wizard li:first-child { padding-left: 15px; border-radius: 4px 0 0 4px; } - -/* product detail */ -.product_detail_img { - min-width: 128px; - max-height: 500px; -} diff --git a/addons/website_sale/static/src/css/website_sale.sass b/addons/website_sale/static/src/css/website_sale.sass index 5b2892a6035..21139236f58 100644 --- a/addons/website_sale/static/src/css/website_sale.sass +++ b/addons/website_sale/static/src/css/website_sale.sass @@ -4,34 +4,6 @@ .oe_product border: 1px solid rgba(100,100,100,0.2) - -.oe_product_description - background: rgba(255,255, 255, 0.8) - padding: 5px 0 5px 0 - z-index: 5 - -.oe_subdescription - line-height: 1.2 - margin-bottom: 4px - -.oe_product_image - position: absolute - img - max-width: 100% - max-height: 100% - margin: auto - position: absolute - top: 0 - left: 0 - bottom: 0 - right: 0 - z-index: 4 - -.oe_product - .oe_product_cart - position: relative - width: 100% - height: 100% .products_pager text-align: center @@ -48,53 +20,62 @@ margin-left: auto margin-right: auto -/* ---- Default Styles Description ---- */ +/* ---- Default Styles ---- */ .oe_product + position: relative .oe_product_image position: absolute left: 15px right: 15px top: 15px - bottom: 50px - .oe_product_description - bottom: 0 + bottom: 55px + text-align: center + img + max-width: 100% + max-height: 100% + margin: auto + position: absolute + top: 0 + left: 0 + bottom: 0 + right: 0 + z-index: 4 + section position: absolute - left: 15px - right: 15px - border-top: 1px solid #dddddd - max-height: 120px + left: 0 + right: 0 + bottom: 0 overflow: hidden - padding-bottom: 24px + padding: 0 15px + max-height: 110px + min-height: 56px + border-top: 1px solid rgba(255,255,255,0.2) + background: rgba(100, 100, 100, 0.1) + z-index: 5 .product_price - position: absolute - right: 15px - left: 15px - bottom: 0 - z-index: 6 - background: rgba(255,255,255,0.6) padding: 5px 0 + position: absolute + bottom: 0 + .oe_product_cart + position: relative + width: 100% + height: 100% + .oe_subdescription + font-size: 0.8em + max-height: 42px + overflow: hidden + margin-bottom: 30px + &.oe_shadow + position: absolute + opacity: .3 + max-height: none .oe_mycart .input-group-addon padding-left: 6px padding-right: 6px - -.oe_shop_top /* Option 1 */ - .oe_product_description - top: 0 - bottom: auto - border-top-style: none - .oe_product_image - top: 15px - bottom: 50px - -.oe_shop_center /* Option 2 */ - .oe_product_description - text-align: center - border-top-style: none - /* Products Options */ .oe_product.oe_image_full @@ -104,17 +85,41 @@ top: 0 bottom: 0 -/* ---- Grid Style ---- */ +/* Ribbon for promotionso on products */ -.style1 - .oe_product .oe_product_image +.oe_product + &.oe_ribbon_promo + .ribbon-wrapper + display: block + + .ribbon-wrapper + display: none + width: 85px + height: 88px + z-index: 5 + overflow: hidden position: absolute - left: 0 - right: 0 top: 0 - bottom: 0 + right: 0 + + .ribbon + font: bold 15px Sans-Serif + color: white + text-align: center + -webkit-transform: rotate(45deg) + -moz-transform: rotate(45deg) + -ms-transform: rotate(45deg) + -o-transform: rotate(45deg) + position: relative + padding: 7px 0 + left: -5px + top: 15px + width: 120px + cursor: default + /* ---- Product Sizes ---- */ + .col-md-12 .oe-height-1 height: 75px @@ -156,7 +161,17 @@ @media (max-width: 400px) #products_grid .oe_product - height: 200px + height: 270px + section + background: rgba(100, 100, 100, 0.2) + .oe_product_image + top: 0 + bottom: 65px + #products_grid + .oe_product.oe_image_full + .oe_product_image + bottom: 50px + @media (min-width: 992px) .col-md-12 @@ -207,34 +222,40 @@ height: 760px /* ---- Product list style ---- */ -.oe_list_products - border: none - border-bottom: 1px solid rgba(100, 100, 100, 0.2) - width: 100% - min-height: 140px - .oe_product_image - position: absolute - left: 15px - right: 15px - top: 0 - bottom: 0 - width: 150px - .oe_product_description - bottom: auto - position: absolute - left: 180px - right: 0 - border-top: none - top: 15px - max-height: 94px - .product_price - left: 180px + +@media (min-width: 400px) + .oe_product.oe_list + border: none + border-bottom: 1px solid rgba(100, 100, 100, 0.2) + width: 100% + min-height: 100px + position: relative + padding-bottom: 5px + .oe_product_image + top: 0 + bottom: 0 + left: 0 + right: 0 + width: 170px + section + position: relative + border: 0 + top: 0 + bottom: auto + left: 180px + background: transparent .oe_website_sale .row .row .col-md-12 float: none +/* product detail */ + +.product_detail_img + min-width: 128px + max-height: 500px /* ---- Publish managment and options ---- */ + #products_grid .css_options display: none position: absolute @@ -265,47 +286,6 @@ #products_grid .oe_product_cart:hover > .css_options display: block -/* Ribbon for promotionso on products */ - -.oe_ribbon_promo - .ribbon-wrapper - display: block - -.ribbon-wrapper - display: none - width: 85px - height: 88px - z-index: 5 - overflow: hidden - position: absolute - top: 0 - right: 0 - -.ribbon - font: bold 15px Sans-Serif - color: white - text-align: center - text-shadow: rgba(0,0,0,0.5) 0px 1px 0px - -webkit-transform: rotate(45deg) - -moz-transform: rotate(45deg) - -ms-transform: rotate(45deg) - -o-transform: rotate(45deg) - position: relative - padding: 7px 0 - left: -5px - top: 15px - width: 120px - background-color: #a00 - background-image: -webkit-gradient(linear, left top, left bottom, from(#800), to(#a00)) - background-image: -webkit-linear-gradient(top, #800, #a00) - background-image: -moz-linear-gradient(top, #800, #a00) - background-image: -ms-linear-gradient(top, #800, #a00) - background-image: -o-linear-gradient(top, #800, #a00) - -webkit-box-shadow: 0px 0px 3px rgba(0,0,0,0.3) - -moz-box-shadow: 0px 0px 3px rgba(0,0,0,0.3) - box-shadow: 0px 0px 3px rgba(0,0,0,0.3) - - /* Wizard */ @@ -365,9 +345,3 @@ ul.wizard li.text-primary .chevron:before ul.wizard li:first-child padding-left: 15px border-radius: 4px 0 0 4px - -/* product detail */ - -.product_detail_img - min-width: 128px - max-height: 500px diff --git a/addons/website_sale/views/website_sale.xml b/addons/website_sale/views/website_sale.xml index c7dde3772a7..7fe930427bd 100644 --- a/addons/website_sale/views/website_sale.xml +++ b/addons/website_sale/views/website_sale.xml @@ -50,34 +50,32 @@