288 lines
11 KiB
HTML
288 lines
11 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block title %}Militantes{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="row mb-4">
|
|
<div class="col-12">
|
|
<div class="d-flex justify-content-between align-items-center">
|
|
<h1 class="h3 mb-0">
|
|
<i class="fas fa-users me-2"></i>Militantes
|
|
</h1>
|
|
{% if current_user.has_permission('gerenciar_militantes') %}
|
|
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#modalNovoMilitante">
|
|
<i class="fas fa-user-plus me-2"></i>Novo Militante
|
|
</button>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<div class="row mb-4">
|
|
<div class="col-md-6">
|
|
<div class="input-group">
|
|
<span class="input-group-text">
|
|
<i class="fas fa-search"></i>
|
|
</span>
|
|
<input type="text" class="form-control" id="searchInput" placeholder="Pesquisar militantes...">
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6 text-end">
|
|
<div class="btn-group me-2">
|
|
<button type="button" class="btn btn-outline-secondary btn-fixed-width dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
|
|
<i class="fas fa-filter me-2"></i>Filtrar
|
|
</button>
|
|
<ul class="dropdown-menu">
|
|
<li><h6 class="dropdown-header">Status</h6></li>
|
|
<li><a class="dropdown-item" href="#" data-filter="todos">Todos</a></li>
|
|
<li><a class="dropdown-item" href="#" data-filter="filiados">Filiados</a></li>
|
|
<li><a class="dropdown-item" href="#" data-filter="nao-filiados">Não Filiados</a></li>
|
|
<li><hr class="dropdown-divider"></li>
|
|
<li><h6 class="dropdown-header">Responsabilidades</h6></li>
|
|
<li><a class="dropdown-item" href="#" data-filter="financas">Finanças</a></li>
|
|
<li><a class="dropdown-item" href="#" data-filter="imprensa">Imprensa</a></li>
|
|
<li><a class="dropdown-item" href="#" data-filter="quadro-orientador">Quadro-Orientador</a></li>
|
|
<li><hr class="dropdown-divider"></li>
|
|
<li><h6 class="dropdown-header">Célula</h6></li>
|
|
{% for celula in celulas %}
|
|
<li><a class="dropdown-item" href="#" data-filter="celula" data-celula="{{ celula.nome }}">{{ celula.nome }}</a></li>
|
|
{% endfor %}
|
|
</ul>
|
|
</div>
|
|
<button class="btn btn-outline-primary btn-fixed-width" type="button" id="btnExportar">
|
|
<i class="fas fa-file-export me-2"></i>Exportar
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="table-responsive">
|
|
<table class="table table-hover" id="militantesTable">
|
|
<thead>
|
|
<tr>
|
|
<th data-sort="nome">Nome <i class="fas fa-sort"></i></th>
|
|
<th data-sort="cpf">CPF <i class="fas fa-sort"></i></th>
|
|
<th data-sort="email">Email <i class="fas fa-sort"></i></th>
|
|
<th data-sort="telefone">Telefone <i class="fas fa-sort"></i></th>
|
|
<th data-sort="celula">Célula <i class="fas fa-sort"></i></th>
|
|
<th>Responsabilidades</th>
|
|
<th class="text-end">Ações</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for militante in militantes %}
|
|
<tr data-militante="{{ militante.id }}" data-filiado="{{ 'sim' if militante.filiado else 'nao' }}">
|
|
<td data-nome="{{ militante.nome }}">{{ militante.nome }}</td>
|
|
<td data-cpf="{{ militante.cpf }}">{{ militante.cpf }}</td>
|
|
<td data-email="{{ militante.email }}">{{ militante.email }}</td>
|
|
<td data-telefone="{{ militante.telefone }}">{{ militante.telefone }}</td>
|
|
<td data-celula="{{ militante.celula.nome }}">{{ militante.celula.nome }}</td>
|
|
<td>
|
|
{% if militante.responsabilidades|bitwise_and(Militante.RESPONSAVEL_FINANCAS) %}
|
|
<span class="badge bg-primary">Finanças</span>
|
|
{% endif %}
|
|
{% if militante.responsabilidades|bitwise_and(Militante.RESPONSAVEL_IMPRENSA) %}
|
|
<span class="badge bg-info">Imprensa</span>
|
|
{% endif %}
|
|
{% if militante.responsabilidades|bitwise_and(Militante.QUADRO_ORIENTADOR) %}
|
|
<span class="badge bg-success">Quadro-Orientador</span>
|
|
{% endif %}
|
|
</td>
|
|
<td class="text-end">
|
|
<div class="btn-group">
|
|
{% if current_user.has_permission('gerenciar_militantes') %}
|
|
<button type="button"
|
|
class="btn btn-sm btn-outline-primary"
|
|
data-bs-toggle="modal"
|
|
data-bs-target="#modalEditarMilitante"
|
|
data-militante-id="{{ militante.id }}"
|
|
data-militante-nome="{{ militante.nome }}"
|
|
data-militante-cpf="{{ militante.cpf }}"
|
|
data-militante-email="{{ militante.email }}"
|
|
data-militante-telefone="{{ militante.telefone }}"
|
|
data-militante-endereco="{{ militante.endereco }}"
|
|
data-militante-filiado="{{ militante.filiado }}"
|
|
title="Editar">
|
|
<i class="fas fa-edit"></i>
|
|
</button>
|
|
<button type="button"
|
|
class="btn btn-sm btn-outline-danger"
|
|
data-bs-toggle="modal"
|
|
data-bs-target="#deleteModal"
|
|
data-militante-id="{{ militante.id }}"
|
|
data-militante-nome="{{ militante.nome }}"
|
|
title="Excluir">
|
|
<i class="fas fa-trash"></i>
|
|
</button>
|
|
{% endif %}
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="pagination-container">
|
|
<div class="text-muted">
|
|
Mostrando <span id="countMilitantes">{{ militantes|length }}</span> militantes
|
|
</div>
|
|
<nav aria-label="Navegação de páginas">
|
|
<ul class="pagination mb-0">
|
|
<li class="page-item disabled" id="prevPage">
|
|
<a class="page-link" href="#"><i class="fas fa-chevron-left"></i></a>
|
|
</li>
|
|
<li class="page-item active"><a class="page-link" href="#">1</a></li>
|
|
<li class="page-item"><a class="page-link" href="#">2</a></li>
|
|
<li class="page-item"><a class="page-link" href="#">3</a></li>
|
|
<li class="page-item" id="nextPage">
|
|
<a class="page-link" href="#"><i class="fas fa-chevron-right"></i></a>
|
|
</li>
|
|
</ul>
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Modais -->
|
|
{% include 'modals/militante_novo.html' %}
|
|
{% include 'modals/militante_editar.html' %}
|
|
{% include 'modals/militante_excluir.html' %}
|
|
{% endblock %}
|
|
|
|
{% block scripts %}
|
|
<script src="{{ url_for('static', filename='js/militantes.js') }}"></script>
|
|
{% endblock %}
|
|
|
|
{% block extra_css %}
|
|
<style>
|
|
/* Estilo para o backdrop com blur em todos os modais */
|
|
.modal-backdrop.show {
|
|
backdrop-filter: blur(8px);
|
|
background-color: rgba(0, 0, 0, 0.7);
|
|
}
|
|
|
|
/* Estilo para botões com largura fixa */
|
|
.btn-fixed-width {
|
|
min-width: 120px;
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 0.375rem 0.75rem;
|
|
text-align: center;
|
|
height: 38px; /* Altura padrão do Bootstrap para btn */
|
|
line-height: 1.5;
|
|
vertical-align: middle;
|
|
}
|
|
|
|
.btn-fixed-width i {
|
|
margin-right: 8px;
|
|
font-size: 0.875rem; /* 14px - tamanho padrão de ícone */
|
|
}
|
|
|
|
.dropdown-toggle::after {
|
|
margin-left: 8px;
|
|
}
|
|
|
|
/* Estilo para o botão de fechar dos modais */
|
|
.btn-close {
|
|
background-color: transparent;
|
|
padding: 0.5rem;
|
|
opacity: 0.8;
|
|
transition: opacity 0.2s;
|
|
filter: invert(1) grayscale(100%) brightness(200%);
|
|
}
|
|
|
|
.btn-close:hover {
|
|
opacity: 1;
|
|
background-color: transparent;
|
|
}
|
|
|
|
/* Estilo para colunas ordenáveis */
|
|
th[data-sort] {
|
|
cursor: pointer;
|
|
user-select: none;
|
|
}
|
|
|
|
th[data-sort] i {
|
|
margin-left: 5px;
|
|
color: #ccc;
|
|
}
|
|
|
|
th[data-sort].sort-asc i,
|
|
th[data-sort].sort-desc i {
|
|
color: var(--primary-color);
|
|
}
|
|
|
|
/* Animação para linhas da tabela */
|
|
#militantesTable tbody tr {
|
|
transition: all 0.3s ease;
|
|
}
|
|
|
|
#militantesTable tbody tr:hover {
|
|
background-color: rgba(0,0,0,0.02);
|
|
transform: translateX(5px);
|
|
}
|
|
|
|
/* Estilo para badges */
|
|
.badge {
|
|
font-weight: 500;
|
|
padding: 0.5em 0.8em;
|
|
}
|
|
|
|
/* Estilo para botões de ação */
|
|
.btn-group .btn {
|
|
padding: 0.25rem 0.5rem;
|
|
}
|
|
|
|
.btn-group .btn i {
|
|
width: 16px;
|
|
text-align: center;
|
|
}
|
|
|
|
/* Estilo para modais */
|
|
.modal-content {
|
|
border: none;
|
|
border-radius: 12px;
|
|
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
|
|
}
|
|
|
|
.modal-header {
|
|
background: linear-gradient(to right, var(--bs-gray-dark), var(--bs-gray));
|
|
color: white;
|
|
border-radius: 12px 12px 0 0;
|
|
border-bottom: none;
|
|
padding: 1rem;
|
|
}
|
|
|
|
.modal-body {
|
|
padding: 1.5rem;
|
|
}
|
|
|
|
.modal-footer {
|
|
border-top: 1px solid #eee;
|
|
padding: 1rem;
|
|
}
|
|
|
|
/* Responsividade */
|
|
@media (max-width: 768px) {
|
|
.btn-group {
|
|
display: flex;
|
|
margin-top: 1rem;
|
|
}
|
|
|
|
.btn-group .btn {
|
|
flex: 1;
|
|
}
|
|
|
|
.modal-footer {
|
|
justify-content: center;
|
|
}
|
|
|
|
.modal-footer .btn {
|
|
min-width: 120px;
|
|
}
|
|
}
|
|
</style>
|
|
{% endblock %} |