nem sei o que fiz

This commit is contained in:
2024-12-26 16:14:01 -03:00
parent a9896730eb
commit df0d652a36
9 changed files with 166 additions and 137 deletions

View File

@@ -2,20 +2,39 @@
{% for product in products %}
<article
id="product-{{ forloop.counter0 }}"
onclick="reloadPage()"
style="background-color: #293552;"
hx-get="{% url 'addProduct' product.id comanda_id %} "
hx-trigger="click"
hx-swap="none">
{% if forloop.counter0 == 0 %}
<article
name="productBox"
id="productId-{{ product.id }}"
style="background-color: #293552;"
hx-get="{% url 'addProductBalcaoTeclado' product.id comanda.id 1 %} " hx-trigger="click" hx-target="#list-products-balcao"
>
<p hidden id="{{forloop.counter0}}" >{{product.id}}</p>
<p hidden id="comanda{{forloop.counter0}}" >{{comanda.id}}</p>
{{product.name}} <br> <p id="{{product.id}}"></p>
R$ {{product.price}}
</article >
{% else %}
<article
name="productBox"
id="productId-{{ product.id }}"
style="background-color: #293552;"
hx-get="{% url 'addProductBalcaoTeclado' product.id comanda.id 1 %} " hx-trigger="click" hx-target="#list-products-balcao"
><data value="{{product.id}}"></data>
{{ forloop.counter0 }} {{product.name}} <br>
R$ {{product.price}}
</article >
{% endif %}
{{ forloop.counter0 }} {{product.name}} <br>
R$ {{product.price}}
</article>
{% endfor %}
<!-- hx-swap="none"> -->

View File

@@ -0,0 +1,23 @@
<tr>
<th style="text-align: left;">Produto</th>
<th style="text-align: left;">Preço</th>
</tr>
{% for item in consumo%}
<tr>
<td>{{item.product.name}}</td>
<td>R$ {{item.product.price}}</td>
<td><button hx-get="{% url 'removeProductBalcao' item.id %} " hx-trigger="click" hx-target="#list-products-balcao" >🗑️ Excluir</button></td>
</tr>
{% endfor %}
<tfoot>
<tr>
<td colspan="2" style="text-align: center;">Total R$ {{total}}</td>
</tr>
</tfoot>
</table>