From ab61a67021f8f56070295eeb05601a490a53326d Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Thu, 8 Aug 2013 09:21:15 +0200 Subject: [PATCH] [IMP] website_hr: create page/aboutus and add Trombinoscope Teams bzr revid: chm@openerp.com-20130808072115-9clevg0tqzir7kjc --- addons/website/views/views.xml | 23 ++++++++++++++++++++++- addons/website_hr/controllers/main.py | 19 ++++--------------- addons/website_hr/static/src/js/hr.js | 2 +- addons/website_hr/views/website_hr.xml | 25 ++++++++++++------------- 4 files changed, 39 insertions(+), 30 deletions(-) diff --git a/addons/website/views/views.xml b/addons/website/views/views.xml index 80802bd673f..198c96d508d 100644 --- a/addons/website/views/views.xml +++ b/addons/website/views/views.xml @@ -40,7 +40,7 @@ @@ -377,5 +377,26 @@ + + diff --git a/addons/website_hr/controllers/main.py b/addons/website_hr/controllers/main.py index 968ec607269..24440373c5f 100644 --- a/addons/website_hr/controllers/main.py +++ b/addons/website_hr/controllers/main.py @@ -5,7 +5,7 @@ from openerp.addons.web.http import request class website_hr(http.Controller): - @http.route(['/hr'], type='http', auth="public") + @http.route(['/page/website.aboutus'], type='http', auth="public") def blog(self, **post): website = request.registry['website'] hr_obj = request.registry['hr.employee'] @@ -13,9 +13,9 @@ class website_hr(http.Controller): values = website.get_rendering_context({ 'employee_ids': hr_obj.browse(request.cr, request.uid, employee_ids) }) - return website.render("website_hr.index", values) + return website.render("website.aboutus", values) - @http.route(['/hr/publish'], type='http', auth="public") + @http.route(['/page/website.aboutus/publish'], type='http', auth="public") def publish(self, **post): obj_id = int(post['id']) data_obj = request.registry['hr.employee'] @@ -24,15 +24,4 @@ class website_hr(http.Controller): data_obj.write(request.cr, request.uid, [obj_id], {'website_published': not obj.website_published}) obj = data_obj.browse(request.cr, request.uid, obj_id) - return obj.website_published and "1" or "0" - - @http.route(['/hr/publish_contact'], type='http', auth="public") - def publish_contact(self, **post): - obj_id = int(post['id']) - data_obj = request.registry['hr.employee'] - - obj = data_obj.browse(request.cr, request.uid, obj_id) - data_obj.write(request.cr, request.uid, [obj_id], {'website_published_on_contact_form': not obj.website_published_on_contact_form}) - obj = data_obj.browse(request.cr, request.uid, obj_id) - - return obj.website_published_on_contact_form and "1" or "0" + return obj.website_published and "1" or "0" \ No newline at end of file diff --git a/addons/website_hr/static/src/js/hr.js b/addons/website_hr/static/src/js/hr.js index e0e69fb5161..632b538509f 100644 --- a/addons/website_hr/static/src/js/hr.js +++ b/addons/website_hr/static/src/js/hr.js @@ -5,7 +5,7 @@ $(document).ready(function () { $link.find('.js_publish, .js_unpublish').addClass("hidden"); var $unp = $link.find(".js_unpublish"); var $p = $link.find(".js_publish"); - $.post('/hr/publish', {'id': $link.data('id')}, function (result) { + $.post('/page/website.aboutus/publish', {'id': $link.data('id')}, function (result) { if (+result) { $p.addClass("hidden"); $unp.removeClass("hidden"); diff --git a/addons/website_hr/views/website_hr.xml b/addons/website_hr/views/website_hr.xml index 659509a1b96..98bebacff8e 100644 --- a/addons/website_hr/views/website_hr.xml +++ b/addons/website_hr/views/website_hr.xml @@ -17,8 +17,7 @@ - -
  • Team
  • +
  • Jobs
  • @@ -27,14 +26,13 @@ - + +
    + +