Merge remote-tracking branch 'odoo/master' into master-inline-searchview-ged

This commit is contained in:
Géry Debongnie
2014-06-12 10:44:32 +02:00
5 changed files with 34 additions and 20 deletions
+2 -2
View File
@@ -14,8 +14,8 @@
<div class="container">
<div class="jumbotron mt32">
<t t-set="survey" t-value="survey_dict['survey']"/>
<h1><span t-field="survey.title"></span> <span style="font-size:1.5em;" class="fa fa-bar-chart-o pull-right "/></h1>
<h2><span t-field="survey.description"></span></h2>
<h1><span t-field="survey.title" /> <span style="font-size:1.5em;" class="fa fa-bar-chart-o pull-right "/></h1>
<div t-field="survey.description" class="oe_no_empty" />
</div>
<div class="panel panel-default hidden-print">
<div class="panel-heading"><span class="fa fa-filter"></span> Filters <span t-if="filter_display_data" class="pull-right text-primary clear_survey_filter"><i class="fa fa-times"></i> Clear All Filters</span></div>
+6 -6
View File
@@ -56,7 +56,7 @@
</div>
<div class='jumbotron mt32'>
<h1 t-field='survey.title' />
<div t-field='survey.description' />
<div t-field='survey.description' class="oe_no_empty"/>
<a class="btn btn-primary btn-lg" t-att-href="'/survey/fill/%s/%s' % (slug(survey), token)">
Start Survey
</a>
@@ -91,7 +91,7 @@
<div class="page-header">
<p class="pull-right">Page <span t-raw='page_nr + 1'/> on <span t-raw="len(survey.page_ids)"/></p>
<h1 t-field='page.title' />
<div t-field='page.description'/>
<div t-field='page.description' class="oe_no_empty"/>
</div>
<form role="form" method="post" class="js_surveyform" t-att-name="'%s_%s' % (survey.id, page.id)" t-att-action="'/survey/fill/%s/%s' % (slug(survey), token)" t-att-data-prefill="'/survey/prefill/%s/%s/%s' % (slug(survey), token, slug(page))" t-att-data-validate="'/survey/validate/%s' % (slug(survey))" t-att-data-submit="'/survey/submit/%s' % (slug(survey))">
@@ -104,7 +104,7 @@
<span t-field='question.question' />
<span t-if="question.constr_mandatory" class="text-danger">*</span>
</h2>
<div t-field='question.description' class="text-muted"/>
<div t-field='question.description' class="text-muted oe_no_empty"/>
<t t-if="question.type == 'free_text'"><t t-call="survey.free_text"/></t>
<t t-if="question.type == 'textbox'"><t t-call="survey.textbox"/></t>
<t t-if="question.type == 'numerical_box'"><t t-call="survey.numerical_box"/></t>
@@ -254,13 +254,13 @@
<div class="row">
<div class='jumbotron mt32'>
<h1><span t-field='survey.title'/></h1>
<t t-if="survey.description"><div t-field='survey.description'/></t>
<t t-if="survey.description"><div t-field='survey.description' class="oe_no_empty"/></t>
</div>
<form role="form" method="post" class="js_surveyform" t-att-name="'%s' % (survey.id)" t-att-data-prefill="'/survey/prefill/%s/%s' % (slug(survey), token)" t-att-data-scores="'/survey/scores/%s/%s' % (slug(survey), token) if quizz_correction else ''">
<t t-foreach="survey.page_ids" t-as="page">
<div class="page-header">
<h1 t-field='page.title' />
<t t-if="page.description"><div t-field='page.description'/></t>
<t t-if="page.description"><div t-field='page.description' class="oe_no_empty"/></t>
</div>
<t t-foreach='page.question_ids' t-as='question'>
<t t-set="prefix" t-value="'%s_%s_%s' % (survey.id, page.id, question.id)" />
@@ -270,7 +270,7 @@
<span t-if="question.constr_mandatory" class="text-danger">*</span>
<span t-if="quizz_correction" class="badge" t-att-data-score-question="question.id"></span>
</h2>
<t t-if="question.description"><div class="text-muted" t-field='question.description' /></t>
<t t-if="question.description"><div class="text-muted oe_no_empty" t-field='question.description'/></t>
<t t-if="question.type == 'free_text'"><t t-call="survey.free_text"/></t>
<t t-if="question.type == 'textbox'"><t t-call="survey.textbox"/></t>
<t t-if="question.type == 'numerical_box'"><t t-call="survey.numerical_box"/></t>
@@ -10,9 +10,10 @@ class website_hr_recruitment(http.Controller):
@http.route([
'/jobs',
'/jobs/department/<model("hr.department"):department>',
'/jobs/office/<string:office>'
'/jobs/office/<string:office>',
'/jobs/country/<model("res.country"):country>'
], type='http', auth="public", website=True)
def jobs(self, department=None, office=None):
def jobs(self, department=None, office=None, country=None):
context=dict(request.context, show_address=True, no_tag_br=True)
cr, uid = request.cr, request.uid
@@ -31,10 +32,12 @@ class website_hr_recruitment(http.Controller):
# Deduce departments and offices of those jobs
departments = set(j.department_id for j in jobs if j.department_id)
offices = set(j.address_id for j in jobs if j.address_id)
countries = set(o.country_id for o in offices if o.country_id)
# Filter the matching one
jobs = [j for j in jobs if department==None or j.department_id and j.department_id.id == department.id]
jobs = [j for j in jobs if office==None or j.address_id and j.address_id.id == office_id]
jobs = [j for j in jobs if country==None or j.address_id and j.address_id.country_id and j.address_id.country_id.id == country.id]
# Render page
return request.website.render("website_hr_recruitment.index", {
@@ -43,6 +46,7 @@ class website_hr_recruitment(http.Controller):
'offices': offices,
'department_id': department and department.id,
'office_id': office_id,
'countries': countries
})
@http.route('/jobs/add', type='http', auth="user", methods=['POST'], website=True)
@@ -122,7 +122,7 @@
"fields": ["address"],
"no_tag_br": true
}'/>
e<h5 class="text-center text-muted">
<h5 class="text-center text-muted">
<i class="fa fa-clock-o"/> <span t-field="job.write_date"/>
</h5>
</div>
@@ -253,15 +253,17 @@
<xpath expr="//div[@id='jobs_grid_left']" position="inside">
<ul class="nav nav-pills nav-stacked mb32">
<li t-att-class=" '' if office_id else 'active' "><a href="/jobs">All Offices</a></li>
<t t-foreach="offices" t-as="thisoffice">
<li t-att-class=" 'active' if office_id == thisoffice.id else '' ">
<a t-attf-href="/jobs/office/#{ slug(thisoffice) }" >
<span t-field="thisoffice.city"/><t t-if="thisoffice.country_id">,
<span t-field="thisoffice.country_id.name"/>
</t>
</a>
</li>
</t>
<li t-foreach="countries" t-as="thiscountry"><a t-attf-href="/jobs/country/#{slug(thiscountry)}" t-field="thiscountry.name"/>
<ul class="nav nav-pills nav-stacked nav-hierarchy">
<t t-foreach="offices" t-as="thisoffice">
<li t-if="thisoffice.country_id == thiscountry" t-att-class=" 'active' if office_id == thisoffice.id else '' ">
<a t-attf-href="/jobs/office/#{ slug(thisoffice) }" >
<span t-field="thisoffice.city"/>
</a>
</li>
</t>
</ul>
</li>
</ul>
</xpath>
<xpath expr="//div[@id='jobs_grid_left']" position="attributes">
+8
View File
@@ -898,6 +898,14 @@ form: module.record_id""" % (xml_id,)
if el.attrib.pop('page', None) == 'True':
record.append(Field(name="page", eval="True"))
if el.get('primary') == 'True':
# Pseudo clone mode, we'll set the t-name to the full canonical xmlid
el.append(
builder.E.xpath(
builder.E.attribute(full_tpl_id, name='t-name'),
expr=".",
position="attributes",
)
)
record.append(Field('primary', name='mode'))
if el.get('optional'):
record.append(Field(el.get('optional'), name='application'))