diff --git a/beesdoo_website_shift/controllers/main.py b/beesdoo_website_shift/controllers/main.py index 84bbec4..0f73fb5 100644 --- a/beesdoo_website_shift/controllers/main.py +++ b/beesdoo_website_shift/controllers/main.py @@ -28,6 +28,11 @@ class WebsiteShiftController(http.Controller): working_mode = user.partner_id.working_mode return working_mode == 'regular' + def is_user_regular_without_shift(self): + user = request.env['res.users'].browse(request.uid) + return (not user.partner_id.subscribed_shift_ids.id and + self.is_user_regular()) + def is_user_exempted(self): user = request.env['res.users'].browse(request.uid) working_mode = user.partner_id.working_mode @@ -89,7 +94,12 @@ class WebsiteShiftController(http.Controller): 'beesdoo_website_shift.my_shift_irregular_worker', self.my_shift_irregular_worker(nexturl='/my/shift') ) - if self.is_user_regular(): + if self.is_user_regular_without_shift(): + return request.render( + 'beesdoo_website_shift.my_shift_regular_worker_without_shift', + self.my_shift_regular_worker_without_shift() + ) + if self.is_user_regular() and not self.is_user_regular_without_shift(): return request.render( 'beesdoo_website_shift.my_shift_regular_worker', self.my_shift_regular_worker() @@ -199,6 +209,12 @@ class WebsiteShiftController(http.Controller): return template_context + def my_shift_regular_worker_without_shift(self): + """ + Return template variables for 'beesdoo_website_shift.my_shift_regular_worker_without_shift' template + """ + return self.my_shift_worker_status() + def my_shift_regular_worker(self): """ Return template variables for 'beesdoo_website_shift.my_shift_regular_worker' template diff --git a/beesdoo_website_shift/i18n/fr_BE.po b/beesdoo_website_shift/i18n/fr_BE.po index 6164d57..1eeb905 100644 --- a/beesdoo_website_shift/i18n/fr_BE.po +++ b/beesdoo_website_shift/i18n/fr_BE.po @@ -562,10 +562,15 @@ msgstr "Vous êtes un supercoopérateur" #. module: beesdoo_website_shift #: model:ir.ui.view,arch_db:beesdoo_website_shift.my_shift_exempted_worker -#: model:ir.ui.view,arch_db:beesdoo_website_shift.my_shift_non_worker msgid "You don't have to participate to shift system." msgstr "Vous ne devez pas participer au système de shift." +#. module: beesdoo_website_shift +#: model:ir.ui.view,arch_db:beesdoo_website_shift.my_shift_non_worker +#: model:ir.ui.view,arch_db:beesdoo_website_shift.my_shift_regular_worker_without_shift +msgid "Please contact the members office to suscribe to shifts." +msgstr "Merci de contacter le bureau des membres pour vous inscrire à un créneau de travail." + #. module: beesdoo_website_shift #: model:ir.ui.view,arch_db:beesdoo_website_shift.my_shift_next_shifts msgid "Your next shifts" diff --git a/beesdoo_website_shift/views/my_shift_website_templates.xml b/beesdoo_website_shift/views/my_shift_website_templates.xml index f938142..163d8e1 100644 --- a/beesdoo_website_shift/views/my_shift_website_templates.xml +++ b/beesdoo_website_shift/views/my_shift_website_templates.xml @@ -5,96 +5,98 @@ --> - - - - - - - +
- -
+ - - - + + + + + + + + + - -

- Up To Date: - That's perfect! You are in order. Thanks a lot. You can come and shop, so can your eaters if you have any. -

- + +