show more infos on the formulas list page

This commit is contained in:
imperosol
2026-02-10 16:31:41 +01:00
parent 72e0aa24a5
commit 045c0b9cdb
2 changed files with 93 additions and 16 deletions

View File

@@ -13,23 +13,66 @@
<main> <main>
<h3 class="margin-bottom">{% trans %}Product formulas{% endtrans %}</h3> <h3 class="margin-bottom">{% trans %}Product formulas{% endtrans %}</h3>
<p> <p>
{%- trans trimmed -%}
Formulas allow you to associate a group of products
with a result product (the formula itself).
{%- endtrans -%}
</p>
<p>
{%- trans trimmed -%}
If the product of a formula is available on a counter,
it will be automatically applied if all the products that
make it up are added to the basket.
{%- endtrans -%}
</p>
<p>
{%- trans trimmed -%}
For example, if there is a combo that combines a "Sandwich Combo" product
with the "Sandwich" and "Soft Drink" products,
then, if a person orders a sandwich and a soft drink,
the combo will be applied and the basket will then contain a sandwich combo instead.
{%- endtrans -%}
</p>
<p class="margin-bottom">
<a href="{{ url('counter:product_formula_create') }}" class="btn btn-blue"> <a href="{{ url('counter:product_formula_create') }}" class="btn btn-blue">
{% trans %}New formula{% endtrans %} {% trans %}New formula{% endtrans %}
<i class="fa fa-plus"></i> <i class="fa fa-plus"></i>
</a> </a>
</p> </p>
<ul class="product-group"> <div class="product-group">
{%- for formula in object_list -%} {%- for formula in object_list -%}
<li> <a
<a href="{{ url('counter:product_formula_edit', formula_id=formula.id) }}"> class="card card-row shadow clickable"
{{ formula.result.name }} href="{{ url('counter:product_formula_edit', formula_id=formula.id) }}"
</a> >
<a href="{{ url('counter:product_formula_delete', formula_id=formula.id) }}"> <div class="card-content">
<i class="fa fa-trash delete-action"></i> <strong class="card-title">{{ formula.result.name }}</strong>
</a> <p>
</li> {% for p in formula.products.all() %}
<i>{{ p.code }} ({{ p.selling_price }} €)</i>
{% if not loop.last %}+{% endif %}
{% endfor %}
</p>
<p>
{{ formula.result.selling_price }}
({% trans %}instead of{% endtrans %} {{ formula.max_selling_price}} €)
</p>
</div>
{% if user.has_perm("counter.delete_productformula") %}
<button
x-data
class="btn btn-red btn-no-text card-top-left"
@click.prevent="document.location.href = '{{ url('counter:product_formula_delete', formula_id=formula.id) }}'"
>
{# The delete link is a button with a JS event listener
instead of a proper <a> element,
because the enclosing card is already a <a>,
and HTML forbids nested <a> #}
<i class="fa fa-trash"></i>
</button>
{% endif %}
</a>
{%- endfor -%} {%- endfor -%}
</ul> </div>
</div>
</main> </main>
{% endblock %} {% endblock %}

View File

@@ -6,7 +6,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-02-08 16:14+0100\n" "POT-Creation-Date: 2026-02-10 16:28+0100\n"
"PO-Revision-Date: 2016-07-18\n" "PO-Revision-Date: 2016-07-18\n"
"Last-Translator: Maréchal <thomas.girod@utbm.fr\n" "Last-Translator: Maréchal <thomas.girod@utbm.fr\n"
"Language-Team: AE info <ae.info@utbm.fr>\n" "Language-Team: AE info <ae.info@utbm.fr>\n"
@@ -3585,10 +3585,44 @@ msgstr "Il n'y a pas de eticket sur ce site web."
msgid "Product formulas" msgid "Product formulas"
msgstr "Formules de produits" msgstr "Formules de produits"
#: counter/templates/counter/formula_list.jinja
msgid ""
"Formulas allow you to associate a group of products with a result product "
"(the formula itself)."
msgstr ""
"Les formules permettent d'associer un groupe de produits à un produit "
"résultat (la formule en elle-même)."
#: counter/templates/counter/formula_list.jinja
msgid ""
"If the product of a formula is available on a counter, it will be "
"automatically applied if all the products that make it up are added to the "
"basket."
msgstr ""
"Si le produit d'une formule est disponible sur un comptoir, celle-ci sera "
"automatiquement appliquée si tous les produits qui la constituent sont "
"ajoutés au panier."
#: counter/templates/counter/formula_list.jinja
msgid ""
"For example, if there is a combo that combines a \"Sandwich Combo\" product "
"with the \"Sandwich\" and \"Soft Drink\" products, then, if a person orders "
"a sandwich and a soft drink, the combo will be applied and the basket will "
"then contain a sandwich combo instead."
msgstr ""
"Par exemple s'il existe une formule associant un produit « Formule "
"sandwich » aux produits « Sandwich » et « Soft », alors, si une personne "
"commande un sandwich et un soft, la formule sera appliquée et le panier "
"contiendra alors une formule sandwich à la place."
#: counter/templates/counter/formula_list.jinja #: counter/templates/counter/formula_list.jinja
msgid "New formula" msgid "New formula"
msgstr "Nouvelle formule" msgstr "Nouvelle formule"
#: counter/templates/counter/formula_list.jinja
msgid "instead of"
msgstr "au lieu de"
#: counter/templates/counter/fragments/create_student_card.jinja #: counter/templates/counter/fragments/create_student_card.jinja
msgid "No student card registered." msgid "No student card registered."
msgstr "Aucune carte étudiante enregistrée." msgstr "Aucune carte étudiante enregistrée."
@@ -4021,8 +4055,8 @@ msgid ""
"inconvenience." "inconvenience."
msgstr "" msgstr ""
"Les paiements par carte bancaire sont actuellement désactivés sur l'eboutic. " "Les paiements par carte bancaire sont actuellement désactivés sur l'eboutic. "
"Vous pouvez cependant toujours recharger votre compte dans un des lieux de vie de l'AE. " "Vous pouvez cependant toujours recharger votre compte dans un des lieux de "
"Veuillez nous excuser pour le désagrément." "vie de l'AE. Veuillez nous excuser pour le désagrément."
#: eboutic/templates/eboutic/eboutic_checkout.jinja #: eboutic/templates/eboutic/eboutic_checkout.jinja
msgid "" msgid ""
@@ -4191,8 +4225,8 @@ msgstr "Les candidatures sont fermées pour cette élection"
#: election/templates/election/election_detail.jinja #: election/templates/election/election_detail.jinja
msgid "Candidate pictures won't display for privacy reasons." msgid "Candidate pictures won't display for privacy reasons."
msgstr "" msgstr ""
"La photo du candidat ne s'affiche pas pour " "La photo du candidat ne s'affiche pas pour des raisons de respect de la vie "
"des raisons de respect de la vie privée." "privée."
#: election/templates/election/election_detail.jinja #: election/templates/election/election_detail.jinja
msgid "Polls close " msgid "Polls close "