2024-04-30 12:27:17 +02:00
{% extends "admin/change_form.html" %}
{% load i18n admin_urls static admin_modify fournée_modify %}
{% if save_on_top %}{% block submit_buttons_top %}{% fournée_submit_row %}{% endblock %}{% endif %}
{% block submit_buttons_bottom %}{% fournée_submit_row %}{% endblock %}
2024-05-14 19:35:42 +02:00
{% block extrahead %}{{ block.super }}
< style >
.alt { display: none}
.fournee-alternative.fournee-show > .alt { display: inline; }
< / style >
{% endblock %}
2024-04-30 12:27:17 +02:00
{% block after_field_sets %}
{% if commandes %}
< h2 > Résumé des commandes< / h2 >
< ul >
{% for commande in commandes %}
< li > {{ commande }}< / li >
{% endfor %}
< / ul >
{% endif %}
{% endblock %}
{% block after_related_objects %}
{% if coulées %}
< h2 > Résumé des coulées< / h2 >
< table >
< thead >
< tr >
< th > < / th >
2024-05-13 22:02:49 +02:00
{% for i in ingrédients %}
2024-05-14 09:59:11 +02:00
< th scope = "col" style = "text-align:center;{% if i.couleur != '#000000' %} background-color: {{ i.couleur }};{% endif %}" > {{ i.nom }}< / th >
2024-04-30 12:27:17 +02:00
{% endfor %}
< / tr >
2024-05-12 19:20:15 +02:00
< / thead >
< tbody >
2024-05-10 08:49:07 +02:00
< tr >
2024-05-14 19:35:42 +02:00
{% for i, p in totaux_coulées %}
2024-05-12 22:26:26 +02:00
{% if forloop.first %}
< th > Total pain : {{p}} kg< / th >
{% else %}
2024-05-14 19:44:28 +02:00
{% if i.conditionnement %}
{% emballe p i as alt %}
{% if alt %}
< th style = "text-align:center" class = "fournee-alternative" >
{{ p }} kg
< img style = "vertical-align:top;" src = "{% static " admin / img / icon-viewlink . svg " % } " alt = "symbole œil" title = "Bascule l'affichage avec ou sans conditionnement" >
< span class = "alt" > < br > ({{ alt }})< / span >
< / th >
{% else %}
< th scope = "col" style = "text-align:center" >
{{ p }} kg
< / th >
{% endif %}
{% else %}
< th scope = "col" style = "text-align:center" >
{{ p }} kg
< / th >
{% endif %}
2024-05-12 22:26:26 +02:00
{% endif %}
2024-05-10 08:49:07 +02:00
{% endfor %}
< / tr >
2024-05-12 19:20:15 +02:00
< / tbody >
< / table >
< div style = "display:inline-grid" >
{% for problems, ingrédients, quantités in coulées %}
2024-05-14 19:35:42 +02:00
< h3 style = "margin-top: 2em;{% if problems %} color: var(--delete-button-hover-bg);{% endif %}" > {{ quantités.0.1 }}{% if problems %} ({{ problems }}){% endif %}< / h3 >
2024-05-12 19:20:15 +02:00
< table >
< thead >
< tr >
< th > < / th >
2024-05-14 19:35:42 +02:00
{% for i in ingrédients %}
< th scope = "col" style = "text-align:center;{% if i.fourniture.couleur != '#000000' %} background-color: {{ i.fourniture.couleur }};{% endif %}" > {{ i.fourniture.nom }}< / th >
2024-05-12 19:20:15 +02:00
{% endfor %}
< / tr >
2024-04-30 12:27:17 +02:00
< / thead >
< tbody >
2024-05-12 19:20:15 +02:00
< tr >
2024-05-14 19:35:42 +02:00
{% for i, q in quantités %}
2024-05-12 19:20:15 +02:00
{% if forloop.first %}
< th scope = "row" > {{ q.pâte.nom }}< / th >
{% else %}
2024-05-14 19:35:42 +02:00
{% if i.fourniture.conditionnement %}
{% emballe q i.fourniture as alt %}
{% if alt %}
< td style = "text-align:center" class = "fournee-alternative" >
{{ q }} kg
< img style = "vertical-align:top;" src = "{% static " admin / img / icon-viewlink . svg " % } " alt = "symbole œil" title = "Bascule l'affichage avec ou sans conditionnement" >
< span class = "alt" > < br > ({{ alt }})< / span >
< / td >
2024-05-14 19:44:28 +02:00
{% else %}
2024-05-14 19:35:42 +02:00
< td style = "text-align:center" >
{{ q }} kg
< / td >
{% endif %}
2024-05-14 19:44:28 +02:00
{% else %}
< td style = "text-align:center" >
{{ q }} kg
< / td >
2024-05-14 19:35:42 +02:00
{% endif %}
2024-05-12 19:20:15 +02:00
{% endif %}
2024-04-30 12:27:17 +02:00
{% endfor %}
< / tr >
< / tbody >
< / table >
2024-05-12 19:20:15 +02:00
{% endfor %}
< / div >
2024-04-30 12:27:17 +02:00
{% endif %}
{% if divisions %}
< hr >
< h2 > Résumé des divisions< / h2 >
< table >
< thead >
< tr >
< th > < / th >
{% for problems, p in pains %}
2024-05-12 22:26:26 +02:00
< th scope = "col" style = "text-align:center{% if problems %}; color: var(--delete-button-hover-bg);{% endif %}" > {{ p }}{% if problems %}< br > Sans coulée !!{% endif %}< / th >
2024-04-30 12:27:17 +02:00
{% endfor %}
< / tr >
2024-05-12 22:26:26 +02:00
< / thead >
2024-05-10 08:49:07 +02:00
< tr >
{% for p in totaux_divisions %}
2024-05-12 22:26:26 +02:00
{% if forloop.first %}
< th > Total pain : {{p}} kg< / th >
{% else %}
< th scope = "col" style = "text-align:center" > {{ p }}< / th >
{% endif %}
2024-05-10 08:49:07 +02:00
{% endfor %}
< / tr >
2024-04-30 12:27:17 +02:00
< tbody >
2024-05-12 22:26:26 +02:00
< tr > < / tr >
2024-04-30 12:27:17 +02:00
{% for commande in divisions %}
< tr >
{% for p in commande %}
{% if forloop.first %}< th scope = "row" > {% else %}< td style = "text-align:center" > {% endif %}
{{ p }}
{% if forloop.first %}< / th > {% else %}< / td > {% endif %}
{% endfor %}
< / tr >
{% endfor %}
< / tbody >
< / table >
< p > < / p >
{% endif %}
2024-05-14 19:35:42 +02:00
< script >
const qtes = document.querySelectorAll(".fournee-alternative");
qtes.forEach(function (qte) {
qte.addEventListener("click", (event) => {
event.target.classList.toggle("fournee-show");
});
});
< / script >
2024-04-30 12:27:17 +02:00
{% endblock %}