vertical item names and check column

This commit is contained in:
Laetitia Getti 2023-07-24 16:31:20 +02:00
parent 7a65f189fd
commit a40abe5525

View file

@ -19,6 +19,30 @@
content: "Liste générée par la Chariotte - chariotte.fr | Page " counter(page)"/" counter(pages); content: "Liste générée par la Chariotte - chariotte.fr | Page " counter(page)"/" counter(pages);
} }
} }
{% if items|length > 10 %}
.item_name {
text-align:center;
white-space:nowrap;
-webkit-transform: rotate(-90deg);
-moz-transform: rotate(-90deg);
-ms-transform: rotate(-90deg);
-o-transform: rotate(-90deg);
transform: rotate(-90deg);
font-size: 8pt;
}
.item_name div {
margin:-10px -120% ;
display:inline-block;
}
.item_name div:before{
content:'';
width:0;
padding-top:110%;
display:inline-block;
vertical-align:middle;
}
{% endif %}
body { body {
font-family: sans-serif; font-family: sans-serif;
@ -62,11 +86,12 @@
<tr> <tr>
<th style="text-align: center">Nom</th> <th style="text-align: center">Nom</th>
{% for item in items %} {% for item in items %}
<th style="word-break: break-all"> <th class="item_name" style="font-weight: normal;">
{{ item.name }} <div>{{ item.name }}</div>
</th> </th>
{% endfor %} {% endfor %}
<th style="width: 2cm">Prix</th> <th style="width: 2cm">Prix</th>
<th style="font-size: 0.5em; width: 2em">OK</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -78,6 +103,7 @@
</td> </td>
{% endfor %} {% endfor %}
<td></td> <td></td>
<td></td>
</tr> </tr>
<tr style="background-color: #bababa"> <tr style="background-color: #bababa">
<th style="text-align: left">TOTAL</th> <th style="text-align: left">TOTAL</th>
@ -87,6 +113,7 @@
</th> </th>
{% endfor %} {% endfor %}
<th>{{ grouped_order.total_price }} €</th> <th>{{ grouped_order.total_price }} €</th>
<th></th>
</tr> </tr>
{% for order, ordered_items in orders_dict.items %} {% for order, ordered_items in orders_dict.items %}
<tr> <tr>
@ -103,6 +130,7 @@
<td> <td>
{{ order.price }} € {{ order.price }} €
</td> </td>
<td></td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>