From 922c940fd56327bd42f6184b544b27806345c20b Mon Sep 17 00:00:00 2001 From: TitouanDor Date: Wed, 4 Mar 2026 15:17:39 +0100 Subject: [PATCH 1/5] add button for general term and condition --- eboutic/templates/eboutic/eboutic_checkout.jinja | 12 ++++++++++++ locale/fr/LC_MESSAGES/django.po | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/eboutic/templates/eboutic/eboutic_checkout.jinja b/eboutic/templates/eboutic/eboutic_checkout.jinja index e299852b..6675a5d1 100644 --- a/eboutic/templates/eboutic/eboutic_checkout.jinja +++ b/eboutic/templates/eboutic/eboutic_checkout.jinja @@ -71,6 +71,12 @@ + + +
{% csrf_token %} + + +
Date: Wed, 4 Mar 2026 15:50:23 +0100 Subject: [PATCH 2/5] correction fautes orthographes --- eboutic/templates/eboutic/eboutic_checkout.jinja | 8 ++++---- locale/fr/LC_MESSAGES/django.po | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/eboutic/templates/eboutic/eboutic_checkout.jinja b/eboutic/templates/eboutic/eboutic_checkout.jinja index 6675a5d1..d278cfa5 100644 --- a/eboutic/templates/eboutic/eboutic_checkout.jinja +++ b/eboutic/templates/eboutic/eboutic_checkout.jinja @@ -74,8 +74,8 @@ + {% trans %}the general terms and conditions{% endtrans%} + {%trans%}of the student assosiation of UTBM{% endtrans %}
+ {% trans %}the general terms and conditions{% endtrans%} + {%trans%}of the student assosiation of UTBM{% endtrans %}
Date: Tue, 26 May 2026 23:30:23 +0200 Subject: [PATCH 3/5] one CGV button for and etransaction and sith account --- core/static/core/forms.scss | 1 - .../templates/eboutic/eboutic_checkout.jinja | 42 ++++++++++++------- 2 files changed, 28 insertions(+), 15 deletions(-) diff --git a/core/static/core/forms.scss b/core/static/core/forms.scss index 0982b3d0..511190b6 100644 --- a/core/static/core/forms.scss +++ b/core/static/core/forms.scss @@ -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; diff --git a/eboutic/templates/eboutic/eboutic_checkout.jinja b/eboutic/templates/eboutic/eboutic_checkout.jinja index d278cfa5..406f5d25 100644 --- a/eboutic/templates/eboutic/eboutic_checkout.jinja +++ b/eboutic/templates/eboutic/eboutic_checkout.jinja @@ -63,20 +63,35 @@
{{ billing_infos_form }}
- {% 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 #} +
+ {# 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. #} +
+ + +
+
+ {% endif %} + {% if settings.SITH_EBOUTIC_CB_ENABLED %}
- - -
user.account_balance %}

{% trans %}AE account payment disabled because you do not have enough money remaining.{% endtrans %}

{% else %} - + {% csrf_token %} - - -
Date: Wed, 27 May 2026 21:36:57 +0200 Subject: [PATCH 4/5] ajout balise de traduction --- .../templates/eboutic/eboutic_checkout.jinja | 4 +- locale/fr/LC_MESSAGES/django.po | 52 +++++++++---------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/eboutic/templates/eboutic/eboutic_checkout.jinja b/eboutic/templates/eboutic/eboutic_checkout.jinja index 406f5d25..c2de60e3 100644 --- a/eboutic/templates/eboutic/eboutic_checkout.jinja +++ b/eboutic/templates/eboutic/eboutic_checkout.jinja @@ -28,8 +28,8 @@ Article - Quantity - Unit price + {% trans %}Quantity{% endtrans %} + {% trans %}Unit price{% endtrans %} diff --git a/locale/fr/LC_MESSAGES/django.po b/locale/fr/LC_MESSAGES/django.po index 8e258572..862fbde5 100644 --- a/locale/fr/LC_MESSAGES/django.po +++ b/locale/fr/LC_MESSAGES/django.po @@ -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 \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" @@ -4523,18 +4536,6 @@ msgstr "Panier disponible jusqu'à %(until)s" msgid "You can't buy a refilling with sith money" msgstr "Vous ne pouvez pas acheter un rechargement avec de l'argent du sith" -#: eboutic/views.py -msgid "I have read and accept" -msgstr "J'ai lu et j'accepte" - -#: eboutic/views.py -msgid "the general terms and conditions" -msgstr "les conditions générales de vente" - -#: eboutic/views.py -msgid "of the student assosiation of UTBM" -msgstr "de l'Association des étudiants de l'UTBM" - #: election/forms.py msgid "You have selected too many candidates." msgstr "Vous avez sélectionné trop de candidats." @@ -4547,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" @@ -4603,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" @@ -4639,19 +4640,13 @@ msgid "Polls will open " msgstr "Les votes ouvriront " #: election/templates/election/election_detail.jinja -msgid " at" -msgstr " à" +msgid "at" +msgstr "à" #: election/templates/election/election_detail.jinja 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" @@ -4705,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" From d73b7de9039f2d84939214fa78ef3fa51be06440 Mon Sep 17 00:00:00 2001 From: imperosol Date: Fri, 5 Jun 2026 13:37:58 +0200 Subject: [PATCH 5/5] tweaks after rebase on clic-limit --- .../static/bundled/eboutic/checkout-index.ts | 122 +++++++++--------- .../templates/eboutic/eboutic_checkout.jinja | 14 +- 2 files changed, 75 insertions(+), 61 deletions(-) diff --git a/eboutic/static/bundled/eboutic/checkout-index.ts b/eboutic/static/bundled/eboutic/checkout-index.ts index 08683218..21bdbdba 100644 --- a/eboutic/static/bundled/eboutic/checkout-index.ts +++ b/eboutic/static/bundled/eboutic/checkout-index.ts @@ -6,67 +6,71 @@ interface Basket { timeout: Date; } document.addEventListener("alpine:init", () => { - Alpine.data("etransaction", (initialData, basket: Basket) => ({ - data: initialData, - isCbAvailable: Object.keys(initialData).length > 0, - isSithAvailable: true, + Alpine.data( + "etransaction", + (initialData: Record, basket: Basket) => ({ + data: initialData, + isCbAvailable: Object.keys(initialData).length > 0, + isSithAvailable: true, - 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 { - setTimeout(() => this.timeoutBasket(), timeout); - } - }, + init() { + const now = new Date(); + const timeout = basket.timeout.getTime() - now.getTime(); + 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); + } + }, - /** - * Make this basket into a timeout state. - * All submission inputs are disabled, and an error message is displayed. - */ - timeoutBasket() { - this.isCbAvailable = false; - this.isSithAvailable = false; - const message = gettext("Basket expired"); + /** + * Make this basket into a timeout state. + * All submission inputs are disabled, and an error message is displayed. + */ + timeoutBasket() { + this.isCbAvailable = false; + this.isSithAvailable = false; + const message = gettext("Basket expired"); - const existingNotif: Notification | undefined = this.$notifications - .getAll() - .find( - (n: Notification) => - n.tag === NotificationLevel.Error && n.message === message, - ); - if (existingNotif === undefined) { - this.$notifications.error(message); - } - }, + const existingNotif: Notification | undefined = this.$notifications + .getAll() + .find( + (n: Notification) => + n.tag === NotificationLevel.Error && n.text === message, + ); + if (existingNotif === undefined) { + this.$notifications.error(message); + } + }, - /** - * Refresh the data used for etransaction. - * - * Note: if this is called while the basket is expired, it will be a no-op - */ - async fill() { - if (new Date() > basket.timeout) { - // refresh etransaction data only if the basket is still valid. - this.timeoutBasket(); - return; - } - this.isCbAvailable = false; - const res = await etransactioninfoFetchEtransactionData({ - // biome-ignore lint/style/useNamingConvention: api is in snake_case - path: { basket_id: basket.id }, - }); - if (res.response.ok) { - this.data = res.data; - this.isCbAvailable = true; - } else if (res.response.status === 410) { - // The basket is expired, so no payment method should be available at all. - // This shouldn't happen, because we don't send the request - // when the timeout is passed, but we are better safe than sorry - this.timeoutBasket(); - } - }, - })); + /** + * Refresh the data used for etransaction. + * + * Note: if this is called while the basket is expired, it will be a no-op + */ + async fill() { + if (new Date() > basket.timeout) { + // refresh etransaction data only if the basket is still valid. + this.timeoutBasket(); + return; + } + this.isCbAvailable = false; + const res = await etransactioninfoFetchEtransactionData({ + // biome-ignore lint/style/useNamingConvention: api is in snake_case + path: { basket_id: basket.id }, + }); + if (res.response.ok) { + this.data = res.data as Record; + this.isCbAvailable = true; + } else if (res.response.status === 410) { + // The basket is expired, so no payment method should be available at all. + // This shouldn't happen, because we don't send the request + // when the timeout is passed, but we are better safe than sorry + this.timeoutBasket(); + } + }, + }), + ); }); diff --git a/eboutic/templates/eboutic/eboutic_checkout.jinja b/eboutic/templates/eboutic/eboutic_checkout.jinja index c2de60e3..277f4ee1 100644 --- a/eboutic/templates/eboutic/eboutic_checkout.jinja +++ b/eboutic/templates/eboutic/eboutic_checkout.jinja @@ -72,8 +72,18 @@ 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. #} -
- +
+