[IMP] website_shift: Refactor and fix bugs (s0030g)
[IMP] website_shift: Next shifts for regular
Refactor the generation of the next shift for regular worker.
Fix: no next shifts shown when the worker is a new worker and doesn't have any
past shift
Fix: no next shifts shown when the next shift of the worker is not
generated yet.
[ADD] website_shift: Help texts
[FIX] website_shift: Help texts
Fix help text for the status based on the input from the members office
[IMP] website_shift: Help texts translation
Add translation for the help texts.
[IMP] website_shift: Future alert date
The future alert date has moved to beesdoo_shift module. So we use this
one instead of re-compute it in the controller.
[IMP] website_shift: Update manifest
[FIX] website_shift: Better position for help text
On a small screen help texts appear on the top of the page leaving
useful info on the bottom. Now help texts is moved on the bottom of the
page.
[ADD] website_shift: Feedback when subscribing
Add a feedback to the user about the successfulness of the subscription.
[FIX] website_shift: Super-cooperator info modal
The modal showing the super-cooperator information didn't work for the
'fictive' shift generated for regular workers. It's due to the fact that
a 'fictive' shift doesn't have an id. So we should not use it to
generate xml ids. Instead we use the index of the foreach loop.
[FIX] website_shift: Wrong time when crossing DST
The issue: There was a time difference of one hour when the fictive
shifts cross the DST (Daylight Saving Time).
Explanation: Python works with two types of datetime. The datetime
without a timezone called *naive* and the one with a timezone called
*non-naive*. `timedelta()` is used to add a number of day to a datetime.
However, changing a non-naive datetime with `timedelta` just change the
date but leave the timezone unchanged. That's no correct because the new
date may not be in the same timezone because of the DST. If the new date
is after a change of time, due to DST, the timezone of the non-naive
datetime should be updated. Python don't do that because `timedelta`
doesn't realy add days but add the corresponding hours ! So when adding
hours it's consistent to not change the timezone (you can use
`normalize()` to get your datetime in the right timezone after a cross
of DST). To fix this, after adding a `timedelta` the timezone of the
datetime should be set to none and the relocalized with the `localize()`
function of the `pytz` corresponding timezone.
[FIX] website_shift: Translations
" If you are in alert status, that means you didn't anticipate enough shifts.\n"
" Your counter is now negative, directly to -2.\n"
" You have 4 weeks to do 2 shifts to be up to date.\n"
" For the compensation shifts, subscribe like you do for a normal shift.\n"
" Be careful, in addition to these 2 shifts, don't forget to do your normal shift in the same delay to prevent to be in the same situation next month."
msgstr "<strong>Alerte :</strong>\n"
"Si vous êtes en alerte, c'est que vous n'avez pas anticipé assez de shifts. Votre compteur est donc passé en négatif, directement à -2. Vous avez donc 4 semaines pour effectuer deux shifts pour vous remettre à jour. Pour les shifts de rattrapage, inscrivez-vous comme pour tout shift normal. Attention, en plus de ces deux shifts de retard, n’oubliez pas de faire votre shift normal dans les mêmes délais, pour éviter d’avoir le même problème le mois prochain."
" If you are in alert status, that means you didn't do your last shift. You have\n"
" until your next scheduled shift to do your compensation shift according to your situation.\n"
" Your compensation is either simple or double. If you don't how how many compensation shifts you have to do, please contact your supercooperator.\n"
" To do your compensation shift, no need to subscribe in advance : you come at the beginning of the shift that best suits you.\n"
" Add your name and the indication \"compensation shift\" on the attendance list.\n"
" No panic, you still can come and shop, so can your eaters if you have any."
msgstr "<strong>Alerte : </strong>\n"
"Si vous êtes en alerte c'est que vous n'avez pas effectué votre dernier shift. Vous avez donc jusqu'à votre prochain shift de prévu pour faire votre compensation suivant la situation. Celle-ci sera simple ou double. Si vous ne savez pas si vous avez une simple ou une double compensation, contactez votre supercoopérateur. Pour les shifts de compensation, pas besoin d'inscription : vous vous présentez au début d'un shift au créneau qui vous convient le mieux. Ajoutez sur la feuille de présence votre nom/prénom + “shift de compensation”.\n"
"Mais pas de panique, vous pouvez toujours venir faire vos courses (ainsi que vos mangeurs le cas échéant)."
" You didn't manage to do your compensation shifts in the delay but you benefit from the auto-extension.\n"
" This is two more weeks to do your compensation shifts. You can shop.\n"
" If you don't do your compensation shifts, you'll be suspended."
msgstr "<strong>Délai de grâce :</strong>\n"
"Vous n'êtes pas parvenu à effectuer vos compensations dans les délais mais vous bénéficiez d’un délai de grâce. Il s’agit de deux semaines supplémentaires pour effectuer vos compensations tout en continuant de pouvoir faire vos courses. Si vous ne les effectuez pas, vous serez suspendu·e."
msgid "<strong>Info!</strong> If you do not agree with your status, please contact the members office by mail (membre@bees-coop.be) or during the open hours of the office (Monday 5PM to 7:30PM, Wednesday 5PM to 7:30 PM and Friday 2:30PM to 5 PM)."
msgstr "<strong>Info !</strong> Si vous n’êtes pas d’accord avec votre statut, il peut s’agir d’une erreur de notre part. Contactez alors le bureau des membres par mail (membre@bees-coop.be) ou en personne pendant les heures d'ouverture du bureau : le lundi de 17h00 à 19h30, le mercredi de 17h à 19h30 et le vendredi de 14h30 à 17h (à l'étage du magasin)."
" If you are suspended, that means you didn't come to a shift and you didn't do you compensation shifts in the delay (4 weeks).\n"
" You cannot shop (so as your eaters). But no need to panic : a two-weeks delay is activable on demand at the entrance of the supermarket.\n"
" You will be able to shop during 2 more weeks and to put your situation in order.\n"
" To do your compensation shift, no need to subscribe in advance : you come at the beginning of the shift that best suits you.\n"
" Add your name and the indication \"compensation shift\" on the attendance list."
msgstr "<strong>Suspendu·e :</strong>\n"
"Si vous êtes suspendu·e, c’est que vous avez raté un shift et vous n'avez pas effectué votre/vos shifts de compensation dans les délais prévus (4 semaines). Vous ne pouvez plus faire vos courses (tout comme vos mangeurs). Mais pas de panique : un délai de grâce de 2 semaines est activable sur simple demande à l’accueil du magasin. Celui-ci vous octroie 2 semaines supplémentaires pour faire vos course et vous remettre en ordre. Si vous ne savez pas si vous avez une simple ou une double compensation, contactez votre supercoopérateur. Pour les shifts de compensation, pas besoin d'inscription : vous vous présentez au début d'un shift au créneau qui vous convient le mieux. Ajoutez sur la feuille de présence votre nom/prénom + “shift de compensation”."
" You did not anticipate enough shifts and you did not come back to a normal situation in the delay.\n"
" You cannot shop anymore, nor can your eaters.\n"
" But no need to panic : a two-weeks delay is activable on demand at the entrance of the supermarket.\n"
" You will be able to shop during 2 more weeks and to put your situation in order.\n"
" For the compensation shifts, subscribe like you do for a normal shift."
msgstr "<strong>Suspendu·e:</strong>\n"
"Vous n'avez pas anticipé suffisamment de shifts et n’avez pas rattrapé votre retard dans les délais prévus. Vous ne pouvez plus faire vos courses (tout comme vos mangeurs). Mais pas de panique, nous pouvons vous proposer un délai de grâce de 2 semaines pour effectuer vos shifts de rattrapage. Vous pouvez le demander à l'accueil du magasin. Cela vous permettra de garder le droit de faire vos courses dans ce délai. Pour les shifts de rattrapage, inscrivez-vous comme pour tout shift normal."
" You did not attend two consecutive shifts. You are now unsubscribed. You cannot shop (nor can your eaters) nor come to work.\n"
" To subscribe again, please contact membre@bees-coop.be or come to the members office during the opening hours."
msgstr "<strong>Désinscrit·e :</strong>\n"
"Vous avez raté deux shifts consécutifs. Vous êtes donc désinscrit·e. Vous ne pouvez plus venir faire vos courses (tout comme vos mangeurs), ni venir travailler. Pour vous réinscrire, contactez membre@bees-coop.be ou passez au bureau des membres pendant les heures d'ouverture."
" Your counter is negative and you haven't come to work for more than 8 weeks.\n"
" You are unsubscribed. You cannot shop nor can your eaters.\n"
" To subscribe again of if it's a mistake, please contact membre@bees-coop.be or come to the members office during the opening hours."
msgstr "<strong>Désinscrit·e :</strong>\n"
"Vous êtes en négatif sur votre compteur et vous n'êtes pas venu travailler depuis plus de 8 semaines.\n"
"Vous êtes donc désinscrit·e. Vous ne pouvez plus venir faire vos courses (tout comme vos mangeurs). Pour vous réinscrire ou si c'est une erreur de notre part, contactez membre@bees-coop.be ou passez au bureau des membres pendant les heures d'ouverture."
msgid "<strong>Warning !</strong> For the moment public holidays are not taken into account. If your shift\n"
" occures during a public holiday, you do not have to do it."
msgstr "<strong>Attention !</strong> Pour le moment, les congés publics ne sont pas pris en compte. Si votre shift tombe durant un congé public, vous ne devez pas le faire."
<strong>Info!</strong> If you do not agree with your status, please contact the members office by mail (membre@bees-coop.be) or during the open hours of the office (Monday 5PM to 7:30PM, Wednesday 5PM to 7:30 PM and Friday 2:30PM to 5 PM).
</div>
<pclass="oe_structure">
Explanation of the status:
</p>
<pclass="oe_structure">
<strong>Up To Date:</strong>
That's perfect! You are in order. Thanks a lot. You can come and shop, so can your eaters if you have any.
</p>
</template>
<template
id="help_text_regular_worker"
name="Help Text for Regular Worker">
<pclass="oe_structure">
<strong>Alert:</strong>
If you are in alert status, that means you didn't do your last shift. You have
until your next scheduled shift to do your compensation shift according to your situation.
Your compensation is either simple or double. If you don't how how many compensation shifts you have to do, please contact your supercooperator.
To do your compensation shift, no need to subscribe in advance : you come at the beginning of the shift that best suits you.
Add your name and the indication "compensation shift" on the attendance list.
No panic, you still can come and shop, so can your eaters if you have any.
</p>
<pclass="oe_structure">
<strong>Suspended:</strong>
If you are suspended, that means you didn't come to a shift and you didn't do you compensation shifts in the delay (4 weeks).
You cannot shop (so as your eaters). But no need to panic : a two-weeks delay is activable on demand at the entrance of the supermarket.
You will be able to shop during 2 more weeks and to put your situation in order.
To do your compensation shift, no need to subscribe in advance : you come at the beginning of the shift that best suits you.
Add your name and the indication "compensation shift" on the attendance list.
</p>
<pclass="oe_structure">
<strong>Auto-Extension:</strong>
You didn't manage to do your compensation shifts in the delay but you benefit from the auto-extension.
This is two more weeks to do your compensation shifts. You can shop.
If you don't do your compensation shifts, you'll be suspended.
</p>
<pclass="oe_structure">
<strong>Unsubscribed:</strong>
You did not attend two consecutive shifts. You are now unsubscribed. You cannot shop (nor can your eaters) nor come to work.
To subscribe again, please contact membre@bees-coop.be or come to the members office during the opening hours.
</p>
</template>
<template
id="help_text_irregular_worker"
name="Help Text for Irregular Worker">
<pclass="oe_structure">
<strong>Alert:</strong>
If you are in alert status, that means you didn't anticipate enough shifts.
Your counter is now negative, directly to -2.
You have 4 weeks to do 2 shifts to be up to date.
For the compensation shifts, subscribe like you do for a normal shift.
Be careful, in addition to these 2 shifts, don't forget to do your normal shift in the same delay to prevent to be in the same situation next month.
</p>
<pclass="oe_structure">
<strong>Suspended:</strong>
You did not anticipate enough shifts and you did not come back to a normal situation in the delay.
You cannot shop anymore, nor can your eaters.
But no need to panic : a two-weeks delay is activable on demand at the entrance of the supermarket.
You will be able to shop during 2 more weeks and to put your situation in order.
For the compensation shifts, subscribe like you do for a normal shift.
</p>
<pclass="oe_structure">
<strong>Auto-Extension:</strong>
You didn't manage to do your compensation shifts in the delay but you benefit from the auto-extension.
This is two more weeks to do your compensation shifts. You can shop.
If you don't do your compensation shifts, you'll be suspended.
</p>
<pclass="oe_structure">
<strong>Unsubscribed:</strong>
Your counter is negative and you haven't come to work for more than 8 weeks.
You are unsubscribed. You cannot shop nor can your eaters.
To subscribe again of if it's a mistake, please contact membre@bees-coop.be or come to the members office during the opening hours.