2025-02-19 14:27:14 -03:00
<!DOCTYPE html>
2025-04-03 10:30:48 -03:00
< html lang = "pt-BR" >
2025-02-19 14:27:14 -03:00
< head >
< meta charset = "UTF-8" >
< meta name = "viewport" content = "width=device-width, initial-scale=1.0" >
2025-04-03 10:30:48 -03:00
< title > {% block title %}{% endblock %} - Sistema de Controle OCI< / title >
< link href = "https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel = "stylesheet" >
< link href = "https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css" rel = "stylesheet" >
< style >
body {
padding-top: 56px;
}
.navbar-brand {
font-weight: bold;
}
.nav-link {
font-weight: 500;
}
.card {
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.card-header {
background-color: #f8f9fa;
border-bottom: 1px solid #dee2e6;
}
.btn-primary {
background-color: #0d6efd;
border-color: #0d6efd;
}
.btn-success {
background-color: #198754;
border-color: #198754;
}
.btn-secondary {
background-color: #6c757d;
border-color: #6c757d;
}
.btn-outline-primary {
color: #0d6efd;
border-color: #0d6efd;
}
.btn-outline-primary:hover {
background-color: #0d6efd;
color: #fff;
}
.alert {
border-radius: 0.25rem;
}
.form-control:focus {
border-color: #0d6efd;
box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}
.form-select:focus {
border-color: #0d6efd;
box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}
< / style >
2025-02-19 14:27:14 -03:00
< / head >
< body >
2025-04-03 10:30:48 -03:00
< nav class = "navbar navbar-expand-lg navbar-dark bg-dark fixed-top" >
2025-02-19 14:27:14 -03:00
< div class = "container" >
2025-04-03 10:30:48 -03:00
< a class = "navbar-brand" href = "{{ url_for('home') }}" > Sistema de Controle OCI< / a >
2025-02-19 14:27:14 -03:00
< button class = "navbar-toggler" type = "button" data-bs-toggle = "collapse" data-bs-target = "#navbarNav" >
< span class = "navbar-toggler-icon" > < / span >
< / button >
< div class = "collapse navbar-collapse" id = "navbarNav" >
2025-03-24 16:34:38 -03:00
< ul class = "navbar-nav me-auto" >
2025-04-03 15:58:07 -03:00
{% if current_user is defined and current_user.is_authenticated %}
{% if current_user.is_admin %}
< li class = "nav-item" >
< a class = "nav-link" href = "{{ url_for('dashboard_admin') }}" > Dashboard Admin< / a >
< / li >
{% else %}
< li class = "nav-item" >
< a class = "nav-link" href = "{{ url_for('home') }}" > Início< / a >
< / li >
{% if current_user.has_permission('view_cell_data') %}
< li class = "nav-item" >
< a class = "nav-link" href = "{{ url_for('listar_militantes') }}" > Militantes< / a >
< / li >
{% endif %}
{% if current_user.has_permission('view_cell_reports') %}
< li class = "nav-item" >
< a class = "nav-link" href = "{{ url_for('listar_pagamentos') }}" > Pagamentos< / a >
< / li >
< li class = "nav-item" >
< a class = "nav-link" href = "{{ url_for('listar_materiais') }}" > Materiais< / a >
< / li >
< li class = "nav-item" >
< a class = "nav-link" href = "{{ url_for('listar_relatorios_vendas') }}" > Vendas< / a >
< / li >
{% endif %}
{% if current_user.has_permission('view_cell_reports') or current_user.has_permission('view_sector_reports') or current_user.has_permission('view_cr_reports') %}
< li class = "nav-item dropdown" >
< a class = "nav-link dropdown-toggle" href = "#" id = "navbarDropdown" role = "button" data-bs-toggle = "dropdown" >
Relatórios
< / a >
< ul class = "dropdown-menu" >
{% if current_user.has_permission('view_cell_reports') %}
< li > < a class = "dropdown-item" href = "{{ url_for('listar_relatorios_cotas') }}" > Relatórios de Cotas< / a > < / li >
< li > < a class = "dropdown-item" href = "{{ url_for('listar_relatorios_vendas') }}" > Relatórios de Vendas< / a > < / li >
{% endif %}
< / ul >
< / li >
{% endif %}
{% endif %}
{% endif %}
2025-02-19 14:27:14 -03:00
< / ul >
2025-03-24 16:34:38 -03:00
< ul class = "navbar-nav" >
2025-04-03 15:58:07 -03:00
{% if current_user is defined and current_user.is_authenticated %}
2025-03-24 16:34:38 -03:00
< li class = "nav-item" >
2025-04-03 10:30:48 -03:00
< a class = "nav-link" href = "{{ url_for('logout') }}" > Sair< / a >
2025-03-24 16:34:38 -03:00
< / li >
2025-04-03 15:58:07 -03:00
{% else %}
< li class = "nav-item" >
< a class = "nav-link" href = "{{ url_for('login') }}" > Login< / a >
< / li >
{% endif %}
2025-03-24 16:34:38 -03:00
< / ul >
2025-02-19 14:27:14 -03:00
< / div >
< / div >
< / nav >
2025-04-03 10:30:48 -03:00
2025-02-19 14:27:14 -03:00
< div class = "container mt-4" >
{% block content %}{% endblock %}
< / div >
2025-04-03 10:30:48 -03:00
< script src = "https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js" > < / script >
2025-04-03 15:58:07 -03:00
< script >
// Verificar status da sessão a cada 5 minutos
function checkSession() {
fetch('/check_session')
.then(response => response.json())
.then(data => {
if (data.expired) {
window.location.href = '/login';
}
})
.catch(error => console.error('Erro ao verificar sessão:', error));
}
// Verificar a cada 5 minutos
setInterval(checkSession, 5 * 60 * 1000);
// Verificar também quando a página ganha foco
document.addEventListener('visibilitychange', function() {
if (document.visibilityState === 'visible') {
checkSession();
}
});
< / script >
2025-02-19 14:27:14 -03:00
< / body >
2025-02-20 10:39:31 -03:00
< / html >