From 8a58d0a0dbdb1d2c0001103cf846475769dd1374 Mon Sep 17 00:00:00 2001 From: Welton Moura Date: Fri, 21 Feb 2025 21:39:08 -0300 Subject: [PATCH] feat: toast --- .../__pycache__/htmx_views.cpython-310.pyc | Bin 3934 -> 3992 bytes .../comandas/templates/viewcomanda.html | 136 +++++++++--------- gestaoRaul/db.sqlite3 | Bin 331776 -> 331776 bytes gestaoRaul/templates/base.html | 5 + gestaoRaul/templates/static/base.css | 28 +++- gestaoRaul/templates/static/base.js | 26 +++- .../static/comandas/css/viewcomanda.css | 39 +++-- .../static/comandas/js/viewcomanda.js | 34 +---- .../static/midia/icons/close-circle.svg | 7 + 9 files changed, 158 insertions(+), 117 deletions(-) create mode 100644 gestaoRaul/templates/static/midia/icons/close-circle.svg diff --git a/gestaoRaul/comandas/__pycache__/htmx_views.cpython-310.pyc b/gestaoRaul/comandas/__pycache__/htmx_views.cpython-310.pyc index 0f7fcaa12177e695ae497aa79a6a88ef74a24d0f..3bae9cca2a6c168fa8c402e50c150015d3b864f2 100644 GIT binary patch delta 812 zcmX|9O=}cE5S{9o>F(+68O@3qMO_m`%t66J63hle)F=^?H6{q20;Xfg2nqHMUhE-< zcnt`B@gTARj|z$x|AlxohkzGMV)mfdP9`*66>3Y@sr(d@6%{*5Tem{PHT6_B; z@1$EAqYUjjTK5ft0mIgzj$KqnJuvYu)Jer0b6}DkR;MoQ#k&ziRZ^xUU^d->npZqT zEJUIb7)d7#$C`A!%#3)<>_nxUaNMOvnrtVjGnY;E4`ZQ$g$7kM91^!#-KeySjB>GS zI7vCvc$IF)i_wUlw@2`@H@)IMOZWK7=EkG-HUFAFY-&4#6?>839Ko2+#e?CK=q7RU zN5>i@6yaBJIQR+%nQi;$;wg;#U*f{(1ogH4!x{AU)T&vpI@YY(E|t3ypa`xF>_m848x576QeK zOp1#TE~T8|eJw;^3wsIg@J-G&<$(fM@hWzV;EHc&lc%ns+ifC{3`N`w5=g+|!A|=Z z*$ST|^0@z*T^{HVnIq7MIN*$Lt4&U?#NP1l)zH!VM4-o1Fa-&4hNRh#-_;PnEid&H zA1CglpVP~*?BD6Lu;{<&8gBbeexBcFMeDSfj*`u9LUY`U zZB!;Y+GVCwDJyJbxfVJe@mg9rIg8!!4a_$rRcaF}4p^>{!?(u#|q9ev*5nQ@1WzF@+#bQ4;yFp z)sB8$^^M*!!`s+7BpC`Ouq6X?AHhq8?qtOn{1-|isDctok_V71t3r=hiSqbNh|)kA z+Ysf0n)~V#6j?TwSG<}D>JlPlff@xmM4dQgG@nq8dag(|^Y|axdw8$81sYi=c579FZzbRV*3u zNC)BVzw>E-u%Xu)8j^WJZqr}eEE*Sf5l*-iIJ3;pO@bM?Zt=6dK*cl<&&_lxS|_(f WZs3+0kIpp|$QUg_6KE1`s(`=7;)Pagamento Parcial + - - -
+ + +
+
+

+
-
-

Adicionar Produto

+
+

Adicionar Produto

-
-
- {% for product in products %} +
+
+ {% for product in products %}
{{product.name}}
@@ -174,40 +177,38 @@ Detalhes {{comanda.name}}
{% endfor %}
- -
+ +
+ - - - - @@ -243,38 +244,38 @@ Detalhes {{comanda.name}} {% csrf_token %} -
-
- - -
-
- +
+
+ + +
+
+
-
- {% csrf_token %} + + {% csrf_token %}

Editar Comanda


- - -
+ + +
- + @@ -283,20 +284,20 @@ Detalhes {{comanda.name}}
{% csrf_token %} -

Adicionar na Conta

-

R$ {{ valores.totalSemTaxa }}

-
- - -

Selecione o Cliente:

- + +

Selecione o Cliente:

+ + +
@@ -304,8 +305,8 @@ Detalhes {{comanda.name}}
-
-
+ + @@ -315,4 +316,5 @@ Detalhes {{comanda.name}} + {% endblock %} \ No newline at end of file diff --git a/gestaoRaul/db.sqlite3 b/gestaoRaul/db.sqlite3 index f1b1681909b8158ccc18f7d328a9f407b93ad09d..26ecd118b92dd5ca892fb02d72938e817c5684df 100644 GIT binary patch delta 3880 zcmai1e{dAl9p8QL_ROi03y2pWGva(B7p?sAt) z1cKF21U3GsU@B|d8O;l!981vOlt*fp$8J_uKtdJ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L#pN4K}Z;}Yr}SI4~`>V%n(9FB7d56n4~~1Hc7E5 z@*RE$umN_KeZsc0I#$9aG0<*mXS5EjNn2_kGKtCM``yGuMi73SPI z^Ul0AzhJaVs;;DXCz{Oh@Z#J>bIN9$CG!_lJY~8b^Ey$4Gl!GQTis-wXS~OW(nqpr z1TeLW1LPzoMWRkJi)Z(V5idkCuaBC{ROet*`f`c;X^OnvM`t8tEOVoj!dQ_ohLY-< zs+vYQFhmn&ppQCX@>2O}KTWdN_0ydmI)kl7(lJPb_;Z;vNS|=%GXZdNo9&CCghf>6AcG_75>(+?0ulVeUGHt)a*?4#(3gy Yb3Dpv<>ZE}fE9^kg)RHyLz)r)H=Q1-(f|Me diff --git a/gestaoRaul/templates/base.html b/gestaoRaul/templates/base.html index b9421da..4b4167f 100644 --- a/gestaoRaul/templates/base.html +++ b/gestaoRaul/templates/base.html @@ -97,6 +97,10 @@ {% endblock %} + +
+

+
@@ -125,4 +129,5 @@ + \ No newline at end of file diff --git a/gestaoRaul/templates/static/base.css b/gestaoRaul/templates/static/base.css index 55fc922..91b218d 100644 --- a/gestaoRaul/templates/static/base.css +++ b/gestaoRaul/templates/static/base.css @@ -7,7 +7,6 @@ @keyframes jump { 0% { transform: scale(0.0); - /* transform: translate(#000000); */ } 70% { transform: scale(1); @@ -295,8 +294,31 @@ input, textarea, select { transform: translateY(-10px); } - - /* .dropdown:hover .dropbtn {background-color: #3e8e41;} */ +.toast { + position: fixed; + top: 40px; + left: 50%; + transform: translateX(-50%); + background-color: #599100; + color: #000000; + font-weight: bold; + padding: 15px; + border-radius: 10px; + opacity: 0; + visibility: hidden; + transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out; + z-index: 200 !important; +} + +.toast p { + color: #000000; +} + +.toast.show { + opacity: 1; + visibility: visible; +} + @media screen and (max-width: 730px) { .dropdown-content { diff --git a/gestaoRaul/templates/static/base.js b/gestaoRaul/templates/static/base.js index ab13cee..5f67324 100644 --- a/gestaoRaul/templates/static/base.js +++ b/gestaoRaul/templates/static/base.js @@ -14,9 +14,31 @@ var elem = document.getElementById("all"); function openFullscreen() { if (elem.requestFullscreen) { elem.requestFullscreen(); - } else if (elem.webkitRequestFullscreen) { /* Safari */ + } else if (elem.webkitRequestFullscreen) { elem.webkitRequestFullscreen(); - } else if (elem.msRequestFullscreen) { /* IE11 */ + } else if (elem.msRequestFullscreen) { elem.msRequestFullscreen(); } + } + + function showToast(message, type ,duration = 3000) { + const toast = document.getElementById('toast'); + + if (type === 'success') { + toast.style.backgroundColor = '#28a745'; + } else if (type === 'error') { + toast.style.backgroundColor = '#dc3545'; + } else if (type === 'info') { + toast.style.backgroundColor = '#ffc107'; + } + + + const toastMessage = document.getElementById('toast-message'); + + toastMessage.textContent = message; + toast.classList.add('show'); + + setTimeout(() => { + toast.classList.remove('show'); + }, duration); } \ No newline at end of file diff --git a/gestaoRaul/templates/static/comandas/css/viewcomanda.css b/gestaoRaul/templates/static/comandas/css/viewcomanda.css index b3597e9..755177f 100644 --- a/gestaoRaul/templates/static/comandas/css/viewcomanda.css +++ b/gestaoRaul/templates/static/comandas/css/viewcomanda.css @@ -6,14 +6,16 @@ margin: 0 auto; } + body { + z-index: 0; + } + .grid-list-products { - justify-items: center; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 800px; - /* margin: 0 auto; */ } .card-product { @@ -27,12 +29,12 @@ background: var(--main-gradient); box-shadow: 3px 3px 10px rgba(2, 2, 2, 0.678); border-radius: 5px; - + transition: transform 0.4s, box-shadow 0.4s; } .card-product:hover { transform: scale(1.05); - transition: transform 0.4s; + transition: transform 0.4s, box-shadow 0.4s; box-shadow: 0px 0px 10px rgba(86, 187, 255, 0.815); } @@ -40,15 +42,25 @@ text-align: center; } - + .close { + height: 45px; + transition: transform 0.4s; + } + .close:hover { + transform: scale(1.2); + transition: transform 0.4s; + filter: drop-shadow(0px 0px 8px rgba(255, 1, 1, 0.452)); + } + .popover{ + position: relative; width: 98%; - height: 98%; + height: 96%; max-width: 800px; top: 20px; left: 25%; padding: 20px; - /* background-color: #f2f2f29d; */ + background-color: #1f1f1fb6; border-radius: 15px; border: none; box-shadow: 0px 0px 8px rgba(143, 143, 143, 0.2); @@ -56,20 +68,19 @@ line-height: 50px; font-size: 18px; font-weight: bold; + z-index: 1; /* color: #333; */ - transition: transform 0.2s; + transition: transform 0.4s; animation: jump 0.5s; } - + + .popover::backdrop { - background-color: rgba(0, 0, 0, 0.315); + background-color: rgba(39, 39, 39, 0.315); backdrop-filter: blur(5px); - /* animation: jump 0.2s; */ } - - @media screen and (max-width: 730px) { .popover{ @@ -78,7 +89,6 @@ max-width: 800px; top: 20px; left: 10px; - } .card-product { @@ -89,6 +99,5 @@ background: var(--main-gradient); box-shadow: 3px 3px 10px rgba(2, 2, 2, 0.678); font-size: 14px; - } } \ No newline at end of file diff --git a/gestaoRaul/templates/static/comandas/js/viewcomanda.js b/gestaoRaul/templates/static/comandas/js/viewcomanda.js index de1ba50..616a5f8 100644 --- a/gestaoRaul/templates/static/comandas/js/viewcomanda.js +++ b/gestaoRaul/templates/static/comandas/js/viewcomanda.js @@ -91,7 +91,6 @@ function imprimirFichas() { if (element) { var content = element.innerHTML; - // console.log(content); content = content.replace( /]*>/gi,''); content = content.replace(/]*>(?:(?!<\/tfoot>)[\s\S])*<\/tfoot>/gi,''); @@ -128,7 +127,6 @@ function imprimirConta() { if (element) { var content = element.innerHTML; - // console.log(content); content = content.replace(/]*>/gi,''); content = content.replace(/]*>(?:(?!<\/th>)[\s\S])*<\/th>/gi,''); // content = content.replace('icons',''); @@ -180,20 +178,6 @@ function troco(){ } -// document.onkeydown = teclado - -// function teclado(event){ -// if (document.getElementById('payment-comanda').style.display == 'block'){ -// if (event.keyCode == 13){ -// troco() -// }else{ -// console.log(event.keyCode) -// } -// }else{ -// console.log('') -// } - -// } function addOrder(){ obs = document.getElementById('obs').value var id = document.getElementById('id-temp').value @@ -206,9 +190,9 @@ function addOrder(){ .then(function(response) { if(response.status == 200){ closeModalObs() - alert('Pedido atualizado com sucesso!') + showToast('✅Pedido atualizado com sucesso!😁','success') }else{ - alert('Erro ao atualizar pedido!') + showToast('❌Ocorreu um erro!😢','error') } }) @@ -232,23 +216,13 @@ function addProductComanda(productId,comandaId, cuisine) { .then(function(response) { return response.text(); }).then(function(text) { - console.log(text); var listProductsBalcaoElement = document.getElementById("list-products-comanda"); listProductsBalcaoElement.innerHTML = text; }) - - // const receber = document.getElementById('pagarComanda') - // const imprimir = document.getElementById('imprimirFichas') - // var search = document.getElementById('search-product') - - // setTimeout(function() { - // updateTotal();}, 100); - - alert('Produto adicionado com sucesso!'); + + showToast('Produto adicionado com sucesso!😁','success'); } - - } function taxa(){ diff --git a/gestaoRaul/templates/static/midia/icons/close-circle.svg b/gestaoRaul/templates/static/midia/icons/close-circle.svg new file mode 100644 index 0000000..dc2afd7 --- /dev/null +++ b/gestaoRaul/templates/static/midia/icons/close-circle.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file