one CGV button for and etransaction and sith account

This commit is contained in:
TitouanDor
2026-05-26 23:30:23 +02:00
committed by imperosol
parent e9a55c6f3a
commit 89afdba055
2 changed files with 28 additions and 15 deletions
-1
View File
@@ -141,7 +141,6 @@ form {
display: block;
margin: calc(var(--nf-input-size) * 1.5) auto 10px;
line-height: 1;
white-space: nowrap;
.fields-centered {
padding: 10px 10px 0;
@@ -63,20 +63,35 @@
<div @htmx:after-request="fill">
{{ billing_infos_form }}
</div>
{% include "core/base/notifications.jinja" %}
{% endif %}
{% include "core/base/notifications.jinja" %}
{% if settings.SITH_EBOUTIC_CB_ENABLED or (basket.total <= user.account_balance and not basket.contains_refilling_item) %}
{# don't display the cgv form if no payment mean is available #}
<form id="cgv-form" x-ref="cgvForm">
{# In order to have one CGV button for both payment means,
we have a third dummy form, containing only the cgv button,
which validation is triggered when one of the two other forms is submitted.
If the validation of this form fails, the submit event will be cancelled. #}
<div class="form-group margin-bottom">
<input type="checkbox" id="cgv-checkbox" name="cgv" required>
<label for="cgv-checkbox">
{% trans trimmed %}I have read and I accept{% endtrans %}
<a href="{{ url('core:page', 'cgv') }}">{% trans %}the general terms and conditions{% endtrans%}</a>
{%trans%}of the student association of the UTBM{% endtrans %}
</label>
</div>
</form>
{% endif %}
{% if settings.SITH_EBOUTIC_CB_ENABLED %}
<form
method="post"
id="bank-payment-form"
action="{{ settings.SITH_EBOUTIC_ET_URL }}"
@submit="if (!$refs.cgvForm.reportValidity()) $event.preventDefault()"
>
<template x-for="[key, value] in Object.entries(data)" :key="key">
<input type="hidden" :name="key" :value="value">
</template>
<input type="checkbox" value="cgv" required>
<label>
{% trans trimmed %}I have read and accept {% endtrans %}
<a href="">{% trans %}the general terms and conditions{% endtrans%}</a>
{%trans%}of the student assosiation of UTBM{% endtrans %}</label>
<br>
<input
x-cloak
type="submit"
@@ -104,14 +119,13 @@
{% elif basket.total > user.account_balance %}
<p>{% trans %}AE account payment disabled because you do not have enough money remaining.{% endtrans %}</p>
{% else %}
<form method="post" action="{{ url('eboutic:pay_with_sith', basket_id=basket.id) }}" name="sith-pay-form">
<form
method="post"
action="{{ url('eboutic:pay_with_sith', basket_id=basket.id) }}"
id="sith-payment-form"
@submit="if (!$refs.cgvForm.reportValidity()) $event.preventDefault()"
>
{% csrf_token %}
<input type="checkbox" value="cgv" required>
<label>
{% trans trimmed %}I have read and accept {% endtrans %}
<a href="">{% trans %}the general terms and conditions{% endtrans%}</a>
{%trans%}of the student assosiation of UTBM{% endtrans %}</label>
<br>
<input
{% if basket.is_expired %}
disabled="disabled"