Browse Source

[ADD] website_shift: Exempted personal work page

Add personal shift page for exempted worker.
pull/33/head
Rémy Taymans 7 years ago
parent
commit
09df1144df
  1. 14
      beesdoo_website_shift/controllers/main.py
  2. 95
      beesdoo_website_shift/views/shift_website_templates.xml

14
beesdoo_website_shift/controllers/main.py

@ -16,6 +16,8 @@ class WebsiteShiftController(http.Controller):
return self.shift_irregular_worker()
if working_mode == 'regular':
return self.shift_template_regular_worker()
if working_mode == 'exempt':
return self.shift_exempted_worker()
return request.render(
'beesdoo_website_shift.shift',
@ -124,3 +126,15 @@ class WebsiteShiftController(http.Controller):
'subscribed_shifts': subscribed_shifts,
}
)
def shift_exempted_worker(self, **kwargs):
# Get current user
cur_user = request.env['res.users'].browse(request.uid)
return request.render(
'beesdoo_website_shift.exempted_worker',
{
'partner': cur_user.partner_id,
'status': cur_user.partner_id.cooperative_status_ids,
}
)

95
beesdoo_website_shift/views/shift_website_templates.xml

@ -49,6 +49,101 @@
</t>
</template>
<!-- Shifts Exempt Workers -->
<template
id="exempted_worker"
name="Shifts for Exempted Workers"
page="True">
<t t-call="website.layout">
<div class="oe_structure"/>
<section class="wrap">
<div class="container">
<div class="row">
<div class="col-md-12">
<h1 class="text-center">
Your shifts
</h1>
</div>
</div>
</div>
</section>
<div class="oe_structure"/>
<section class="wrap">
<div class="container">
<div class="row">
<div class="col-xs-12 col-md-4 pull-right">
<section class="wrap">
<div class="container">
<div class="row">
<div class="col-md-12">
<h2>
Worker status
</h2>
</div>
</div>
</div>
</section>
<div class="oe_structure"/>
<p>
<label>Working Mode:</label>
<t t-esc="dict(status.fields_get(allfields=['working_mode'])['working_mode']['selection'])[status.working_mode]"/>
</p>
<p>
<label>Status:</label>
<t t-esc="dict(status.fields_get(allfields=['status'])['status']['selection'])[status.status]"/>
</p>
<p>
<label>Exempt Reason:</label>
<t t-esc="status.exempt_reason_id.name"/>
</p>
<t t-if="status.holiday_start_time">
<p>
<label>Holiday start time:</label>
<t t-esc="status.holiday_start_time"/>
</p>
<p>
<label>Holiday end time:</label>
<t t-esc="status.holiday_end_time"/>
</p>
</t>
<div class="oe_structure"/>
</div>
<div class="col-xs-12 col-md-8">
<section class="wrap">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="alert alert-info">
You don't have to participate to shift system.
</div>
</div>
</div>
</div>
</section>
<div class="oe_structure"/>
</div> <!-- col-md-8 -->
</div> <!-- row -->
</div> <!-- container -->
</section>
<div class="oe_structure"/>
</t>
</template>
<!-- Shifts for Regular Workers -->
<template
id="regular_worker"

Loading…
Cancel
Save