From d22223df140ef4c6899661c1a91aa87f79b093cd Mon Sep 17 00:00:00 2001 From: bth-openerp Date: Wed, 4 Sep 2013 18:00:17 +0530 Subject: [PATCH] [IMP]Convert into bootstrap 3.0 and removed publish. bzr revid: bth@tinyerp.com-20130904123017-v3q93lxrlr9yt58l --- addons/website_hr_recruitment/__openerp__.py | 2 +- .../controllers/main.py | 20 ----- .../static/src/js/recruitment.js | 44 +--------- .../views/website_hr_recruitment.xml | 88 +++++++++---------- 4 files changed, 44 insertions(+), 110 deletions(-) diff --git a/addons/website_hr_recruitment/__openerp__.py b/addons/website_hr_recruitment/__openerp__.py index 98257e2eb19..2b204c8c181 100644 --- a/addons/website_hr_recruitment/__openerp__.py +++ b/addons/website_hr_recruitment/__openerp__.py @@ -8,7 +8,7 @@ OpenERP Contact Form """, 'author': 'OpenERP SA', - 'depends': ['website', 'hr', 'hr_recruitment'], + 'depends': ['website', 'hr', 'hr_recruitment', 'website_mail'], 'data': [ 'views/website_hr_recruitment.xml', 'security/website_hr_recruitment_security.xml', diff --git a/addons/website_hr_recruitment/controllers/main.py b/addons/website_hr_recruitment/controllers/main.py index 45af8397e44..cafd4a61dd7 100644 --- a/addons/website_hr_recruitment/controllers/main.py +++ b/addons/website_hr_recruitment/controllers/main.py @@ -63,26 +63,6 @@ class website_hr_recruitment(http.Controller): }) return website.render("website_hr_recruitment.thankyou", values) - @http.route('/recruitment/published', type='json', auth="admin") - def published (self, **post): - hr_job = request.registry['hr.job'] - id = int(post['id']) - rec = hr_job.browse(request.cr, request.uid, id) - vals = {} - - vals['website_published'] = not rec.website_published - if vals['website_published']: - vals['state'] = 'recruit' - if rec.no_of_recruitment == 0.0: - vals ['no_of_recruitment'] = 1.0 - else: - vals['state'] = 'open' - vals ['no_of_recruitment'] = 0.0 - - res = hr_job.write(request.cr, request.uid, [rec.id], vals) - obj = hr_job.browse(request.cr, request.uid, id) - return { 'published': obj.website_published and "1" or "0", 'count': obj.no_of_recruitment } - @http.route('/recruitment/message_get_subscribed', type='json', auth="admin") def message_get_subscribed(self, email, id): id = int(id) diff --git a/addons/website_hr_recruitment/static/src/js/recruitment.js b/addons/website_hr_recruitment/static/src/js/recruitment.js index 54704ba3562..3dc33416c70 100644 --- a/addons/website_hr_recruitment/static/src/js/recruitment.js +++ b/addons/website_hr_recruitment/static/src/js/recruitment.js @@ -3,7 +3,7 @@ $(function () { div = $(this).parent(); parent = $(this).parent().parent(); id = $(this).parent().parent().attr('id'); - email = $(this).siblings('input[name=email]').val(); + email = $(this).siblings('div').find('input[name=email]').val(); openerp.jsonRpc('/recruitment/message_get_subscribed', 'call', {'email': email, 'id': id}).then(function (result) { if (result == 1) { div.hide(); @@ -23,46 +23,4 @@ $(function () { } }); }); - $(document).on('click', '.js_published, .js_unpublished', function (e) { - e.preventDefault(); - var $link = $(this).parent(); - $link.find('.js_published, .js_unpublished').addClass("hidden"); - var $unp = $link.find(".js_unpublished"); - var $p = $link.find(".js_published"); - openerp.jsonRpc('/recruitment/published', 'call', {'id': $link.data('id'), 'object': $link.data('object')}).then(function (result) { - if (+result['published']) { - $p.addClass("hidden"); - $unp.removeClass("hidden"); - $('tr[id='+$link.data('id')+']').find('span#norecruit').addClass("hidden"); - $('tr[id='+$link.data('id')+']').find('span#counting').removeClass("hidden"); - if ($.trim($('tr[id='+$link.data('id')+']').find('span#counting').html()).length == 0) { - htmlcon = ' No.of Post: ' + result['count'] + ''; - $('tr[id='+$link.data('id')+']').find('span#counting').html(htmlcon); - } else { - $('tr[id='+$link.data('id')+']').find('span#counting').find('span#counting_num').html(result['count']); - } - $('tr[id='+$link.data('id')+']').find('div[id='+$link.data('id')+']').addClass('hidden'); - } else { - $p.removeClass("hidden"); - $unp.addClass("hidden"); - $('tr[id='+$link.data('id')+']').find('span#counting').addClass("hidden"); - $('tr[id='+$link.data('id')+']').find('span#norecruit').removeClass("hidden"); - if ($.trim($('tr[id='+$link.data('id')+']').find('span#norecruit').html()).length == 0) { - $('tr[id='+$link.data('id')+']').find('span#norecruit').html("Right now no recruitment is going on.") - } - $('tr[id='+$link.data('id')+']').find('div[id='+$link.data('id')+']').removeClass('hidden'); - if ($.trim($('tr[id='+$link.data('id')+']').find('div[id='+$link.data('id')+']').html()).length == 0) { - htmlcon = "
You may also be interested in our others job positions, for which we don't have availabilities right now.
" - htmlcon += "Follow the positions that interests you and we will send you an email when the position is available.


" - htmlcon += "" - htmlcon += "" - htmlcon += "
" - $('tr[id='+$link.data('id')+']').find('div[id='+$link.data('id')+']').html(htmlcon); - }else{ - $('tr[id='+$link.data('id')+']').find('div[id='+$link.data('id')+']').removeClass('hidden'); - } - - } - }); - }); }); diff --git a/addons/website_hr_recruitment/views/website_hr_recruitment.xml b/addons/website_hr_recruitment/views/website_hr_recruitment.xml index 67f3ddf548b..8c06a431907 100644 --- a/addons/website_hr_recruitment/views/website_hr_recruitment.xml +++ b/addons/website_hr_recruitment/views/website_hr_recruitment.xml @@ -15,14 +15,10 @@ Jobs
- +

Job Position

- +

@@ -65,14 +61,16 @@
You may also be interested in our others job positions, for which we don't have availabilities right now.
Follow the positions that interests you and we will send you an email when the position is available.


- - +
+ +
+
@@ -95,24 +90,16 @@ -
- -