mirror of
https://github.com/welton89/RRBEC.git
synced 2026-04-05 13:35:42 +00:00
feat: page mesas_map, popover com lista de comandas associadas com nome, total, e link para abrir a comanda. mesas livre cor diferente e não cria popover.
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user