mirror of
https://github.com/ae-utbm/sith.git
synced 2026-06-05 15:49:21 +00:00
@@ -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;
|
||||
|
||||
@@ -6,7 +6,9 @@ interface Basket {
|
||||
timeout: Date;
|
||||
}
|
||||
document.addEventListener("alpine:init", () => {
|
||||
Alpine.data("etransaction", (initialData, basket: Basket) => ({
|
||||
Alpine.data(
|
||||
"etransaction",
|
||||
(initialData: Record<string, string>, basket: Basket) => ({
|
||||
data: initialData,
|
||||
isCbAvailable: Object.keys(initialData).length > 0,
|
||||
isSithAvailable: true,
|
||||
@@ -14,10 +16,11 @@ document.addEventListener("alpine:init", () => {
|
||||
init() {
|
||||
const now = new Date();
|
||||
const timeout = basket.timeout.getTime() - now.getTime();
|
||||
if (timeout <= 0) {
|
||||
// basket was already outdated at initial page load
|
||||
this.timeoutBasket();
|
||||
} else {
|
||||
if (timeout > 0) {
|
||||
// if not going inside this condition, it means that
|
||||
// basket was already outdated at initial page load,
|
||||
// in which case disabling buttons and displaying
|
||||
// error message has been done at rendering time
|
||||
setTimeout(() => this.timeoutBasket(), timeout);
|
||||
}
|
||||
},
|
||||
@@ -35,7 +38,7 @@ document.addEventListener("alpine:init", () => {
|
||||
.getAll()
|
||||
.find(
|
||||
(n: Notification) =>
|
||||
n.tag === NotificationLevel.Error && n.message === message,
|
||||
n.tag === NotificationLevel.Error && n.text === message,
|
||||
);
|
||||
if (existingNotif === undefined) {
|
||||
this.$notifications.error(message);
|
||||
@@ -59,7 +62,7 @@ document.addEventListener("alpine:init", () => {
|
||||
path: { basket_id: basket.id },
|
||||
});
|
||||
if (res.response.ok) {
|
||||
this.data = res.data;
|
||||
this.data = res.data as Record<string, string>;
|
||||
this.isCbAvailable = true;
|
||||
} else if (res.response.status === 410) {
|
||||
// The basket is expired, so no payment method should be available at all.
|
||||
@@ -68,5 +71,6 @@ document.addEventListener("alpine:init", () => {
|
||||
this.timeoutBasket();
|
||||
}
|
||||
},
|
||||
}));
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -28,8 +28,8 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Article</td>
|
||||
<td>Quantity</td>
|
||||
<td>Unit price</td>
|
||||
<td>{% trans %}Quantity{% endtrans %}</td>
|
||||
<td>{% trans %}Unit price{% endtrans %}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -63,10 +63,41 @@
|
||||
<div @htmx:after-request="fill">
|
||||
{{ billing_infos_form }}
|
||||
</div>
|
||||
{% 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">
|
||||
<input
|
||||
type="checkbox"
|
||||
id="cgv-checkbox"
|
||||
name="cgv"
|
||||
required
|
||||
{% if basket.is_expired %}
|
||||
disabled="disabled"
|
||||
{% else %}
|
||||
:disabled="!isCbAvailable && !isSithAvailable"
|
||||
{% endif %}
|
||||
>
|
||||
<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">
|
||||
@@ -98,7 +129,12 @@
|
||||
{% 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
|
||||
{% if basket.is_expired %}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2026-06-04 17:30+0200\n"
|
||||
"POT-Creation-Date: 2026-06-05 13:39+0200\n"
|
||||
"PO-Revision-Date: 2016-07-18\n"
|
||||
"Last-Translator: Maréchal <thomas.girod@utbm.fr\n"
|
||||
"Language-Team: AE info <ae.info@utbm.fr>\n"
|
||||
@@ -680,6 +680,7 @@ msgstr "Étiquette"
|
||||
#: core/templates/core/user_account_detail.jinja
|
||||
#: core/templates/core/user_stats.jinja
|
||||
#: counter/templates/counter/last_ops.jinja
|
||||
#: eboutic/templates/eboutic/eboutic_checkout.jinja
|
||||
msgid "Quantity"
|
||||
msgstr "Quantité"
|
||||
|
||||
@@ -963,7 +964,7 @@ msgstr "rôle de club – membre"
|
||||
msgid "Benefit"
|
||||
msgstr "Bénéfice"
|
||||
|
||||
#: club/views.py
|
||||
#: club/views.py eboutic/templates/eboutic/eboutic_checkout.jinja
|
||||
msgid "Unit price"
|
||||
msgstr "Prix unitaire"
|
||||
|
||||
@@ -4380,6 +4381,18 @@ msgstr "Solde actuel : "
|
||||
msgid "Remaining account amount: "
|
||||
msgstr "Solde restant : "
|
||||
|
||||
#: eboutic/templates/eboutic/eboutic_checkout.jinja
|
||||
msgid "I have read and I accept"
|
||||
msgstr "J'ai lu et j'accepte"
|
||||
|
||||
#: eboutic/templates/eboutic/eboutic_checkout.jinja
|
||||
msgid "the general terms and conditions"
|
||||
msgstr "les conditions générales de vente"
|
||||
|
||||
#: eboutic/templates/eboutic/eboutic_checkout.jinja
|
||||
msgid "of the student association of the UTBM"
|
||||
msgstr "de l'Association des étudiants de l'UTBM"
|
||||
|
||||
#: eboutic/templates/eboutic/eboutic_checkout.jinja
|
||||
msgid "Pay with credit card"
|
||||
msgstr "Payer avec une carte bancaire"
|
||||
@@ -4535,10 +4548,6 @@ msgstr "Utilisateur se présentant"
|
||||
msgid "Blank vote"
|
||||
msgstr "Vote blanc"
|
||||
|
||||
#: election/forms.py
|
||||
msgid "This role already exists for this election"
|
||||
msgstr "Ce rôle existe déjà pour cette élection"
|
||||
|
||||
#: election/models.py
|
||||
msgid "clubs"
|
||||
msgstr "clubs"
|
||||
@@ -4591,6 +4600,10 @@ msgstr ""
|
||||
"Un rôle de club. Remplir ce champ permet l'autocomplétion du titre et de la "
|
||||
"description, et l'attribution automatique des rôles après les élections."
|
||||
|
||||
#: election/models.py
|
||||
msgid "This role already exists for this election"
|
||||
msgstr "Ce rôle existe déjà pour cette élection"
|
||||
|
||||
#: election/models.py
|
||||
msgid "election list"
|
||||
msgstr "liste électorale"
|
||||
@@ -4634,12 +4647,6 @@ msgstr " à"
|
||||
msgid "and will close "
|
||||
msgstr "et fermeront"
|
||||
|
||||
#: election/templates/election/election_detail.jinja
|
||||
#: election/templates/election/election_list.jinja
|
||||
#: forum/templates/forum/macros.jinja
|
||||
msgid " at "
|
||||
msgstr " à "
|
||||
|
||||
#: election/templates/election/election_detail.jinja
|
||||
msgid "Apply election result"
|
||||
msgstr "Appliquer les résultats de l'élection"
|
||||
@@ -4693,6 +4700,11 @@ msgstr "Nouvelle élection"
|
||||
msgid "Applications open from"
|
||||
msgstr "Candidatures ouvertes à partir du"
|
||||
|
||||
#: election/templates/election/election_list.jinja
|
||||
#: forum/templates/forum/macros.jinja
|
||||
msgid " at "
|
||||
msgstr " à "
|
||||
|
||||
#: election/templates/election/election_list.jinja
|
||||
msgid "to"
|
||||
msgstr "au"
|
||||
|
||||
Reference in New Issue
Block a user