mirror of
https://github.com/welton89/RRBEC.git
synced 2026-04-05 13:35:42 +00:00
page orders | add duplicati container
This commit is contained in:
Binary file not shown.
@@ -20,26 +20,16 @@
|
||||
{% endblock %}
|
||||
</head>
|
||||
|
||||
|
||||
<body>
|
||||
{% block 'body' %}
|
||||
|
||||
<h1>Pedidos cozinha</h1>
|
||||
|
||||
|
||||
<div id="list-orders">
|
||||
|
||||
<div class="tab">
|
||||
<button class="tablinks active" onclick="openTab(event, 'Fila')">Fila</button>
|
||||
<button class="tablinks" onclick="openTab(event, 'Preparo')">Preparo</button>
|
||||
<button class="tablinks" onclick="openTab(event, 'Finalizado')">Pronto</button>
|
||||
<button class="tablinks" onclick="openTab(event, 'Entregue')">Entregue</button>
|
||||
</div>
|
||||
|
||||
<div id="etapas">
|
||||
|
||||
<div id="Fila" class="tabcontent">
|
||||
{% for order in orders %}
|
||||
<div class="container">
|
||||
<h1>Pedidos cozinha</h1>
|
||||
<div class="kanban-board">
|
||||
{% csrf_token %}
|
||||
<div class="column">
|
||||
<h2>FILA</h2>
|
||||
<div id="fila" class="cards-container">
|
||||
{% for order in orders %}
|
||||
{% if order.preparing == None and order.productComanda != Null %}
|
||||
<div class="m-card" id="m-card-{{order.id}}"
|
||||
{% if order.productComanda == Null %}
|
||||
@@ -54,18 +44,21 @@
|
||||
<h4> Atendente: {{order.id_comanda.user.first_name}} </h4>
|
||||
<h4>{{order.queue|date:"D"}} {{order.queue|date:"d/m/Y - H:i"}}</h4>
|
||||
{% if user|groupUser:"Cozinha" %}
|
||||
<button class="btn-primary" onclick="delayTab('Fila')"
|
||||
hx-get="{% url 'preparing' order.id %} " hx-trigger="click" hx-target="#etapas"
|
||||
>Preparar</button>
|
||||
|
||||
<form method="path" action="{% url 'preparing' order.id %}">
|
||||
|
||||
<button class="btn-primary" type="submit">Preparar</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
|
||||
<div id="Preparo" class="tabcontent">
|
||||
{% for order in orders %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="column">
|
||||
<h2>PREPARANDO</h2>
|
||||
<div class="cards-container">
|
||||
{% for order in orders %}
|
||||
{% if order.finished == None and order.preparing != None %}
|
||||
<div class="m-card" id="m-card-{{order.id}}"
|
||||
{% if order.productComanda == Null %}
|
||||
@@ -80,17 +73,20 @@
|
||||
<h4> Atendente: {{order.id_comanda.user.first_name}} </h4>
|
||||
<h4>{{order.queue|date:"D"}} {{order.queue|date:"d/m/Y - H:i"}}</h4>
|
||||
{% if user|groupUser:"Cozinha" %}
|
||||
<button class="btn-secondary" onclick="delayTab( 'Preparo')"
|
||||
hx-get="{% url 'finished' order.id %} " hx-trigger="click" hx-target="#etapas"
|
||||
>Finalizar</button>
|
||||
<form method="path" action="{% url 'finished' order.id %}">
|
||||
<button class="btn-primary" type="submit">Finalizar</button>
|
||||
</form>
|
||||
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div id="Finalizado" class="tabcontent">
|
||||
{% for order in orders %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="column">
|
||||
<h2>PRONTO</h2>
|
||||
<div class="cards-container">
|
||||
{% for order in orders %}
|
||||
{% if order.delivered == None and order.finished != None %}
|
||||
<div class="m-card" id="m-card-{{order.id}}"
|
||||
{% if order.productComanda == Null %}
|
||||
@@ -105,17 +101,27 @@
|
||||
<h4> Atendente: {{order.id_comanda.user.first_name}} </h4>
|
||||
<h4>{{order.queue|date:"D"}} {{order.queue|date:"d/m/Y - H:i"}}</h4>
|
||||
{% if user|groupUser:"Garçom" %}
|
||||
<button class="btn-secondary" onclick="delayTab( 'Finalizado')"
|
||||
hx-get="{% url 'delivered' order.id %} " hx-trigger="click" hx-target="#etapas"
|
||||
>Entregar</button>
|
||||
<form method="path" action="{% url 'delivered' order.id %}">
|
||||
<button class="btn-primary" type="submit">Entregar</button>
|
||||
</form>
|
||||
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div id="Entregue" class="tabcontent">
|
||||
{% for order in orders %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="column"
|
||||
{% if user|groupUser:"Gerente" %}
|
||||
style="display:block"
|
||||
{% else %}
|
||||
style="display:none"
|
||||
{% endif %}
|
||||
|
||||
>
|
||||
<h2>ENTREGUE</h2>
|
||||
<div class="cards-container">
|
||||
{% for order in orders %}
|
||||
{% if order.delivered != None %}
|
||||
<div class="m-card" id="m-card-{{order.id}}"
|
||||
{% if order.productComanda == Null %}
|
||||
@@ -132,21 +138,11 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<dialog id="loading" >
|
||||
<div >
|
||||
<img class="loading" src="{% static 'midia/icons/loading.svg' %}" alt="">
|
||||
</div>
|
||||
<br><br>
|
||||
<h1>Carregando...</h1>
|
||||
</dialog>
|
||||
|
||||
<script src="{% static 'orders/js/orders.js' %}"></script> {% endblock %}
|
||||
<script src="{% static 'orders/js/orders.js' %}"></script>
|
||||
{% endblock %}
|
||||
</body>
|
||||
|
||||
|
||||
</html>
|
||||
@@ -1,6 +1,6 @@
|
||||
# from datetime import timezone
|
||||
from django.utils import timezone
|
||||
from django.shortcuts import render
|
||||
from django.shortcuts import render, redirect
|
||||
from django.http import JsonResponse, HttpResponse
|
||||
import asyncio
|
||||
import websockets
|
||||
@@ -35,7 +35,7 @@ def preparing(request, order_id):
|
||||
order.save()
|
||||
fifteen_hours_ago = timezone.now() - timezone.timedelta(hours=15)
|
||||
orders = Order.objects.filter(queue__gte=fifteen_hours_ago )
|
||||
return render(request, 'htmx_components/orders/htmx_list_orders_fila.html',{'orders': orders})
|
||||
return redirect(request.META.get('HTTP_REFERER', '/'))
|
||||
|
||||
|
||||
@group_required(groupName='Cozinha')
|
||||
@@ -45,8 +45,8 @@ def finished(request, order_id):
|
||||
order.save()
|
||||
fifteen_hours_ago = timezone.now() - timezone.timedelta(hours=15)
|
||||
orders = Order.objects.filter(queue__gte=fifteen_hours_ago )
|
||||
asyncio.run(enviar_mensagem())
|
||||
return render(request, 'htmx_components/orders/htmx_list_orders_fila.html',{'orders': orders})
|
||||
# asyncio.run(enviar_mensagem())
|
||||
return redirect(request.META.get('HTTP_REFERER', '/'))
|
||||
|
||||
@group_required(groupName='Garçom')
|
||||
def delivered(request, order_id):
|
||||
@@ -55,7 +55,7 @@ def delivered(request, order_id):
|
||||
order.save()
|
||||
fifteen_hours_ago = timezone.now() - timezone.timedelta(hours=15)
|
||||
orders = Order.objects.filter(queue__gte=fifteen_hours_ago )
|
||||
return render(request, 'htmx_components/orders/htmx_list_orders_fila.html',{'orders': orders})
|
||||
return redirect(request.META.get('HTTP_REFERER', '/'))
|
||||
|
||||
|
||||
def notificacao(request):
|
||||
|
||||
Reference in New Issue
Block a user