feat: bolinha de status ativo/inativo clicavel na lista de clientes

This commit is contained in:
Gustavo
2026-08-20 10:51:28 -03:00
parent 0c82170c26
commit 9fbc57b0ad
4 changed files with 103 additions and 0 deletions
+15
View File
@@ -37,6 +37,7 @@
</a>
</th>
{% endfor %}
<th>Status</th>
<th></th>
</tr>
{% for c in clientes %}
@@ -45,6 +46,20 @@
<td>{{ c.RAZAO }}</td>
<td>{{ c.FANTASIA }}</td>
<td>{{ c.CNPJ }}</td>
<td>
<form method="post" action="/clientes/{{ c.ID }}/alternar-ativo" style="display:inline">
<input type="hidden" name="csrf_token" value="{{ csrf_token }}">
<input type="hidden" name="redirecionar_para" value="{{ redirecionar_para }}">
<button
type="submit"
class="status-dot {{ 'status-dot-ativo' if c.ATIVO else 'status-dot-inativo' }}"
title="{{ 'Ativo — clique para desativar' if c.ATIVO else 'Inativo — clique para ativar' }}"
onclick='return confirm({{ ((("Desativar" if c.ATIVO else "Reativar") + " o cliente " + c.RAZAO + "?")) | tojson }})'
>
<span class="sr-only">{{ "Ativo" if c.ATIVO else "Inativo" }}</span>
</button>
</form>
</td>
<td>
<a class="botao" href="/clientes/{{ c.ID }}">Abrir</a>
<button type="button" class="botao botao-gerar-chave" data-codigo="{{ c.CODIGO }}" onclick="gerarChaveReativacao(this)">Gerar chave</button>