feat: buscar reativa em products

This commit is contained in:
2025-01-07 14:51:18 -03:00
parent a761bd2db2
commit 03192adf94
7 changed files with 53 additions and 2 deletions

View File

@@ -0,0 +1,43 @@
<tr>
<th style="text-align: left;">Produto</th>
<th style="text-align: left;width: 20%;">Preço</th>
<th style="text-align: left;">Quantidade</th>
<th style="text-align: left;">Categoria</th>
<th style="text-align: left;width: 20%;">Ações</th>
</tr>
{% for product in products %}
<tr>
<td id="name-{{product.id}}" >{{product.name}}</td>
<td id="price-{{product.id}}" >R$ {{product.price}}</td>
<td id="quantity-{{product.id}}" >{{product.quantity}}</td>
<td id="category-{{product.id}}" >{{product.category.name}}</td>
<td>
<div class="grid-buttons">
<h2 onclick="editProduct({{product.id}})" style="cursor: pointer;" >📝</h2>
<input type="hidden" id="h-category-{{product.id}}" value="{{ product.category.id }}">
<input type="hidden" id="description-{{product.id}}" value="{{ product.description }}">
<form action="{% url 'onOffproduct' %}" method="post">
{% csrf_token %}
<input type="hidden" name="id-product" id="id-{{product.id}}" value="{{ product.id }}">
{% if product.active == True %}
<button style="background-color: rgba(255, 0, 0, 0);"></button>
{% else %}
<button style="background-color: rgba(0, 128, 0, 0);" >🚫</button>
{% endif %}
</form>
</div>
</td>
</tr>
{% endfor %}
</table>