[MERGE]Merge trunk-website-al.

bzr revid: bth@tinyerp.com-20131031073239-x07851ujal6yx8pz
This commit is contained in:
bth-openerp 2013-10-31 13:02:39 +05:30
commit 3a8226cbd8
25 changed files with 195 additions and 121 deletions

View File

@ -271,10 +271,21 @@ class Website(openerp.addons.web.controllers.main.Home):
def robots(self): def robots(self):
return request.website.render('website.robots', {'url_root': request.httprequest.url_root}) return request.website.render('website.robots', {'url_root': request.httprequest.url_root})
@website.route(['/sitemap.xml'], type='http', auth="public") @website.route('/sitemap', type='http', auth='public', multilang=True)
def sitemap(self): def sitemap(self, **kwargs):
return request.website.render('website.sitemap', {'pages': request.website.list_pages()}) 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): class Images(http.Controller):
def placeholder(self, response): def placeholder(self, response):
# file_open may return a StringIO. StringIO can be closed but are # file_open may return a StringIO. StringIO can be closed but are

View File

@ -9,5 +9,8 @@
<field name="social_linkedin">http://www.linkedin.com/company/openerp</field> <field name="social_linkedin">http://www.linkedin.com/company/openerp</field>
</record> </record>
<record id="base.main_company" model="res.company">
<field name="rml_header1">Great Product for Great People</field>
</record>
</data> </data>
</openerp> </openerp>

View File

@ -131,7 +131,9 @@ class view(osv.osv):
arch_section = html.fromstring( arch_section = html.fromstring(
value, parser=html.HTMLParser(encoding='utf-8')) 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: if xpath is None:
# value is an embedded field on its own, not a view section # value is an embedded field on its own, not a view section

View File

@ -55,7 +55,7 @@ def url_for(path, lang=None, keep_query=None):
if request: if request:
path = urljoin(request.httprequest.path, path) path = urljoin(request.httprequest.path, path)
langs = request.context.get('langs') langs = request.context.get('langs')
if path[0] == '/' and len(langs) > 1: if path[0] == '/' and (len(langs) > 1 or lang):
ps = path.split('/') ps = path.split('/')
lang = lang or request.context.get('lang') lang = lang or request.context.get('lang')
if ps[1] in langs: if ps[1] in langs:

View File

@ -1,3 +1,4 @@
@charset "utf-8";
/* ---- CKEditor Minimal Reset ---- */ /* ---- CKEditor Minimal Reset ---- */
.navbar.navbar-inverse .cke_chrome { .navbar.navbar-inverse .cke_chrome {
border: none; border: none;

View File

@ -2,7 +2,7 @@
/* THIS CSS FILE IS FOR WEBSITE THEMING CUSTOMIZATION ONLY /* THIS CSS FILE IS FOR WEBSITE THEMING CUSTOMIZATION ONLY
* *
* css for editor buttons, openerp widget included in the website and other * 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 ---- */ /* ----- GENERIC LAYOUTING HELPERS ---- */
@ -451,4 +451,7 @@ table.well tr th {
table.well tr td span { table.well tr td span {
padding-right: 5px; padding-right: 5px;
.logo-img {
width: 220px;
} }

View File

@ -1,10 +1,10 @@
@charset "utf-8" @charset "utf-8"
/* /*
* THIS CSS FILE IS FOR WEBSITE THEMING CUSTOMIZATION ONLY * THIS CSS FILE IS FOR WEBSITE THEMING CUSTOMIZATION ONLY
* *
* css for editor buttons, openerp widget included in the website and other * 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 header, #wrap, footer
display: table-row display: table-row
footer footer
height: 100% height: 100%
background: rgb(239, 248, 248) background: rgb(239, 248, 248)
@ -183,7 +183,7 @@ footer
// .navbar .nav > li a // .navbar .nav > li a
// text-shadow: none // text-shadow: none
// .nav > li a // .nav > li a
// display: block // display: block
.carousel-inner .item .carousel-inner .item
@ -284,7 +284,6 @@ footer
height: 300px height: 300px
&.oe_big &.oe_big
height: 450px height: 450px
/* -- Hack for removing double scrollbar from mobile preview -- */ /* -- Hack for removing double scrollbar from mobile preview -- */
div#mobile-preview.modal div#mobile-preview.modal
overflow: hidden overflow: hidden
@ -345,3 +344,6 @@ table.well tr
padding-right: 10px padding-right: 10px
td td
padding-right: 5px padding-right: 5px
.logo-img
width: 220px

View File

@ -1037,6 +1037,11 @@
this.$target.attr("id", "myCarousel" + id); this.$target.attr("id", "myCarousel" + id);
this.$target.find(".carousel-control").attr("href", "#myCarousel" + id); this.$target.find(".carousel-control").attr("href", "#myCarousel" + id);
this.$target.find("[data-target='#myCarousel']").attr("data-target", "#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(); this.rebind_event();
}, },
onFocus: function () { onFocus: function () {
@ -1053,6 +1058,9 @@
if(!this.$target.find(".item.active").length) { if(!this.$target.find(".item.active").length) {
this.$target.find(".item:first").addClass("active"); this.$target.find(".item:first").addClass("active");
} }
this.$target.removeAttr('contentEditable')
.find('.content, .carousel-image img')
.removeAttr('contentEditable');
}, },
start : function () { start : function () {
this._super(); this._super();
@ -1223,7 +1231,6 @@
size = 'oe_small'; size = 'oe_small';
else if ($el.hasClass('oe_medium')) else if ($el.hasClass('oe_medium'))
size = 'oe_medium'; size = 'oe_medium';
var $ul = this.$editor.find('ul[name="parallax-size"]'); var $ul = this.$editor.find('ul[name="parallax-size"]');
var $li = $ul.find("li"); var $li = $ul.find("li");

View File

@ -62,7 +62,7 @@
<img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block_banner.png"/> <img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block_banner.png"/>
<span class="oe_snippet_thumbnail_title">Banner</span> <span class="oe_snippet_thumbnail_title">Banner</span>
</div> </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 --> <!-- Indicators -->
<ol class="carousel-indicators hidden"> <ol class="carousel-indicators hidden">
<li data-target="#myCarousel" data-slide-to="0" class="active"></li> <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
@ -70,7 +70,7 @@
<div class="carousel-inner"> <div class="carousel-inner">
<div class="item image_text active" style="background-image: url('/website/static/src/img/banner/color_splash.jpg')"> <div class="item image_text active" style="background-image: url('/website/static/src/img/banner/color_splash.jpg')">
<div class="container"> <div class="container">
<div class="carousel-caption content" contenteditable="true"> <div class="carousel-caption content">
<h2>Your Banner Title</h2> <h2>Your Banner Title</h2>
<h3>Click to customize this text</h3> <h3>Click to customize this text</h3>
<p> <p>
@ -78,7 +78,7 @@
</p> </p>
</div> </div>
<div class="carousel-image hidden-xs"> <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> </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/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/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/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> <li class="oe_custom_bg"><a><b>Chose your picture</b></a></li>
</ul> </ul>
</li> </li>

View File

@ -401,10 +401,22 @@ User-agent: *
Sitemap: <t t-esc="url_root"/>sitemap.xml Sitemap: <t t-esc="url_root"/>sitemap.xml
</template> </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"> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<t t-foreach="pages" t-as="page"> <t t-foreach="pages" t-as="page">
<url t-esc="page['url']"/> <url>
<loc><t t-esc="page['url']"/></loc>
</url>
</t> </t>
</urlset> </urlset>
</template> </template>
@ -460,31 +472,42 @@ Sitemap: <t t-esc="url_root"/>sitemap.xml
<template id="aboutus" name="About us" page="True"> <template id="aboutus" name="About us" page="True">
<t t-call="website.layout"> <t t-call="website.layout">
<div id="wrap"> <div id="wrap">
<div class="oe_structure"/> <div data-snippet-id="parallax">
<div class="container mb32"> <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="row col-wrap" id="aboutus"> <div class="container">
<div class="col-sm-12 text-center"> <div class="row">
<h1>About us</h1> <div class="col-md-12 mt32 mb32" data-snippet-id="colmd">
<h3 class="text-muted">A passion for great products</h3> <div class="text-center">
</div> <img src="/web/static/src/img/logo.png" class="img shadow logo-img"/>
<div class="col-sm-8 mt16"> </div>
<p> <h3 class="text-center text-muted" t-field="res_company.rml_header1"></h3>
We are a team of passionated people whose goal is to improve everyone's </div>
life through disruptive products. We build great products to solve your </div>
business problems. </div>
</p> </div>
<p> </div>
Our products are designed for small to medium companies willing to optimize <div class="oe_structure"/>
their performance. <div class="container mb32">
</p> <div class="row col-wrap" id="aboutus">
</div><div class="col-sm-3 col-sm-offset-1"> <div class="col-sm-8 mt16">
<img src="/website/static/src/img/library/business_conference.jpg" class="img img-responsive shadow" alt="Out Team"/> <p>
</div> We are a team of passionated people whose goal is to improve everyone's
</div> life through disruptive products. We build great products to solve your
</div> business problems.
<div class="oe_structure"/> </p>
</div> <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> </t>
</template> </template>

View File

@ -41,7 +41,7 @@ class WebsiteBlog(http.Controller):
'/blog/cat/<int:category_id>/page/<int:page>/', '/blog/cat/<int:category_id>/page/<int:page>/',
'/blog/tag/', '/blog/tag/',
'/blog/tag/<int:tag_id>/', '/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): def blog(self, category_id=None, blog_post_id=None, tag_id=None, page=1, **post):
""" Prepare all values to display the blog. """ Prepare all values to display the blog.

View File

@ -1,4 +1,4 @@
@import url(compass/css3.css); @charset "UTF-8";
.css_website_mail .has-error { .css_website_mail .has-error {
border-color: red; border-color: red;
} }
@ -22,11 +22,14 @@ p.post-meta {
} }
.js_website_blog div#right_column section { .js_website_blog div#right_column section {
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=60);
opacity: 0.6; opacity: 0.6;
} }
.js_website_blog div#right_column section:hover { .js_website_blog div#right_column section:hover {
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100);
opacity: 1; opacity: 1;
-moz-transition: all 0.2s ease-out;
-webkit-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; transition: all 0.2s ease-out;
} }

View File

@ -1,30 +1,29 @@
@charset "utf-8"
@import "compass/css3" @import "compass/css3"
.css_website_mail .css_website_mail
.has-error .has-error
border-color: red border-color: red
.css_nav_month .css_nav_month
display: none display: none
&:first-of-type &:first-of-type
display: block display: block
.blog_content .blog_content
a.oe_mail_expand:after a.oe_mail_expand:after
content: "" content: ""
a.oe_mail_expand a.oe_mail_expand
font-weight: bold font-weight: bold
p.post-meta p.post-meta
position: relative position: relative
top: -5px top: -5px
.js_website_blog .js_website_blog
div#right_column div#right_column
section section
opacity: 0.6 +opacity(0.6)
section:hover section:hover
opacity: 1 +opacity(1)
-moz-transition: all 0.2s ease-out @include transition(all 0.2s ease-out)
-webkit-transition: all 0.2s ease-out
transition: all 0.2s ease-out

View File

@ -4,10 +4,10 @@
<!-- Layout add nav and footer --> <!-- Layout add nav and footer -->
<template id="header_footer_custom" inherit_id="website.layout"> <template id="header_footer_custom" inherit_id="website.layout">
<xpath expr="//header//ul[@id='top_menu']/li[@name='contactus']" position="before"> <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>
<xpath expr="//footer//div[@name='info']/ul" position="inside"> <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> </xpath>
</template> </template>
@ -24,17 +24,17 @@
<t t-call="website.publish_management"> <t t-call="website.publish_management">
<t t-set="object" t-value="blog_post"/> <t t-set="object" t-value="blog_post"/>
<t t-set="publish_edit" t-value="True"/> <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> </t>
</div> </div>
<h2 class="text-center"> <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> </h2>
<p class="post-meta text-muted text-center" name='blog_post_data'> <p class="post-meta text-muted text-center" name='blog_post_data'>
<span class="icon-calendar"> <span t-field="blog_post.create_date"/></span> &amp;nbsp; <span class="icon-calendar"> <span t-field="blog_post.create_date"/></span> &amp;nbsp;
<span class="icon-user"> By <span t-field="blog_post.create_uid"/> &amp;nbsp;</span> <span class="icon-user"> By <span t-field="blog_post.create_uid"/> &amp;nbsp;</span>
<span t-if="len(blog_post.message_ids) &gt; 0" class="icon-comment"> <span t-if="len(blog_post.message_ids) &gt; 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) &lt;= 1" ><t t-esc="len(blog_post.message_ids)"/> comment</t> <t t-if="len(blog_post.message_ids) &lt;= 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> <t t-if="len(blog_post.message_ids) > 1"><t t-esc="len(blog_post.message_ids)"/> comments</t>
</a> </a>
@ -69,7 +69,7 @@
<p class="post-meta text-muted text-center" t-if="len(blog_post.tag_ids)"> <p class="post-meta text-muted text-center" t-if="len(blog_post.tag_ids)">
<span class="icon-tags"/> <span class="icon-tags"/>
<t t-foreach="blog_post.tag_ids" t-as="tag"> <t t-foreach="blog_post.tag_ids" t-as="tag">
<a t-attf-href="/blog/tag/#{tag.id}" t-esc="tag.name"/> &amp;nbsp; <a t-href="/blog/tag/#{tag.id}" t-esc="tag.name"/> &amp;nbsp;
</t> </t>
</p> </p>
</xpath> </xpath>
@ -90,7 +90,7 @@
<p class="post-meta text-muted text-center" name="blog_post_data"> <p class="post-meta text-muted text-center" name="blog_post_data">
<span class="icon-calendar"> <span t-field="blog_post.create_date"/></span> &amp;nbsp; <span class="icon-calendar"> <span t-field="blog_post.create_date"/></span> &amp;nbsp;
<span class="icon-user"> By <span t-field="blog_post.create_uid"/> &amp;nbsp;</span> <span class="icon-user"> By <span t-field="blog_post.create_uid"/> &amp;nbsp;</span>
<span t-if="len(blog_post.message_ids) &gt; 0" class="icon-comment"> With <span t-if="len(blog_post.message_ids) &gt; 0" class="icon-comment"> With
<a t-attf-href="#comments"> <a t-attf-href="#comments">
<t t-if="len(blog_post.message_ids) &lt;= 1" ><t t-esc="len(blog_post.message_ids)"/> comment</t> <t t-if="len(blog_post.message_ids) &lt;= 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> <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)"> <p class="post-meta text-muted text-center" t-if="len(blog_post.tag_ids)">
<span class="icon-tags"/> <span class="icon-tags"/>
<t t-foreach="blog_post.tag_ids" t-as="tag"> <t t-foreach="blog_post.tag_ids" t-as="tag">
<a t-attf-href="/blog/tag/#{tag.id}" t-esc="tag.name"/> &amp;nbsp; <a t-href="/blog/tag/#{tag.id}" t-esc="tag.name"/> &amp;nbsp;
</t> </t>
</p> </p>
</xpath> </xpath>
</template> </template>
<!-- Page --> <!-- Page -->
<template id="index" name="Blog" page="True"> <template id="index" name="Blog" page="True">
<t t-call="website.layout"> <t t-call="website.layout">
<t t-set="head"> <t t-set="head">
@ -188,7 +188,7 @@
<div class="col-lg-12 col-sm-12" t-if="not blog_post" id="blog_post"> <div class="col-lg-12 col-sm-12" t-if="not blog_post" id="blog_post">
<t t-if="category and editable"> <t t-if="category and editable">
<div class="row"> <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> </div>
</t> </t>
<t t-foreach="blog_posts" t-as="blog_post" data-publish=""> <t t-foreach="blog_posts" t-as="blog_post" data-publish="">
@ -301,7 +301,7 @@
<ul class="nav nav-pills nav-stacked"> <ul class="nav nav-pills nav-stacked">
<t t-foreach="categories" t-as="nav_category"> <t t-foreach="categories" t-as="nav_category">
<li> <li>
<a t-attf-href="/blog/#{nav_category.id}"> <a t-href="/blog/#{nav_category.id}">
<span t-field="nav_category.name"/> <span t-field="nav_category.name"/>
</a> </a>
</li> </li>

View File

@ -94,7 +94,7 @@ class WebsiteCrmPartnerAssign(http.Controller):
def partners_ref(self, partner_id=0, **post): def partners_ref(self, partner_id=0, **post):
partner_obj = request.registry['res.partner'] partner_obj = request.registry['res.partner']
if request.context['is_public_user']: 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: else:
partner_ids = partner_obj.search(request.cr, request.uid, [('id', '=', partner_id)], context=request.context) partner_ids = partner_obj.search(request.cr, request.uid, [('id', '=', partner_id)], context=request.context)
if not partner_ids: if not partner_ids:

View File

@ -182,7 +182,10 @@ class website_event(http.Controller):
_values = None _values = None
for key, value in post.items(): 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 ticket_id = key.split("-")[0] == 'ticket' and int(key.split("-")[1]) or None
if not ticket_id or not quantity: if not ticket_id or not quantity:
continue continue

View File

@ -1,4 +1,5 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink 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_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_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

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_event_event_public event.event.public event.model_event_event base.group_public 1 0 0 0
3 access_event_type_public event.type.public event.model_event_type base.group_public 1 0 0 0
4 access_event_event_ticket_public event.event.ticket.public event_sale.model_event_event_ticket base.group_public 1 0 0 0
5 access_event_product_product_public event.product.product.public product.model_product_product base.group_public 1 0 0 0

View File

@ -12,7 +12,7 @@
</xpath> </xpath>
</template> </template>
<!-- Page --> <!-- Page -->
<template id="index" name="Events" page="True"> <template id="index" name="Events" page="True">
<t t-call="website.layout"> <t t-call="website.layout">
<div id="wrap"> <div id="wrap">
@ -124,7 +124,7 @@
<h1 class="text-center" t-field="event_id.name"></h1> <h1 class="text-center" t-field="event_id.name"></h1>
<h4 class="text-center text-muted"> <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"/> <span t-field="event_id.date_end"/>
</h4> </h4>
<h4 t-if="event_id.city and event_id.country_id" class="text-center text-muted"> <h4 t-if="event_id.city and event_id.country_id" class="text-center text-muted">
@ -262,12 +262,12 @@
<ul class="list-unstyled"> <ul class="list-unstyled">
<li t-if="event_id.type"> <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>
<li t-if="event_id.country_id"> <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>
<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> </ul>
</div> </div>
</div> </div>

View File

@ -7,7 +7,7 @@ import base64
class website_hr_recruitment(http.Controller): 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): def jobs(self, id=0, page=1, **post):
id = id and int(id) or 0 id = id and int(id) or 0
hr_job_obj = request.registry['hr.job'] hr_job_obj = request.registry['hr.job']
@ -36,7 +36,7 @@ class website_hr_recruitment(http.Controller):
step = 10 step = 10
pager = request.website.pager(url="/jobs/", total=len(jobpost_ids), page=page, step=step, scope=5) 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']) jobpost_ids = hr_job_obj.search(request.cr, request.uid, domain, limit=step, offset=pager['offset'])
values = { values = {
'active': active, 'active': active,
'companies': companies, 'companies': companies,
@ -47,16 +47,15 @@ class website_hr_recruitment(http.Controller):
} }
return request.website.render("website_hr_recruitment.index", values) return request.website.render("website_hr_recruitment.index", values)
@website.route(['/job/detail/<id>'], type='http', auth="public") @website.route(['/job/detail/<model("hr.job"):job>'], type='http', auth="public", multilang=True)
def detail(self, id=0): def detail(self, job=None):
id = id and int(id) or 0
values = { values = {
'job': request.registry['hr.job'].browse(request.cr, request.uid, id), 'job': job,
'vals_date': request.registry['hr.job'].browse(request.cr, request.uid, id).write_date.split(' ')[0] 'vals_date': job.write_date.split(' ')[0],
} }
return request.website.render("website_hr_recruitment.detail", values) 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): def success(self, **post):
id = request.registry['hr.applicant'].create(request.cr, request.uid, post) id = request.registry['hr.applicant'].create(request.cr, request.uid, post)
if post['ufile']: if post['ufile']:
@ -74,9 +73,9 @@ class website_hr_recruitment(http.Controller):
'jobid': post['job_id'] 'jobid': post['job_id']
} }
return request.website.render("website_hr_recruitment.thankyou", values) return request.website.render("website_hr_recruitment.thankyou", values)
@website.route(['/apply/<int:id>'], type='http', auth="public") @website.route(['/apply/<int:id>'], type='http', auth="public", multilang=True)
def applyjobpost(self, id=0): def applyjobpost(self, id=0, **kwargs):
id = id and int(id) or 0 id = id and int(id) or 0
job = request.registry['hr.job'].browse(request.cr, request.uid, id) job = request.registry['hr.job'].browse(request.cr, request.uid, id)
values = { values = {
@ -84,7 +83,7 @@ class website_hr_recruitment(http.Controller):
} }
return request.website.render("website_hr_recruitment.applyjobpost", values) 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): def published (self, id, **post):
hr_job = request.registry['hr.job'] hr_job = request.registry['hr.job']
id = int(id) id = int(id)

View File

@ -9,10 +9,10 @@
<template id="job_footer_custom" inherit_id="website.layout" name="Custom Footer Job"> <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"> <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>
<xpath expr="//footer//div[@name='info']/ul" position="inside"> <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> </xpath>
</template> </template>
@ -36,7 +36,7 @@
<t t-if="job.no_of_recruitment"> <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> <span class="label label-default pull-right label-info"><t t-esc="vals[job.id]['count']"/> Vacancies.</span>
</t> </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"> <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> <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> </div>
@ -83,7 +83,7 @@
<h5 class="text-center text-muted"> <h5 class="text-center text-muted">
<i class="icon-time"/> <span><t t-esc="vals_date"/></span> <i class="icon-time"/> <span><t t-esc="vals_date"/></span>
</h5> </h5>
</div> </div>
<div class="container oe_structure"> <div class="container oe_structure">
<div class="row"> <div class="row">
<div t-if="job.website_description"> <div t-if="job.website_description">
@ -92,11 +92,11 @@
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="col-md-12 text-center mt16 mb16"> <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> </div>
</div> </div>
</section> </section>
</div> </div>
</div> </div>
</div> </div>
@ -112,6 +112,7 @@
<h1 class="text-center">Apply for <span t-field="job.name"/></h1> <h1 class="text-center">Apply for <span t-field="job.name"/></h1>
<div class="row"> <div class="row">
<section id="forms"> <section id="forms">
<!-- TODO Multilingual form action support ? -->
<form class="form-horizontal mt32" action="/job/success" method="post" enctype="multipart/form-data"> <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.department_id.id" name="department_id"/>
<input type="hidden" t-att-value="job.id" name="job_id"/> <input type="hidden" t-att-value="job.id" name="job_id"/>
@ -170,10 +171,10 @@
<xpath expr="//div[@id='jobs_grid']" position="before"> <xpath expr="//div[@id='jobs_grid']" position="before">
<div class="col-md-3"> <div class="col-md-3">
<ul class="nav nav-pills nav-stacked mt16"> <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"> <t t-foreach="departments" t-as="department">
<li t-att-class="department.id == active and 'active' or ''"> <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> </li>
</t> </t>
</ul> </ul>

View File

@ -3,17 +3,20 @@
<data> <data>
<template id="follow"> <template id="follow">
<div name="follow"> <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'" <a href="#" t-att-data-id="object.id"
class="pull-right js_follow" t-if="editable" t-ignore="true"> 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-success css_follow">Follow</span>
<span t-attf-class="label label-danger css_unfollow">Unfollow</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-success css_followed">Following</span>
<span t-attf-class="label label-danger css_unfollowed">Not Following</span> <span t-attf-class="label label-danger css_unfollowed">Not Following</span>
</a> </a>
<input type="email" name="email" class="js_follow_email css_unfollowed_email" <input type="email" name="email"
t-att-value="email" class="js_follow_email css_unfollowed_email"
t-att-placeholder="email or 'Email Address'"/> t-att-value="email"
t-att-placeholder="email or 'Email Address'"/>
</div> </div>
</template> </template>

View File

@ -91,7 +91,7 @@ class WebsiteMembership(http.Controller):
def partners_ref(self, partner_id=0, **post): def partners_ref(self, partner_id=0, **post):
partner_obj = request.registry['res.partner'] partner_obj = request.registry['res.partner']
if request.context['is_public_user']: 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: else:
partner_ids = partner_obj.search(request.cr, request.uid, [('id', '=', partner_id)], context=request.context) partner_ids = partner_obj.search(request.cr, request.uid, [('id', '=', partner_id)], context=request.context)
if not partner_ids: if not partner_ids:

View File

@ -107,7 +107,7 @@
<!-- Option: index: Left Google Map --> <!-- Option: index: Left Google Map -->
<template id="opt_index_google_map" name="Left World Map" <template id="opt_index_google_map" name="Left World Map"
inherit_option_id="website_membership.index" inherit_id="website_membership.index"> 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"> <ul class="nav nav-pills nav-stacked mt16">
<li class="nav-header"><h3>World Map</h3></li> <li class="nav-header"><h3>World Map</h3></li>
<ul class="nav"> <ul class="nav">

View File

@ -1,14 +1,16 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import random
import uuid
import urllib
import simplejson
import werkzeug.exceptions
from openerp import SUPERUSER_ID from openerp import SUPERUSER_ID
from openerp.osv import osv from openerp.osv import osv
from openerp.addons.web import http from openerp.addons.web import http
from openerp.addons.web.http import request from openerp.addons.web.http import request
from openerp.addons.website.models import website from openerp.addons.website.models import website
import random
import uuid
import urllib
import simplejson
def get_order(order_id=None): def get_order(order_id=None):
order_obj = request.registry.get('sale.order') 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) @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): def add_product(self, cat_id=0, **post):
product_id = request.registry.get('product.product').create(request.cr, request.uid, if request.httprequest.method != 'POST':
{'name': 'New Product', 'public_categ_id': cat_id}, request.context) return werkzeug.exceptions.MethodNotAllowed(valid_methods=['POST'])
return request.redirect("/shop/product/%s/?enable_editor=1" % product_id)
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): def get_pricelist(self):
if not request.httprequest.session.get('ecommerce_pricelist'): if not request.httprequest.session.get('ecommerce_pricelist'):

View File

@ -78,7 +78,10 @@
<div class="container oe_website_sale"> <div class="container oe_website_sale">
<div class="row"> <div class="row">
<div class="col-sm-6 pagination" style="padding-left: 15px;"> <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>
<div class="col-sm-6"> <div class="col-sm-6">
<t t-call="website.pager"> <t t-call="website.pager">
@ -250,7 +253,7 @@
<form t-action="/shop/" method="get" class="pull-right" t-keep-query="category,facettes"> <form t-action="/shop/" method="get" class="pull-right" t-keep-query="category,facettes">
<div class="input-group"> <div class="input-group">
<t t-if="search"> <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]"/> <input t-att-name="key[0]" t-att-value="key[1]"/>
</t> </t>
</t> </t>