Use thead and tbody in tables

This commit is contained in:
Yohan Boniface 2019-04-16 20:56:15 +02:00
parent d604259f57
commit 5deae74c9a
4 changed files with 26 additions and 12 deletions

View file

@ -337,12 +337,15 @@ th.total {
tr:nth-child(even) { tr:nth-child(even) {
background-color: #ddd; background-color: #ddd;
} }
tr:nth-child(1) { thead tr {
background-color: #3498db; background-color: #3498db;
} }
tr:nth-child(1) * { thead tr * {
color: #f1f1f1; color: #f1f1f1;
} }
thead th + th {
border-left: 1px solid white;
}
article.order { article.order {
max-width: 1200px; max-width: 1200px;
margin-left: auto; margin-left: auto;

View file

@ -8,14 +8,18 @@
<p><strong>Manquant</strong> {{ delivery.product_missing(product) }}</p> <p><strong>Manquant</strong> {{ delivery.product_missing(product) }}</p>
<form method="post"> <form method="post">
<table> <table>
<tr><th>Personne</th><th class="amount">Commande</th><th class="amount">Ajustement</th></tr> <thead>
{% for email, order in delivery.orders.items() %} <tr><th>Personne</th><th class="amount">Commande</th><th class="amount">Ajustement</th></tr>
<tr> </thead>
<td>{{ email }}</td> <tbody>
<td>{{ order[product].wanted }}</td> {% for email, order in delivery.orders.items() %}
<td class="with-input"><input type="number" min=0 name="{{ email }}" value="{{ order[product].adjustment }}"></td> <tr>
</tr> <td>{{ email }}</td>
{% endfor %} <td>{{ order[product].wanted }}</td>
<td class="with-input"><input type="number" min=0 name="{{ email }}" value="{{ order[product].adjustment }}"></td>
</tr>
{% endfor %}
</tbody>
</table> </table>
<input type="submit" value="Enregistrer"> <input type="submit" value="Enregistrer">
</form> </form>

View file

@ -5,7 +5,7 @@
{% include "includes/delivery_head.html" %} {% include "includes/delivery_head.html" %}
<article class="delivery"> <article class="delivery">
<table class="delivery"> <table class="delivery">
<tbody> <thead>
<tr> <tr>
<th class="ref">Référence</th> <th class="ref">Référence</th>
<th class="product">Produit</th> <th class="product">Produit</th>
@ -24,6 +24,8 @@
</th> </th>
{% endfor %} {% endfor %}
</tr> </tr>
</thead>
<tbody>
{% for product in delivery.products %} {% for product in delivery.products %}
<tr> <tr>
<td class="ref">{{ product.ref }}</td> <td class="ref">{{ product.ref }}</td>

View file

@ -6,6 +6,7 @@
{% include "includes/delivery_head.html" %} {% include "includes/delivery_head.html" %}
<form method="post"> <form method="post">
<table class="order"> <table class="order">
<thead>
<tr> <tr>
<th class="product">Produit</th> <th class="product">Produit</th>
<th class="price">Prix</th> <th class="price">Prix</th>
@ -13,7 +14,10 @@
<th class="packing">Conditionnement</th> <th class="packing">Conditionnement</th>
{% endif %} {% endif %}
<th class="amount">Quantité</th> <th class="amount">Quantité</th>
{% if delivery.status == delivery.ADJUSTMENT %}<th class="amount">Ajustement</th>{% endif %}</tr> {% if delivery.status == delivery.ADJUSTMENT %}<th class="amount">Ajustement</th>{% endif %}
</tr>
</thead>
<tbody>
{% for product in delivery.products %} {% for product in delivery.products %}
<tr> <tr>
<th class="product">{{ product }} <th class="product">{{ product }}
@ -33,6 +37,7 @@
{% endif %} {% endif %}
</tr> </tr>
{% endfor %} {% endfor %}
</tbody>
</table> </table>
<p>Total: {{ order.total(delivery.products) if order else 0 }} €</p> <p>Total: {{ order.total(delivery.products) if order else 0 }} €</p>
{% if delivery.is_passed %} {% if delivery.is_passed %}