[MERGE] upstream
bzr revid: fme@openerp.com-20131031165355-p8lyjfiftmdkca34
This commit is contained in:
commit
254e1e5ba3
|
@ -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.
|
||||
|
||||
|
@ -159,7 +159,8 @@ class WebsiteBlog(http.Controller):
|
|||
|
||||
return request.website.render("website_blog.index", values)
|
||||
|
||||
@website.route(['/blog/nav'], type='http', auth="public")
|
||||
# TODO: Refactor (used in website_blog.js for archive links)
|
||||
@website.route(['/blog/nav'], type='http', auth="public", multilang=True)
|
||||
def nav(self, **post):
|
||||
cr, uid, context = request.cr, request.uid, request.context
|
||||
blog_post_ids = request.registry['blog.post'].search(
|
||||
|
@ -171,9 +172,10 @@ class WebsiteBlog(http.Controller):
|
|||
blog_post_data = [
|
||||
{
|
||||
'id': blog_post.id,
|
||||
'name': blog_post.name,
|
||||
'website_published': blog_post.website_published,
|
||||
'category_id': blog_post.category_id and blog_post.category_id.id or False,
|
||||
'fragment': request.website.render("website_blog.blog_archive_link", {
|
||||
'blog_post': blog_post
|
||||
}),
|
||||
}
|
||||
for blog_post in request.registry['blog.post'].browse(cr, uid, blog_post_ids, context=context)
|
||||
]
|
||||
|
|
|
@ -8,15 +8,14 @@ $(document).ready(function () {
|
|||
e.preventDefault();
|
||||
var $ul = $(this).next("ul");
|
||||
if (!$ul.find('li').length) {
|
||||
// TODO: Why POST? A GET would be more appropriate...
|
||||
// This should be done server side anyway...
|
||||
$.post('/blog/nav', {'domain': $(this).data("domain")}, function (result) {
|
||||
var blog_id = +window.location.pathname.split("/").pop();
|
||||
$(JSON.parse(result)).each(function () {
|
||||
var $a = $('<a href="/blog/' + this.id + '"/>').text(this.name);
|
||||
var $li = $("<li/>").append($a);
|
||||
if (blog_id == this.id)
|
||||
$li.addClass("active");
|
||||
if (!this.website_published)
|
||||
$a.css("color", "red");
|
||||
var $li = $($.parseHTML(this.fragment));
|
||||
if (blog_id == this.id) $li.addClass("active");
|
||||
if (!this.website_published) $li.find('a').css("color", "red");
|
||||
$ul.append($li);
|
||||
});
|
||||
|
||||
|
@ -38,4 +37,4 @@ $(document).ready(function () {
|
|||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
|
@ -4,7 +4,7 @@
|
|||
<!-- Layout add nav and footer -->
|
||||
<template id="header_footer_custom" inherit_id="website.layout">
|
||||
<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>
|
||||
|
||||
|
@ -21,17 +21,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>
|
||||
|
@ -66,7 +66,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>
|
||||
|
@ -87,7 +87,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>
|
||||
|
@ -166,13 +166,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">
|
||||
|
@ -185,7 +185,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="">
|
||||
|
@ -298,7 +298,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>
|
||||
|
@ -308,5 +308,11 @@
|
|||
</xpath>
|
||||
</template>
|
||||
|
||||
<template id="blog_archive_link">
|
||||
<li>
|
||||
<a t-href="/blog/#{blog_post.id}"><t t-esc="blog_post.name"/></a>
|
||||
</li>
|
||||
</template>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
</xpath>
|
||||
</template>
|
||||
|
||||
<!-- Page -->
|
||||
<!-- Page -->
|
||||
<template id="index" name="Events" page="True">
|
||||
<t t-call="website.layout">
|
||||
<div id="wrap">
|
||||
|
@ -121,7 +121,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">
|
||||
|
@ -259,12 +259,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,7 +9,7 @@
|
|||
|
||||
<template id="job_footer_custom" inherit_id="website.layout" name="Custom Footer Job">
|
||||
<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>
|
||||
|
||||
|
@ -33,7 +33,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>
|
||||
|
@ -80,7 +80,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">
|
||||
|
@ -89,11 +89,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>
|
||||
|
@ -109,6 +109,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"/>
|
||||
|
@ -167,10 +168,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>
|
||||
|
|
Loading…
Reference in New Issue