[IMP] added list grid for shop.

bzr revid: psa@tinyerp.com-20130923124752-dhg0aao3diuh1isn
This commit is contained in:
Paramjit Singh Sahota 2013-09-23 18:17:52 +05:30
parent 71ab933988
commit f06f48ce52
2 changed files with 64 additions and 2 deletions

View File

@ -7,7 +7,6 @@
top: 15px;
bottom: 50px;
}
.oe_product_description {
bottom: 0;
position: absolute;
@ -15,6 +14,29 @@
right: 15px;
border-top: 1px solid #dddddd;
}
.oe_products {
border: 1px solid rgba(100, 100, 100, 0.2);
max-width: 100%;
max-height: 140px;
}
.oe_product_list_image {
left: 15px;
right: 15px;
top: 15px;
bottom: 50px;
width: 200px;
}
.oe_products .oe_product_list_image img {
width: 150px;
height: 140px;
}
.oe_product_list_description {
bottom: 0;
position: absolute;
left: 240px;
right: 240px;
border-top: 1px solid #dddddd;
}
.oe_shop_top .oe_product_description {
top: 0;

View File

@ -165,7 +165,7 @@
<!-- Add to cart button-->
<template id="add_basket" inherit_option_id="website_sale.products" name="Add to Cart">
<template id="add_to_basket" inherit_option_id="website_sale.products" name="Add to Cart">
<xpath expr="//span[@id='add_to_cart']" position="replace">
<a t-attf-href="./add_cart/?product_id=#{ product.id }">
<span class="icon-shopping-cart"/>
@ -173,6 +173,46 @@
</xpath>
</template>
<!-- List view of products -->
<template id="add_basket" inherit_option_id="website_sale.products" name="List View">
<xpath expr="//div[@id='products_grid']" position="replace">
<div class="col-md-12">
<t t-foreach="products" t-as="product">
<div class="col-md-12 oe_products oe-height-1}" t-att-data-publish="product.website_published" data-snippet-id="colmd">
<div class="oe_product_list_image .col-md-3">
<a t-attf-href="/shop/product/#{ product.id }/?#{ search and ('search=%s' % search) or ''}#{ category_id and ('&amp;category_id=%s' % category_id) or ''}">
<img class="img" t-att-src="product.img('image')"/>
</a>
</div>
<div class="oe_product_list_description .col-md-offset-3">
<a t-attf-href="/shop/product/#{ product.id }/?#{ search and ('search=%s' % search) or ''}#{ category_id and ('&amp;category_id=%s' % category_id) or ''}">
<b t-field="product.name"/>
</a>
<!-- This should be an option -->
<div t-if="product.description_sale" class="text-muted oe_subdescription">
<div id="product_description" t-att-data-name="product.id"/>
</div>
<div>
<b>
<t t-if="product.product_variant_ids[0].lst_price != product.product_variant_ids[0].price">
<span class="text-danger" style="text-decoration: line-through;">
<t t-esc="product.product_variant_ids[0].lst_price" />
</span>&amp;nbsp;
</t>
<t t-esc="product.product_variant_ids[0].price" />
</b>
<span id="add_to_cart" t-att-data-name="product.id"/>
</div>
</div>
</div>
</t>
</div>
</xpath>
</template>
<!-- product -->
<template id="product" name="Product">