Melhorada interface dos formulários. Adicionado a opção de editar os Militantes direto da Lista
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
<h2>Lista de Militantes</h2>
|
||||
<a href="{{ url_for('novo_militante') }}" class="btn btn-primary mb-3">Novo Militante</a>
|
||||
|
||||
<table class="table table-striped">
|
||||
<table class="table table-striped table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Nome</th>
|
||||
@@ -21,7 +21,7 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for militante in militantes %}
|
||||
<tr>
|
||||
<tr class="clickable-row" data-href="{{ url_for('editar_militante', id=militante.id) }}">
|
||||
<td>{{ militante.nome }}</td>
|
||||
<td>{{ militante.cpf }}</td>
|
||||
<td>{{ militante.email }}</td>
|
||||
@@ -34,4 +34,24 @@
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.clickable-row {
|
||||
cursor: pointer;
|
||||
}
|
||||
.clickable-row:hover {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const rows = document.querySelectorAll('.clickable-row');
|
||||
rows.forEach(row => {
|
||||
row.addEventListener('click', function() {
|
||||
window.location.href = this.dataset.href;
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user