Commit 9910c111 by François C.

Misc change for production use

parent c18fc4b6
Pipeline #2811 failed with stage
in 1 minute 19 seconds
...@@ -106,14 +106,13 @@ function fill_member_slide(member) { ...@@ -106,14 +106,13 @@ function fill_member_slide(member) {
html_elts.status_explanation.html(explanation); html_elts.status_explanation.html(explanation);
} }
if (member.cooperative_state == 'Désinscrit(e)' || member.cooperative_state == 'Parti(e)') {
if (member.cooperative_state == 'Désinscrit(e)' || member.cooperative_state == 'Parti(e)' || member.cooperative_state == 'Rattrapage' || member.cooperative_state == 'Suspendu(e)') {
coop_info.addClass('b_red'); coop_info.addClass('b_red');
} }
else if (member.cooperative_state == 'En alerte' || member.cooperative_state == 'Délai accordé') { else if (member.cooperative_state == 'En alerte' || member.cooperative_state == 'Délai accordé') {
coop_info.addClass('b_yellow') coop_info.addClass('b_yellow')
} else if (member.cooperative_state == 'Suspendu(e)') { }
coop_info.addClass('b_orange');
}
if (member.shifts.length > 0) { if (member.shifts.length > 0) {
html_elts.next_shifts.append('Prochains services : '); html_elts.next_shifts.append('Prochains services : ');
......
...@@ -48,12 +48,15 @@ def index(request): ...@@ -48,12 +48,15 @@ def index(request):
return HttpResponse("Le créneau des comités n'est pas configuré dans Odoo !") return HttpResponse("Le créneau des comités n'est pas configuré dans Odoo !")
else: else:
context['committees_shift_id'] = committees_shift_id context['committees_shift_id'] = committees_shift_id
if getattr(settings, 'USE_EXEMPTIONS_SHIFT_TEMPLATE', False) is True:
exemptions_shift_id = CagetteServices.get_exemptions_shift_id() exemptions_shift_id = CagetteServices.get_exemptions_shift_id()
if exemptions_shift_id is None: if exemptions_shift_id is None:
return HttpResponse("Le créneau des exemptions n'est pas configuré dans Odoo !") return HttpResponse("Le créneau des exemptions n'est pas configuré dans Odoo !")
else:
context['exemptions_shift_id'] = exemptions_shift_id
else: else:
context['exemptions_shift_id'] = exemptions_shift_id context['exemptions_shift_id'] = 0
if 'no_picture_member_advice' in msettings: if 'no_picture_member_advice' in msettings:
if len(msettings['no_picture_member_advice']['value']) > 0: if len(msettings['no_picture_member_advice']['value']) > 0:
...@@ -94,7 +97,10 @@ def inscriptions(request, type=1): ...@@ -94,7 +97,10 @@ def inscriptions(request, type=1):
template = loader.get_template('members/inscriptions.html') template = loader.get_template('members/inscriptions.html')
committees_shift_id = CagetteServices.get_committees_shift_id() committees_shift_id = CagetteServices.get_committees_shift_id()
exemptions_shift_id = CagetteServices.get_exemptions_shift_id() if getattr(settings, 'USE_EXEMPTIONS_SHIFT_TEMPLATE', False) is True:
exemptions_shift_id = CagetteServices.get_exemptions_shift_id()
else:
exemptions_shift_id = 0
context = { context = {
'type': type, 'title': 'Inscriptions', 'type': type, 'title': 'Inscriptions',
'couchdb_server': settings.COUCHDB['url'], 'couchdb_server': settings.COUCHDB['url'],
...@@ -133,7 +139,10 @@ def prepa_odoo(request): ...@@ -133,7 +139,10 @@ def prepa_odoo(request):
"""Generate coop subscription form, to be fill by BDM.""" """Generate coop subscription form, to be fill by BDM."""
template = loader.get_template('members/prepa_odoo.html') template = loader.get_template('members/prepa_odoo.html')
committees_shift_id = CagetteServices.get_committees_shift_id() committees_shift_id = CagetteServices.get_committees_shift_id()
exemptions_shift_id = CagetteServices.get_exemptions_shift_id() if getattr(settings, 'USE_EXEMPTIONS_SHIFT_TEMPLATE', False) is True:
exemptions_shift_id = CagetteServices.get_exemptions_shift_id()
else:
exemptions_shift_id = 0
context = {'title': 'Préparation Odoo Inscriptions', context = {'title': 'Préparation Odoo Inscriptions',
'warning_placeholder': 'Par exemple, il manque un chèque', 'warning_placeholder': 'Par exemple, il manque un chèque',
......
...@@ -162,6 +162,14 @@ def index(request, exception=None): ...@@ -162,6 +162,14 @@ def index(request, exception=None):
context['helper_unsubscribe_form_link'] = msettings['helper_unsubscribe_form_link']['value'] if 'helper_unsubscribe_form_link' in msettings else '' context['helper_unsubscribe_form_link'] = msettings['helper_unsubscribe_form_link']['value'] if 'helper_unsubscribe_form_link' in msettings else ''
context['covid_form_link'] = msettings['covid_form_link']['value'] if 'covid_form_link' in msettings else '' context['covid_form_link'] = msettings['covid_form_link']['value'] if 'covid_form_link' in msettings else ''
context['covid_end_form_link'] = msettings['covid_end_form_link']['value'] if 'covid_end_form_link' in msettings else '' context['covid_end_form_link'] = msettings['covid_end_form_link']['value'] if 'covid_end_form_link' in msettings else ''
if getattr(settings, 'USE_EXEMPTIONS_SHIFT_TEMPLATE', False) is True:
exemptions_shift_id = CagetteServices.get_exemptions_shift_id()
if exemptions_shift_id is None:
return HttpResponse("Le créneau des exemptions n'est pas configuré dans Odoo !")
else:
context['exemptions_shift_id'] = exemptions_shift_id
else:
context['exemptions_shift_id'] = 0
else: else:
# may arrive when switching database without cleaning cookie # may arrive when switching database without cleaning cookie
return redirect('/website/deconnect') return redirect('/website/deconnect')
......
...@@ -7,9 +7,11 @@ ...@@ -7,9 +7,11 @@
ou ... ou ...
<br /> <br />
<button class="flex-container--column" data-select="Volant">Volant</button> <button class="flex-container--column" data-select="Volant">Volant</button>
{% if exemptions_shift_id != 0 %}
ou ... ou ...
<br /> <br />
<button class="flex-container--column" data-select="Exemption">Exempté</button> <button class="flex-container--column" data-select="Exemption">Exempté</button>
{% endif %}
<div class="info"></div> <div class="info"></div>
</div> </div>
<div class="col-5 main_content"> <div class="col-5 main_content">
......
...@@ -9,9 +9,11 @@ ...@@ -9,9 +9,11 @@
<br /> <br />
<button class="flex-container--column" data-select="Volant">Volant</button> <button class="flex-container--column" data-select="Volant">Volant</button>
{% endif %} {% endif %}
{% if exemptions_shift_id != 0 %}
ou ... ou ...
<br /> <br />
<button class="flex-container--column" data-select="Exemption">Exempté</button> <button class="flex-container--column" data-select="Exemption">Exempté</button>
{% endif %}
<div class="info"></div> <div class="info"></div>
</div> </div>
<div class="col-5 main_content"> <div class="col-5 main_content">
......
...@@ -132,7 +132,8 @@ ...@@ -132,7 +132,8 @@
</div> </div>
<script> <script>
var max_begin_hour = "{{max_begin_hour}}", var max_begin_hour = "{{max_begin_hour}}",
type = 2; type = 2,
exemptions_shift_id = '{{exemptions_shift_id}}';
</script> </script>
{% endif %} {% endif %}
</div> </div>
...@@ -108,9 +108,6 @@ ...@@ -108,9 +108,6 @@
<p data-type="next_ftop_shift"> <p data-type="next_ftop_shift">
Le système informatique viendra prélever un service sur votre compteur le <span data-type="next_ftop_shift_date"></span>. Le système informatique viendra prélever un service sur votre compteur le <span data-type="next_ftop_shift_date"></span>.
</p> </p>
<p>
Veillez à faire au moins 1 service d'ici là !
</p>
</div> </div>
</div> </div>
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment