Files
controles/templates/listar_militantes.html

88 lines
4.3 KiB
HTML

{% extends 'base.html' %}
{% block title %}Listar Militantes{% endblock %}
{% block content %}
<div class="container">
<div class="row">
<div class="col-md-12">
<h1 class="mb-4">Lista de Militantes</h1>
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
{% for category, message in messages %}
<div class="alert alert-{{ category }}">{{ message }}</div>
{% endfor %}
{% endif %}
{% endwith %}
<div class="d-flex justify-content-between mb-4">
<a href="{{ url_for('novo_militante') }}" class="btn btn-success">Novo Militante</a>
<a href="{{ url_for('home') }}" class="btn btn-outline-primary">Início</a>
</div>
<div class="table-responsive">
<table class="table table-striped table-hover">
<thead>
<tr>
<th>ID</th>
<th>Nome</th>
<th>CPF</th>
<th>Título Eleitoral</th>
<th>Data de Nascimento</th>
<th>Data de Entrada</th>
<th>Data de Efetivação</th>
<th>Telefone 1</th>
<th>Telefone 2</th>
<th>Profissão</th>
<th>Regime de Trabalho</th>
<th>Empresa</th>
<th>Contratante</th>
<th>Instituição de Ensino</th>
<th>Tipo de Instituição</th>
<th>Sindicato</th>
<th>Cargo Sindical</th>
<th>Dirigente Sindical</th>
<th>Central Sindical</th>
<th>Setor</th>
<th>Célula</th>
<th>Ações</th>
</tr>
</thead>
<tbody>
{% for militante in militantes %}
<tr>
<td>{{ militante.id }}</td>
<td>{{ militante.nome }}</td>
<td>{{ militante.cpf }}</td>
<td>{{ militante.titulo_eleitoral }}</td>
<td>{{ militante.data_nascimento.strftime('%d/%m/%Y') }}</td>
<td>{{ militante.data_entrada_oci.strftime('%d/%m/%Y') }}</td>
<td>{{ militante.data_efetivacao_oci.strftime('%d/%m/%Y') }}</td>
<td>{{ militante.telefone1 }}</td>
<td>{{ militante.telefone2 }}</td>
<td>{{ militante.profissao }}</td>
<td>{{ militante.regime_trabalho }}</td>
<td>{{ militante.empresa }}</td>
<td>{{ militante.contratante }}</td>
<td>{{ militante.instituicao_ensino }}</td>
<td>{{ militante.tipo_instituicao }}</td>
<td>{{ militante.sindicato }}</td>
<td>{{ militante.cargo_sindical }}</td>
<td>{{ 'Sim' if militante.dirigente_sindical else 'Não' }}</td>
<td>{{ militante.central_sindical }}</td>
<td>{{ militante.setor.nome }}</td>
<td>{{ militante.celula.nome }}</td>
<td>
<a href="{{ url_for('editar_militante', id=militante.id) }}" class="btn btn-primary btn-sm">Editar</a>
<a href="{{ url_for('deletar_militante', id=militante.id) }}" class="btn btn-danger btn-sm" onclick="return confirm('Tem certeza que deseja excluir este militante?')">Excluir</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
{% endblock %}