[IMP]Convert into bootstrap 3.0 and removed publish.

bzr revid: bth@tinyerp.com-20130904123017-v3q93lxrlr9yt58l
This commit is contained in:
bth-openerp 2013-09-04 18:00:17 +05:30
parent a8659aa1dd
commit d22223df14
4 changed files with 44 additions and 110 deletions

View File

@ -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',

View File

@ -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)

View File

@ -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 = '<i class="icon-group"></i> No.of Post: <span id="counting_num">' + result['count'] + '</span>';
$('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 = "<div class='subscribedetails'><strong>You may also be interested in our others job positions, for which we don't have availabilities right now.<br/>"
htmlcon += "Follow the positions that interests you and we will send you an email when the position is available.</strong><br/><br/>"
htmlcon += "<input placeholder='Email Address' type='email' name='email' class='input-medium'/>"
htmlcon += "<button class='btn btn-primary' name='subscribe'>Subscribe</button>"
htmlcon += "<input type='hidden' name='recid' t-att-value='job.id'/> </div>"
$('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');
}
}
});
});
});

View File

@ -15,14 +15,10 @@
</t>
<t t-set="title">Jobs</t>
<div class="container">
<div class="page-header">
<h1>Job Position</h1>
</div>
<h1>Job Position</h1>
<t t-if="no_of_jobs &gt; 0">
<t t-foreach="companies" t-as="company">
<div class="page-header">
<h2 class="text-center"><t t-field="company.name"/></h2>
</div>
<h2 class="text-center"><t t-field="company.name"/></h2>
<table class="table">
<thead>
<tr>
@ -65,14 +61,16 @@
<div class="subscribedetails">
<strong>You may also be interested in our others job positions, for which we don't have availabilities right now.<br/>
Follow the positions that interests you and we will send you an email when the position is available.</strong><br/><br/>
<input placeholder="Email Address" type="email" name="email" class="input-medium"/>
<button class="btn btn-primary" name="subscribe" style="margin-bottom:10px;">Subscribe</button>
<div class="col-md-4 col-sm-8">
<input placeholder="Email Address" type="email" name="email" class="form-control"/>
</div>
<button class="btn btn-primary" name="subscribe">Subscribe</button>
<input type="hidden" name="recid" t-att-value="job.id"/>
</div>
<div class="hidden">
<div class="alert alert-success">
<button type="button" class="close" data-dismiss="alert">×</button>
<strong>Oh great!</strong> You are successfully subscribed email notifications for a <b><t t-esc="job.name"/></b> job.
<div class="alert alert-dismissable alert-success">
<button type="button" class="close" data-dismiss="alert">x</button>
<strong>Oh great!</strong> You are successfully subscribed email notifications for a <a t-att-href="'/job/detail/%%s' %% job.id" class="alert-link"><t t-esc="job.name"/></a> job.
</div>
<input type="hidden" name="email"/>
<button type="submit" class="btn" name="unsubscribe">Unsubscribe</button>
@ -80,9 +78,6 @@
</t>
</div>
</td>
<td>
<t t-call="website_hr_recruitment.published"><t t-set="object" t-value="job"/></t>
</td>
</tr>
</t>
</tbody>
@ -95,24 +90,16 @@
</div>
</t>
</template>
<template id="published">
<a href="#" t-att-data-id="object.id" t-att-data-object="object._name" class="pull-right" t-if="editable" t-ignore="true">
<span t-att-class="'label label-success js_unpublished %%s' %% (not object.website_published and 'hidden' or '')">Unpublish</span>
<span t-att-class="'label label-important js_published %%s' %% (object.website_published and 'hidden' or '')">Publish</span>
</a>
</template>
<template id="detail">
<t t-call="website.layout">
<t t-set="title">Job Detail</t>
<div class="span4 pull-right">
<div class="col-md-4 pull-right">
<ul class="pager">
<li><a t-att-href="'/jobs'">All Jobs</a></li>
</ul>
</div>
<div class="container">
<div class="page-header">
<h1><t t-field="job.name"/></h1>
</div>
<h1><t t-field="job.name"/></h1>
<div class="row">
<div class="span12">
<t t-if="job.description">
@ -128,32 +115,41 @@
<template id="applyjobpost">
<t t-set="title">Apply Job</t>
<section id="forms">
<div class="page-header">
<h1>Apply</h1>
</div>
<h1>Apply</h1>
<div class="row">
<form class="form-horizontal well" action="/job/success" method="post" enctype="multipart/form-data">
<fieldset>
<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.name" name="name"/>
<div class="control-group">
<input type="text" class="input-xlarge" id="nametxt" name="partner_name" required="true" placeholder="Name..."/>
<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"/>
<input type="hidden" t-att-value="job.name" name="name"/>
<div class="form-group">
<label class="col-md-3 col-sm-4 control-label" for="partner_name">Name</label>
<div class="col-md-7 col-sm-8">
<input type="text" class="form-control" name="partner_name" required="True" />
</div>
<div class="control-group">
<input type="email" class="input-xlarge" id="emailtxt" name="email_from" required="true" placeholder="Email..."/>
</div>
<div class="form-group">
<label class="col-md-3 col-sm-4 control-label" for="email_from">Email</label>
<div class="col-md-7 col-sm-8">
<input type="email" class="form-control" name="email_from" required="True" />
</div>
<div class="control-group">
<textarea class="span8" style="margin-top:5px; height: 140px;" name="description" placeholder="Enter your comment..."> </textarea>
</div>
<div class="form-group">
<label class="col-md-3 col-sm-4 control-label" for="description">Description</label>
<div class="col-md-7 col-sm-8">
<textarea class="form-control" name="description" style="min-height: 120px"/>
</div>
<div class="control-group">
</div>
<div class="form-group">
<label class="col-md-3 col-sm-4 control-label" for="ufile">Upload File</label>
<div class="col-md-7 col-sm-8">
<input class="input-file" id="fileInput" type="file" name="ufile" required="true"/>
</div>
<div class="form-actions">
</div>
<div class="form-group">
<div class="col-md-offset-3 col-sm-offset-4 col-sm-8 col-md-7">
<button type="submit" class="btn btn-primary">Save</button>
<button type="reset" class="btn"><a t-att-href="'/jobs'">Cancel</a></button>
</div>
</fieldset>
</div>
</div>
</form>
</div>
</section>
@ -161,7 +157,7 @@
<template id="thankyou">
<t t-call="website.layout">
<t t-set="title">Thank You!</t>
<div class="span4 pull-right">
<div class="col-md-4 pull-right">
<ul class="pager">
<li><a t-att-href="'/job/detail/%%s' %% jobid">All Jobs</a></li>
</ul>
@ -169,11 +165,11 @@
<section id="typography">
<div class="container">
<div class="row">
<h2 class="oe_slogan">You have successfully applied for job.</h2>
<h2>You have successfully applied for job.</h2>
</div>
</div>
</section>
</t>
</template>
</data>
</openerp>
</openerp>