mirror of
https://github.com/welton89/RRBEC.git
synced 2026-04-05 13:35:42 +00:00
form create product | add product in comanda
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
|
||||
|
||||
{% for product in products %}
|
||||
{{co}}
|
||||
|
||||
<div class="card">
|
||||
{{product.name}}
|
||||
<div class="card" hx-get="{% url 'addProduct' product.id comanda_id %} " hx-trigger="click" hx-target="#list-products-comanda">
|
||||
{{product.name}} <br>
|
||||
R$ {{product.price}}
|
||||
</div>
|
||||
|
||||
{% endfor %}
|
||||
@@ -11,3 +13,5 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
<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>
|
||||
</tr>
|
||||
|
||||
{% endfor %}
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="2" style="text-align: center;">Total R$ {{total}}</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
@@ -17,15 +17,16 @@
|
||||
.card {
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
background-color: #f2f2f2;
|
||||
background-color: #c9ffbc;
|
||||
border-radius: 15px;
|
||||
box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.2);
|
||||
text-align: center;
|
||||
line-height: 120px; /* Centraliza o texto verticalmente */
|
||||
line-height: 40px; /* Centraliza o texto verticalmente */
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
transition: transform 0.2s;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.card:hover {
|
||||
|
||||
@@ -1,20 +1,21 @@
|
||||
function openModal() {
|
||||
document.getElementById('myModal').style.display = 'block';
|
||||
document.getElementById('Modal-create-product').style.display = 'block';
|
||||
}
|
||||
|
||||
function closeModal() {
|
||||
document.getElementById('myModal').style.display = 'none';
|
||||
document.getElementById('Modal-create-product').style.display = 'none';
|
||||
}
|
||||
|
||||
document.getElementById('openModal').addEventListener('click', openModal);
|
||||
|
||||
document.getElementById('productForm').addEventListener('submit', function(event) {
|
||||
event.preventDefault();
|
||||
// document.getElementById('productForm').addEventListener('submit', function(event) {
|
||||
// event.preventDefault();
|
||||
|
||||
// const productName = document.getElementById('productName').value;
|
||||
// const productPrice = document.getElementById('productPrice').value;
|
||||
// const productDescription = document.getElementById('productDescription').value;
|
||||
|
||||
// closeModal();
|
||||
});
|
||||
// }
|
||||
// );
|
||||
|
||||
Reference in New Issue
Block a user