mirror of
https://github.com/ae-utbm/sith.git
synced 2026-06-04 23:29:24 +00:00
one CGV button for and etransaction and sith account
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -59,13 +59,21 @@
|
||||
<div @htmx:after-request="fill">
|
||||
{{ billing_infos_form }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% include "core/base/notifications.jinja" %}
|
||||
<form
|
||||
method="post"
|
||||
action="{{ settings.SITH_EBOUTIC_ET_URL }}"
|
||||
id="bank-form"
|
||||
onsubmit="return validateCgv()"
|
||||
>
|
||||
<form method="post" id="payment-form">
|
||||
{# In order to have one CGV button for both payment means,
|
||||
there is only one form, which action will be given
|
||||
the `formaction` attribute of the selected submit input #}
|
||||
<div class="form-group margin-bottom">
|
||||
<input type="checkbox" id="cgv" name="cgv" required>
|
||||
<label for="cgv">
|
||||
{% trans trimmed %}I have read and I accept{% endtrans %}
|
||||
<a href="">{% trans %}the general terms and conditions{% endtrans%}</a>
|
||||
{%trans%}of the student association of the UTBM{% endtrans %}
|
||||
</label>
|
||||
</div>
|
||||
{% if settings.SITH_EBOUTIC_CB_ENABLED %}
|
||||
<template x-for="[key, value] in Object.entries(data)" :key="key">
|
||||
<input type="hidden" :name="key" :value="value">
|
||||
</template>
|
||||
@@ -79,9 +87,9 @@
|
||||
:disabled="!isCbAvailable"
|
||||
{% endif %}
|
||||
class="btn btn-blue"
|
||||
formaction="{{ settings.SITH_EBOUTIC_ET_URL }}"
|
||||
value="{% trans %}Pay with credit card{% endtrans %}"
|
||||
/>
|
||||
</form>
|
||||
{% else %}
|
||||
<div class="alert alert-yellow">
|
||||
{% trans trimmed %}
|
||||
@@ -96,13 +104,6 @@
|
||||
{% 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"
|
||||
id="sith-form"
|
||||
onsubmit="return validateCgv()"
|
||||
>
|
||||
{% csrf_token %}
|
||||
<input
|
||||
{% if basket.is_expired %}
|
||||
@@ -112,29 +113,10 @@
|
||||
{% endif %}
|
||||
class="btn btn-blue"
|
||||
type="submit"
|
||||
formaction="{{ url('eboutic:pay_with_sith', basket_id=basket.id) }}"
|
||||
value="{% trans %}Pay with Sith account{% endtrans %}"
|
||||
/>
|
||||
</form>
|
||||
{% endif %}
|
||||
|
||||
<div class="cgv-block">
|
||||
<input type="checkbox" id="cgv" name="cgv" value="1" required>
|
||||
<label for="cgv">
|
||||
{% 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>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function validateCgv() {
|
||||
const checkbox = document.getElementById('cgv');
|
||||
if (!checkbox.checked) {
|
||||
checkbox.focus();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user