Skip to content
Permalink
Browse files

[REF] website_sale: allow to customize default aspect ratio of grid shop

  • Loading branch information...
qsm-odoo committed Mar 5, 2019
1 parent 1751ecd commit 412e6c4985fea04682f820dd24d398c01226ac1e
@@ -0,0 +1 @@
$o-wsale-products-layout-grid-ratio: 1.0 !default;
@@ -195,13 +195,23 @@ $o-wsale-products-layout-grid-gutter-width: min($grid-gutter-width / 2, $o-wsale
margin-top: 0; // For list and mobile design
}

.o_wsale_product_grid_filler + * {
@include o-position-absolute(0, 0, 0, 0);
.o_wsale_product_grid_filler {
@for $x from 1 through 4 {
@for $y from 1 through 4 {
&.o_wsale_product_grid_filler_#{$x}_#{$y} {
padding-top: 100% * $o-wsale-products-layout-grid-ratio * $y / $x;
}
}
}

+ * {
@include o-position-absolute(0, 0, 0, 0);

@if $o-wsale-products-layout-grid-gutter-width <= 0 {
&.card {
&, .card-body {
border-radius: 0;
@if $o-wsale-products-layout-grid-gutter-width <= 0 {
&.card {
&, .card-body {
border-radius: 0;
}
}
}
}
@@ -1,6 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Layout and common templates -->
<template id="_assets_primary_variables" inherit_id="website._assets_primary_variables">
<xpath expr="//link[last()]" position="after">
<link rel="stylesheet" type="text/scss" href="/website_sale/static/src/scss/primary_variables.scss"/>
</xpath>
</template>

<template id="assets_backend" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<script type="text/javascript" src="/website_sale/static/src/js/website_sale_backend.js"></script>
@@ -227,8 +232,7 @@
<td t-att-colspan="td_product['x'] != 1 and td_product['x']"
t-att-rowspan="td_product['y'] != 1 and td_product['y']"
t-attf-class="oe_product #{td_product['class']}">
<div t-attf-class="o_wsale_product_grid_filler"
t-attf-style="padding-top: #{'%.2f' % (100 * td_product['y'] / td_product['x'])}%;"/>
<div t-attf-class="o_wsale_product_grid_filler o_wsale_product_grid_filler_#{td_product['x']}_#{td_product['y']}"/>
<t t-call="website_sale.products_item">
<t t-set="product_image_big" t-value="td_product['x'] + td_product['y'] &gt; 2"/>
</t>

0 comments on commit 412e6c4

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.