[MERGE] Merge parents

bzr revid: rim@openerp.com-20131108075411-o8rw5twr1jq94zvz
This commit is contained in:
Richard Mathot (OpenERP)
2013-11-08 08:54:11 +01:00
23 changed files with 246 additions and 163 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ logger = logging.getLogger(__name__)
def auth_method_public():
registry = openerp.modules.registry.RegistryManager.get(request.db)
if not request.session.uid:
request.uid = registry['website'].get_public_user().id
request.uid = registry['website'].get_public_user(request.cr, openerp.SUPERUSER_ID, request.context).id
else:
request.uid = request.session.uid
http.auth_methods['public'] = auth_method_public
+34 -45
View File
@@ -35,24 +35,19 @@ def route(routes, *route_args, **route_kwargs):
request.route_lang = kwargs.get('lang_code', None)
if not hasattr(request, 'website'):
request.multilang = f.multilang
request.website = request.registry['website'].get_current()
# TODO: Select website, currently hard coded
request.website = request.registry['website'].browse(
request.cr, request.uid, 1, context=request.context)
if request.route_lang:
lang_ok = [lg.code for lg in request.website.language_ids if lg.code == request.route_lang]
if not lang_ok:
return request.not_found()
request.website.preprocess_request(*args, **kwargs)
request.website.preprocess_request(request)
return f(*args, **kwargs)
return wrap
return decorator
def auth_method_public():
registry = openerp.modules.registry.RegistryManager.get(request.db)
if not request.session.uid:
request.uid = registry['website'].get_public_user().id
else:
request.uid = request.session.uid
http.auth_methods['public'] = auth_method_public
def url_for(path_or_uri, lang=None, keep_query=None):
location = path_or_uri.strip()
url = urlparse.urlparse(location)
@@ -109,32 +104,28 @@ class website(osv.osv):
public_user = None
def get_public_user(self):
def get_public_user(self, cr, uid, context=None):
if not self.public_user:
ref = request.registry['ir.model.data'].get_object_reference(request.cr, openerp.SUPERUSER_ID, 'website', 'public_user')
self.public_user = request.registry[ref[0]].browse(request.cr, openerp.SUPERUSER_ID, ref[1])
uid = openerp.SUPERUSER_ID
ref = self.pool['ir.model.data'].get_object_reference(cr, uid, 'website', 'public_user')
self.public_user = self.pool[ref[0]].browse(cr, uid, ref[1])
return self.public_user
def get_lang(self):
website = request.registry['website'].get_current()
if hasattr(request, 'route_lang'):
lang = request.route_lang
else:
lang = request.params.get('lang', None) or request.httprequest.cookies.get('lang', None)
if lang not in [lg.code for lg in website.language_ids]:
lang = website.default_lang_id.code
return lang
def preprocess_request(self, cr, uid, ids, *args, **kwargs):
def preprocess_request(self, cr, uid, ids, request, context=None):
def redirect(url):
return werkzeug.utils.redirect(url_for(url))
request.redirect = redirect
is_public_user = request.uid == self.get_public_user().id
lang = self.get_lang()
is_public_user = request.uid == self.get_public_user(cr, uid, context).id
# Select current language
if hasattr(request, 'route_lang'):
lang = request.route_lang
else:
lang = request.params.get('lang', None) or request.httprequest.cookies.get('lang', None)
if lang not in [lg.code for lg in request.website.language_ids]:
lang = request.website.default_lang_id.code
is_master_lang = lang == request.website.default_lang_id.code
request.context.update({
'lang': lang,
@@ -147,16 +138,15 @@ class website(osv.osv):
'translatable': not is_public_user and not is_master_lang and request.multilang,
})
def get_current(self):
# WIP, currently hard coded
return self.browse(request.cr, request.uid, 1)
def render(self, cr, uid, ids, template, values=None, context=None):
view = self.pool.get("ir.ui.view")
IMD = self.pool.get("ir.model.data")
user = self.pool.get("res.users")
def render(self, cr, uid, ids, template, values=None):
view = request.registry.get("ir.ui.view")
IMD = request.registry.get("ir.model.data")
user = request.registry.get("res.users")
if not context:
context = {}
qweb_context = request.context.copy()
qweb_context = context.copy()
if values:
qweb_context.update(values)
@@ -170,7 +160,6 @@ class website(osv.osv):
user_id=user.browse(cr, uid, uid),
)
context = request.context.copy()
context.update(
inherit_branding=qweb_context.setdefault('editable', False),
)
@@ -189,7 +178,7 @@ class website(osv.osv):
if 'main_object' not in qweb_context:
try:
main_object = request.registry[view_ref[0]].browse(cr, uid, view_ref[1])
main_object = self.pool[view_ref[0]].browse(cr, uid, view_ref[1])
qweb_context['main_object'] = main_object
except Exception:
pass
@@ -220,7 +209,7 @@ class website(osv.osv):
status=code,
content_type='text/html;charset=utf-8')
def pager(self, cr, uid, ids, url, total, page=1, step=30, scope=5, url_args=None):
def pager(self, cr, uid, ids, url, total, page=1, step=30, scope=5, url_args=None, context=None):
# Compute Pager
page_count = int(math.ceil(float(total) / step))
@@ -291,15 +280,15 @@ class website(osv.osv):
if xids[view['id']]
]
def kanban(self, cr, uid, ids, model, domain, column, template, step=None, scope=None, orderby=None):
def kanban(self, cr, uid, ids, model, domain, column, template, step=None, scope=None, orderby=None, context=None):
step = step and int(step) or 10
scope = scope and int(scope) or 5
orderby = orderby or "name"
get_args = dict(request.httprequest.args or {})
model_obj = request.registry[model]
model_obj = self.pool[model]
relation = model_obj._columns.get(column)._obj
relation_obj = request.registry[relation]
relation_obj = self.pool[relation]
get_args.setdefault('kanban', "")
kanban = get_args.pop('kanban')
@@ -353,9 +342,9 @@ class website(osv.osv):
}
return request.website.render("website.kanban_contain", values)
def kanban_col(self, cr, uid, ids, model, domain, page, template, step, orderby):
def kanban_col(self, cr, uid, ids, model, domain, page, template, step, orderby, context=None):
html = ""
model_obj = request.registry[model]
model_obj = self.pool[model]
domain = safe_eval(domain)
step = int(step)
offset = (int(page)-1) * step
@@ -63,6 +63,39 @@
link_dialog(editor);
}, null, null, 500);
var previousSelection;
editor.on('selectionChange', function (evt) {
var selected = evt.data.path.lastElement;
if (previousSelection) {
// cleanup previous selection
$(previousSelection).next().remove();
previousSelection = null;
}
if (!selected.is('img')
|| selected.data('cke-realelement')
|| selected.isReadOnly()
|| selected.data('oe-model') === 'ir.ui.view') {
return;
}
// display button
var $el = $(previousSelection = selected.$);
var $btn = $('<button type="button" class="btn btn-primary" contenteditable="false">Edit</button>')
.insertAfter($el)
.click(function (e) {
e.preventDefault();
e.stopPropagation();
image_dialog(editor);
});
var position = $el.position();
$btn.css({
position: 'absolute',
top: $el.height() / 2 + position.top - $btn.outerHeight() / 2,
left: $el.width() / 2 + position.left - $btn.outerWidth() / 2,
});
});
//noinspection JSValidateTypes
editor.addCommand('link', {
exec: function (editor) {
@@ -17,9 +17,15 @@
return this._super();
},
edit: function () {
var self = this;
$("body").off('click');
window.snippets = this.snippets = new website.snippet.BuildingBlock(this);
this.snippets.appendTo(this.$el);
this.rte.on('rte:ready', this, function () {
self.snippets.$button.removeClass("hidden");
});
return this._super.apply(this, arguments);
},
save: function () {
@@ -118,10 +124,11 @@
start: function() {
var self = this;
var $ul = this.parent.$("#website-top-edit ul");
this.$button = $(openerp.qweb.render('website.snippets_button'))
.prependTo(this.parent.$("#website-top-edit ul"))
.find("button");
var $button = $(openerp.qweb.render('website.snippets_button')).prependTo($ul);
$button.find('button').click(function () {
this.$button.click(function () {
self.make_active(false);
self.$el.toggleClass("hidden");
});
@@ -237,6 +244,7 @@
}
if (this.$active_snipped_id) {
this.snippet_blur(this.$active_snipped_id);
this.$active_snipped_id = false;
}
if ($snipped_id) {
if(_.indexOf(this.snippets, $snipped_id.get(0)) === -1) {
@@ -245,8 +253,6 @@
this.$active_snipped_id = $snipped_id;
this.create_overlay(this.$active_snipped_id);
this.snippet_focus($snipped_id);
} else {
self.$active_snipped_id = false;
}
},
create_overlay: function ($snipped_id) {
@@ -750,6 +756,7 @@
var index = _.indexOf(self.parent.snippets, self.$target.get(0));
delete self.parent.snippets[index];
self.$target.remove();
self.$overlay.remove();
return false;
});
this._drag_and_drop();
@@ -768,7 +775,7 @@
* This method is called when the user click inside the snippet in the dom
*/
onFocus : function () {
this.$overlay.addClass('oe_active');
this.$overlay.addClass('oe_active').effect('bounce', {distance: 18, times: 5}, 250);
},
/* onFocus
@@ -3,7 +3,7 @@
<!-- Snippet loader -->
<t t-name="website.snippets_button">
<li class="navbar-form js_hide_on_translate"><button type="button" data-action="snippet" class="btn btn-primary">Insert Blocks</button></li>
<li class="navbar-form js_hide_on_translate"><button type="button" data-action="snippet" class="hidden btn btn-primary">Insert Blocks</button></li>
</t>
<t t-name="website.snippets_style">
<li class="navbar-form">
@@ -63,7 +63,7 @@
<div class="btn-group">
<a href="#" class="btn btn-default btn-sm oe_snippet_parent" title="Select Container Block"><span class="icon-upload-alt"/></a>
<div class="dropdown oe_options hidden btn-group">
<a href="#" data-toggle="dropdown" class="btn btn-default btn-sm" title="Customize">Customize <span class="caret"/></a>
<a href="#" data-toggle="dropdown" class="btn btn-primary btn-sm" title="Customize">Customize <span class="caret"/></a>
<ul class="dropdown-menu" role="menu"></ul>
</div>
<a href="#" class="btn btn-default btn-sm oe_snippet_move" title="Drag to Move">&amp;nbsp; <span class="icon-move"/> &amp;nbsp;</a>
+1 -1
View File
@@ -555,7 +555,7 @@
<img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block_button.png"/>
<span class="oe_snippet_thumbnail_title">Button</span>
</div>
<section class="oe_snippet_body dark">
<section class="oe_snippet_body oe_snippet_darken dark">
<div class="container">
<div class="row">
<div class="col-md-12 text-center mt16 mb16">
+28 -28
View File
@@ -12,7 +12,7 @@
<template id="website.submenu" name="Submenu">
<li t-if="not submenu.child_id">
<a t-att-href="url_for(submenu.url)">
<a t-att-href="url_for(submenu.url)" t-ignore="true">
<span t-field="submenu.name"/>
</a>
</li>
@@ -118,7 +118,7 @@
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" t-href="/"><em>Your</em><b>Company</b></a>
<a class="navbar-brand" href="/"><em>Your</em> <b>Company</b></a>
</div>
<div class="collapse navbar-collapse navbar-top-collapse">
<ul class="nav navbar-nav navbar-right" id="top_menu">
@@ -227,30 +227,32 @@
<template id="footer_custom" inherit_option_id="website.layout" name="Custom Footer">
<xpath expr="//div[@id='footer_container']" position="before">
<section data-snippet-id='three-columns' class="mt16 mb16">
<div class="container">
<div class="row">
<div class="col-md-4">
<h4 class="mt16">Subtitle</h4>
<p>
<a t-href="/">Homepage</a>
</p>
</div>
<div class="col-md-4">
<h4 class="mt16">Subtitle 2</h4>
<p>
...
</p>
</div>
<div class="col-md-4">
<h4 class="mt16">Subtitle 3</h4>
<p>
...
</p>
<div class="oe_structure">
<section data-snippet-id='three-columns' class="mt16 mb16">
<div class="container">
<div class="row">
<div class="col-md-4">
<h4 class="mt16">Subtitle</h4>
<p>
<a href="/">Homepage</a>
</p>
</div>
<div class="col-md-4">
<h4 class="mt16">Subtitle 2</h4>
<p>
...
</p>
</div>
<div class="col-md-4">
<h4 class="mt16">Subtitle 3</h4>
<p>
...
</p>
</div>
</div>
</div>
</div>
</section>
</section>
</div>
</xpath>
<xpath expr="//div[@id='footer_container']" position="attributes">
<attribute name="style">display: none</attribute>
@@ -258,8 +260,7 @@
</template>
<template id="publish_management">
<t t-if="editable" t-ignore="true">
<div class="pull-right">
<div t-if="editable" t-ignore="true" class="pull-right hidden-xs" t-att-style="style or ''">
<div t-attf-class="btn-group dropdown js_publish_management #{object.id and object.website_published and 'css_publish' or 'css_unpublish'}" t-att-data-id="object.id" t-att-data-object="object._name" t-att-data-controller="publish_controller">
<a t-attf-class="btn btn-sm btn-#{object.id and object.website_published and 'success' or 'default'}" t-att-id="'dopprod-%s' % object.id" role="button" data-toggle="dropdown">Options <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu" t-att-aria-labelledby="'dopprod-%s' % object.id">
@@ -275,7 +276,6 @@
</ul>
</div>
</div>
</t>
</template>
<template id="publish_short">
@@ -292,7 +292,7 @@
</template>
<template id="pager" name="Pager">
<ul t-if="pager['page_count'] > 1" t-attf-class="#{ classname or '' } pagination">
<ul t-if="pager['page_count'] > 1" t-attf-class="#{ classname or '' } pagination" t-att-style="style or ''">
<li t-att-class=" 'disabled' if pager['page']['num'] == 1 else '' ">
<a t-att-href=" pager['page_previous']['url'] if pager['page']['num'] != 1 else '' ">Prev</a>
</li>
@@ -2,18 +2,12 @@
<openerp>
<data>
<!-- Layout add nav and footer -->
<template id="header_footer_custom" inherit_id="website.layout">
<template id="header_footer_custom" inherit_id="website.layout" name="Footer News Blog Link">
<xpath expr="//footer//div[@name='info']/ul" position="inside">
<li><a t-href="/blog/cat/%(website_blog.blog_category_1)d/">News</a></li>
</xpath>
</template>
<template id="footer_custom" inherit_option_id="website.layout" name="Job Announces">
<xpath expr="//footer//div[@name='info']/ul" position="inside">
<li><a t-href="/blog/%(website_blog.blog_category_2)d/">Jobs</a></li>
</xpath>
</template>
<!-- Blog Post Summary -->
<template id="blog_post_short" name="Blog Post Summary">
<div>
@@ -200,7 +194,7 @@
<div class="row">
<div class="col-lg-12 col-sm-12" t-if="not blog_post" id="blog_post">
<t t-if="category and editable">
<div class="row">
<div class="row hidden-xs">
<a t-href="/blog/#{category.id}/new" class="btn btn-primary pull-right">New Blog Post</a>
</div>
</t>
@@ -28,7 +28,7 @@ class WebsiteCrmPartnerAssign(http.Controller):
if request.context['is_public_user']:
base_partner_domain += [('website_published', '=', True)]
partner_domain = list(base_partner_domain)
if grade_id:
if grade_id and grade_id != "all":
partner_domain += [('grade_id', '=', int(grade_id))] # try/catch int
if country_id:
country = country_obj.browse(request.cr, request.uid, country_id, request.context)
@@ -4,7 +4,7 @@
<!-- Layout add nav and footer -->
<template id="footer_custom" inherit_id="website.layout" name="Custom Footer">
<template id="footer_custom" inherit_id="website.layout" name="Footer Partners Link">
<xpath expr="//footer//div[@name='info']/ul" position="inside">
<li><a t-href="/partners/">Partners</a></li>
</xpath>
@@ -3,7 +3,7 @@
<data>
<!-- Layout add nav and footer -->
<template id="footer_custom" inherit_id="website.layout" name="Custom Footer">
<template id="footer_custom" inherit_id="website.layout" name="Footer Customer References Link">
<xpath expr="//footer//div[@name='info']/ul" position="inside">
<li><a t-href="/customers/">Customer References</a></li>
</xpath>
+3 -2
View File
@@ -3,8 +3,8 @@
<data>
<!-- Layout add nav and footer -->
<template id="header_footer_custom" inherit_id="website.layout">
<xpath expr="//footer//div[@name='info']/ul" position="inside">
<template id="header_footer_custom" inherit_id="website.layout" name="Footer Events Link">
<xpath expr="//footer//ul[@name='products']" position="inside">
<li><a t-href="/event">Events</a></li>
</xpath>
</template>
@@ -200,6 +200,7 @@
<t t-set="object" t-value="event_id"/>
<t t-set="publish_edit" t-value="True"/>
<t t-set="publish_controller">/event/publish</t>
<t t-set="style">position: relative; top: -80px;</t>
</t>
<h4>Where</h4>
</div>
@@ -7,7 +7,7 @@
<field name="description">Job Posts on your website</field>
</record>
<template id="job_footer_custom" inherit_id="website.layout" name="Custom Footer Job">
<template id="job_footer_custom" inherit_id="website.layout" name="Footer Job Link">
<xpath expr="//footer//div[@name='info']/ul" position="inside">
<li><a t-href="/jobs">Jobs</a></li>
</xpath>
@@ -3,7 +3,7 @@
<data>
<!-- Layout add nav and footer -->
<template id="footer_custom" inherit_id="website.layout" name="Custom Footer">
<template id="footer_custom" inherit_id="website.layout" name="Footer Associations Link">
<xpath expr="//footer//div[@name='info']/ul" position="inside">
<li><a t-href="/members/">Associations</a></li>
</xpath>
+2 -2
View File
@@ -28,13 +28,13 @@ from openerp.osv import osv
class Website(osv.Model):
_inherit = "website"
def preprocess_request(self, cr, uid, ids, *args, **kwargs):
def preprocess_request(self, cr, uid, ids, request, context=None):
project_obj = request.registry['project.project']
project_ids = project_obj.search(cr, uid, [('privacy_visibility', "=", "public")], context=request.context)
request.context['website_project_ids'] = project_obj.browse(cr, uid, project_ids, request.context)
return super(Website, self).preprocess_request(cr, uid, ids, *args, **kwargs)
return super(Website, self).preprocess_request(cr, uid, ids, request, context)
class website_project(http.Controller):
@@ -3,9 +3,9 @@
<data>
<!-- Layout add nav and footer -->
<template id="footer_custom" inherit_id="website.layout" name="Custom Footer">
<template id="footer_custom" inherit_id="website.layout" name="Footer Project's Links">
<xpath expr="//footer//ul[@name='products']" position="inside">
<li t-foreach="website_project_ids" t-as="project"><a t-href="/project/#{ project.id }/"><t t-esc="project.name"/></a></li>
<li t-foreach="website_project_ids" t-as="project"><a t-href="/project/#{ project.id }/" t-field="project.name"/></li>
</xpath>
</template>
+13 -6
View File
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
import random
import uuid
import urllib
import simplejson
import werkzeug.exceptions
@@ -54,11 +53,11 @@ def get_current_order():
class Website(osv.osv):
_inherit = "website"
def preprocess_request(self, cr, uid, ids, *args, **kwargs):
def preprocess_request(self, cr, uid, ids, request, context=None):
request.context.update({
'website_sale_order': get_current_order(),
})
return super(Website, self).preprocess_request(cr, uid, ids, *args, **kwargs)
return super(Website, self).preprocess_request(cr, uid, ids, request, context=None)
class Ecommerce(http.Controller):
@@ -264,7 +263,7 @@ class Ecommerce(http.Controller):
post.pop(key)
return request.redirect("/shop/?filter=%s%s%s%s" % (
simplejson.dumps(filter).replace(" ", ""),
simplejson.dumps(filter),
add_filter and "&add_filter=%s" % add_filter or "",
post.get("search") and "&search=%s" % post.get("search") or "",
post.get("category") and "&category=%s" % post.get("category") or ""
@@ -331,7 +330,11 @@ class Ecommerce(http.Controller):
'Ecommerce': self,
'product_ids': product_ids,
'product_ids_for_holes': fill_hole,
'search': post or dict(),
'search': {
'search': post.get('search') or '',
'category': category,
'filter': filter or '',
},
'pager': pager,
'styles': styles,
'style_in_product': lambda style, product: style.id in [s.id for s in product.website_style_ids],
@@ -364,7 +367,11 @@ class Ecommerce(http.Controller):
'category_list': category_list,
'main_object': product,
'product': product,
'search': post or dict(),
'search': {
'search': post.get('search') or '',
'category': post.get('category') or '',
'filter': post.get('filter') or '',
}
}
return request.website.render("website_sale.product", values)
@@ -38,7 +38,7 @@ class attributes(osv.Model):
_columns = {
'name': fields.char('Name', size=64, translate=True, required=True),
'type': fields.selection([('distinct', 'Distinct'), ('float', 'Float')], "Type", required=True),
'type': fields.selection([('distinct', 'Textual Value'), ('float', 'Numeric Value')], "Type", required=True),
'value_ids': fields.one2many('product.attribute.value', 'attribute_id', 'Values'),
'product_ids': fields.one2many('product.attribute.product', 'attribute_id', 'Products'),
@@ -48,7 +48,7 @@ class attributes(osv.Model):
'float_min': fields.function(_get_float_min, type='float', string="Min", store={
'product.attribute.product': (_get_min_max, ['value','attribute_id'], 20),
}),
'visible': fields.boolean('Visible'),
'visible': fields.boolean('Display Filter on Website'),
}
_defaults = {
'type': 'distinct',
@@ -65,9 +65,10 @@ class attributes_value(osv.Model):
class attributes_product(osv.Model):
_name = "product.attribute.product"
_order = 'attribute_id, value_id, value'
_columns = {
'value': fields.float('Value'),
'value_id': fields.many2one('product.attribute.value', 'Distinct Value'),
'value': fields.float('Numeric Value'),
'value_id': fields.many2one('product.attribute.value', 'Textual Value'),
'attribute_id': fields.many2one('product.attribute', 'Attribute', required=True),
'product_id': fields.many2one('product.template', 'Product', required=True),
@@ -133,7 +133,7 @@
height: 560px;
}
@media (max-width: 600px) {
@media (max-width: 768px) {
#products_grid table, #products_grid tbody, #products_grid tr, #products_grid td {
float: left;
width: 100%;
@@ -145,6 +145,16 @@
height: 300px;
display: inline-block;
}
.products_pager {
text-align: center;
margin: 10px 0;
}
.products_pager .pagination {
float: none !important;
margin: 0 !important;
padding: 0 !important;
}
}
@media (max-width: 400px) {
#products_grid .oe_product {
@@ -121,7 +121,7 @@
.oe-height-8
height: 560px
@media (max-width: 600px)
@media (max-width: 768px)
#products_grid
table, tbody,tr, td
float: left
@@ -132,6 +132,13 @@
width: 100%
height: 300px
display: inline-block
.products_pager
text-align: center
margin: 10px 0
.pagination
float: none !important
margin: 0 !important
padding: 0 !important
@media (max-width: 400px)
#products_grid
@@ -17,7 +17,7 @@ $(document).ready(function () {
function set_my_cart_quantity(qty) {
var $q = $(".my_cart_quantity");
$q.parent().parent().toggleClass("hidden", !qty);
$q.parent().parent().removeClass("hidden", !qty);
$q.html(qty)
.hide()
.fadeIn(600);
+67 -46
View File
@@ -4,7 +4,7 @@
<!-- Layout add nav and footer -->
<template id="header" inherit_id="website.layout" name="Custom Header">
<template id="header" inherit_id="website.layout" name="Header Shop My Cart Link">
<xpath expr="//header//ul[@id='top_menu']/li" position="before">
<li t-att-class="(not website_sale_order or not website_sale_order.get_total_quantity()) and 'hidden' or ''">
<a t-href="/shop/mycart/">
@@ -19,7 +19,7 @@
<!-- List of categories -->
<template id="categories_recursive" name="Category list">
<li t-att-class="category.id == search.get('category') and 'active' or ''">
<li t-att-class="str(category.id) == search.get('category') and 'active' or ''">
<a t-att-class="category.id not in categ[1] and 'unpublish' or ''" t-href="/shop/?category=#{ category.id }" t-field="category.name" t-keep-query="search,facettes"></a>
<ul t-if="category.child_id" class="nav nav-pills nav-stacked nav-hierarchy">
<t t-foreach="category.child_id" t-as="category">
@@ -33,6 +33,12 @@
<!-- Product list -->
<template id="search" name="Search hidden fields">
<input type="hidden" name="category" t-att-value="search.get('category') or ''"/>
<input type="hidden" name="filter" t-att-value="search.get('filter') or ''"/>
<input type="text" name="search" class="search-query form-control" placeholder="Search..." t-att-value="search.get('search') or ''"/>
</template>
<template id="products_cart" name="Shopping cart">
<div class="ribbon-wrapper">
<div class="ribbon">Promo</div>
@@ -78,26 +84,27 @@
<div class="oe_structure"/>
<div class="container oe_website_sale">
<div class="row">
<div class="col-sm-6 pagination" style="padding-left: 15px;">
<div class="col-sm-6 pagination hidden-xs" style="padding-left: 15px;">
<form t-if="editable" t-keep-query="category,search,facettes"
method="POST" t-action="/shop/add_product">
<button class="btn btn-primary">New Product</button>
</form>
</div>
<div class="col-sm-6">
<div class="col-sm-6 products_pager">
<t t-call="website.pager">
<t t-set="classname">pull-right</t>
<t t-set="style">padding-left: 5px;</t>
</t>
<form t-action="/shop/" method="get" class="pull-right pagination form-inline" style="padding-right: 5px;" t-keep-query="category,search,facettes">
<div class="form-group">
<input type="text" name="search" class="search-query form-control" placeholder="Search..." t-att-value="search.get('search') or ''"/>
</div>
<form t-action="/shop/" method="get" class="pull-right pagination form-inline" style="padding-right: 5px;">
<t t-call="website_sale.search" />
</form>
</div>
</div>
<div class='style_default row'>
<div class="hidden" id="products_grid_before"></div>
<div class="col-md-12" id="products_grid">
<t t-if="product_ids">
<table width="100%">
<tbody>
<t t-set="table_products" t-value="Ecommerce.get_bin_packing_products(product_ids, product_ids_for_holes, 4)"/>
@@ -171,9 +178,13 @@
</tr>
</tbody>
</table>
</t>
<t t-if="not product_ids">
<h3 class="text-center text-muted">No product found for this search</h3>
</t>
</div>
</div>
<div>
<div class="products_pager">
<t t-call="website.pager">
<t t-set="classname">pull-right</t>
</t>
@@ -251,17 +262,9 @@
</li>
</t>
</div><div class="col-sm-3 col-sm-offset-1">
<form t-action="/shop/" method="get" class="pull-right" t-keep-query="category,facettes">
<div class="input-group">
<t t-if="search">
<t t-foreach="search.items()" t-as="key">
<input t-att-name="key[0]" t-att-value="key[1]"/>
</t>
</t>
<span class="input-group-addon"><span class="glyphicon glyphicon-search"/></span>
<input type="text" name="search" class="search-query form-control" placeholder="Search..." t-att-value="search or ''"/>
</div>
</form>
<form t-action="/shop/" method="get" class="pull-right">
<t t-call="website_sale.search" />
</form>
</div>
</div>
</section>
@@ -269,7 +272,7 @@
<section class="container oe_website_sale mb16" id="product_detail">
<div class="row">
<div class="col-sm-7 col-md-7 col-lg-7">
<span t-field="product.image" style="max-height: 500px" t-field-options='{"widget": "image"}'/>
<span t-field="product.image" style="max-height: 500px" t-field-options='{"widget": "image", "class": "img img-responsive"}'/>
</div><div class="col-sm-5 col-md-5 col-lg-4 col-lg-offset-1">
<h1 t-field="product.name">Product Name</h1>
@@ -342,6 +345,16 @@
</xpath>
</template>
<template id="product_attributes" inherit_option_id="website_sale.product" name="Product Attributes">
<xpath expr="//p[@t-field='product.description_sale']" position="after">
<hr t-if="product.website_attribute_ids"/>
<p class="text-muted">
<t t-set="attr" t-value="None"/>
<t t-foreach="product.website_attribute_ids" t-as="attribute"><br t-if="attr and attribute.attribute_id.id != attr"/><t t-if="attribute.attribute_id.id != attr"><span t-field="attribute.attribute_id"/>: </t><t t-if="attribute.attribute_id.id == attr">, </t><t t-if="attribute.attribute_id.type == 'distinct'"><span t-field="attribute.value_id"/></t><t t-if="attribute.attribute_id.type == 'float'"><span t-field="attribute.value"/></t><t t-set="attr" t-value="attribute.attribute_id.id"/></t>
</p>
</xpath>
</template>
<!-- Page Shop my cart -->
<template id="mycart" name="Your Cart">
@@ -362,18 +375,6 @@
</ul>
<h1 class="mb32">Shopping Cart</h1>
<div class="row">
<div class="col-md-3 text-muted" id="right_column">
<h4>Policies</h4>
<ul class="list-unstyled mb32">
<li>&#9745; 30-days money-back guarantee</li>
<li>&#9745; Invoice sent by e-Mail</li>
</ul>
<h4>Secure Payment</h4>
<ul class="list-unstyled mb32">
<li>&#9745; 256 bit encryption</li>
<li>&#9745; Processed by Ogone</li>
</ul>
</div>
<div class="col-md-8 col-md-offset-1 oe_mycart">
<div t-if="not website_sale_order or not website_sale_order.order_line" class="well well-lg">
Your cart is empty!
@@ -467,6 +468,18 @@
<a t-if="website_sale_order and website_sale_order.order_line" t-href="/shop/checkout/" class="btn btn-primary pull-right mb32">Process Checkout <span class="icon-long-arrow-right"/></a>
<div class="oe_structure"/>
</div>
<div class="col-md-3 text-muted" id="right_column">
<h4>Policies</h4>
<ul class="list-unstyled mb32">
<li>&#9745; 30-days money-back guarantee</li>
<li>&#9745; Invoice sent by e-Mail</li>
</ul>
<h4>Secure Payment</h4>
<ul class="list-unstyled mb32">
<li>&#9745; 256 bit encryption</li>
<li>&#9745; Processed by Ogone</li>
</ul>
</div>
</div>
</div>
@@ -478,24 +491,25 @@
<!-- Page Shop -->
<template id="products_categories" inherit_option_id="website_sale.products" name="Product Categories">
<xpath expr="//div[@id='products_grid']" position="before">
<div id="categories" class="col-md-3">
<ul class="nav nav-pills nav-stacked mt16">
<li t-att-class=" '' if search.get('category') else 'active' "><a t-href="/shop/">All Products</a></li>
<t t-set="categ" t-value="Ecommerce.get_categories()"/>
<t t-foreach="categ[0]" t-as="category">
<t t-call="website_sale.categories_recursive"/>
</t>
</ul>
</div>
<xpath expr="//div[@id='products_grid_before']" position="inside">
<ul class="nav nav-pills nav-stacked mt16">
<li t-att-class=" '' if search.get('category') else 'active' "><a t-href="/shop/">All Products</a></li>
<t t-set="categ" t-value="Ecommerce.get_categories()"/>
<t t-foreach="categ[0]" t-as="category">
<t t-call="website_sale.categories_recursive"/>
</t>
</ul>
</xpath>
<xpath expr="//div[@id='products_grid_before']" position="attributes">
<attribute name="class">col-md-3</attribute>
</xpath>
<xpath expr="//div[@id='products_grid']" position="attributes">
<attribute name="class">col-md-9</attribute>
</xpath>
</template>
<template id="products_attributes" inherit_option_id="website_sale.products_categories" name="Product Filters and Attributes">
<xpath expr="//div[@id='categories']" position="inside">
<template id="products_attributes" inherit_option_id="website_sale.products" name="Product Filters and Attributes">
<xpath expr="//div[@id='products_grid_before']" position="inside">
<form t-action="/shop/filter/" method="post" t-keep-query="category,search,add_filter">
<ul class="nav nav-pills nav-stacked mt16">
<t t-set="attribute_ids" t-value="Ecommerce.get_attribute_ids()"/>
@@ -529,11 +543,18 @@
</t>
</ul>
<button class="btn btn-xs btn-primary mt16">Apply filter</button>
<a t-href="/shop/" t-keep-query="category,search,add_filter" class="btn btn-xs btn-default mt16">Cancel filter</a>
</form>
</xpath>
<xpath expr="//div[@id='products_grid_before']" position="attributes">
<attribute name="class">col-md-3</attribute>
</xpath>
<xpath expr="//div[@id='products_grid']" position="attributes">
<attribute name="class">col-md-9</attribute>
</xpath>
</template>
<template id="suggested_products_list" inherit_id="website_sale.mycart" inherit_option_id="website_sale.mycart" name="Suggested Products in list view">
<template id="suggested_products_list" inherit_id="website_sale.mycart" inherit_option_id="website_sale.mycart" name="Suggested Products in my cart">
<xpath expr="//table[@id='mycart_products']" position="after">
<table t-if="suggested_products" class='table table-striped table-condensed'>
<colgroup>
@@ -64,7 +64,7 @@
<field name="website_published"/>
</xpath>
<xpath expr="//page[@string='Information']" position="inside">
<group colspan="4" string="Products On Ecommerce">
<group colspan="4" string="Website Options">
<field name="suggested_product_ids" widget="many2many_tags"/>
<field name="website_style_ids" widget="many2many_tags"/>
<field colspan="4" name="website_attribute_ids" nolabel="1">
@@ -81,9 +81,22 @@
</group>
</xpath>
</field>
</record>
<record model="ir.ui.view" id="view_product_attribute_form">
<field name="name">product.attribute.form</field>
<field name="model">product.attribute</field>
<field name="arch" type="xml">
<form string="Product Attributes" version="7.0">
<group>
<field name="name"/>
<field name="type"/>
<field name="visible"/>
</group>
</form>
</field>
</record>
</data>
</openerp>