Skip to content

Commit

Permalink
Merge branch 'release/3.4.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
tarunbhardwaj committed May 25, 2015
2 parents b979e04 + 4aab1a3 commit b77f4fa
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 46 deletions.
4 changes: 1 addition & 3 deletions static/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1308,9 +1308,7 @@ span.text-success, span.text-warning, span.text-danger, span.text-info{
cursor: pointer;
color: #C34848;
}
#featured-node img{
height: 360px;
}

.reset_password{
padding-top: 50px;
}
Expand Down
66 changes: 24 additions & 42 deletions templates/webshop/home.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -59,54 +59,36 @@

<section class="products latest">
<div class="container">
{% set featured_products = request.nereid_website.featured_products_node and request.nereid_website.featured_products_node.get_products(per_page=3) %}
{% if featured_products %}
<div class="row" id="featured-node">
<h3>Featured Products</h3>
<br>
{% for product in featured_products %}
<a href="{{ url_for('product.product.render', uri=product.uri) }}" ga-product-link data-ga-product-list="Featured Products" data-ga-event-label="Product Name" data-ga-product-id="{{ product.id }}" data-ga-product-name="{{ product.name }}" data-ga-product-category="{{ product.category and product.category.name or None }}">
<div class="col-md-4 thumb">
<img class="img img-responsive margin-auto"
src="{{ CDN }}{{ product.default_image.transform_command().thumbnail(400, 400, 'a') }}"
alt="{{ product.name }}" title="{{ product.name }}"/>
<div class="fig-caption text-center">
<h4>{{ product.name }}</h4>
{% set homepage_menus = request.nereid_website.homepage_menu and request.nereid_website.homepage_menu.get_menu_item(max_depth=3).children %}
{% for child_menu in homepage_menus %}
<div class="row section-spaces">
<h3 class="text-center mrt-0">{{ child_menu.title }}</h3>
<br>
<div class="col-md-12 product-data">
<div class="client-slider">
{% for child in child_menu.children %}
<div class="slide">
<a href="{{ child.link }}">
<img class="img img-responsive margin-auto"
src="{{ CDN + url_for('nereid.webshop.send_static_file', filename='images/no-image.jpg') }}"
alt="{{ child.title }}" title="{{ child.title }}">
</a>
</div>
{% endfor %}
</div>
</a>
{% endfor %}
</div>
<div class="bx-controls-direction">
<a class="bx-prev" href="#"></a>
<a class="bx-next" href="#"></a>
</div>
</div>
</div>
{% endfor %}
<br>
{% endif %}
</div>
</section>
<div class="container">
<hr class="margin-0">
</div>
{% if latest_products %}
<section class="section-spaces">
<div class="container">
<h3 class="text-center mrt-0">Most Popular Item</h3>
<br>
<div class="col-md-12 product-data">
<div class="client-slider">
{% for product in latest_products %}
<div class="slide">
<a href="{{ url_for('product.product.render', uri=product.uri) }}" ga-product-link data-ga-product-list="Most Popular Item" data-ga-event-label="Product Name" data-ga-product-id="{{ product.id }}" data-ga-product-name="{{ product.name }}" data-ga-product-category="{{ product.category and product.category.name or None }}">
<img src="{{ CDN }}{{ product.default_image.transform_command().thumbnail(150, 150, 'a') }}" alt="{{ product.name }}" title="{{ product.name }}" class="img-responsive img-rounded">
</a>
</div>
{% endfor %}
</div>
<div class="bx-controls-direction">
<a class="bx-prev" href="#"></a>
<a class="bx-next" href="#"></a>
</div>
</div>
</div>
</section>
{% endif %}
<section>
<div class="container">
<div class="col-md-12 shop-assurance">
Expand Down Expand Up @@ -170,9 +152,9 @@ $(document).ready(function() {
});
$('.client-slider').bxSlider({
slideWidth: 180,
slideWidth: 230,
minSlides: 2,
maxSlides: 5,
maxSlides: 4,
slideMargin: 10,
infiniteLoop: true,
pager:false,
Expand Down
6 changes: 6 additions & 0 deletions tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def setUp(self):
self.ProductNodeRelationship = POOL.get(
'product.product-product.tree_node'
)
self.MenuItem = POOL.get('nereid.cms.menuitem')
self.templates = {
'shopping-cart.jinja':
'Cart:{{ cart.id }},{{get_cart_size()|round|int}},'
Expand Down Expand Up @@ -495,6 +496,10 @@ def setup_defaults(self):
'name': 'root',
'slug': 'root',
}])
self.default_menuitem, = self.MenuItem.create([{
'type_': 'view',
'title': 'Test Title'
}])
self.NereidWebsite.create([{
'name': 'localhost',
'channel': self.channel,
Expand All @@ -504,6 +509,7 @@ def setup_defaults(self):
'guest_user': self.guest_user,
'countries': [('add', self.available_countries)],
'currencies': [('add', [self.usd.id])],
'homepage_menu': self.default_menuitem.id,
}])

# Create an article category
Expand Down
2 changes: 1 addition & 1 deletion tryton.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tryton]
version=3.4.1.12
version=3.4.2.0
depends:
nereid
nereid_cms
Expand Down
2 changes: 2 additions & 0 deletions view/website_form.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
<field name="cms_root_menu" />
<label name="cms_root_footer" />
<field name="cms_root_footer" />
<label name="homepage_menu" />
<field name="homepage_menu" />
</xpath>
<xpath
expr="/form/notebook/page[@id='general']/field[@name='cms_static_folder']"
Expand Down
5 changes: 5 additions & 0 deletions webshop.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ class Website:
select=True,
)

homepage_menu = fields.Many2One(
'nereid.cms.menuitem', "Homepage Menu", ondelete='RESTRICT',
select=True,
)

@classmethod
@route('/sitemap', methods=["GET"])
def render_sitemap(cls):
Expand Down

0 comments on commit b77f4fa

Please sign in to comment.