diff --git a/gestaoRaul/db.sqlite3 b/gestaoRaul/db.sqlite3 index e75f23b..ed3d9df 100644 Binary files a/gestaoRaul/db.sqlite3 and b/gestaoRaul/db.sqlite3 differ diff --git a/gestaoRaul/mesas/__pycache__/views.cpython-310.pyc b/gestaoRaul/mesas/__pycache__/views.cpython-310.pyc index 30b7ff4..8ae363e 100644 Binary files a/gestaoRaul/mesas/__pycache__/views.cpython-310.pyc and b/gestaoRaul/mesas/__pycache__/views.cpython-310.pyc differ diff --git a/gestaoRaul/mesas/templates/mesas_map.html b/gestaoRaul/mesas/templates/mesas_map.html index a4f4eab..a35c18a 100644 --- a/gestaoRaul/mesas/templates/mesas_map.html +++ b/gestaoRaul/mesas/templates/mesas_map.html @@ -1,9 +1,10 @@ {% extends "base.html" %} {% load static %} +{% load custom_filter_tag %} {% block 'head' %} - + {% endblock %} @@ -16,7 +17,7 @@ RRB&C - Mapa de Mesas {% csrf_token %}

Mapa de Mesas

@@ -54,15 +33,14 @@ RRB&C - Mapa de Mesas
{% for eixo in eixosXY %} -
-
+ top: {{eixo.x}}px; + "> +
{% endfor %} @@ -71,20 +49,46 @@ RRB&C - Mapa de Mesas
{% for mesa in mesas %} - {% if mesa.active == True %} -
{{mesa.name}}
- {% else %} -
- -
- {{mesa.id}} - {{mesa.name}} - {{mesa.name}} -
+ {% if mesa.active == True %} - {% endif %} +
+ + +
+ +
+

{{mesa.name}}

+ {% for comanda in comandas %} + {% if comanda.mesa.id == mesa.id %} +
+ + {{comanda.name}}🔗 + + {{ comanda.id | total }} +
+ {% endif %} + {% endfor %} +
+ + {% else %} +
+ {{mesa.name}} + +
+ {% endif %} {% endfor %} diff --git a/gestaoRaul/mesas/views.py b/gestaoRaul/mesas/views.py index 43e3ec8..23757ba 100644 --- a/gestaoRaul/mesas/views.py +++ b/gestaoRaul/mesas/views.py @@ -1,15 +1,17 @@ from django.shortcuts import render from django.http import JsonResponse +from comandas.models import Comanda from mesas.models import Mesa +from gestaoRaul.decorators import group_required def mesas(request): - mesas = Mesa.objects.all() - return render(request, 'mesas.html', {'mesas': mesas}) + return render(request, 'mesas.html', {'mesas': mesas, }) +@group_required(groupName='Garçom') def mapMesas(request): eixosXY = [] for i in range(0,27): @@ -18,7 +20,16 @@ def mapMesas(request): eixosXY.append(item) mesas = Mesa.objects.all() - return render(request, 'mesas_map.html', {'mesas': mesas, 'eixosXY': eixosXY}) + comandas = Comanda.objects.filter(status__in=["OPEN", "PAYING"]) + for mesa in mesas: + for comanda in comandas: + if mesa.id == comanda.mesa.id: + mesa.active = True + break + for mesa in mesas: + print(mesa.active) + + return render(request, 'mesas_map.html', {'comandas': comandas,'mesas': mesas, 'eixosXY': eixosXY}) def locationMesa(request, mesaId, location): print('inicioul') diff --git a/gestaoRaul/templates/static/mesas/css/mesas.css b/gestaoRaul/templates/static/mesas/css/mesas.css index 81e222d..a7dc5a7 100644 --- a/gestaoRaul/templates/static/mesas/css/mesas.css +++ b/gestaoRaul/templates/static/mesas/css/mesas.css @@ -19,7 +19,7 @@ color: #333; transition: transform 0.2s; } -.m-card { +/* .m-card { width: 50px; height: 50px; background-color: #f2f2f2; @@ -32,20 +32,20 @@ color: #333; transition: transform 0.2s; cursor: move; - } + } */ .card:hover { transform: scale(1.05); box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.3); } -.m-card:hover { +/* .m-card:hover { transform: scale(1.05); box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.3); - } - + } */ +/* .elemento { position: absolute; } @@ -63,4 +63,4 @@ padding: 15px; min-height: 300px; max-width: 1400px; -} \ No newline at end of file +} */ \ No newline at end of file diff --git a/gestaoRaul/templates/static/mesas/css/mesas_map.css b/gestaoRaul/templates/static/mesas/css/mesas_map.css new file mode 100644 index 0000000..7fcf644 --- /dev/null +++ b/gestaoRaul/templates/static/mesas/css/mesas_map.css @@ -0,0 +1,137 @@ +@keyframes jump { + 0% { + transform: scale(0.0); + } + 70% { + transform: scale(1.2); + } + 100% { + transform: scale(1); + } +} + + +.m-card { + width: 50px; + height: 50px; + background-color: #ff9797; + border-radius: 15px; + box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.2); + text-align: center; + line-height: 50px; + font-size: 10px; + font-weight: bold; + color: #333; + transition: transform 0.2s; + cursor: move; + } + + +.m-card:hover { + transform: scale(1.05); + box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.3); + } + + + + +.elemento { + position: absolute; +} + +.espaco { + border: 0.3px solid #cccccc56; + padding: 0px; + background-color: rgba(0, 0, 255, 0); + width: 50px; + height: 50px; + position: absolute +} + +.popover{ + width: 300px; + height: 400px; + top: 20%; + left: 25%; + padding: 20px; + background-color: #f2f2f29d; + border-radius: 15px; + border: none; + box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.2); + text-align: justify; + line-height: 50px; + font-size: 18px; + font-weight: bold; + color: #333; + transition: transform 0.2s; + animation: jump 0.7s; +} + +.popover div { + display: flex; + color: #333; + width: 100%; + justify-content: space-between; +} + +.popover > h4 { + color: #333; + justify-self: center; +} +.popover a { + text-decoration: none; + color: #333; + justify-self: center; +} +.popover::backdrop { + background-color: rgba(0, 0, 0, 0.5); + backdrop-filter: blur(5px); + /* animation: jump 0.2s; */ +} + +.button-popover { + border: none; + background-color: rgba(240, 248, 255, 0); + padding: 0px; + font-size: 12px; + color: black; +} + + + +#drop { + display: flex; + background-color: rgb(75, 75, 75); + border-radius: 15px; + padding: 15px; + min-height: 300px; + max-width: 1400px; +} + + + + +#scroll { +display: grid; +position: relative; + scrollbar-width: thin; +} + +@media screen and (max-width: 730px) { +#scroll { + margin: 10px; + + overflow: scroll; +} + +#mapa { +margin: 0px; + +} + +.popover { + left: 15%; + width: 70%; +} + + } \ No newline at end of file