diff --git a/gestaoRaul/balcao/__pycache__/htmx_views.cpython-310.pyc b/gestaoRaul/balcao/__pycache__/htmx_views.cpython-310.pyc index a52198b..2a0039d 100644 Binary files a/gestaoRaul/balcao/__pycache__/htmx_views.cpython-310.pyc and b/gestaoRaul/balcao/__pycache__/htmx_views.cpython-310.pyc differ diff --git a/gestaoRaul/balcao/__pycache__/urls.cpython-310.pyc b/gestaoRaul/balcao/__pycache__/urls.cpython-310.pyc index 9946b1d..7a57d00 100644 Binary files a/gestaoRaul/balcao/__pycache__/urls.cpython-310.pyc and b/gestaoRaul/balcao/__pycache__/urls.cpython-310.pyc differ diff --git a/gestaoRaul/balcao/__pycache__/views.cpython-310.pyc b/gestaoRaul/balcao/__pycache__/views.cpython-310.pyc index edb053d..651e1cb 100644 Binary files a/gestaoRaul/balcao/__pycache__/views.cpython-310.pyc and b/gestaoRaul/balcao/__pycache__/views.cpython-310.pyc differ diff --git a/gestaoRaul/balcao/htmx_views.py b/gestaoRaul/balcao/htmx_views.py index 8ea02ae..1b7f3f2 100644 --- a/gestaoRaul/balcao/htmx_views.py +++ b/gestaoRaul/balcao/htmx_views.py @@ -31,10 +31,6 @@ def listProductBalcao(request, comanda_id, search_product): return render(request, "htmx_components/htmx_list_products_balcao.html", {"products": products,'comanda_id':comanda_id}) -# def listProductBalcao(request, comanda_id): -# product = request.GET.get("search-product") -# products = Product.objects.filter(name__icontains=product) -# return render(request, "htmx_components/htmx_list_products_balcao.html", {"products": products,'comanda_id':comanda_id}) def addProductBalcao(request, product_id, comanda_id, qtd): for i in range(qtd): diff --git a/gestaoRaul/balcao/templates/viewBalcao.html b/gestaoRaul/balcao/templates/viewBalcao.html index 407d1f9..dcd1558 100644 --- a/gestaoRaul/balcao/templates/viewBalcao.html +++ b/gestaoRaul/balcao/templates/viewBalcao.html @@ -69,8 +69,6 @@
- -

Buscar Produto

@@ -128,22 +126,14 @@ {% endfor %}
-
- - - -
- - - + + diff --git a/gestaoRaul/products/urls.py b/gestaoRaul/products/urls.py index 4094eb9..5f71484 100644 --- a/gestaoRaul/products/urls.py +++ b/gestaoRaul/products/urls.py @@ -5,5 +5,6 @@ from . import views urlpatterns = [ path('', views.products, name='products'), path('create_product', views.createProduct, name='create_product'), + path('onOffproduct', views.onOffProduct, name='onOffproduct'), ] diff --git a/gestaoRaul/products/views.py b/gestaoRaul/products/views.py index 88ddf1b..234322c 100644 --- a/gestaoRaul/products/views.py +++ b/gestaoRaul/products/views.py @@ -18,4 +18,13 @@ def createProduct(request): product = Product(name=name, description=description, price=price, category=category) product.save() return redirect('/products') - # return render(request, 'products.html') \ No newline at end of file + # return render(request, 'products.html') + + +def onOffProduct(request): + id = request.POST.get('id-product') + product_id = int(id) + product = Product.objects.get(id=product_id) + product.active = not product.active + product.save() + return redirect('products') \ No newline at end of file diff --git a/gestaoRaul/templates/static/comandas/js/viewbalcao.js b/gestaoRaul/templates/static/comandas/js/viewbalcao.js index b9f19f6..d2db574 100644 --- a/gestaoRaul/templates/static/comandas/js/viewbalcao.js +++ b/gestaoRaul/templates/static/comandas/js/viewbalcao.js @@ -8,7 +8,6 @@ function close_modal_payment_comanda() { document.getElementById('payment-comanda').style.display = 'none'; } -// document.cookie = 'qtd=1'; function imprimirFichas() { @@ -28,6 +27,7 @@ function imprimirFichas() { if (element) { var content = element.innerHTML; content = content.replace(/]*>(?:(?!<\/button>)[\s\S])*<\/button>/gi,''); + content = content.replace(/]*>(?:(?!<\/tfoot>)[\s\S])*<\/tfoot>/gi,''); content = content.replace(/]*>(?:(?!<\/th>)[\s\S])*<\/th>/gi,''); content = content.replace(/<\/tr>/g,''+dateString+ '
VÁLIDO SOMENTE POR ESSA NOITE'+''); diff --git a/gestaoRaul/templates/static/products/css/products.css b/gestaoRaul/templates/static/products/css/products.css index d8506fc..de5f400 100644 --- a/gestaoRaul/templates/static/products/css/products.css +++ b/gestaoRaul/templates/static/products/css/products.css @@ -2,7 +2,7 @@ button { background-color: #007BFF; color: white; - padding: 10px 20px; + padding: 10px 10px; border: none; border-radius: 5px; cursor: pointer; @@ -55,11 +55,19 @@ input, textarea { -.grid-container { +.grid-buttons { display: grid; grid-template-columns: repeat(2, 1fr); + gap: 10px; + max-width: 500px; /* Define a largura máxima do grid */ + /* margin: 0 auto; */ + } + +.grid-container { + display: grid; + grid-template-columns: repeat(1, 1fr); gap: 20px; - max-width: 800px; /* Define a largura máxima do grid */ + max-width: 1000px; /* Define a largura máxima do grid */ margin: 0 auto; /* Centraliza o grid na página */ }