[IMP] Make the job position clickable and non clickable on publish and unpublish.
[odoo/odoo.git] / addons / website_hr_recruitment / views / website_hr_recruitment.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3     <data>
4         <record id="website_mail_jobs" model="mail.group">
5             <field name="name">Jobs</field>
6             <field name="public">public</field>
7             <field name="description">Job Posts on your website</field>
8         </record>
9         <template id="job_footer_custom" inherit_id="website.layout" name="Custom Footer Job">
10             <xpath expr="//body/footer//a[@href='/page/website.aboutus']" position="after">
11                 <li><a href="/jobs">Jobs</a></li>
12             </xpath>
13         </template>
14         
15         <template id="index" name="Jobs">
16             <t t-call="website.layout">
17                 <t t-set="head">
18                     <script type="text/javascript" src="/website_hr_recruitment/static/src/js/recruitment.js"></script>
19                     <t t-raw="head or ''"/>
20                 </t>
21                 <t t-set="title">Jobs</t>
22                 <div class="container">
23                     <h1>Job Position</h1>
24                     <t t-if="no_of_jobs &gt; 0">
25                         <t t-foreach="companies" t-as="company">
26                             <h2 class="text-center"><t t-field="company.name"/></h2>
27                             <table class="table">
28                                 <thead>
29                                     <tr>
30                                         <th><h4>Post Name</h4></th>
31                                         <th/>
32                                     </tr>
33                                 </thead>
34                                 <tbody>
35                                     <t t-foreach="res_job" t-as="job">
36                                         <tr t-if="job.company_id.id==company.id" t-att-id="job.id">
37                                             <td>
38                                                 <span id="job_post" t-att-class="job.no_of_recruitment &gt; 0 and 'show' or 'hidden'">
39                                                     <a t-att-href="'/job/detail/%%s' %% job.id"><span class="lead" t-field="job.name"/></a><br/>
40                                                 </span>
41                                                 <span id="no_job_post" t-att-class="job.no_of_recruitment &lt; 1 and 'show' or 'hidden'">
42                                                     <div t-att-href="'/job/detail/%%s' %% job.id"><span class="lead" t-field="job.name"/></div>
43                                                 </span>
44                                                 <t t-if="job.department_id">
45                                                     <span t-field="job.department_id.name"></span>
46                                                 </t><br/>
47                                                 <i class="icon-time"></i> <t t-esc="vals[job.id]['date_recruitment']"/><br/>
48                                                 <span id='counting' t-att-class="job.no_of_recruitment &gt; 0 and 'show' or 'hidden'" style="position:absolute;">
49                                                     <i class="icon-group"></i> No.of Post:
50                                                     <span id='counting_num'>
51                                                         <t t-esc="vals[job.id]['count']"></t>
52                                                     </span>
53                                                 </span>
54                                                 <span id="norecruit" t-att-class="job.no_of_recruitment &lt; 1 and 'show' or 'hidden'" style="position:absolute;">
55                                                     Right now no recruitment is going on.
56                                                 </span>
57                                                 <br/>
58                                                 <span><i class="icon-map-marker"></i> <t t-field="res_company.city"/> 
59                                                 <t t-if="res_company.state_id">
60                                                     <span t-field="res_company.state_id.name"></span>
61                                                 </t>
62                                                 <t t-if="res_company.country_id">
63                                                     <span t-field="res_company.country_id.name"></span>
64                                                 </t><br/>
65                                                 <t t-if="res_company.phone">&amp;#x2706; <t t-field="res_company.phone"/></t></span>
66                                                 <div t-att-id="job.id">
67                                                     <div class="subscribedetails" t-att-class="job.no_of_recruitment &lt; 1 and 'show' or 'hidden'">
68                                                         <strong>You may also be interested in our others job positions, for which we don't have availabilities right now.<br/>
69                                                         Follow the positions that interests you and we will send you an email when the position is available.</strong><br/><br/>
70                                                         <div class="col-md-4 col-sm-8">
71                                                             <input placeholder="Email Address" type="email" name="email" class="form-control"/>
72                                                         </div>
73                                                         <button class="btn btn-primary" name="subscribe">Subscribe</button>
74                                                         <input type="hidden" name="recid" t-att-value="job.id"/>
75                                                         <input type="hidden" name="group_id" t-att-value="%(website_hr_recruitment.website_mail_jobs)d"/>
76                                                     </div>
77                                                     <div class="hidden">
78                                                         <div class="alert alert-dismissable alert-success">
79                                                             <button type="button" class="close" data-dismiss="alert">x</button>
80                                                             <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.
81                                                         </div>
82                                                         <input type="hidden" name="email"/>
83                                                         <input type="hidden" name="group_id" t-att-value="%(website_hr_recruitment.website_mail_jobs)d"/>
84                                                         <button type="submit" class="btn" name="unsubscribe">Unsubscribe</button>
85                                                     </div>
86                                                 </div>
87                                             </td>
88                                             <td><t t-call="website.publish"><t t-set="object" t-value="job"/></t></td>
89                                         </tr>
90                                     </t>
91                                 </tbody>
92                             </table>
93                         </t>
94                     </t>
95                     <t t-if="no_of_jobs &lt; 1">
96                         <h3>"Thank you for your interest, but right now there is no job openings available in our company."</h3>
97                     </t>
98                 </div>
99             </t>
100         </template>
101         <template id="detail">
102             <t t-call="website.layout">
103                 <t t-set="title">Job Detail</t>
104                 <div class="col-md-4 pull-right">
105                     <ul class="pager">
106                         <li><a t-att-href="'/jobs'">All Jobs</a></li>
107                     </ul>
108                 </div>
109                 <div class="container">
110                     <h1><t t-field="job.name"/></h1>
111                     <div class="row">
112                         <div class="span12">
113                             <t t-if="job.description">
114                                 <h3>Description</h3>
115                                 <p t-if="job.description"><t t-field="job.description"/></p>
116                             </t>
117                         </div>
118                     </div>
119                     <t t-call="website_hr_recruitment.applyjobpost"/>
120                 </div>
121             </t>
122         </template>
123         <template id="applyjobpost">
124             <t t-set="title">Apply Job</t>
125             <section id="forms">
126                 <h1>Apply</h1>
127                 <div class="row">
128                     <form class="form-horizontal mt32" action="/job/success" method="post" enctype="multipart/form-data">
129                         <input type="hidden" t-att-value="job.department_id.id" name="department_id"/>
130                         <input type="hidden" t-att-value="job.id" name="job_id"/>
131                         <input type="hidden" t-att-value="job.name" name="name"/>
132                         <div class="form-group">
133                             <label class="col-md-3 col-sm-4 control-label" for="partner_name">Name</label>
134                             <div class="col-md-7 col-sm-8">
135                                 <input type="text" class="form-control" name="partner_name" required="True" />
136                             </div>
137                         </div>
138                         <div class="form-group">
139                             <label class="col-md-3 col-sm-4 control-label" for="email_from">Email</label>
140                             <div class="col-md-7 col-sm-8">
141                                 <input type="email" class="form-control" name="email_from" required="True" />
142                             </div>
143                         </div>
144                         <div class="form-group">
145                             <label class="col-md-3 col-sm-4 control-label" for="description">Description</label>
146                             <div class="col-md-7 col-sm-8">
147                                 <textarea  class="form-control" name="description" style="min-height: 120px"/>
148                             </div>
149                         </div>
150                         <div class="form-group">
151                             <label class="col-md-3 col-sm-4 control-label" for="ufile">Upload File</label>
152                             <div class="col-md-7 col-sm-8">
153                                 <input class="input-file" id="fileInput" type="file" name="ufile" required="true"/>
154                             </div>
155                         </div>
156                         <div class="form-group">
157                             <div class="col-md-offset-3 col-sm-offset-4 col-sm-8 col-md-7">
158                                 <button type="submit" class="btn btn-primary">Save</button>
159                             </div>
160                         </div>
161                     </form>
162                 </div>
163             </section>
164         </template>
165         <template id="thankyou">
166             <t t-call="website.layout">
167                 <t t-set="title">Thank You!</t>
168                 <div class="col-md-4 pull-right">
169                     <ul class="pager">
170                         <li><a t-att-href="'/job/detail/%%s' %% jobid">All Jobs</a></li>
171                     </ul>
172                 </div>
173                 <section id="typography">
174                     <div class="container">
175                         <div class="row">
176                             <h2>You have successfully applied for job.</h2>
177                         </div>
178                     </div>
179                 </section>
180             </t>
181         </template>
182      </data>
183 </openerp>