mirror of
https://github.com/welton89/RRBEC.git
synced 2026-04-05 13:35:42 +00:00
chore: Delete numerous application modules, templates, static assets, documentation, and build files.
This commit is contained in:
144
templates/base.html
Normal file
144
templates/base.html
Normal file
@@ -0,0 +1,144 @@
|
||||
{% load static %}
|
||||
{% load custom_filter_tag %}
|
||||
|
||||
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="pt-BR" id="all">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="shortcut icon" href="{% static 'midia/favicon/favicon.ico' %}" />
|
||||
{% load pwa %}
|
||||
{% progressive_web_app_meta %}
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css">
|
||||
<link rel="stylesheet" href="{% static 'base.css' %}">
|
||||
{% block 'head' %}
|
||||
|
||||
{% endblock %}
|
||||
<title> {% block 'title' %}{% endblock %} </title>
|
||||
</head>
|
||||
|
||||
|
||||
<header>
|
||||
<div class="p-header">
|
||||
<nav class="nav-bar">
|
||||
<div class="logo">
|
||||
<h1>
|
||||
<img src="{% static 'midia/logo.png' %}" width="60">
|
||||
</h1>
|
||||
<button id="icon-notify" style="border: none; margin-left: 10px; border-radius: 20px; height: 40px;width: 40px; padding: 2px; align-self: center;" onclick="cookieNotificacao()" >🔊</button>
|
||||
</div>
|
||||
<div class="nav-list">
|
||||
<ul>
|
||||
{% if user|groupUser:"Gerente" %}
|
||||
<li class="nav-item"><a href="{% url 'home' %}" class="nav-link">Início</a></li>
|
||||
{% endif %}
|
||||
<li class="nav-item"><a href="{% url 'comandas' %}" class="nav-link">Comandas</a></li>
|
||||
<li class="nav-item"><a href="{% url 'pedidos' %}" class="nav-link">Cozinha</a></li>
|
||||
<li class="nav-item"><a href="{% url 'viewBalcao' %}" class="nav-link">Balcão</a></li>
|
||||
<li class="nav-item"><a href="{% url 'mapMesas' %}" class="nav-link">Mapa</a></li>
|
||||
|
||||
<div class="dropdown">
|
||||
<li class="nav-item">Cadastros<img class="img-drop" src="{% static 'midia/icons/down.svg' %}"></li>
|
||||
<div class="dropdown-content">
|
||||
<a href="{% url 'products' %}" class="nav-link">Produtos</a>
|
||||
<a href="{% url 'categories' %}" class="nav-link">Categorias</a>
|
||||
<a href="{% url 'clients' %}" class="nav-link">Clientes</a>
|
||||
<a href="{% url 'admin:index' %}" class="nav-link">Admin</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="logout-button">
|
||||
<div id="user-info">{{user.first_name}} {{user.last_name}}</div>
|
||||
<a href="{% url 'logout' %}" style="width: 50px;"><img src="{% static 'midia/icons/logout.svg' %}" style="width: 40px;"></a>
|
||||
</div>
|
||||
|
||||
<div class="mobile-menu-icon">
|
||||
<button onclick="menuShow()">
|
||||
<img
|
||||
class="icon"
|
||||
src="https://raw.githubusercontent.com/Larissakich/menu_responsivo/6e3b09504434628c1b01f65b7d8ccf6ace3225cb/menu%20responsivo/assets/img/menu_white_36dp.svg"
|
||||
alt="">
|
||||
</button>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="header-mobile">
|
||||
|
||||
<button class="nav-toggle"><i for="menu-toggle" class="fas fa-bars"></i></button>
|
||||
|
||||
<nav id="nav-links" class="nav-links">
|
||||
<div style="
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
top:20px;
|
||||
">
|
||||
<div class="logo">
|
||||
<button
|
||||
id="icon-notify"
|
||||
style="border: none; margin-left: 10px; border-radius: 20px; height: 40px;width: 40px; padding: 2px; align-self: center;"
|
||||
onclick="cookieNotificacao()" >🔊
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div id="user-info">{{user.first_name}} {{user.last_name}}</div>
|
||||
<a href="{% url 'logout' %}" style="width: 50px;padding: 3px;"><img src="{% static 'midia/icons/logout.svg' %}" style="width: 40px;"></a>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="nav-component">
|
||||
{% if user|groupUser:"Gerente" %}
|
||||
<a href="{% url 'home' %}" class="nav-link">DashBoard</a>
|
||||
<a href="{% url 'products' %}" class="nav-link"> Produtos</a>
|
||||
{% endif %}
|
||||
<a href="{% url 'comandas' %}" class="nav-link">Comandas</a>
|
||||
<a href="{% url 'pedidos' %}" class="nav-link">Cozinha</a>
|
||||
<a href="{% url 'mapMesas' %}" class="nav-link">Mapa</a>
|
||||
<a href="{% url 'clients' %}" class="nav-link"> Clientes</a>
|
||||
{% if user|groupUser:"Admin" %}
|
||||
<a href="{% url 'admin:index' %}" class="nav-link">Admin</a>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
|
||||
<br>
|
||||
|
||||
{% block 'body' %}
|
||||
{% endblock %}
|
||||
<script src="{% static 'htmx_base.js' %}"></script>
|
||||
<script src="{% static 'base.js' %}"></script>
|
||||
|
||||
<div id="toast" class="toast">
|
||||
<p id="toast-message"></p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
|
||||
<link href="https://cdn.jsdelivr.net/npm/sweetalert2@11/dist/sweetalert2.min.css" rel="stylesheet">
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
|
||||
|
||||
|
||||
<footer>
|
||||
|
||||
|
||||
</footer>
|
||||
|
||||
</html>
|
||||
19
templates/htmx_components/comandas/htmx_list_products.html
Normal file
19
templates/htmx_components/comandas/htmx_list_products.html
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
|
||||
{% for product in products %}
|
||||
|
||||
<div
|
||||
style="background-image: url('{{product.image}}');"
|
||||
class="card-product"
|
||||
onclick="addProductComanda({{product.id}}, {{comanda_id}}, '{{product.cuisine}}')" >
|
||||
<p class="card-product-p"> {{product.name}}</p>
|
||||
<p class="card-product-p"> R$ {{product.price}}</p>
|
||||
</div >
|
||||
|
||||
{% endfor %}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
{% load static %}
|
||||
{% load custom_filter_tag %}
|
||||
|
||||
|
||||
<tr>
|
||||
<th style="text-align: left;"><b>Produto</b></th>
|
||||
<th style="text-align: left;"><b>Preço</b></th>
|
||||
</tr>
|
||||
|
||||
{% for item in consumo%}
|
||||
|
||||
<tr id="item-{{item.id}}">
|
||||
<td id="id-for-print-{{item.id}}">
|
||||
<spam style="cursor: pointer;" onclick="inforOrders({{item.id}})">
|
||||
{{item.product.name}}</spam>
|
||||
{% if item.product.cuisine == True %}
|
||||
<input hidden id="{{item.id}}-obsOrder" type="order" value="{{item.id | obsOrder}}">
|
||||
|
||||
|
||||
<img
|
||||
onclick="openModalObs({{item.id}})"
|
||||
src="{% static 'midia/icons/note.svg' %}"
|
||||
style="width: 25px; height: 35px; cursor: pointer;">
|
||||
</img>
|
||||
|
||||
|
||||
<img
|
||||
onclick="printOrder({{item.id}})"
|
||||
src="{% static 'midia/icons/print.svg' %}"
|
||||
style="width: 35px; height: 35px; cursor: pointer;">
|
||||
</img>
|
||||
{% endif %}
|
||||
|
||||
</td>
|
||||
<td>R$ {{item.product.price}}</td>
|
||||
|
||||
{% if comanda.status != 'OPEN'%}
|
||||
{% else %}
|
||||
<td>
|
||||
|
||||
<img
|
||||
onclick="removeProductComanda({{item.id}}, '{{item.product.name}}')"
|
||||
src="{% static 'midia/icons/delete.svg' %}"
|
||||
style="width: 35px; height: 35px; cursor: pointer;"
|
||||
>
|
||||
</img>
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% if config.taxa %}
|
||||
<tr>
|
||||
<td>
|
||||
Taxa de serviço 10%
|
||||
</td>
|
||||
<td>
|
||||
R$ {{valores.taxa}}
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
|
||||
{% if parcials%}
|
||||
<td colspan="2" style="text-align: center;"><b>Pagamentos parciais</b></td>
|
||||
{% endif %}
|
||||
{% for parcial in parcials %}
|
||||
<tr>
|
||||
<td>{{parcial.description}} ás {{parcial.datetime|date:"H:i"}}</td>
|
||||
<td>R$ -{{parcial.value}}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
|
||||
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
{% if config.taxa %}
|
||||
<td colspan="2" style="text-align: center;"><b>Total R$ {{valores.totalComTaxa}}</b></td>
|
||||
{% else %}
|
||||
<td colspan="2" style="text-align: center;"><b>Total R$ {{valores.totalSemTaxa}}</b></td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
51
templates/htmx_components/htmx_list_products_balcao.html
Normal file
51
templates/htmx_components/htmx_list_products_balcao.html
Normal file
@@ -0,0 +1,51 @@
|
||||
|
||||
|
||||
{% for product in products %}
|
||||
|
||||
{% if forloop.counter0 == 0 %}
|
||||
|
||||
<article
|
||||
style="background-image: url('{{product.image}}');"
|
||||
name="productBox"
|
||||
id="productId-{{ product.id }}"
|
||||
class="card-product"
|
||||
onclick="addProductClick({{product.id}} )"
|
||||
>
|
||||
<p hidden id="{{forloop.counter0}}" >{{product.id}}</p>
|
||||
<p hidden id="comanda{{forloop.counter0}}" >{{comanda.id}}</p>
|
||||
<p class="card-product-p"> {{product.name}}</p>
|
||||
<p id="{{product.id}}"></p>
|
||||
<p class="card-product-p"> R$ {{product.price}}</p>
|
||||
</article >
|
||||
|
||||
{% else %}
|
||||
|
||||
<article
|
||||
style="background-image: url('{{product.image}}');"
|
||||
name="productBox"
|
||||
id="productId-{{ product.id }}"
|
||||
class="card-product"
|
||||
onclick="addProductClick({{product.id}})"
|
||||
>
|
||||
<p class="card-product-p"> {{product.name}}</p>
|
||||
<p class="card-product-p"> R$ {{product.price}}</p>
|
||||
</article >
|
||||
|
||||
{% endif %}
|
||||
|
||||
|
||||
{% endfor %}
|
||||
|
||||
<!-- hx-swap="none"> -->
|
||||
|
||||
|
||||
|
||||
<div
|
||||
style="background-image: url('{{product.image}}');"
|
||||
class="card-product"
|
||||
onclick="addProductComanda({{product.id}}, {{comanda.id}}, '{{product.cuisine}}')" >
|
||||
<p class="card-product-p"> {{product.name}}</p>
|
||||
<p class="card-product-p"> R$ {{product.price}}</p>
|
||||
</div >
|
||||
|
||||
|
||||
28
templates/htmx_components/htmx_list_products_in_balcao.html
Normal file
28
templates/htmx_components/htmx_list_products_in_balcao.html
Normal file
@@ -0,0 +1,28 @@
|
||||
<tr>
|
||||
<th style="text-align: left;"><b>Produto</b></th>
|
||||
<th style="text-align: left;"><b>Preço</b></th>
|
||||
</tr>
|
||||
|
||||
{% for item in consumo%}
|
||||
|
||||
<tr>
|
||||
<td>{{item.product.name}}</td>
|
||||
<td>R$ {{item.product.price}} </td>
|
||||
<td><button class="btn-cancel" onclick="removeProductBalcao({{item.id}})"
|
||||
|
||||
>Excluir</button></td>
|
||||
</tr>
|
||||
|
||||
{% endfor %}
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td value={{total}} colspan="2" style="text-align: center;">Total R$ {{total}}</td>
|
||||
</tr>
|
||||
<tr >
|
||||
<td hidden id="total">{{total}}</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
|
||||
|
||||
160
templates/htmx_components/products/htmx_search_products.html
Normal file
160
templates/htmx_components/products/htmx_search_products.html
Normal file
@@ -0,0 +1,160 @@
|
||||
{% load static %}
|
||||
|
||||
|
||||
<thead> <tr>
|
||||
<th style="text-align: left;" data-col-type="text">Produto</th>
|
||||
<th style="text-align: left;width: 20%;" data-col-type="number">Preço</th>
|
||||
<th class="hide-on-mobile" style="text-align: left;" data-col-type="number">Quantidade</th>
|
||||
<th class="hide-on-mobile" style="text-align: left;" data-col-type="text">Categoria</th>
|
||||
<th style="text-align: left;width: 20%;">Ações</th> </tr>
|
||||
</thead>
|
||||
<tbody> {% for product in products %}
|
||||
<tr>
|
||||
<td id="name-{{product.id}}" >{{product.name}}</td>
|
||||
<td id="price-{{product.id}}" >R$ {{product.price}}</td>
|
||||
|
||||
{% if product.quantity > 20 %}
|
||||
<td class="hide-on-mobile" id="quantity-{{product.id}}" >{{product.quantity}}</td>
|
||||
{% else %}
|
||||
<td class="hide-on-mobile" id="quantity-{{product.id}}" style="background-color: brown;" >{{product.quantity}}</td>
|
||||
{% endif %}
|
||||
<td hidden class="hide-on-mobile" id="image-{{product.id}}" >{{product.image}}</td>
|
||||
<td class="hide-on-mobile" id="category-{{product.id}}" >{{product.category.name}}</td>
|
||||
<td>
|
||||
<div class="grid-buttons">
|
||||
<img
|
||||
src="{% static 'midia/icons/edit.svg' %}"
|
||||
style="width: 35px; height: 35px; cursor: pointer;"
|
||||
onclick="editProduct({{product.id}})"
|
||||
>
|
||||
</img>
|
||||
|
||||
<input type="hidden" id="h-category-{{product.id}}" value="{{ product.category.id }}">
|
||||
<input type="hidden" id="description-{{product.id}}" value="{{ product.description }}">
|
||||
<input type="hidden" id="cuisine-{{product.id}}" value="{{ product.cuisine }}">
|
||||
|
||||
<form hx-post="{% url 'onOffproduct' %}" hx-trigger="click" hx-target="#product-list">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="id-product" id="id-{{product.id}}" value="{{ product.id }}">
|
||||
|
||||
{% if product.active == True %}
|
||||
<button style="background-color: rgba(255, 0, 0, 0); padding: 0px;border: 0px;">
|
||||
<span data-tooltip="Ativar ou Desativar Produto" data-flow="top">
|
||||
<img
|
||||
src="{% static 'midia/icons/toggle-on.svg' %}"
|
||||
style="width: 35px; height: 35px; cursor: pointer;"
|
||||
>
|
||||
</img>
|
||||
</span>
|
||||
</button>
|
||||
{% else %}
|
||||
<button style="background-color: rgba(0, 128, 0, 0); padding: 0px;border: 0px;" >
|
||||
<span data-tooltip="Ativar ou Desativar Produto" data-flow="top">
|
||||
<img
|
||||
src="{% static 'midia/icons/toggle-off.svg' %}"
|
||||
style="width: 35px; height: 35px; cursor: pointer;"
|
||||
>
|
||||
</img>
|
||||
<span>
|
||||
</button>
|
||||
{% endif %}
|
||||
</form>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<script>
|
||||
function listerSortTeable(){
|
||||
|
||||
|
||||
|
||||
// document.addEventListener('DOMContentLoaded', function() {
|
||||
const table = document.getElementById('product-list');
|
||||
const headers = table.querySelectorAll('th');
|
||||
const tbody = table.querySelector('tbody'); // Seleciona o corpo da tabela
|
||||
|
||||
let currentSortColumn = -1; // Armazena o índice da coluna atualmente ordenada
|
||||
let sortDirection = 'asc'; // 'asc' para ascendente, 'desc' para descendente
|
||||
|
||||
// Adiciona um ouvinte de evento de clique a cada cabeçalho de coluna
|
||||
headers.forEach((header, index) => {
|
||||
if (header.textContent.trim() !== 'Ações') {
|
||||
header.addEventListener('click', () => {
|
||||
// Se a mesma coluna for clicada, inverte a direção da ordenação
|
||||
if (currentSortColumn === index) {
|
||||
sortDirection = (sortDirection === 'asc') ? 'desc' : 'asc';
|
||||
} else {
|
||||
// Se uma nova coluna for clicada, define como a coluna atual
|
||||
// e inicia a ordenação ascendente
|
||||
currentSortColumn = index;
|
||||
sortDirection = 'asc';
|
||||
}
|
||||
|
||||
// Remove as classes de ordenação de todos os cabeçalhos
|
||||
headers.forEach(h => {
|
||||
h.classList.remove('sorted-asc', 'sorted-desc');
|
||||
});
|
||||
|
||||
// Adiciona a classe de ordenação ao cabeçalho clicado para visualização
|
||||
header.classList.add(`sorted-${sortDirection}`);
|
||||
|
||||
// Chama a função de ordenação
|
||||
sortColumn(index, sortDirection, header.dataset.colType);
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
function sortColumn(columnIndex, direction, columnType) {
|
||||
// Converte os NodeList de linhas em um Array para poder usar sort()
|
||||
const rows = Array.from(tbody.querySelectorAll('tr'));
|
||||
|
||||
rows.sort((rowA, rowB) => {
|
||||
// Obtém o texto da célula na coluna clicada para ambas as linhas
|
||||
let valueA = rowA.children[columnIndex].textContent.trim();
|
||||
let valueB = rowB.children[columnIndex].textContent.trim();
|
||||
|
||||
// Trata valores específicos para colunas como "Preço" que têm "R$"
|
||||
if (columnIndex === 1) { // Índice da coluna "Preço"
|
||||
valueA = valueA.replace('R$', '').trim();
|
||||
valueB = valueB.replace('R$', '').trim();
|
||||
}
|
||||
|
||||
// Converte para número se o tipo da coluna for "number"
|
||||
// ou se for a coluna de "Preço" após remover "R$"
|
||||
if (columnType === 'number' || columnIndex === 1) {
|
||||
valueA = parseFloat(valueA);
|
||||
valueB = parseFloat(valueB);
|
||||
// Garante que NaN (Not a Number) sejam tratados para evitar problemas de ordenação
|
||||
valueA = isNaN(valueA) ? -Infinity : valueA;
|
||||
valueB = isNaN(valueB) ? -Infinity : valueB;
|
||||
} else {
|
||||
// Para texto, use localeCompare para ordenação correta com caracteres acentuados
|
||||
// e torna minúsculo para ordenação case-insensitive
|
||||
valueA = valueA.toLowerCase();
|
||||
valueB = valueB.toLowerCase();
|
||||
}
|
||||
|
||||
let comparison = 0;
|
||||
if (valueA > valueB) {
|
||||
comparison = 1;
|
||||
} else if (valueA < valueB) {
|
||||
comparison = -1;
|
||||
}
|
||||
|
||||
// Aplica a direção da ordenação
|
||||
return (direction === 'asc') ? comparison : -comparison;
|
||||
});
|
||||
|
||||
// Remove todas as linhas existentes e adiciona as linhas ordenadas de volta ao tbody
|
||||
while (tbody.firstChild) {
|
||||
tbody.removeChild(tbody.firstChild);
|
||||
}
|
||||
rows.forEach(row => tbody.appendChild(row));
|
||||
}
|
||||
// });
|
||||
}
|
||||
listerSortTeable()
|
||||
</script>
|
||||
Reference in New Issue
Block a user