feat: toast

This commit is contained in:
2025-02-21 21:39:08 -03:00
parent baafa4cdec
commit 8a58d0a0db
9 changed files with 158 additions and 117 deletions

View File

@@ -154,19 +154,22 @@ Detalhes {{comanda.name}}
<button class="btn-secondary" onclick="modal_payment_parcial()">Pagamento Parcial</button>
</div>
<!-- <dialog id="Modal-add-product" style="display: none;" >
<article> -->
<div id="addProduct" popover class="popover">
<div id="addProduct" popover class="popover">
<div id="toast" class="toast">
<p id="toast-message"></p>
</div>
<form id="productForm" >
<div style="display: flex;justify-content: space-around;">
<h2>Adicionar Produto</h2> <button class="btn-cancel" type="button" onclick="closeModal()">Fechar</button>
<div style="display: flex;justify-content: space-between;">
<h2>Adicionar Produto</h2> <img class="close" src="{% static 'midia/icons/close-circle.svg' %}" onclick="closeModal()">
</div>
<input type="text" id="search-product" name="search-product" placeholder="Buscar Produto" hx-get="{% url 'listProduct' comanda.id %}" hx-trigger="keyup" hx-target="#product-list"><br>
<div id="product-list" class="grid-list-products">
{% for product in products %}
<input type="text" id="search-product" name="search-product" placeholder="Buscar Produto" hx-get="{% url 'listProduct' comanda.id %}" hx-trigger="keyup" hx-target="#product-list"><br>
<div id="product-list" class="grid-list-products">
{% for product in products %}
<div class="card-product" onclick="addProductComanda({{product.id}}, {{comanda.id}}, '{{product.cuisine}}')" >
{{product.name}} <br>
@@ -174,40 +177,38 @@ Detalhes {{comanda.name}}
</div >
{% endfor %}
</div>
</form>
</div>
</form>
</div>
<!-- </article>
</dialog> -->
<dialog id="modal-obs" style="display: none;">
<article>
<h2>Observação do Pedido</h2>
<p>Observações do pedido que serão enviadas para o preparo na cozinha.</p>
<textarea placeholder="Ex.: pedido sem cebola. para viagem." name="obs" id="obs"></textarea>
<div>
<div style="display: flex;gap: 10px;">
<button type="submit" class="btn-primary" onclick="addOrder()" >OK</button>
<button type="button" class="btn-cancel" onclick="closeModalObs()">Cancela</button>
<dialog id="modal-obs" style="display: none;">
<article>
<h2>Observação do Pedido</h2>
<p>Observações do pedido que serão enviadas para o preparo na cozinha.</p>
<textarea placeholder="Ex.: pedido sem cebola. para viagem." name="obs" id="obs"></textarea>
<div>
<div style="display: flex;gap: 10px;">
<button type="submit" class="btn-primary" onclick="addOrder()" >OK</button>
<button type="button" class="btn-cancel" onclick="closeModalObs()">Cancela</button>
</div>
</article>
</dialog>
<dialog id="payment-comanda" style="display: none;" >
<article>
<form action="{% url 'paymentComanda' comanda.id %}" method="post">
{% csrf_token %}
<h2>Pagamento</h2>
<div style="display: flex; align-content: space-around; align-items: center; justify-self: center;gap: 50px;">
{% if config.taxa %}
<h1 id="first-total">R$ {{ valores.totalComTaxa }}</h1>
<h1 hidden id="totalComTaxa">R$ {{ valores.totalComTaxa }}</h1>
<h1 hidden id="totalSemTaxa">R$ {{ valores.totalSemTaxa }}</h1>
<div>
<h2>Pagamento</h2>
<div style="display: flex; align-content: space-around; align-items: center; justify-self: center;gap: 50px;">
{% if config.taxa %}
<h1 id="first-total">R$ {{ valores.totalComTaxa }}</h1>
<h1 hidden id="totalComTaxa">R$ {{ valores.totalComTaxa }}</h1>
<h1 hidden id="totalSemTaxa">R$ {{ valores.totalSemTaxa }}</h1>
<div>
<input id="taxa" name="taxa" type="checkbox" value="True" label="Taxa de serviço" checked >Taxa de serviço
{% else %}
<h1 id="first-total">R$ {{ valores.totalSemTaxa }}</h1>
@@ -221,7 +222,7 @@ Detalhes {{comanda.name}}
</div>
<footer>
<div style="display: flex;gap: 10px;">
<button type="submit" class="btn-secondary" onclick="backPage()">Receber</button>
{% if comanda.status != 'FIADO' %}
<button type="button" class="btn-primary" onclick=" modal_conta_client()">
@@ -232,7 +233,7 @@ Detalhes {{comanda.name}}
</div>
</footer>
</form>
</article>
</article>
</dialog>
@@ -243,38 +244,38 @@ Detalhes {{comanda.name}}
{% csrf_token %}
<input id="value-parcial" name="value-parcial" type="number" step="0.01" max="{{total}}" placeholder="Valor">
<input id="name-parcial" name="name-parcial" type="text" placeholder="Nome" >
<footer>
<div style="display: flex;gap: 10px;">
<button type="submit" class="btn-secondary" onclick="backPage()">Receber</button>
<button type="button" class="btn-cancel" onclick="close_modal_payment_parcial()">Cancelar</button>
</div>
</footer>
</form>
<footer>
<div style="display: flex;gap: 10px;">
<button type="submit" class="btn-secondary" onclick="backPage()">Receber</button>
<button type="button" class="btn-cancel" onclick="close_modal_payment_parcial()">Cancelar</button>
</div>
</footer>
</form>
</article>
</dialog>
<dialog id="Modal-alter-comanda">
<article >
<form id="form-comanda" method="post" action="{% url 'editComanda' %}">
{% csrf_token %}
<form id="form-comanda" method="post" action="{% url 'editComanda' %}">
{% csrf_token %}
<h2>Editar Comanda</h2>
<input hidden type="text" name="h-comandaId" id="h-comandaId" value="{{comanda.id}}">
<input type="text" id="nameComanda" name="nameComanda" required placeholder="Nome"><br>
<select name="select-mesa" id="select-mesa" required >
{% for mesa in mesas %}
<option value="{{mesa.id}}">{{mesa.name}}</option>
{% endfor %}
{% for mesa in mesas %}
<option value="{{mesa.id}}">{{mesa.name}}</option>
{% endfor %}
</select>
<div style="display: flex;gap: 10px;">
<button type="submit" class="btn-primary">Alterar</button>
<button type="button" class="btn-cancel" onclick="closeModalAlter()">Cancelar</button>
</div>
<button type="submit" class="btn-primary">Alterar</button>
<button type="button" class="btn-cancel" onclick="closeModalAlter()">Cancelar</button>
</div>
</form>
</article>
</article>
</dialog >
@@ -283,20 +284,20 @@ Detalhes {{comanda.name}}
<article>
<form id="form-comanda" method="post" action="{% url 'addContaCliente' %}">
{% csrf_token %}
<h2>Adicionar na Conta</h2>
<h1>R$ {{ valores.totalSemTaxa }}</h1>
<div>
<input hidden type="text" name="valor-conta" value="{{ total }}">
<input hidden type="text" name="idComanda" value="{{ comanda.id }}">
<p>Selecione o Cliente:</p>
<select name="select-client" id="select-client" required>
<option value="">Selecione um cliente</option>
<h2>Adicionar na Conta</h2>
<h1>R$ {{ valores.totalSemTaxa }}</h1>
<div>
<input hidden type="text" name="valor-conta" value="{{ total }}">
<input hidden type="text" name="idComanda" value="{{ comanda.id }}">
<p>Selecione o Cliente:</p>
<select name="select-client" id="select-client" required>
<option value="">Selecione um cliente</option>
{% for client in clients %}
<option value="{{client.id}}">{{client.name}}</option>
<option value="{{client.id}}">{{client.name}}</option>
{% endfor %}
</select>
</select>
</div>
<footer>
<div style="display: flex;gap: 10px;">
@@ -304,8 +305,8 @@ Detalhes {{comanda.name}}
<button type="button" class="btn-cancel" onclick="close_modal_conta_client()">Cancelar</button>
</div>
</form>
</footer>
</article>
</footer>
</article>
</dialog>
@@ -315,4 +316,5 @@ Detalhes {{comanda.name}}
</body>
{% endblock %}