mirror of
https://github.com/ae-utbm/sith.git
synced 2026-02-11 01:48:18 +00:00
make formula deletion page clearer
This commit is contained in:
@@ -21,6 +21,8 @@
|
|||||||
<h2>{% trans %}Delete confirmation{% endtrans %}</h2>
|
<h2>{% trans %}Delete confirmation{% endtrans %}</h2>
|
||||||
<form action="" method="post">{% csrf_token %}
|
<form action="" method="post">{% csrf_token %}
|
||||||
<p>{% trans name=object_name %}Are you sure you want to delete "{{ name }}"?{% endtrans %}</p>
|
<p>{% trans name=object_name %}Are you sure you want to delete "{{ name }}"?{% endtrans %}</p>
|
||||||
|
{% if help_text %}<p><em>{{ help_text }}</em></p>{% endif %}
|
||||||
|
<br/>
|
||||||
<input type="submit" value="{% trans %}Confirm{% endtrans %}" />
|
<input type="submit" value="{% trans %}Confirm{% endtrans %}" />
|
||||||
</form>
|
</form>
|
||||||
<form method="GET" action="javascript:history.back();">
|
<form method="GET" action="javascript:history.back();">
|
||||||
|
|||||||
@@ -166,7 +166,9 @@ class ProductEditView(CounterAdminTabsMixin, CounterAdminMixin, UpdateView):
|
|||||||
|
|
||||||
class ProductFormulaListView(CounterAdminTabsMixin, PermissionRequiredMixin, ListView):
|
class ProductFormulaListView(CounterAdminTabsMixin, PermissionRequiredMixin, ListView):
|
||||||
model = ProductFormula
|
model = ProductFormula
|
||||||
queryset = ProductFormula.objects.select_related("result")
|
queryset = ProductFormula.objects.select_related("result").prefetch_related(
|
||||||
|
"products"
|
||||||
|
)
|
||||||
template_name = "counter/formula_list.jinja"
|
template_name = "counter/formula_list.jinja"
|
||||||
current_tab = "formulas"
|
current_tab = "formulas"
|
||||||
permission_required = "counter.view_productformula"
|
permission_required = "counter.view_productformula"
|
||||||
@@ -206,6 +208,17 @@ class ProductFormulaDeleteView(
|
|||||||
success_url = reverse_lazy("counter:product_formula_list")
|
success_url = reverse_lazy("counter:product_formula_list")
|
||||||
permission_required = "counter.delete_productformula"
|
permission_required = "counter.delete_productformula"
|
||||||
|
|
||||||
|
def get_context_data(self, **kwargs):
|
||||||
|
obj_name = self.object.result.name
|
||||||
|
return super().get_context_data(**kwargs) | {
|
||||||
|
"object_name": _("%(formula)s (formula)") % {"formula": obj_name},
|
||||||
|
"help_text": _(
|
||||||
|
"This action will only delete the formula, "
|
||||||
|
"but not the %(product)s product itself."
|
||||||
|
)
|
||||||
|
% {"product": obj_name},
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
class ReturnableProductListView(
|
class ReturnableProductListView(
|
||||||
CounterAdminTabsMixin, PermissionRequiredMixin, ListView
|
CounterAdminTabsMixin, PermissionRequiredMixin, ListView
|
||||||
|
|||||||
@@ -3843,6 +3843,20 @@ msgstr "Temps"
|
|||||||
msgid "Top 100 barman %(counter_name)s (all semesters)"
|
msgid "Top 100 barman %(counter_name)s (all semesters)"
|
||||||
msgstr "Top 100 barman %(counter_name)s (tous les semestres)"
|
msgstr "Top 100 barman %(counter_name)s (tous les semestres)"
|
||||||
|
|
||||||
|
#: counter/views/admin.py
|
||||||
|
#, python-format
|
||||||
|
msgid "%(formula)s (formula)"
|
||||||
|
msgstr "%(formula)s (formule)"
|
||||||
|
|
||||||
|
#: counter/views/admin.py
|
||||||
|
#, python-format
|
||||||
|
msgid ""
|
||||||
|
"This action will only delete the formula, but not the %(product)s product "
|
||||||
|
"itself."
|
||||||
|
msgstr ""
|
||||||
|
"Cette action supprimera seulement la formule, mais pas le produit "
|
||||||
|
"%(product)s en lui-même."
|
||||||
|
|
||||||
#: counter/views/admin.py
|
#: counter/views/admin.py
|
||||||
#, python-format
|
#, python-format
|
||||||
msgid "returnable product : %(returnable)s -> %(returned)s"
|
msgid "returnable product : %(returnable)s -> %(returned)s"
|
||||||
|
|||||||
Reference in New Issue
Block a user