feat: rotas e telas de CLIENTE (listar, criar, editar, detalhe, excluir)

This commit is contained in:
Gustavo
2026-08-13 10:07:15 -03:00
parent e93a0f3d1d
commit c7f2c5f92b
7 changed files with 334 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
<!-- app/templates/cliente_form.html -->
{% extends "base.html" %}
{% block titulo %}{{ "Editar" if cliente else "Novo" }} cliente{% endblock %}
{% block conteudo %}
<h1>{{ "Editar" if cliente else "Novo" }} cliente</h1>
{% if aviso_codigo_duplicado %}
<div class="mensagem warning">
O código {{ dados.CODIGO }} já está em uso por outro cliente.
<form method="post">
{% for campo, valor in dados.items() %}<input type="hidden" name="{{ campo }}" value="{{ valor }}">{% endfor %}
<input type="hidden" name="confirmar_codigo_duplicado" value="1">
<button type="submit">Cadastrar mesmo assim</button>
</form>
</div>
{% endif %}
{% if aviso_dv_invalido %}
<div class="mensagem warning">O dígito verificador do documento ({{ dados.CNPJ }}) não confere — confirme se digitou certo antes de salvar.</div>
{% endif %}
<form method="post">
{% for campo in campos %}
<label for="{{ campo }}">{{ campo }}</label>
<input type="text" id="{{ campo }}" name="{{ campo }}" value="{{ dados[campo] if dados else '' }}">
{% endfor %}
<button type="submit">Salvar</button>
</form>
{% endblock %}