feat: websocket part1 (estudo)

This commit is contained in:
2025-03-03 21:23:35 -03:00
parent 76d2d4a879
commit 3a7cbfc413
115 changed files with 17856 additions and 33 deletions

View File

@@ -40,27 +40,28 @@
<div id="Fila" class="tabcontent">
{% for order in orders %}
{% if order.preparing == None and order.productComanda != Null %}
<div class="m-card"
{% if order.productComanda == Null %}
style="background-color: rgb(253, 69, 69);"
{% elif order.obs != '' %}
style="background-color: rgb(243, 165, 75);"
{% endif %}
>
<h4>{{order.id_product.name}}</h4>
<h4>{{order.obs}} </h4>
<h4>{{order.id_comanda.name}} - {{order.id_comanda.mesa.name}} </h4>
<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>
{% endif %}
</div>
{% endif %}
{% endfor %}
{% if order.preparing == None and order.productComanda != Null %}
<div class="m-card"
{% if order.productComanda == Null %}
style="background-color: rgb(253, 69, 69);"
{% elif order.obs != '' %}
style="background-color: rgb(243, 165, 75);"
{% endif %}
>
<h4>{{order.id_product.name}}</h4>
<h4 id="obs-{{order.id}}">{{order.obs}} </h4>
<h4>{{order.id_comanda.name}} - {{order.id_comanda.mesa.name}} </h4>
<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>
{% endif %}
</div>
{% endif %}
{% endfor %}
<!-- <output id="fila"></output> -->
</div>
@@ -75,7 +76,7 @@
{% endif %}
>
<h4>{{order.id_product.name}}</h4>
<h4>{{order.obs}} </h4>
<h4 id="obs-{{order.id}}">{{order.obs}} </h4>
<h4>{{order.id_comanda.name}} - {{order.id_comanda.mesa.name}} </h4>
<h4> Atendente: {{order.id_comanda.user.first_name}} </h4>
<h4>{{order.queue|date:"D"}} {{order.queue|date:"d/m/Y - H:i"}}</h4>
@@ -100,7 +101,7 @@
{% endif %}
>
<h4>{{order.id_product.name}}</h4>
<h4>{{order.obs}} </h4>
<h4 id="obs-{{order.id}}">{{order.obs}} </h4>
<h4>{{order.id_comanda.name}} - {{order.id_comanda.mesa.name}} </h4>
<h4> Atendente: {{order.id_comanda.user.first_name}} </h4>
<h4>{{order.queue|date:"D"}} {{order.queue|date:"d/m/Y - H:i"}}</h4>
@@ -125,7 +126,7 @@
{% endif %}
>
<h4>{{order.id_product.name}}</h4>
<h4>{{order.obs}} </h4>
<h4 id="obs-{{order.id}}">{{order.obs}} </h4>
<h4>{{order.id_comanda.name}} - {{order.id_comanda.mesa.name}} </h4>
<h4> Atendente: {{order.id_comanda.user.first_name}} </h4>
<h4>{{order.queue|date:"D"}} {{order.queue|date:"d/m/Y - H:i"}}</h4>