[MERGE] Merge parents
bzr revid: rim@openerp.com-20131031081039-9dtoq4rhmbvpz83f
This commit is contained in:
commit
0221fa91f7
|
@ -271,10 +271,21 @@ class Website(openerp.addons.web.controllers.main.Home):
|
|||
def robots(self):
|
||||
return request.website.render('website.robots', {'url_root': request.httprequest.url_root})
|
||||
|
||||
@website.route(['/sitemap.xml'], type='http', auth="public")
|
||||
def sitemap(self):
|
||||
@website.route('/sitemap', type='http', auth='public', multilang=True)
|
||||
def sitemap(self, **kwargs):
|
||||
return request.website.render('website.sitemap', {'pages': request.website.list_pages()})
|
||||
|
||||
@website.route('/sitemap.xml', type='http', auth="public")
|
||||
def sitemap_xml(self):
|
||||
body = request.website.render('website.sitemap_xml', {
|
||||
'pages': request.website.list_pages()
|
||||
})
|
||||
|
||||
return request.make_response(body, [
|
||||
('Content-Type', 'application/xml;charset=utf-8')
|
||||
])
|
||||
|
||||
|
||||
class Images(http.Controller):
|
||||
def placeholder(self, response):
|
||||
# file_open may return a StringIO. StringIO can be closed but are
|
||||
|
|
|
@ -9,5 +9,8 @@
|
|||
<field name="social_linkedin">http://www.linkedin.com/company/openerp</field>
|
||||
</record>
|
||||
|
||||
<record id="base.main_company" model="res.company">
|
||||
<field name="rml_header1">Great Product for Great People</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -131,7 +131,9 @@ class view(osv.osv):
|
|||
arch_section = html.fromstring(
|
||||
value, parser=html.HTMLParser(encoding='utf-8'))
|
||||
|
||||
self._normalize_urls(arch_section)
|
||||
# TODO fme: Temporary desactivated because this breaks most of the snippets
|
||||
# Need to find another way to normalize multilang urls (postprocessing) ?
|
||||
# self._normalize_urls(arch_section)
|
||||
|
||||
if xpath is None:
|
||||
# value is an embedded field on its own, not a view section
|
||||
|
|
|
@ -55,7 +55,7 @@ def url_for(path, lang=None, keep_query=None):
|
|||
if request:
|
||||
path = urljoin(request.httprequest.path, path)
|
||||
langs = request.context.get('langs')
|
||||
if path[0] == '/' and len(langs) > 1:
|
||||
if path[0] == '/' and (len(langs) > 1 or lang):
|
||||
ps = path.split('/')
|
||||
lang = lang or request.context.get('lang')
|
||||
if ps[1] in langs:
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
@charset "utf-8";
|
||||
/* ---- CKEditor Minimal Reset ---- */
|
||||
.navbar.navbar-inverse .cke_chrome {
|
||||
border: none;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
/* THIS CSS FILE IS FOR WEBSITE THEMING CUSTOMIZATION ONLY
|
||||
*
|
||||
* css for editor buttons, openerp widget included in the website and other
|
||||
* stuff must go to the editor.css
|
||||
* stuff must go to the editor.css
|
||||
*
|
||||
*/
|
||||
/* ----- GENERIC LAYOUTING HELPERS ---- */
|
||||
|
@ -440,3 +440,7 @@ a[data-publish][data-publish='on']:hover .css_published {
|
|||
::selection {
|
||||
background: rgba(150, 150, 220, 0.3);
|
||||
}
|
||||
|
||||
.logo-img {
|
||||
width: 220px;
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
@charset "utf-8"
|
||||
|
||||
/*
|
||||
/*
|
||||
* THIS CSS FILE IS FOR WEBSITE THEMING CUSTOMIZATION ONLY
|
||||
*
|
||||
* css for editor buttons, openerp widget included in the website and other
|
||||
* stuff must go to the editor.css
|
||||
* stuff must go to the editor.css
|
||||
*
|
||||
*/
|
||||
|
||||
|
@ -133,7 +133,7 @@ html,body, #wrapwrap
|
|||
|
||||
header, #wrap, footer
|
||||
display: table-row
|
||||
|
||||
|
||||
footer
|
||||
height: 100%
|
||||
background: rgb(239, 248, 248)
|
||||
|
@ -183,7 +183,7 @@ footer
|
|||
// .navbar .nav > li a
|
||||
// text-shadow: none
|
||||
|
||||
// .nav > li a
|
||||
// .nav > li a
|
||||
// display: block
|
||||
|
||||
.carousel-inner .item
|
||||
|
@ -284,7 +284,6 @@ footer
|
|||
height: 300px
|
||||
&.oe_big
|
||||
height: 450px
|
||||
|
||||
/* -- Hack for removing double scrollbar from mobile preview -- */
|
||||
div#mobile-preview.modal
|
||||
overflow: hidden
|
||||
|
@ -335,3 +334,6 @@ a[data-publish]
|
|||
|
||||
::selection
|
||||
background: rgba(150, 150, 220, 0.3)
|
||||
|
||||
.logo-img
|
||||
width: 220px
|
||||
|
|
|
@ -1037,6 +1037,11 @@
|
|||
this.$target.attr("id", "myCarousel" + id);
|
||||
this.$target.find(".carousel-control").attr("href", "#myCarousel" + id);
|
||||
this.$target.find("[data-target='#myCarousel']").attr("data-target", "#myCarousel" + id);
|
||||
|
||||
this.$target.attr('contentEditable', 'false')
|
||||
.find('.content, .carousel-image img')
|
||||
.attr('contentEditable', 'true');
|
||||
|
||||
this.rebind_event();
|
||||
},
|
||||
onFocus: function () {
|
||||
|
@ -1053,6 +1058,9 @@
|
|||
if(!this.$target.find(".item.active").length) {
|
||||
this.$target.find(".item:first").addClass("active");
|
||||
}
|
||||
this.$target.removeAttr('contentEditable')
|
||||
.find('.content, .carousel-image img')
|
||||
.removeAttr('contentEditable');
|
||||
},
|
||||
start : function () {
|
||||
this._super();
|
||||
|
@ -1223,7 +1231,6 @@
|
|||
size = 'oe_small';
|
||||
else if ($el.hasClass('oe_medium'))
|
||||
size = 'oe_medium';
|
||||
|
||||
var $ul = this.$editor.find('ul[name="parallax-size"]');
|
||||
var $li = $ul.find("li");
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
<img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block_banner.png"/>
|
||||
<span class="oe_snippet_thumbnail_title">Banner</span>
|
||||
</div>
|
||||
<div id="myCarousel" class="oe_snippet_body carousel slide oe_medium mb32" contenteditable="false">
|
||||
<div id="myCarousel" class="oe_snippet_body carousel slide oe_medium mb32">
|
||||
<!-- Indicators -->
|
||||
<ol class="carousel-indicators hidden">
|
||||
<li data-target="#myCarousel" data-slide-to="0" class="active"></li>
|
||||
|
@ -70,7 +70,7 @@
|
|||
<div class="carousel-inner">
|
||||
<div class="item image_text active" style="background-image: url('/website/static/src/img/banner/color_splash.jpg')">
|
||||
<div class="container">
|
||||
<div class="carousel-caption content" contenteditable="true">
|
||||
<div class="carousel-caption content">
|
||||
<h2>Your Banner Title</h2>
|
||||
<h3>Click to customize this text</h3>
|
||||
<p>
|
||||
|
@ -78,7 +78,7 @@
|
|||
</p>
|
||||
</div>
|
||||
<div class="carousel-image hidden-xs">
|
||||
<img src="/website/static/src/img/banner/banner_picture.png" contenteditable="true" alt="Banner OpenERP Image"/>
|
||||
<img src="/website/static/src/img/banner/banner_picture.png" alt="Banner OpenERP Image"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -692,6 +692,7 @@
|
|||
<li data-value="/website/static/src/img/banner/landscape.jpg"><a>Landscape</a></li>
|
||||
<li data-value="/website/static/src/img/parallax/parallax_photo1.jpg"><a>Photo Woman</a></li>
|
||||
<li data-value="/website/static/src/img/banner/mountains.jpg"><a>Mountains</a></li>
|
||||
<li data-value="/website/static/src/img/parallax/parallax_bg.jpg"><a>Office</a></li>
|
||||
<li class="oe_custom_bg"><a><b>Chose your picture</b></a></li>
|
||||
</ul>
|
||||
</li>
|
||||
|
|
|
@ -401,10 +401,22 @@ User-agent: *
|
|||
Sitemap: <t t-esc="url_root"/>sitemap.xml
|
||||
</template>
|
||||
|
||||
<template id="sitemap">
|
||||
<template id="sitemap" name="Site Map" page="True">
|
||||
<t t-call="website.layout">
|
||||
<ul>
|
||||
<li t-foreach="pages" t-as="page">
|
||||
<a t-att-href="page['url']"><t t-esc="page['name']"/></a>
|
||||
</li>
|
||||
</ul>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
<template id="sitemap_xml">
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
<t t-foreach="pages" t-as="page">
|
||||
<url t-esc="page['url']"/>
|
||||
<url>
|
||||
<loc><t t-esc="page['url']"/></loc>
|
||||
</url>
|
||||
</t>
|
||||
</urlset>
|
||||
</template>
|
||||
|
@ -460,31 +472,42 @@ Sitemap: <t t-esc="url_root"/>sitemap.xml
|
|||
|
||||
<template id="aboutus" name="About us" page="True">
|
||||
<t t-call="website.layout">
|
||||
<div id="wrap">
|
||||
<div class="oe_structure"/>
|
||||
<div class="container mb32">
|
||||
<div class="row col-wrap" id="aboutus">
|
||||
<div class="col-sm-12 text-center">
|
||||
<h1>About us</h1>
|
||||
<h3 class="text-muted">A passion for great products</h3>
|
||||
</div>
|
||||
<div class="col-sm-8 mt16">
|
||||
<p>
|
||||
We are a team of passionated people whose goal is to improve everyone's
|
||||
life through disruptive products. We build great products to solve your
|
||||
business problems.
|
||||
</p>
|
||||
<p>
|
||||
Our products are designed for small to medium companies willing to optimize
|
||||
their performance.
|
||||
</p>
|
||||
</div><div class="col-sm-3 col-sm-offset-1">
|
||||
<img src="/website/static/src/img/library/business_conference.jpg" class="img img-responsive shadow" alt="Out Team"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oe_structure"/>
|
||||
</div>
|
||||
<div id="wrap">
|
||||
<div data-snippet-id="parallax">
|
||||
<div style="background-image: url('/website/static/src/img/parallax/parallax_bg.jpg')" data-stellar-background-ratio="0.3" class="parallax oe_structure mt32 mb32 oe_small">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12 mt32 mb32" data-snippet-id="colmd">
|
||||
<div class="text-center">
|
||||
<img src="/web/static/src/img/logo.png" class="img shadow logo-img"/>
|
||||
</div>
|
||||
<h3 class="text-center text-muted" t-field="res_company.rml_header1"></h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oe_structure"/>
|
||||
<div class="container mb32">
|
||||
<div class="row col-wrap" id="aboutus">
|
||||
<div class="col-sm-8 mt16">
|
||||
<p>
|
||||
We are a team of passionated people whose goal is to improve everyone's
|
||||
life through disruptive products. We build great products to solve your
|
||||
business problems.
|
||||
</p>
|
||||
<p>
|
||||
Our products are designed for small to medium companies willing to optimize
|
||||
their performance.
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-sm-3 col-sm-offset-1">
|
||||
<img src="/website/static/src/img/library/business_conference.jpg" class="img img-responsive shadow" alt="Out Team"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oe_structure"/>
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ class WebsiteBlog(http.Controller):
|
|||
'/blog/cat/<int:category_id>/page/<int:page>/',
|
||||
'/blog/tag/',
|
||||
'/blog/tag/<int:tag_id>/',
|
||||
], type='http', auth="public")
|
||||
], type='http', auth="public", multilang=True)
|
||||
def blog(self, category_id=None, blog_post_id=None, tag_id=None, page=1, **post):
|
||||
""" Prepare all values to display the blog.
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
@import url(compass/css3.css);
|
||||
@charset "UTF-8";
|
||||
.css_website_mail .has-error {
|
||||
border-color: red;
|
||||
}
|
||||
|
@ -22,11 +22,14 @@ p.post-meta {
|
|||
}
|
||||
|
||||
.js_website_blog div#right_column section {
|
||||
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=60);
|
||||
opacity: 0.6;
|
||||
}
|
||||
.js_website_blog div#right_column section:hover {
|
||||
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
|
||||
opacity: 1;
|
||||
-moz-transition: all 0.2s ease-out;
|
||||
-webkit-transition: all 0.2s ease-out;
|
||||
-moz-transition: all 0.2s ease-out;
|
||||
-o-transition: all 0.2s ease-out;
|
||||
transition: all 0.2s ease-out;
|
||||
}
|
||||
|
|
|
@ -1,30 +1,29 @@
|
|||
@charset "utf-8"
|
||||
|
||||
@import "compass/css3"
|
||||
|
||||
.css_website_mail
|
||||
.has-error
|
||||
border-color: red
|
||||
.css_nav_month
|
||||
display: none
|
||||
&:first-of-type
|
||||
display: block
|
||||
.has-error
|
||||
border-color: red
|
||||
.css_nav_month
|
||||
display: none
|
||||
&:first-of-type
|
||||
display: block
|
||||
|
||||
.blog_content
|
||||
a.oe_mail_expand:after
|
||||
content: " →"
|
||||
a.oe_mail_expand
|
||||
font-weight: bold
|
||||
a.oe_mail_expand:after
|
||||
content: " →"
|
||||
a.oe_mail_expand
|
||||
font-weight: bold
|
||||
|
||||
p.post-meta
|
||||
position: relative
|
||||
top: -5px
|
||||
position: relative
|
||||
top: -5px
|
||||
|
||||
.js_website_blog
|
||||
div#right_column
|
||||
section
|
||||
opacity: 0.6
|
||||
section:hover
|
||||
opacity: 1
|
||||
-moz-transition: all 0.2s ease-out
|
||||
-webkit-transition: all 0.2s ease-out
|
||||
transition: all 0.2s ease-out
|
||||
|
||||
div#right_column
|
||||
section
|
||||
+opacity(0.6)
|
||||
section:hover
|
||||
+opacity(1)
|
||||
@include transition(all 0.2s ease-out)
|
||||
|
|
|
@ -4,10 +4,10 @@
|
|||
<!-- Layout add nav and footer -->
|
||||
<template id="header_footer_custom" inherit_id="website.layout">
|
||||
<xpath expr="//header//ul[@id='top_menu']/li[@name='contactus']" position="before">
|
||||
<li><a t-attf-href="/blog/cat/%(website_blog.blog_category_1)d/">News</a></li>
|
||||
<li><a t-href="/blog/cat/%(website_blog.blog_category_1)d/">News</a></li>
|
||||
</xpath>
|
||||
<xpath expr="//footer//div[@name='info']/ul" position="inside">
|
||||
<li><a t-attf-href="/blog/cat/%(website_blog.blog_category_1)d/">News</a></li>
|
||||
<li><a t-href="/blog/cat/%(website_blog.blog_category_1)d/">News</a></li>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
|
@ -24,17 +24,17 @@
|
|||
<t t-call="website.publish_management">
|
||||
<t t-set="object" t-value="blog_post"/>
|
||||
<t t-set="publish_edit" t-value="True"/>
|
||||
<t t-set="publish_duplicate" t-value="'/blog/%s/duplicate' % (blog_post.id)"/>
|
||||
<t t-set="publish_duplicate" t-value="'/blog/#{blog_post.id}/duplicate'"/>
|
||||
</t>
|
||||
</div>
|
||||
<h2 class="text-center">
|
||||
<a t-attf-href="/blog/#{blog_post.id}" t-field="blog_post.name"></a>
|
||||
<a t-href="/blog/#{blog_post.id}" t-field="blog_post.name"></a>
|
||||
</h2>
|
||||
<p class="post-meta text-muted text-center" name='blog_post_data'>
|
||||
<span class="icon-calendar"> <span t-field="blog_post.create_date"/></span> &nbsp;
|
||||
<span class="icon-user"> By <span t-field="blog_post.create_uid"/> &nbsp;</span>
|
||||
<span t-if="len(blog_post.message_ids) > 0" class="icon-comment">
|
||||
<a t-attf-href="/blog/#{blog_post.id}/#comment">
|
||||
<a t-href="/blog/#{blog_post.id}/#comment">
|
||||
<t t-if="len(blog_post.message_ids) <= 1" ><t t-esc="len(blog_post.message_ids)"/> comment</t>
|
||||
<t t-if="len(blog_post.message_ids) > 1"><t t-esc="len(blog_post.message_ids)"/> comments</t>
|
||||
</a>
|
||||
|
@ -69,7 +69,7 @@
|
|||
<p class="post-meta text-muted text-center" t-if="len(blog_post.tag_ids)">
|
||||
<span class="icon-tags"/>
|
||||
<t t-foreach="blog_post.tag_ids" t-as="tag">
|
||||
<a t-attf-href="/blog/tag/#{tag.id}" t-esc="tag.name"/> &nbsp;
|
||||
<a t-href="/blog/tag/#{tag.id}" t-esc="tag.name"/> &nbsp;
|
||||
</t>
|
||||
</p>
|
||||
</xpath>
|
||||
|
@ -90,7 +90,7 @@
|
|||
<p class="post-meta text-muted text-center" name="blog_post_data">
|
||||
<span class="icon-calendar"> <span t-field="blog_post.create_date"/></span> &nbsp;
|
||||
<span class="icon-user"> By <span t-field="blog_post.create_uid"/> &nbsp;</span>
|
||||
<span t-if="len(blog_post.message_ids) > 0" class="icon-comment"> With
|
||||
<span t-if="len(blog_post.message_ids) > 0" class="icon-comment"> With
|
||||
<a t-attf-href="#comments">
|
||||
<t t-if="len(blog_post.message_ids) <= 1" ><t t-esc="len(blog_post.message_ids)"/> comment</t>
|
||||
<t t-if="len(blog_post.message_ids) > 1"><t t-esc="len(blog_post.message_ids)"/> comments</t>
|
||||
|
@ -169,13 +169,13 @@
|
|||
<p class="post-meta text-muted text-center" t-if="len(blog_post.tag_ids)">
|
||||
<span class="icon-tags"/>
|
||||
<t t-foreach="blog_post.tag_ids" t-as="tag">
|
||||
<a t-attf-href="/blog/tag/#{tag.id}" t-esc="tag.name"/> &nbsp;
|
||||
<a t-href="/blog/tag/#{tag.id}" t-esc="tag.name"/> &nbsp;
|
||||
</t>
|
||||
</p>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
<!-- Page -->
|
||||
<!-- Page -->
|
||||
<template id="index" name="Blog" page="True">
|
||||
<t t-call="website.layout">
|
||||
<t t-set="head">
|
||||
|
@ -188,7 +188,7 @@
|
|||
<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">
|
||||
<a t-attf-href="/blog/#{category.id}/new" class="btn btn-primary pull-right">New Blog Post</a>
|
||||
<a t-href="/blog/#{category.id}/new" class="btn btn-primary pull-right">New Blog Post</a>
|
||||
</div>
|
||||
</t>
|
||||
<t t-foreach="blog_posts" t-as="blog_post" data-publish="">
|
||||
|
@ -301,7 +301,7 @@
|
|||
<ul class="nav nav-pills nav-stacked">
|
||||
<t t-foreach="categories" t-as="nav_category">
|
||||
<li>
|
||||
<a t-attf-href="/blog/#{nav_category.id}">
|
||||
<a t-href="/blog/#{nav_category.id}">
|
||||
<span t-field="nav_category.name"/>
|
||||
</a>
|
||||
</li>
|
||||
|
|
|
@ -94,7 +94,7 @@ class WebsiteCrmPartnerAssign(http.Controller):
|
|||
def partners_ref(self, partner_id=0, **post):
|
||||
partner_obj = request.registry['res.partner']
|
||||
if request.context['is_public_user']:
|
||||
partner_ids = partner_obj.search(request.cr, openerp.SUPERUSER_ID, [('website_pushished', '=', True), ('id', '=', partner_id)], context=request.context)
|
||||
partner_ids = partner_obj.search(request.cr, openerp.SUPERUSER_ID, [('website_published', '=', True), ('id', '=', partner_id)], context=request.context)
|
||||
else:
|
||||
partner_ids = partner_obj.search(request.cr, request.uid, [('id', '=', partner_id)], context=request.context)
|
||||
if not partner_ids:
|
||||
|
|
|
@ -182,7 +182,10 @@ class website_event(http.Controller):
|
|||
|
||||
_values = None
|
||||
for key, value in post.items():
|
||||
quantity = int(value)
|
||||
try:
|
||||
quantity = int(value)
|
||||
except:
|
||||
quantity = None
|
||||
ticket_id = key.split("-")[0] == 'ticket' and int(key.split("-")[1]) or None
|
||||
if not ticket_id or not quantity:
|
||||
continue
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_event_event_public,event.event.public,event.model_event_event,base.group_public,1,0,0,0
|
||||
access_event_type_public,event.type.public,event.model_event_type,base.group_public,1,0,0,0
|
||||
access_event_event_ticket_public,event.event.ticket.public,event_sale.model_event_event_ticket,base.group_public,1,0,0,0
|
||||
access_event_product_product_public,event.product.product.public,product.model_product_product,base.group_public,1,0,0,0
|
||||
access_event_product_product_public,event.product.product.public,product.model_product_product,base.group_public,1,0,0,0
|
||||
|
|
|
|
@ -12,7 +12,7 @@
|
|||
</xpath>
|
||||
</template>
|
||||
|
||||
<!-- Page -->
|
||||
<!-- Page -->
|
||||
<template id="index" name="Events" page="True">
|
||||
<t t-call="website.layout">
|
||||
<div id="wrap">
|
||||
|
@ -124,7 +124,7 @@
|
|||
|
||||
<h1 class="text-center" t-field="event_id.name"></h1>
|
||||
<h4 class="text-center text-muted">
|
||||
<i class="icon-time"></i> <span t-field="event_id.date_begin"/> to
|
||||
<i class="icon-time"></i> <span t-field="event_id.date_begin"/> to
|
||||
<span t-field="event_id.date_end"/>
|
||||
</h4>
|
||||
<h4 t-if="event_id.city and event_id.country_id" class="text-center text-muted">
|
||||
|
@ -262,12 +262,12 @@
|
|||
|
||||
<ul class="list-unstyled">
|
||||
<li t-if="event_id.type">
|
||||
<a t-att-href="'/event?type='+str(event_id.type.id)"><strong><span class="icon-double-angle-right"/> Other <t t-esc="event_id.type.name"/></strong></a>
|
||||
<a t-href="/event?type=#{event_id.type.id}"><strong><span class="icon-double-angle-right"/> Other <t t-esc="event_id.type.name"/></strong></a>
|
||||
</li>
|
||||
<li t-if="event_id.country_id">
|
||||
<a t-att-href="'/event?country='+str(event_id.country_id.id)"><strong><span class="icon-double-angle-right"/> Other Events in <span t-esc="event_id.country_id.name"/></strong></a>
|
||||
<a t-href="/event?country=#{event_id.country_id.id}"><strong><span class="icon-double-angle-right"/> Other Events in <span t-esc="event_id.country_id.name"/></strong></a>
|
||||
</li>
|
||||
<li><a href="/event"><strong><span class="icon-double-angle-right"/> All Events</strong></a></li>
|
||||
<li><a t-href="/event"><strong><span class="icon-double-angle-right"/> All Events</strong></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -7,7 +7,7 @@ import base64
|
|||
|
||||
class website_hr_recruitment(http.Controller):
|
||||
|
||||
@website.route(['/jobs', '/jobs/page/<int:page>/', '/department/<id>/', '/department/<id>/page/<int:page>/'], type='http', auth="public")
|
||||
@website.route(['/jobs', '/jobs/page/<int:page>/', '/department/<id>/', '/department/<id>/page/<int:page>/'], type='http', auth="public", multilang=True)
|
||||
def jobs(self, id=0, page=1, **post):
|
||||
id = id and int(id) or 0
|
||||
hr_job_obj = request.registry['hr.job']
|
||||
|
@ -36,7 +36,7 @@ class website_hr_recruitment(http.Controller):
|
|||
step = 10
|
||||
pager = request.website.pager(url="/jobs/", total=len(jobpost_ids), page=page, step=step, scope=5)
|
||||
jobpost_ids = hr_job_obj.search(request.cr, request.uid, domain, limit=step, offset=pager['offset'])
|
||||
|
||||
|
||||
values = {
|
||||
'active': active,
|
||||
'companies': companies,
|
||||
|
@ -47,16 +47,15 @@ class website_hr_recruitment(http.Controller):
|
|||
}
|
||||
return request.website.render("website_hr_recruitment.index", values)
|
||||
|
||||
@website.route(['/job/detail/<id>'], type='http', auth="public")
|
||||
def detail(self, id=0):
|
||||
id = id and int(id) or 0
|
||||
@website.route(['/job/detail/<model("hr.job"):job>'], type='http', auth="public", multilang=True)
|
||||
def detail(self, job=None):
|
||||
values = {
|
||||
'job': request.registry['hr.job'].browse(request.cr, request.uid, id),
|
||||
'vals_date': request.registry['hr.job'].browse(request.cr, request.uid, id).write_date.split(' ')[0]
|
||||
'job': job,
|
||||
'vals_date': job.write_date.split(' ')[0],
|
||||
}
|
||||
return request.website.render("website_hr_recruitment.detail", values)
|
||||
|
||||
@website.route(['/job/success'], type='http', auth="admin")
|
||||
@website.route(['/job/success'], type='http', auth="admin", multilang=True)
|
||||
def success(self, **post):
|
||||
id = request.registry['hr.applicant'].create(request.cr, request.uid, post)
|
||||
if post['ufile']:
|
||||
|
@ -74,9 +73,9 @@ class website_hr_recruitment(http.Controller):
|
|||
'jobid': post['job_id']
|
||||
}
|
||||
return request.website.render("website_hr_recruitment.thankyou", values)
|
||||
|
||||
@website.route(['/apply/<int:id>'], type='http', auth="public")
|
||||
def applyjobpost(self, id=0):
|
||||
|
||||
@website.route(['/apply/<int:id>'], type='http', auth="public", multilang=True)
|
||||
def applyjobpost(self, id=0, **kwargs):
|
||||
id = id and int(id) or 0
|
||||
job = request.registry['hr.job'].browse(request.cr, request.uid, id)
|
||||
values = {
|
||||
|
@ -84,7 +83,7 @@ class website_hr_recruitment(http.Controller):
|
|||
}
|
||||
return request.website.render("website_hr_recruitment.applyjobpost", values)
|
||||
|
||||
@website.route('/recruitment/published', type='json', auth="admin")
|
||||
@website.route('/recruitment/published', type='json', auth="admin", multilang=True)
|
||||
def published (self, id, **post):
|
||||
hr_job = request.registry['hr.job']
|
||||
id = int(id)
|
||||
|
|
|
@ -9,10 +9,10 @@
|
|||
|
||||
<template id="job_footer_custom" inherit_id="website.layout" name="Custom Footer Job">
|
||||
<xpath expr="//header//ul[@id='top_menu']/li[@name='contactus']" position="before">
|
||||
<li><a href="/jobs">Jobs</a></li>
|
||||
<li><a t-href="/jobs">Jobs</a></li>
|
||||
</xpath>
|
||||
<xpath expr="//footer//div[@name='info']/ul" position="inside">
|
||||
<li><a href="/jobs">Jobs</a></li>
|
||||
<li><a t-href="/jobs">Jobs</a></li>
|
||||
</xpath>
|
||||
</template>
|
||||
|
||||
|
@ -36,7 +36,7 @@
|
|||
<t t-if="job.no_of_recruitment">
|
||||
<span class="label label-default pull-right label-info"><t t-esc="vals[job.id]['count']"/> Vacancies.</span>
|
||||
</t>
|
||||
<h4 class="media-heading"><a t-attf-href="/job/detail/#{ job.id }/"><span t-field="job.name"> </span></a></h4>
|
||||
<h4 class="media-heading"><a t-href="/job/detail/#{ job.id }/"><span t-field="job.name"> </span></a></h4>
|
||||
<div t-if="companies[0].country_id">
|
||||
<i class="icon-map-marker"/> <span t-field="companies[0].city"> </span> <span t-if="companies[0].state_id" t-field="companies[0].state_id.name"> </span>, <span t-field="companies[0].country_id.name"> </span>
|
||||
</div>
|
||||
|
@ -83,7 +83,7 @@
|
|||
<h5 class="text-center text-muted">
|
||||
<i class="icon-time"/> <span><t t-esc="vals_date"/></span>
|
||||
</h5>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container oe_structure">
|
||||
<div class="row">
|
||||
<div t-if="job.website_description">
|
||||
|
@ -92,11 +92,11 @@
|
|||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12 text-center mt16 mb16">
|
||||
<a t-attf-href="/apply/#{ job.id }/" class="btn btn-primary btn-lg">Apply</a>
|
||||
<a t-href="/apply/#{ job.id }/" class="btn btn-primary btn-lg">Apply</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -112,6 +112,7 @@
|
|||
<h1 class="text-center">Apply for <span t-field="job.name"/></h1>
|
||||
<div class="row">
|
||||
<section id="forms">
|
||||
<!-- TODO Multilingual form action support ? -->
|
||||
<form class="form-horizontal mt32" action="/job/success" method="post" enctype="multipart/form-data">
|
||||
<input type="hidden" t-att-value="job.department_id.id" name="department_id"/>
|
||||
<input type="hidden" t-att-value="job.id" name="job_id"/>
|
||||
|
@ -170,10 +171,10 @@
|
|||
<xpath expr="//div[@id='jobs_grid']" position="before">
|
||||
<div class="col-md-3">
|
||||
<ul class="nav nav-pills nav-stacked mt16">
|
||||
<li t-att-class=" '' if active else 'active' "><a href="/jobs">All Departments</a></li>
|
||||
<li t-att-class=" '' if active else 'active' "><a t-href="/jobs">All Departments</a></li>
|
||||
<t t-foreach="departments" t-as="department">
|
||||
<li t-att-class="department.id == active and 'active' or ''">
|
||||
<a t-attf-href="/department/#{ department.id }/" ><span t-field="department.name"/></a>
|
||||
<a t-href="/department/#{ department.id }/" ><span t-field="department.name"/></a>
|
||||
</li>
|
||||
</t>
|
||||
</ul>
|
||||
|
|
|
@ -3,17 +3,20 @@
|
|||
<data>
|
||||
|
||||
<template id="follow">
|
||||
<div name="follow">
|
||||
<a href="#" t-att-data-id="object.id" t-att-data-object="object._name" t-att-data-follow="object.id and object.message_is_follower and 'on' or 'off'"
|
||||
class="pull-right js_follow" t-if="editable" t-ignore="true">
|
||||
<div name="follow" t-if="editable">
|
||||
<a href="#" t-att-data-id="object.id"
|
||||
t-att-data-object="object._name"
|
||||
t-att-data-follow="object.id and object.message_is_follower and 'on' or 'off'"
|
||||
class="pull-right js_follow" t-ignore="true">
|
||||
<span t-attf-class="label label-success css_follow">Follow</span>
|
||||
<span t-attf-class="label label-danger css_unfollow">Unfollow</span>
|
||||
<span t-attf-class="label label-success css_followed">Following</span>
|
||||
<span t-attf-class="label label-danger css_unfollowed">Not Following</span>
|
||||
</a>
|
||||
<input type="email" name="email" class="js_follow_email css_unfollowed_email"
|
||||
t-att-value="email"
|
||||
t-att-placeholder="email or 'Email Address'"/>
|
||||
<input type="email" name="email"
|
||||
class="js_follow_email css_unfollowed_email"
|
||||
t-att-value="email"
|
||||
t-att-placeholder="email or 'Email Address'"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ class WebsiteMembership(http.Controller):
|
|||
def partners_ref(self, partner_id=0, **post):
|
||||
partner_obj = request.registry['res.partner']
|
||||
if request.context['is_public_user']:
|
||||
partner_ids = partner_obj.search(request.cr, openerp.SUPERUSER_ID, [('website_pushished', '=', True), ('id', '=', partner_id)], context=request.context)
|
||||
partner_ids = partner_obj.search(request.cr, openerp.SUPERUSER_ID, [('website_published', '=', True), ('id', '=', partner_id)], context=request.context)
|
||||
else:
|
||||
partner_ids = partner_obj.search(request.cr, request.uid, [('id', '=', partner_id)], context=request.context)
|
||||
if not partner_ids:
|
||||
|
|
|
@ -103,7 +103,7 @@
|
|||
<!-- Option: index: Left Google Map -->
|
||||
<template id="opt_index_google_map" name="Left World Map"
|
||||
inherit_option_id="website_membership.index" inherit_id="website_membership.index">
|
||||
<xpath expr="//div[@id='left_column']/ul[last()]" position="after">
|
||||
<xpath expr="//div[@id='left_column']/ul[1]" position="before">
|
||||
<ul class="nav nav-pills nav-stacked mt16">
|
||||
<li class="nav-header"><h3>World Map</h3></li>
|
||||
<ul class="nav">
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
import random
|
||||
import uuid
|
||||
import urllib
|
||||
import simplejson
|
||||
|
||||
import werkzeug.exceptions
|
||||
|
||||
from openerp import SUPERUSER_ID
|
||||
from openerp.osv import osv
|
||||
from openerp.addons.web import http
|
||||
from openerp.addons.web.http import request
|
||||
from openerp.addons.website.models import website
|
||||
import random
|
||||
import uuid
|
||||
import urllib
|
||||
import simplejson
|
||||
|
||||
def get_order(order_id=None):
|
||||
order_obj = request.registry.get('sale.order')
|
||||
|
@ -358,9 +360,16 @@ class Ecommerce(http.Controller):
|
|||
|
||||
@website.route(['/shop/add_product/', '/shop/category/<int:cat_id>/add_product/'], type='http', auth="public", multilang=True)
|
||||
def add_product(self, cat_id=0, **post):
|
||||
product_id = request.registry.get('product.product').create(request.cr, request.uid,
|
||||
{'name': 'New Product', 'public_categ_id': cat_id}, request.context)
|
||||
return request.redirect("/shop/product/%s/?enable_editor=1" % product_id)
|
||||
if request.httprequest.method != 'POST':
|
||||
return werkzeug.exceptions.MethodNotAllowed(valid_methods=['POST'])
|
||||
|
||||
Product = request.registry.get('product.product')
|
||||
product_id = Product.create(request.cr, request.uid, {
|
||||
'name': 'New Product', 'public_categ_id': cat_id
|
||||
}, context=request.context)
|
||||
product = Product.browse(request.cr, request.uid, product_id, context=request.context)
|
||||
|
||||
return request.redirect("/shop/product/%s/?enable_editor=1" % product.product_tmpl_id.id)
|
||||
|
||||
def get_pricelist(self):
|
||||
if not request.httprequest.session.get('ecommerce_pricelist'):
|
||||
|
|
|
@ -78,7 +78,10 @@
|
|||
<div class="container oe_website_sale">
|
||||
<div class="row">
|
||||
<div class="col-sm-6 pagination" style="padding-left: 15px;">
|
||||
<a t-if="editable" t-href="/shop/add_product/" class="btn btn-primary btn-default" t-keep-query="category,search,facettes">New Product</a>
|
||||
<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">
|
||||
<t t-call="website.pager">
|
||||
|
@ -250,7 +253,7 @@
|
|||
<form t-action="/shop/" method="get" class="pull-right" t-keep-query="category,facettes">
|
||||
<div class="input-group">
|
||||
<t t-if="search">
|
||||
<t foreach="search.items()" t-as="key">
|
||||
<t t-foreach="search.items()" t-as="key">
|
||||
<input t-att-name="key[0]" t-att-value="key[1]"/>
|
||||
</t>
|
||||
</t>
|
||||
|
|
Loading…
Reference in New Issue