mirror of
https://github.com/almet/copanier.git
synced 2025-04-28 19:42:37 +02:00
Display product weigth when available
This commit is contained in:
parent
1a0bda56b0
commit
d8e9e6f714
4 changed files with 16 additions and 4 deletions
|
@ -97,6 +97,13 @@ class Product(Base):
|
|||
url: str = ""
|
||||
img: str = ""
|
||||
|
||||
@property
|
||||
def label(self):
|
||||
out = self.name
|
||||
if self.weight:
|
||||
out += f" ({self.weight})"
|
||||
return out
|
||||
|
||||
|
||||
@dataclass
|
||||
class ProductOrder(Base):
|
||||
|
|
|
@ -317,8 +317,13 @@ th.price {
|
|||
th.amount {
|
||||
width: 5rem;
|
||||
}
|
||||
th.ref {
|
||||
.ref {
|
||||
width: 5rem;
|
||||
text-align: left;
|
||||
}
|
||||
td.ref {
|
||||
font-weight: 300;
|
||||
font-style: normal;
|
||||
}
|
||||
td.total,
|
||||
th.total {
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
</tr>
|
||||
{% for product in delivery.products %}
|
||||
<tr>
|
||||
<th class="product">{{ product.ref }}</th>
|
||||
<th class="product">{{ product.name }}</th>
|
||||
<td class="ref">{{ product.ref }}</td>
|
||||
<th class="product">{{ product.label }}</th>
|
||||
<td>{{ product.price }} €</td>
|
||||
<th>{{ delivery.product_wanted(product) }}</th>
|
||||
{% for email, order in delivery.orders.items() %}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<tr><th class="product">Produit</th><th class="price">Prix</th><th class="amount">Quantité</th></tr>
|
||||
{% for product in delivery.products %}
|
||||
<tr>
|
||||
<th class="product">{{ product.name }}
|
||||
<th class="product">{{ product.label }}
|
||||
{% if product.description or product.img %}
|
||||
{% with unique_id=loop.index %}
|
||||
{% include "includes/modal_product.html" %}
|
||||
|
|
Loading…
Reference in a new issue