Adicionados os campos mínimos do Banco de Dados, precisa melhorar interface e controle de acesso que será posterior nessa branch mesmo
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
from sqlalchemy import create_engine, Column, Integer, String, Boolean, Numeric, Date, ForeignKey, DateTime
|
from sqlalchemy import create_engine, Column, Integer, String, Boolean, Numeric, Date, ForeignKey, DateTime, Text
|
||||||
from sqlalchemy.orm import relationship, sessionmaker
|
from sqlalchemy.orm import relationship, sessionmaker
|
||||||
from sqlalchemy.ext.declarative import declarative_base
|
from sqlalchemy.ext.declarative import declarative_base
|
||||||
from werkzeug.security import generate_password_hash, check_password_hash
|
from werkzeug.security import generate_password_hash, check_password_hash
|
||||||
@@ -57,42 +57,116 @@ class Celula(Base):
|
|||||||
nome = Column(String(100), nullable=False)
|
nome = Column(String(100), nullable=False)
|
||||||
setor_id = Column(Integer, ForeignKey('setores.id'))
|
setor_id = Column(Integer, ForeignKey('setores.id'))
|
||||||
cr_id = Column(Integer, ForeignKey('comites_regionais.id'))
|
cr_id = Column(Integer, ForeignKey('comites_regionais.id'))
|
||||||
|
secretario = Column(Integer, ForeignKey('militantes.id'))
|
||||||
|
responsavel_financas = Column(Integer, ForeignKey('militantes.id'))
|
||||||
|
quadro_orientador = Column(String(255))
|
||||||
|
|
||||||
|
# Relacionamentos
|
||||||
setor = relationship("Setor", back_populates="celulas")
|
setor = relationship("Setor", back_populates="celulas")
|
||||||
cr = relationship("ComiteRegional", back_populates="celulas")
|
cr = relationship("ComiteRegional", back_populates="celulas")
|
||||||
militantes = relationship("Militante", back_populates="celula")
|
militantes = relationship("Militante", back_populates="celula", foreign_keys="[Militante.celula_id]")
|
||||||
|
secretario_rel = relationship("Militante", foreign_keys=[secretario])
|
||||||
|
responsavel_financas_rel = relationship("Militante", foreign_keys=[responsavel_financas])
|
||||||
|
pagamentos = relationship("PagamentoCelula", back_populates="celula")
|
||||||
|
|
||||||
class ComiteRegional(Base):
|
class ComiteRegional(Base):
|
||||||
__tablename__ = 'comites_regionais'
|
__tablename__ = 'comites_regionais'
|
||||||
|
|
||||||
id = Column(Integer, primary_key=True, autoincrement=True)
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
||||||
nome = Column(String(100), nullable=False)
|
nome = Column(String(100), nullable=False)
|
||||||
|
responsavel_financas = Column(Integer, ForeignKey('militantes.id'))
|
||||||
|
responsavel_formacao = Column(Integer, ForeignKey('militantes.id'))
|
||||||
|
secretario_organizacao = Column(Integer, ForeignKey('militantes.id'))
|
||||||
|
correspondente_jornal = Column(Integer, ForeignKey('militantes.id'))
|
||||||
|
|
||||||
|
# Relacionamentos
|
||||||
|
responsavel_financas_rel = relationship("Militante", foreign_keys=[responsavel_financas])
|
||||||
|
responsavel_formacao_rel = relationship("Militante", foreign_keys=[responsavel_formacao])
|
||||||
|
secretario_organizacao_rel = relationship("Militante", foreign_keys=[secretario_organizacao])
|
||||||
|
correspondente_jornal_rel = relationship("Militante", foreign_keys=[correspondente_jornal])
|
||||||
setores = relationship("Setor", back_populates="cr")
|
setores = relationship("Setor", back_populates="cr")
|
||||||
celulas = relationship("Celula", back_populates="cr")
|
celulas = relationship("Celula", back_populates="cr")
|
||||||
|
|
||||||
|
class EmailMilitante(Base):
|
||||||
|
__tablename__ = 'emails_militantes'
|
||||||
|
|
||||||
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
||||||
|
militante_id = Column(Integer, ForeignKey('militantes.id'))
|
||||||
|
endereco_email = Column(String(100))
|
||||||
|
militante = relationship("Militante", back_populates="emails")
|
||||||
|
|
||||||
|
class Endereco(Base):
|
||||||
|
__tablename__ = 'enderecos'
|
||||||
|
|
||||||
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
||||||
|
estado = Column(String(2))
|
||||||
|
cidade = Column(String(50))
|
||||||
|
bairro = Column(String(50))
|
||||||
|
rua = Column(String(100))
|
||||||
|
numero = Column(String(10))
|
||||||
|
complemento = Column(String(50))
|
||||||
|
cep = Column(String(9))
|
||||||
|
militantes = relationship("Militante", back_populates="endereco")
|
||||||
|
|
||||||
|
class RedeSocial(Base):
|
||||||
|
__tablename__ = 'redes_sociais'
|
||||||
|
|
||||||
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
||||||
|
militante_id = Column(Integer, ForeignKey('militantes.id'))
|
||||||
|
tipo = Column(String(20)) # Instagram, TikTok, Discord, etc.
|
||||||
|
identificador = Column(String(100))
|
||||||
|
militante = relationship("Militante", back_populates="redes_sociais")
|
||||||
|
|
||||||
class Militante(Base):
|
class Militante(Base):
|
||||||
__tablename__ = 'militantes'
|
__tablename__ = 'militantes'
|
||||||
|
|
||||||
id = Column(Integer, primary_key=True, autoincrement=True)
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
||||||
nome = Column(String(100), nullable=False)
|
nome = Column(String(100), nullable=False)
|
||||||
cpf = Column(String(14), unique=True)
|
cpf = Column(String(14), unique=True)
|
||||||
email = Column(String(100), unique=True)
|
# Novos campos básicos
|
||||||
telefone = Column(String(15))
|
titulo_eleitoral = Column(String(20))
|
||||||
endereco = Column(String(255))
|
data_nascimento = Column(Date)
|
||||||
filiado = Column(Boolean, default=False)
|
data_entrada_oci = Column(Date)
|
||||||
|
data_efetivacao_oci = Column(Date)
|
||||||
|
# Campos de contato
|
||||||
|
telefone1 = Column(String(15))
|
||||||
|
telefone2 = Column(String(15))
|
||||||
|
# Relacionamento para múltiplos emails
|
||||||
|
emails = relationship("EmailMilitante", back_populates="militante")
|
||||||
|
# Endereço
|
||||||
|
endereco_id = Column(Integer, ForeignKey('enderecos.id'))
|
||||||
|
endereco = relationship("Endereco", back_populates="militantes")
|
||||||
|
# Redes sociais
|
||||||
|
redes_sociais = relationship("RedeSocial", back_populates="militante")
|
||||||
|
# Campos profissionais
|
||||||
|
profissao = Column(String(100))
|
||||||
|
regime_trabalho = Column(String(50)) # CLT, Estatutário, etc.
|
||||||
|
empresa = Column(String(100))
|
||||||
|
contratante = Column(String(100)) # Para terceirizados
|
||||||
|
# Campos acadêmicos
|
||||||
|
instituicao_ensino = Column(String(100))
|
||||||
|
tipo_instituicao = Column(String(20)) # Federal, Estadual, etc.
|
||||||
|
# Campos sindicais
|
||||||
|
sindicato = Column(String(100))
|
||||||
|
cargo_sindical = Column(String(50))
|
||||||
|
dirigente_sindical = Column(Boolean)
|
||||||
|
central_sindical = Column(String(100))
|
||||||
|
# Responsável pelo cadastro
|
||||||
|
registrado_por = Column(Integer, ForeignKey('militantes.id'))
|
||||||
|
# Campos existentes
|
||||||
celula_id = Column(Integer, ForeignKey('celulas.id'))
|
celula_id = Column(Integer, ForeignKey('celulas.id'))
|
||||||
responsabilidades = Column(Integer, default=0) # Armazenará as responsabilidades como bits
|
responsabilidades = Column(Integer, default=0)
|
||||||
otp_secret = Column(String(32))
|
otp_secret = Column(String(32))
|
||||||
temp_token = Column(String(64))
|
temp_token = Column(String(64))
|
||||||
temp_token_expiry = Column(DateTime)
|
temp_token_expiry = Column(DateTime)
|
||||||
|
|
||||||
|
# Relacionamentos existentes
|
||||||
cotas_mensais = relationship("CotaMensal", back_populates="militante")
|
cotas_mensais = relationship("CotaMensal", back_populates="militante")
|
||||||
pagamentos = relationship("Pagamento", back_populates="militante")
|
pagamentos = relationship("Pagamento", back_populates="militante")
|
||||||
materiais_vendidos = relationship("MaterialVendido", back_populates="militante")
|
materiais_vendidos = relationship("MaterialVendido", back_populates="militante")
|
||||||
vendas_jornais = relationship("VendaJornalAvulso", back_populates="militante")
|
vendas_jornais = relationship("VendaJornalAvulso", back_populates="militante")
|
||||||
assinaturas = relationship("AssinaturaAnual", back_populates="militante")
|
assinaturas = relationship("AssinaturaAnual", back_populates="militante")
|
||||||
celula = relationship("Celula", back_populates="militantes")
|
celula = relationship("Celula", back_populates="militantes", foreign_keys=[celula_id])
|
||||||
|
|
||||||
# Constantes para responsabilidades
|
# Constantes para responsabilidades
|
||||||
SECRETARIO = 1
|
SECRETARIO = 1
|
||||||
@@ -186,19 +260,22 @@ class TipoPagamento(Base):
|
|||||||
id = Column(Integer, primary_key=True, autoincrement=True)
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
||||||
descricao = Column(String(100), nullable=False)
|
descricao = Column(String(100), nullable=False)
|
||||||
|
|
||||||
pagamentos = relationship("Pagamento", back_populates="tipo_pagamento")
|
|
||||||
|
|
||||||
class Pagamento(Base):
|
class Pagamento(Base):
|
||||||
__tablename__ = 'pagamentos'
|
__tablename__ = 'pagamentos'
|
||||||
|
|
||||||
id = Column(Integer, primary_key=True, autoincrement=True)
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
||||||
militante_id = Column(Integer, ForeignKey('militantes.id'))
|
militante_id = Column(Integer, ForeignKey('militantes.id'))
|
||||||
tipo_pagamento_id = Column(Integer, ForeignKey('tipos_pagamento.id'))
|
tipo_pagamento = Column(String(50)) # Cota, Jornal, Assinatura, etc.
|
||||||
|
mes_referencia = Column(Date)
|
||||||
|
numero_jornal = Column(String(20))
|
||||||
|
numero_inicial_assinatura = Column(String(20))
|
||||||
|
numero_final_assinatura = Column(String(20))
|
||||||
|
campanha_financeira = Column(String(50))
|
||||||
valor = Column(Numeric(10, 2), nullable=False)
|
valor = Column(Numeric(10, 2), nullable=False)
|
||||||
data_pagamento = Column(Date, nullable=False)
|
data_pagamento = Column(Date, nullable=False)
|
||||||
|
|
||||||
militante = relationship("Militante", back_populates="pagamentos")
|
militante = relationship("Militante", back_populates="pagamentos")
|
||||||
tipo_pagamento = relationship("TipoPagamento", back_populates="pagamentos")
|
transacoes_pix = relationship("TransacaoPIX", back_populates="pagamento")
|
||||||
|
|
||||||
class TipoMaterial(Base):
|
class TipoMaterial(Base):
|
||||||
__tablename__ = 'tipos_materiais'
|
__tablename__ = 'tipos_materiais'
|
||||||
@@ -250,13 +327,20 @@ class AssinaturaAnual(Base):
|
|||||||
class Setor(Base):
|
class Setor(Base):
|
||||||
__tablename__ = 'setores'
|
__tablename__ = 'setores'
|
||||||
|
|
||||||
id = Column(Integer, primary_key=True, autoincrement=True)
|
id = Column(Integer, primary_key=True)
|
||||||
nome = Column(String(100), nullable=False)
|
nome = Column(String(100), nullable=False)
|
||||||
|
cr_id = Column(Integer, ForeignKey('comites_regionais.id'))
|
||||||
|
responsavel = Column(Integer, ForeignKey('militantes.id'))
|
||||||
|
responsavel_financas = Column(Integer, ForeignKey('militantes.id'))
|
||||||
|
|
||||||
relatorios_cotas = relationship("RelatorioCotasMensais", back_populates="setor")
|
# Relacionamentos
|
||||||
relatorios_vendas = relationship("RelatorioVendasMateriais", back_populates="setor")
|
cr = relationship("ComiteRegional", back_populates="setores")
|
||||||
|
responsavel_rel = relationship("Militante", foreign_keys=[responsavel])
|
||||||
|
responsavel_financas_rel = relationship("Militante", foreign_keys=[responsavel_financas])
|
||||||
usuarios = relationship("Usuario", back_populates="setor")
|
usuarios = relationship("Usuario", back_populates="setor")
|
||||||
celulas = relationship("Celula", back_populates="setor")
|
celulas = relationship("Celula", back_populates="setor")
|
||||||
|
relatorios_cotas = relationship("RelatorioCotasMensais", back_populates="setor")
|
||||||
|
relatorios_vendas = relationship("RelatorioVendasMateriais", back_populates="setor")
|
||||||
|
|
||||||
class ComiteCentral(Base):
|
class ComiteCentral(Base):
|
||||||
__tablename__ = 'comites_centrais'
|
__tablename__ = 'comites_centrais'
|
||||||
@@ -306,9 +390,13 @@ class Usuario(Base):
|
|||||||
ultimo_login = Column(DateTime)
|
ultimo_login = Column(DateTime)
|
||||||
ultimo_logout = Column(DateTime)
|
ultimo_logout = Column(DateTime)
|
||||||
motivo_logout = Column(String(100))
|
motivo_logout = Column(String(100))
|
||||||
|
cr_id = Column(Integer, ForeignKey('comites_regionais.id'))
|
||||||
|
celula_id = Column(Integer, ForeignKey('celulas.id'))
|
||||||
|
|
||||||
role = relationship("Role", back_populates="usuarios")
|
role = relationship("Role", back_populates="usuarios")
|
||||||
setor = relationship("Setor", back_populates="usuarios")
|
setor = relationship("Setor", back_populates="usuarios")
|
||||||
|
celula = relationship("Celula")
|
||||||
|
cr = relationship("ComiteRegional")
|
||||||
|
|
||||||
def __init__(self, username, password, is_admin=False):
|
def __init__(self, username, password, is_admin=False):
|
||||||
self.username = username
|
self.username = username
|
||||||
@@ -373,6 +461,78 @@ class RolePermissao(Base):
|
|||||||
role = relationship("Role", back_populates="permissoes")
|
role = relationship("Role", back_populates="permissoes")
|
||||||
permissao = relationship("Permissao", back_populates="roles")
|
permissao = relationship("Permissao", back_populates="roles")
|
||||||
|
|
||||||
|
class PagamentoCelula(Base):
|
||||||
|
__tablename__ = 'pagamentos_celula'
|
||||||
|
|
||||||
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
||||||
|
celula_id = Column(Integer, ForeignKey('celulas.id'))
|
||||||
|
data = Column(Date)
|
||||||
|
valor = Column(Numeric(10, 2))
|
||||||
|
metodo_pagamento = Column(String(20)) # PIX, Dinheiro, etc.
|
||||||
|
codigo_pix = Column(String(100))
|
||||||
|
descricao = Column(String(255))
|
||||||
|
registrado_por = Column(Integer, ForeignKey('militantes.id'))
|
||||||
|
|
||||||
|
celula = relationship("Celula", back_populates="pagamentos")
|
||||||
|
registrado_por_rel = relationship("Militante", foreign_keys=[registrado_por])
|
||||||
|
|
||||||
|
class Atividade(Base):
|
||||||
|
__tablename__ = 'atividades'
|
||||||
|
|
||||||
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
||||||
|
descricao = Column(String(255))
|
||||||
|
data = Column(Date)
|
||||||
|
responsavel1 = Column(Integer, ForeignKey('militantes.id'))
|
||||||
|
responsavel2 = Column(Integer, ForeignKey('militantes.id'))
|
||||||
|
|
||||||
|
responsavel1_rel = relationship("Militante", foreign_keys=[responsavel1])
|
||||||
|
responsavel2_rel = relationship("Militante", foreign_keys=[responsavel2])
|
||||||
|
materiais = relationship("MaterialAtividade", back_populates="atividade")
|
||||||
|
|
||||||
|
class MaterialAtividade(Base):
|
||||||
|
__tablename__ = 'materiais_atividades'
|
||||||
|
|
||||||
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
||||||
|
atividade_id = Column(Integer, ForeignKey('atividades.id'))
|
||||||
|
tipo = Column(String(20)) # Jornal, Revista, etc.
|
||||||
|
quantidade = Column(Integer)
|
||||||
|
detalhes = Column(String(255))
|
||||||
|
|
||||||
|
atividade = relationship("Atividade", back_populates="materiais")
|
||||||
|
|
||||||
|
class Relatorio(Base):
|
||||||
|
__tablename__ = 'relatorios'
|
||||||
|
|
||||||
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
||||||
|
tipo = Column(String(50)) # Semanal, Quinzenal, Mensal
|
||||||
|
periodo_inicio = Column(Date)
|
||||||
|
periodo_fim = Column(Date)
|
||||||
|
gerado_por = Column(Integer, ForeignKey('militantes.id'))
|
||||||
|
conteudo = Column(Text)
|
||||||
|
# Relacionamento hierárquico
|
||||||
|
celula_id = Column(Integer, ForeignKey('celulas.id'))
|
||||||
|
setor_id = Column(Integer, ForeignKey('setores.id'))
|
||||||
|
cr_id = Column(Integer, ForeignKey('comites_regionais.id'))
|
||||||
|
|
||||||
|
gerado_por_rel = relationship("Militante", foreign_keys=[gerado_por])
|
||||||
|
celula = relationship("Celula", foreign_keys=[celula_id])
|
||||||
|
setor = relationship("Setor", foreign_keys=[setor_id])
|
||||||
|
cr = relationship("ComiteRegional", foreign_keys=[cr_id])
|
||||||
|
|
||||||
|
class TransacaoPIX(Base):
|
||||||
|
__tablename__ = 'transacoes_pix'
|
||||||
|
|
||||||
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
||||||
|
chave_pix = Column(String(100))
|
||||||
|
valor = Column(Numeric(10, 2))
|
||||||
|
data_geracao = Column(DateTime)
|
||||||
|
data_pagamento = Column(DateTime)
|
||||||
|
status = Column(String(20)) # Pendente, Pago, Expirado
|
||||||
|
qr_code = Column(Text)
|
||||||
|
pagamento_id = Column(Integer, ForeignKey('pagamentos.id'))
|
||||||
|
|
||||||
|
pagamento = relationship("Pagamento", back_populates="transacoes_pix")
|
||||||
|
|
||||||
# Remover o banco de dados existente (se existir)
|
# Remover o banco de dados existente (se existir)
|
||||||
if os.path.exists(db_path):
|
if os.path.exists(db_path):
|
||||||
os.remove(db_path)
|
os.remove(db_path)
|
||||||
|
|||||||
@@ -1,26 +1,75 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="pt-br">
|
<html lang="pt-BR">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>{% block title %}{% endblock %} - Sistema de Gestão</title>
|
<title>{% block title %}{% endblock %} - Sistema de Controle OCI</title>
|
||||||
{{ bootstrap.load_css() }}
|
<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>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
{% if 'user_id' in session %}
|
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
|
||||||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<a class="navbar-brand" href="{{ url_for('home') }}">Sistema de Gestão</a>
|
<a class="navbar-brand" href="{{ url_for('home') }}">Sistema de Controle OCI</a>
|
||||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
|
||||||
<span class="navbar-toggler-icon"></span>
|
<span class="navbar-toggler-icon"></span>
|
||||||
</button>
|
</button>
|
||||||
<div class="collapse navbar-collapse" id="navbarNav">
|
<div class="collapse navbar-collapse" id="navbarNav">
|
||||||
<ul class="navbar-nav me-auto">
|
<ul class="navbar-nav me-auto">
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="{{ url_for('listar_militantes') }}">Militantes</a>
|
<a class="nav-link" href="{{ url_for('home') }}">Início</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="{{ url_for('listar_cotas') }}">Cotas</a>
|
<a class="nav-link" href="{{ url_for('listar_militantes') }}">Militantes</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="{{ url_for('listar_pagamentos') }}">Pagamentos</a>
|
<a class="nav-link" href="{{ url_for('listar_pagamentos') }}">Pagamentos</a>
|
||||||
@@ -28,40 +77,39 @@
|
|||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="{{ url_for('listar_materiais') }}">Materiais</a>
|
<a class="nav-link" href="{{ url_for('listar_materiais') }}">Materiais</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="{{ url_for('listar_relatorios_vendas') }}">Vendas</a>
|
||||||
|
</li>
|
||||||
|
<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">
|
||||||
|
<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>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item dropdown">
|
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown">
|
||||||
|
Configurações
|
||||||
|
</a>
|
||||||
|
<ul class="dropdown-menu">
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="navbar-nav">
|
<ul class="navbar-nav">
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="{{ url_for('logout') }}">
|
<a class="nav-link" href="{{ url_for('logout') }}">Sair</a>
|
||||||
<i class="fas fa-sign-out-alt"></i> Sair
|
|
||||||
</a>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<div class="container mt-4">
|
<div class="container mt-4">
|
||||||
{% block content %}{% endblock %}
|
{% block content %}{% endblock %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{ bootstrap.load_js() }}
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||||
<!-- Adicionar Font Awesome para o ícone de Sair -->
|
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
|
|
||||||
|
|
||||||
{% if 'user_id' in session %}
|
|
||||||
<script>
|
|
||||||
// Verificar a sessão a cada minuto
|
|
||||||
setInterval(function() {
|
|
||||||
fetch('/check_session')
|
|
||||||
.then(response => response.json())
|
|
||||||
.then(data => {
|
|
||||||
if (data.expired) {
|
|
||||||
window.location.href = '/login';
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}, 60000);
|
|
||||||
</script>
|
|
||||||
{% endif %}
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
94
templates/editar_celula.html
Normal file
94
templates/editar_celula.html
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block title %}Editar Célula{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<h1 class="mb-4">Editar Célula</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 %}
|
||||||
|
|
||||||
|
<form method="POST" class="needs-validation" novalidate>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="nome" class="form-label">Nome</label>
|
||||||
|
<input type="text" class="form-control" id="nome" name="nome" value="{{ celula.nome }}" required>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, insira o nome da célula.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="setor_id" class="form-label">Setor</label>
|
||||||
|
<select class="form-select" id="setor_id" name="setor_id" required>
|
||||||
|
<option value="">Selecione um setor</option>
|
||||||
|
{% for setor in setores %}
|
||||||
|
<option value="{{ setor.id }}" {% if setor.id == celula.setor_id %}selected{% endif %}>{{ setor.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, selecione um setor.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="responsavel" class="form-label">Responsável</label>
|
||||||
|
<select class="form-select" id="responsavel" name="responsavel">
|
||||||
|
<option value="">Selecione um responsável</option>
|
||||||
|
{% for militante in militantes %}
|
||||||
|
<option value="{{ militante.id }}" {% if militante.id == celula.responsavel %}selected{% endif %}>{{ militante.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="responsavel_financas" class="form-label">Responsável Finanças</label>
|
||||||
|
<select class="form-select" id="responsavel_financas" name="responsavel_financas">
|
||||||
|
<option value="">Selecione um responsável financeiro</option>
|
||||||
|
{% for militante in militantes %}
|
||||||
|
<option value="{{ militante.id }}" {% if militante.id == celula.responsavel_financas %}selected{% endif %}>{{ militante.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="d-flex justify-content-between mt-4">
|
||||||
|
<button type="submit" class="btn btn-primary">Salvar</button>
|
||||||
|
<a href="{{ url_for('listar_celulas') }}" class="btn btn-secondary">Cancelar</a>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// Validação do formulário
|
||||||
|
(function () {
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
var forms = document.querySelectorAll('.needs-validation')
|
||||||
|
|
||||||
|
Array.prototype.slice.call(forms)
|
||||||
|
.forEach(function (form) {
|
||||||
|
form.addEventListener('submit', function (event) {
|
||||||
|
if (!form.checkValidity()) {
|
||||||
|
event.preventDefault()
|
||||||
|
event.stopPropagation()
|
||||||
|
}
|
||||||
|
|
||||||
|
form.classList.add('was-validated')
|
||||||
|
}, false)
|
||||||
|
})
|
||||||
|
})()
|
||||||
|
</script>
|
||||||
|
{% endblock %}
|
||||||
94
templates/editar_comite.html
Normal file
94
templates/editar_comite.html
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block title %}Editar Comitê Regional{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<h1 class="mb-4">Editar Comitê Regional</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 %}
|
||||||
|
|
||||||
|
<form method="POST" class="needs-validation" novalidate>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="nome" class="form-label">Nome</label>
|
||||||
|
<input type="text" class="form-control" id="nome" name="nome" value="{{ comite.nome }}" required>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, insira o nome do comitê regional.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="comite_central_id" class="form-label">Comitê Central</label>
|
||||||
|
<select class="form-select" id="comite_central_id" name="comite_central_id" required>
|
||||||
|
<option value="">Selecione um comitê central</option>
|
||||||
|
{% for comite_central in comites_centrais %}
|
||||||
|
<option value="{{ comite_central.id }}" {% if comite_central.id == comite.comite_central_id %}selected{% endif %}>{{ comite_central.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, selecione um comitê central.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="responsavel" class="form-label">Responsável</label>
|
||||||
|
<select class="form-select" id="responsavel" name="responsavel">
|
||||||
|
<option value="">Selecione um responsável</option>
|
||||||
|
{% for militante in militantes %}
|
||||||
|
<option value="{{ militante.id }}" {% if militante.id == comite.responsavel %}selected{% endif %}>{{ militante.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="responsavel_financas" class="form-label">Responsável Finanças</label>
|
||||||
|
<select class="form-select" id="responsavel_financas" name="responsavel_financas">
|
||||||
|
<option value="">Selecione um responsável financeiro</option>
|
||||||
|
{% for militante in militantes %}
|
||||||
|
<option value="{{ militante.id }}" {% if militante.id == comite.responsavel_financas %}selected{% endif %}>{{ militante.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="d-flex justify-content-between mt-4">
|
||||||
|
<button type="submit" class="btn btn-primary">Salvar</button>
|
||||||
|
<a href="{{ url_for('listar_comites') }}" class="btn btn-secondary">Cancelar</a>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// Validação do formulário
|
||||||
|
(function () {
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
var forms = document.querySelectorAll('.needs-validation')
|
||||||
|
|
||||||
|
Array.prototype.slice.call(forms)
|
||||||
|
.forEach(function (form) {
|
||||||
|
form.addEventListener('submit', function (event) {
|
||||||
|
if (!form.checkValidity()) {
|
||||||
|
event.preventDefault()
|
||||||
|
event.stopPropagation()
|
||||||
|
}
|
||||||
|
|
||||||
|
form.classList.add('was-validated')
|
||||||
|
}, false)
|
||||||
|
})
|
||||||
|
})()
|
||||||
|
</script>
|
||||||
|
{% endblock %}
|
||||||
81
templates/editar_comite_central.html
Normal file
81
templates/editar_comite_central.html
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block title %}Editar Comitê Central{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<h1 class="mb-4">Editar Comitê Central</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 %}
|
||||||
|
|
||||||
|
<form method="POST" class="needs-validation" novalidate>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="nome" class="form-label">Nome</label>
|
||||||
|
<input type="text" class="form-control" id="nome" name="nome" value="{{ comite.nome }}" required>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, insira o nome do comitê central.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="responsavel" class="form-label">Responsável</label>
|
||||||
|
<select class="form-select" id="responsavel" name="responsavel">
|
||||||
|
<option value="">Selecione um responsável</option>
|
||||||
|
{% for militante in militantes %}
|
||||||
|
<option value="{{ militante.id }}" {% if militante.id == comite.responsavel %}selected{% endif %}>{{ militante.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="responsavel_financas" class="form-label">Responsável Finanças</label>
|
||||||
|
<select class="form-select" id="responsavel_financas" name="responsavel_financas">
|
||||||
|
<option value="">Selecione um responsável financeiro</option>
|
||||||
|
{% for militante in militantes %}
|
||||||
|
<option value="{{ militante.id }}" {% if militante.id == comite.responsavel_financas %}selected{% endif %}>{{ militante.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="d-flex justify-content-between mt-4">
|
||||||
|
<button type="submit" class="btn btn-primary">Salvar</button>
|
||||||
|
<a href="{{ url_for('listar_comites_centrais') }}" class="btn btn-secondary">Cancelar</a>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// Validação do formulário
|
||||||
|
(function () {
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
var forms = document.querySelectorAll('.needs-validation')
|
||||||
|
|
||||||
|
Array.prototype.slice.call(forms)
|
||||||
|
.forEach(function (form) {
|
||||||
|
form.addEventListener('submit', function (event) {
|
||||||
|
if (!form.checkValidity()) {
|
||||||
|
event.preventDefault()
|
||||||
|
event.stopPropagation()
|
||||||
|
}
|
||||||
|
|
||||||
|
form.classList.add('was-validated')
|
||||||
|
}, false)
|
||||||
|
})
|
||||||
|
})()
|
||||||
|
</script>
|
||||||
|
{% endblock %}
|
||||||
94
templates/editar_material.html
Normal file
94
templates/editar_material.html
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block title %}Editar Material{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<h1 class="mb-4">Editar Material</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 %}
|
||||||
|
|
||||||
|
<form method="POST" class="needs-validation" novalidate>
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="nome" class="form-label">Nome</label>
|
||||||
|
<input type="text" class="form-control" id="nome" name="nome" value="{{ material.nome }}" required>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, insira o nome do material.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="descricao" class="form-label">Descrição</label>
|
||||||
|
<textarea class="form-control" id="descricao" name="descricao" rows="3" required>{{ material.descricao }}</textarea>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, insira a descrição do material.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="preco" class="form-label">Preço</label>
|
||||||
|
<input type="number" class="form-control" id="preco" name="preco" step="0.01" value="{{ material.preco }}" required>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, insira o preço do material.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="quantidade" class="form-label">Quantidade</label>
|
||||||
|
<input type="number" class="form-control" id="quantidade" name="quantidade" value="{{ material.quantidade }}" required>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, insira a quantidade do material.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="tipo_id" class="form-label">Tipo de Material</label>
|
||||||
|
<select class="form-select" id="tipo_id" name="tipo_id" required>
|
||||||
|
<option value="">Selecione um tipo</option>
|
||||||
|
{% for tipo in tipos %}
|
||||||
|
<option value="{{ tipo.id }}" {% if tipo.id == material.tipo_id %}selected{% endif %}>{{ tipo.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, selecione o tipo do material.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="d-flex justify-content-between">
|
||||||
|
<button type="submit" class="btn btn-success">Salvar</button>
|
||||||
|
<a href="{{ url_for('listar_materiais') }}" class="btn btn-outline-secondary">Voltar</a>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// Validação do formulário
|
||||||
|
(function () {
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
var forms = document.querySelectorAll('.needs-validation')
|
||||||
|
|
||||||
|
Array.prototype.slice.call(forms)
|
||||||
|
.forEach(function (form) {
|
||||||
|
form.addEventListener('submit', function (event) {
|
||||||
|
if (!form.checkValidity()) {
|
||||||
|
event.preventDefault()
|
||||||
|
event.stopPropagation()
|
||||||
|
}
|
||||||
|
|
||||||
|
form.classList.add('was-validated')
|
||||||
|
}, false)
|
||||||
|
})
|
||||||
|
})()
|
||||||
|
</script>
|
||||||
|
{% endblock %}
|
||||||
@@ -3,7 +3,10 @@
|
|||||||
{% block title %}Editar Militante{% endblock %}
|
{% block title %}Editar Militante{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>Editar Militante</h1>
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<h1 class="mb-4">Editar Militante</h1>
|
||||||
|
|
||||||
{% with messages = get_flashed_messages(with_categories=true) %}
|
{% with messages = get_flashed_messages(with_categories=true) %}
|
||||||
{% if messages %}
|
{% if messages %}
|
||||||
@@ -13,22 +16,180 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
|
|
||||||
<form method="post">
|
<form method="POST" class="needs-validation" novalidate>
|
||||||
Nome: <input type="text" name="nome" required
|
<div class="row">
|
||||||
value="{{ militante.nome }}"><br>
|
<div class="col-md-6 mb-3">
|
||||||
CPF: <input type="text" name="cpf" required
|
<label for="nome" class="form-label">Nome</label>
|
||||||
value="{{ militante.cpf }}"
|
<input type="text" class="form-control" id="nome" name="nome" value="{{ militante.nome }}" required>
|
||||||
pattern="\d{3}\.?\d{3}\.?\d{3}-?\d{2}"
|
<div class="invalid-feedback">
|
||||||
title="Digite um CPF no formato: xxx.xxx.xxx-xx"><br>
|
Por favor, insira o nome do militante.
|
||||||
Email: <input type="email" name="email" required
|
</div>
|
||||||
value="{{ militante.email }}"><br>
|
</div>
|
||||||
Telefone: <input type="text" name="telefone"
|
|
||||||
value="{{ militante.telefone }}"><br>
|
<div class="col-md-6 mb-3">
|
||||||
Endereço: <input type="text" name="endereco"
|
<label for="cpf" class="form-label">CPF</label>
|
||||||
value="{{ militante.endereco }}"><br>
|
<input type="text" class="form-control" id="cpf" name="cpf" value="{{ militante.cpf }}" required>
|
||||||
Filiado: <input type="checkbox" name="filiado"
|
<div class="invalid-feedback">
|
||||||
{% if militante.filiado %}checked{% endif %}><br>
|
Por favor, insira o CPF do militante.
|
||||||
<input type="submit" value="Salvar" class="btn btn-primary">
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="titulo_eleitoral" class="form-label">Título Eleitoral</label>
|
||||||
|
<input type="text" class="form-control" id="titulo_eleitoral" name="titulo_eleitoral" value="{{ militante.titulo_eleitoral }}">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="data_nascimento" class="form-label">Data de Nascimento</label>
|
||||||
|
<input type="date" class="form-control" id="data_nascimento" name="data_nascimento" value="{{ militante.data_nascimento.strftime('%Y-%m-%d') }}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="data_entrada_oci" class="form-label">Data de Entrada na OCI</label>
|
||||||
|
<input type="date" class="form-control" id="data_entrada_oci" name="data_entrada_oci" value="{{ militante.data_entrada_oci.strftime('%Y-%m-%d') }}">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="data_efetivacao_oci" class="form-label">Data de Efetivação na OCI</label>
|
||||||
|
<input type="date" class="form-control" id="data_efetivacao_oci" name="data_efetivacao_oci" value="{{ militante.data_efetivacao_oci.strftime('%Y-%m-%d') }}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="telefone1" class="form-label">Telefone 1</label>
|
||||||
|
<input type="text" class="form-control" id="telefone1" name="telefone1" value="{{ militante.telefone1 }}">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="telefone2" class="form-label">Telefone 2</label>
|
||||||
|
<input type="text" class="form-control" id="telefone2" name="telefone2" value="{{ militante.telefone2 }}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="profissao" class="form-label">Profissão</label>
|
||||||
|
<input type="text" class="form-control" id="profissao" name="profissao" value="{{ militante.profissao }}">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="regime_trabalho" class="form-label">Regime de Trabalho</label>
|
||||||
|
<input type="text" class="form-control" id="regime_trabalho" name="regime_trabalho" value="{{ militante.regime_trabalho }}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="empresa" class="form-label">Empresa</label>
|
||||||
|
<input type="text" class="form-control" id="empresa" name="empresa" value="{{ militante.empresa }}">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="contratante" class="form-label">Contratante</label>
|
||||||
|
<input type="text" class="form-control" id="contratante" name="contratante" value="{{ militante.contratante }}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="instituicao_ensino" class="form-label">Instituição de Ensino</label>
|
||||||
|
<input type="text" class="form-control" id="instituicao_ensino" name="instituicao_ensino" value="{{ militante.instituicao_ensino }}">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="tipo_instituicao" class="form-label">Tipo de Instituição</label>
|
||||||
|
<input type="text" class="form-control" id="tipo_instituicao" name="tipo_instituicao" value="{{ militante.tipo_instituicao }}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="sindicato" class="form-label">Sindicato</label>
|
||||||
|
<input type="text" class="form-control" id="sindicato" name="sindicato" value="{{ militante.sindicato }}">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="cargo_sindical" class="form-label">Cargo Sindical</label>
|
||||||
|
<input type="text" class="form-control" id="cargo_sindical" name="cargo_sindical" value="{{ militante.cargo_sindical }}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<div class="form-check">
|
||||||
|
<input class="form-check-input" type="checkbox" id="dirigente_sindical" name="dirigente_sindical" {% if militante.dirigente_sindical %}checked{% endif %}>
|
||||||
|
<label class="form-check-label" for="dirigente_sindical">
|
||||||
|
Dirigente Sindical
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="central_sindical" class="form-label">Central Sindical</label>
|
||||||
|
<input type="text" class="form-control" id="central_sindical" name="central_sindical" value="{{ militante.central_sindical }}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="setor_id" class="form-label">Setor</label>
|
||||||
|
<select class="form-select" id="setor_id" name="setor_id" required>
|
||||||
|
<option value="">Selecione um setor</option>
|
||||||
|
{% for setor in setores %}
|
||||||
|
<option value="{{ setor.id }}" {% if setor.id == militante.setor_id %}selected{% endif %}>{{ setor.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, selecione um setor.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="celula_id" class="form-label">Célula</label>
|
||||||
|
<select class="form-select" id="celula_id" name="celula_id" required>
|
||||||
|
<option value="">Selecione uma célula</option>
|
||||||
|
{% for celula in celulas %}
|
||||||
|
<option value="{{ celula.id }}" {% if celula.id == militante.celula_id %}selected{% endif %}>{{ celula.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, selecione uma célula.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="d-flex justify-content-between mt-4">
|
||||||
|
<button type="submit" class="btn btn-primary">Salvar</button>
|
||||||
<a href="{{ url_for('listar_militantes') }}" class="btn btn-secondary">Cancelar</a>
|
<a href="{{ url_for('listar_militantes') }}" class="btn btn-secondary">Cancelar</a>
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// Validação do formulário
|
||||||
|
(function () {
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
var forms = document.querySelectorAll('.needs-validation')
|
||||||
|
|
||||||
|
Array.prototype.slice.call(forms)
|
||||||
|
.forEach(function (form) {
|
||||||
|
form.addEventListener('submit', function (event) {
|
||||||
|
if (!form.checkValidity()) {
|
||||||
|
event.preventDefault()
|
||||||
|
event.stopPropagation()
|
||||||
|
}
|
||||||
|
|
||||||
|
form.classList.add('was-validated')
|
||||||
|
}, false)
|
||||||
|
})
|
||||||
|
})()
|
||||||
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
91
templates/editar_relatorio_cotas.html
Normal file
91
templates/editar_relatorio_cotas.html
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block title %}Editar Relatório de Cotas{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<h1 class="mb-4">Editar Relatório de Cotas</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 %}
|
||||||
|
|
||||||
|
<form method="POST" class="needs-validation" novalidate>
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="setor_id" class="form-label">Setor</label>
|
||||||
|
<select class="form-select" id="setor_id" name="setor_id" required>
|
||||||
|
<option value="">Selecione um setor</option>
|
||||||
|
{% for setor in setores %}
|
||||||
|
<option value="{{ setor.id }}" {% if setor.id == relatorio.setor_id %}selected{% endif %}>{{ setor.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, selecione o setor.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="comite_id" class="form-label">Comitê Central</label>
|
||||||
|
<select class="form-select" id="comite_id" name="comite_id" required>
|
||||||
|
<option value="">Selecione um comitê</option>
|
||||||
|
{% for comite in comites %}
|
||||||
|
<option value="{{ comite.id }}" {% if comite.id == relatorio.comite_id %}selected{% endif %}>{{ comite.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, selecione o comitê central.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="total_cotas" class="form-label">Total de Cotas</label>
|
||||||
|
<input type="number" class="form-control" id="total_cotas" name="total_cotas" step="0.01" value="{{ relatorio.total_cotas }}" required>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, insira o total de cotas.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="data_relatorio" class="form-label">Data do Relatório</label>
|
||||||
|
<input type="date" class="form-control" id="data_relatorio" name="data_relatorio" value="{{ relatorio.data_relatorio.strftime('%Y-%m-%d') }}" required>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, insira a data do relatório.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="d-flex justify-content-between">
|
||||||
|
<button type="submit" class="btn btn-success">Salvar</button>
|
||||||
|
<a href="{{ url_for('listar_relatorios_cotas') }}" class="btn btn-outline-secondary">Voltar</a>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// Validação do formulário
|
||||||
|
(function () {
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
var forms = document.querySelectorAll('.needs-validation')
|
||||||
|
|
||||||
|
Array.prototype.slice.call(forms)
|
||||||
|
.forEach(function (form) {
|
||||||
|
form.addEventListener('submit', function (event) {
|
||||||
|
if (!form.checkValidity()) {
|
||||||
|
event.preventDefault()
|
||||||
|
event.stopPropagation()
|
||||||
|
}
|
||||||
|
|
||||||
|
form.classList.add('was-validated')
|
||||||
|
}, false)
|
||||||
|
})
|
||||||
|
})()
|
||||||
|
</script>
|
||||||
|
{% endblock %}
|
||||||
91
templates/editar_relatorio_pagamentos.html
Normal file
91
templates/editar_relatorio_pagamentos.html
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block title %}Editar Relatório de Pagamentos{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<h1 class="mb-4">Editar Relatório de Pagamentos</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 %}
|
||||||
|
|
||||||
|
<form method="POST" class="needs-validation" novalidate>
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="setor_id" class="form-label">Setor</label>
|
||||||
|
<select class="form-select" id="setor_id" name="setor_id" required>
|
||||||
|
<option value="">Selecione um setor</option>
|
||||||
|
{% for setor in setores %}
|
||||||
|
<option value="{{ setor.id }}" {% if setor.id == relatorio.setor_id %}selected{% endif %}>{{ setor.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, selecione o setor.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="comite_id" class="form-label">Comitê Central</label>
|
||||||
|
<select class="form-select" id="comite_id" name="comite_id" required>
|
||||||
|
<option value="">Selecione um comitê</option>
|
||||||
|
{% for comite in comites %}
|
||||||
|
<option value="{{ comite.id }}" {% if comite.id == relatorio.comite_id %}selected{% endif %}>{{ comite.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, selecione o comitê central.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="total_pagamentos" class="form-label">Total de Pagamentos</label>
|
||||||
|
<input type="number" class="form-control" id="total_pagamentos" name="total_pagamentos" step="0.01" value="{{ relatorio.total_pagamentos }}" required>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, insira o total de pagamentos.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="data_relatorio" class="form-label">Data do Relatório</label>
|
||||||
|
<input type="date" class="form-control" id="data_relatorio" name="data_relatorio" value="{{ relatorio.data_relatorio.strftime('%Y-%m-%d') }}" required>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, insira a data do relatório.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="d-flex justify-content-between">
|
||||||
|
<button type="submit" class="btn btn-success">Salvar</button>
|
||||||
|
<a href="{{ url_for('listar_relatorios_pagamentos') }}" class="btn btn-outline-secondary">Voltar</a>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// Validação do formulário
|
||||||
|
(function () {
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
var forms = document.querySelectorAll('.needs-validation')
|
||||||
|
|
||||||
|
Array.prototype.slice.call(forms)
|
||||||
|
.forEach(function (form) {
|
||||||
|
form.addEventListener('submit', function (event) {
|
||||||
|
if (!form.checkValidity()) {
|
||||||
|
event.preventDefault()
|
||||||
|
event.stopPropagation()
|
||||||
|
}
|
||||||
|
|
||||||
|
form.classList.add('was-validated')
|
||||||
|
}, false)
|
||||||
|
})
|
||||||
|
})()
|
||||||
|
</script>
|
||||||
|
{% endblock %}
|
||||||
91
templates/editar_relatorio_vendas.html
Normal file
91
templates/editar_relatorio_vendas.html
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block title %}Editar Relatório de Vendas{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<h1 class="mb-4">Editar Relatório de Vendas</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 %}
|
||||||
|
|
||||||
|
<form method="POST" class="needs-validation" novalidate>
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="setor_id" class="form-label">Setor</label>
|
||||||
|
<select class="form-select" id="setor_id" name="setor_id" required>
|
||||||
|
<option value="">Selecione um setor</option>
|
||||||
|
{% for setor in setores %}
|
||||||
|
<option value="{{ setor.id }}" {% if setor.id == relatorio.setor_id %}selected{% endif %}>{{ setor.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, selecione o setor.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="comite_id" class="form-label">Comitê Central</label>
|
||||||
|
<select class="form-select" id="comite_id" name="comite_id" required>
|
||||||
|
<option value="">Selecione um comitê</option>
|
||||||
|
{% for comite in comites %}
|
||||||
|
<option value="{{ comite.id }}" {% if comite.id == relatorio.comite_id %}selected{% endif %}>{{ comite.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, selecione o comitê central.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="total_vendas" class="form-label">Total de Vendas</label>
|
||||||
|
<input type="number" class="form-control" id="total_vendas" name="total_vendas" step="0.01" value="{{ relatorio.total_vendas }}" required>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, insira o total de vendas.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="data_relatorio" class="form-label">Data do Relatório</label>
|
||||||
|
<input type="date" class="form-control" id="data_relatorio" name="data_relatorio" value="{{ relatorio.data_relatorio.strftime('%Y-%m-%d') }}" required>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, insira a data do relatório.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="d-flex justify-content-between">
|
||||||
|
<button type="submit" class="btn btn-success">Salvar</button>
|
||||||
|
<a href="{{ url_for('listar_relatorios_vendas') }}" class="btn btn-outline-secondary">Voltar</a>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// Validação do formulário
|
||||||
|
(function () {
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
var forms = document.querySelectorAll('.needs-validation')
|
||||||
|
|
||||||
|
Array.prototype.slice.call(forms)
|
||||||
|
.forEach(function (form) {
|
||||||
|
form.addEventListener('submit', function (event) {
|
||||||
|
if (!form.checkValidity()) {
|
||||||
|
event.preventDefault()
|
||||||
|
event.stopPropagation()
|
||||||
|
}
|
||||||
|
|
||||||
|
form.classList.add('was-validated')
|
||||||
|
}, false)
|
||||||
|
})
|
||||||
|
})()
|
||||||
|
</script>
|
||||||
|
{% endblock %}
|
||||||
1
templates/editar_setor.html
Normal file
1
templates/editar_setor.html
Normal file
@@ -0,0 +1 @@
|
|||||||
|
|
||||||
74
templates/editar_tipo_material.html
Normal file
74
templates/editar_tipo_material.html
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block title %}Editar Tipo de Material{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<h1 class="mb-4">Editar Tipo de Material</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 %}
|
||||||
|
|
||||||
|
<form method="POST" class="needs-validation" novalidate>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="nome" class="form-label">Nome</label>
|
||||||
|
<input type="text" class="form-control" id="nome" name="nome" value="{{ tipo.nome }}" required>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, insira o nome do tipo de material.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="preco" class="form-label">Preço</label>
|
||||||
|
<input type="number" class="form-control" id="preco" name="preco" step="0.01" min="0" value="{{ tipo.preco }}" required>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, insira o preço do tipo de material.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12 mb-3">
|
||||||
|
<label for="descricao" class="form-label">Descrição</label>
|
||||||
|
<textarea class="form-control" id="descricao" name="descricao" rows="3">{{ tipo.descricao }}</textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="d-flex justify-content-between mt-4">
|
||||||
|
<button type="submit" class="btn btn-primary">Salvar</button>
|
||||||
|
<a href="{{ url_for('listar_tipos_materiais') }}" class="btn btn-secondary">Cancelar</a>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// Validação do formulário
|
||||||
|
(function () {
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
var forms = document.querySelectorAll('.needs-validation')
|
||||||
|
|
||||||
|
Array.prototype.slice.call(forms)
|
||||||
|
.forEach(function (form) {
|
||||||
|
form.addEventListener('submit', function (event) {
|
||||||
|
if (!form.checkValidity()) {
|
||||||
|
event.preventDefault()
|
||||||
|
event.stopPropagation()
|
||||||
|
}
|
||||||
|
|
||||||
|
form.classList.add('was-validated')
|
||||||
|
}, false)
|
||||||
|
})
|
||||||
|
})()
|
||||||
|
</script>
|
||||||
|
{% endblock %}
|
||||||
124
templates/editar_venda.html
Normal file
124
templates/editar_venda.html
Normal file
@@ -0,0 +1,124 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block title %}Editar Venda{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<h1 class="mb-4">Editar Venda</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 %}
|
||||||
|
|
||||||
|
<form method="POST" class="needs-validation" novalidate>
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="militante_id" class="form-label">Militante</label>
|
||||||
|
<select class="form-select" id="militante_id" name="militante_id" required>
|
||||||
|
<option value="">Selecione um militante</option>
|
||||||
|
{% for militante in militantes %}
|
||||||
|
<option value="{{ militante.id }}" {% if militante.id == venda.militante_id %}selected{% endif %}>{{ militante.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, selecione o militante.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="material_id" class="form-label">Material</label>
|
||||||
|
<select class="form-select" id="material_id" name="material_id" required>
|
||||||
|
<option value="">Selecione um material</option>
|
||||||
|
{% for material in materiais %}
|
||||||
|
<option value="{{ material.id }}" data-preco="{{ material.preco }}" {% if material.id == venda.material_id %}selected{% endif %}>{{ material.nome }} - R$ {{ "%.2f"|format(material.preco) }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, selecione o material.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="quantidade" class="form-label">Quantidade</label>
|
||||||
|
<input type="number" class="form-control" id="quantidade" name="quantidade" min="1" value="{{ venda.quantidade }}" required>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, insira a quantidade.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="valor_total" class="form-label">Valor Total</label>
|
||||||
|
<input type="number" class="form-control" id="valor_total" name="valor_total" step="0.01" value="{{ venda.valor_total }}" readonly required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="data_venda" class="form-label">Data da Venda</label>
|
||||||
|
<input type="date" class="form-control" id="data_venda" name="data_venda" value="{{ venda.data_venda.strftime('%Y-%m-%d') }}" required>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, insira a data da venda.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="d-flex justify-content-between">
|
||||||
|
<button type="submit" class="btn btn-success">Salvar</button>
|
||||||
|
<a href="{{ url_for('listar_vendas') }}" class="btn btn-outline-secondary">Voltar</a>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// Validação do formulário
|
||||||
|
(function () {
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
var forms = document.querySelectorAll('.needs-validation')
|
||||||
|
|
||||||
|
Array.prototype.slice.call(forms)
|
||||||
|
.forEach(function (form) {
|
||||||
|
form.addEventListener('submit', function (event) {
|
||||||
|
if (!form.checkValidity()) {
|
||||||
|
event.preventDefault()
|
||||||
|
event.stopPropagation()
|
||||||
|
}
|
||||||
|
|
||||||
|
form.classList.add('was-validated')
|
||||||
|
}, false)
|
||||||
|
})
|
||||||
|
})()
|
||||||
|
|
||||||
|
// Cálculo do valor total
|
||||||
|
document.getElementById('material_id').addEventListener('change', function() {
|
||||||
|
calcularValorTotal();
|
||||||
|
});
|
||||||
|
|
||||||
|
document.getElementById('quantidade').addEventListener('input', function() {
|
||||||
|
calcularValorTotal();
|
||||||
|
});
|
||||||
|
|
||||||
|
function calcularValorTotal() {
|
||||||
|
const materialSelect = document.getElementById('material_id');
|
||||||
|
const quantidadeInput = document.getElementById('quantidade');
|
||||||
|
const valorTotalInput = document.getElementById('valor_total');
|
||||||
|
|
||||||
|
if (materialSelect.value && quantidadeInput.value) {
|
||||||
|
const preco = parseFloat(materialSelect.options[materialSelect.selectedIndex].dataset.preco);
|
||||||
|
const quantidade = parseFloat(quantidadeInput.value);
|
||||||
|
const valorTotal = preco * quantidade;
|
||||||
|
|
||||||
|
valorTotalInput.value = valorTotal.toFixed(2);
|
||||||
|
} else {
|
||||||
|
valorTotalInput.value = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Calcular valor total inicial
|
||||||
|
calcularValorTotal();
|
||||||
|
</script>
|
||||||
|
{% endblock %}
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
{% block title %}Início{% endblock %}
|
{% block title %}Home{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-8 offset-md-2">
|
<div class="col-md-12">
|
||||||
<h2 class="mb-4">Menu do Sistema</h2>
|
<h1 class="mb-4">Bem-vindo, {{ current_user.username }}!</h1>
|
||||||
|
|
||||||
{% with messages = get_flashed_messages(with_categories=true) %}
|
{% with messages = get_flashed_messages(with_categories=true) %}
|
||||||
{% if messages %}
|
{% if messages %}
|
||||||
@@ -16,12 +16,83 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
|
|
||||||
<div class="list-group">
|
<div class="row">
|
||||||
{% for url, nome in links %}
|
<div class="col-md-4">
|
||||||
<a href="{{ url }}" class="list-group-item list-group-item-action">
|
<div class="card mb-4">
|
||||||
{{ nome }}
|
<div class="card-header">
|
||||||
</a>
|
<h5 class="card-title">Militantes</h5>
|
||||||
{% endfor %}
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<p class="card-text">Gerencie os militantes da organização.</p>
|
||||||
|
<a href="{{ url_for('listar_militantes') }}" class="btn btn-primary">Listar Militantes</a>
|
||||||
|
<a href="{{ url_for('novo_militante') }}" class="btn btn-success">Novo Militante</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-4">
|
||||||
|
<div class="card mb-4">
|
||||||
|
<div class="card-header">
|
||||||
|
<h5 class="card-title">Pagamentos</h5>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<p class="card-text">Gerencie os pagamentos dos militantes.</p>
|
||||||
|
<a href="{{ url_for('listar_pagamentos') }}" class="btn btn-primary">Listar Pagamentos</a>
|
||||||
|
<a href="{{ url_for('novo_pagamento') }}" class="btn btn-success">Novo Pagamento</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-4">
|
||||||
|
<div class="card mb-4">
|
||||||
|
<div class="card-header">
|
||||||
|
<h5 class="card-title">Materiais</h5>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<p class="card-text">Gerencie os materiais da organização.</p>
|
||||||
|
<a href="{{ url_for('listar_materiais') }}" class="btn btn-primary">Listar Materiais</a>
|
||||||
|
<a href="{{ url_for('novo_material') }}" class="btn btn-success">Novo Material</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-4">
|
||||||
|
<div class="card mb-4">
|
||||||
|
<div class="card-header">
|
||||||
|
<h5 class="card-title">Vendas</h5>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<p class="card-text">Gerencie as vendas de materiais.</p>
|
||||||
|
<a href="{{ url_for('listar_relatorios_vendas') }}" class="btn btn-primary">Listar Vendas</a>
|
||||||
|
<a href="{{ url_for('novo_relatorio_vendas') }}" class="btn btn-success">Nova Venda</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-4">
|
||||||
|
<div class="card mb-4">
|
||||||
|
<div class="card-header">
|
||||||
|
<h5 class="card-title">Relatórios</h5>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<p class="card-text">Gerencie os relatórios da organização.</p>
|
||||||
|
<a href="{{ url_for('listar_relatorios_cotas') }}" class="btn btn-primary">Relatórios de Cotas</a>
|
||||||
|
<a href="{{ url_for('listar_relatorios_vendas') }}" class="btn btn-primary">Relatórios de Vendas</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-4">
|
||||||
|
<div class="card mb-4">
|
||||||
|
<div class="card-header">
|
||||||
|
<h5 class="card-title">Configurações</h5>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<p class="card-text">Gerencie as configurações da organização.</p>
|
||||||
|
<a href="{{ url_for('novo_usuario') }}" class="btn btn-primary">Novo Usuário</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
56
templates/listar_celulas.html
Normal file
56
templates/listar_celulas.html
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block title %}Listar Células{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<h1 class="mb-4">Lista de Células</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('nova_celula') }}" class="btn btn-success">Nova Célula</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>Responsável</th>
|
||||||
|
<th>Responsável Finanças</th>
|
||||||
|
<th>Setor</th>
|
||||||
|
<th>Ações</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for celula in celulas %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ celula.id }}</td>
|
||||||
|
<td>{{ celula.nome }}</td>
|
||||||
|
<td>{{ celula.responsavel_rel.nome if celula.responsavel_rel else '-' }}</td>
|
||||||
|
<td>{{ celula.responsavel_financas_rel.nome if celula.responsavel_financas_rel else '-' }}</td>
|
||||||
|
<td>{{ celula.setor.nome }}</td>
|
||||||
|
<td>
|
||||||
|
<a href="{{ url_for('editar_celula', id=celula.id) }}" class="btn btn-primary btn-sm">Editar</a>
|
||||||
|
<a href="{{ url_for('deletar_celula', id=celula.id) }}" class="btn btn-danger btn-sm" onclick="return confirm('Tem certeza que deseja excluir esta célula?')">Excluir</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
56
templates/listar_comites.html
Normal file
56
templates/listar_comites.html
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block title %}Listar Comitês Regionais{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<h1 class="mb-4">Lista de Comitês Regionais</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_comite') }}" class="btn btn-success">Novo Comitê Regional</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>Responsável</th>
|
||||||
|
<th>Responsável Finanças</th>
|
||||||
|
<th>Comitê Central</th>
|
||||||
|
<th>Ações</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for comite in comites %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ comite.id }}</td>
|
||||||
|
<td>{{ comite.nome }}</td>
|
||||||
|
<td>{{ comite.responsavel_rel.nome if comite.responsavel_rel else '-' }}</td>
|
||||||
|
<td>{{ comite.responsavel_financas_rel.nome if comite.responsavel_financas_rel else '-' }}</td>
|
||||||
|
<td>{{ comite.comite_central.nome }}</td>
|
||||||
|
<td>
|
||||||
|
<a href="{{ url_for('editar_comite', id=comite.id) }}" class="btn btn-primary btn-sm">Editar</a>
|
||||||
|
<a href="{{ url_for('deletar_comite', id=comite.id) }}" class="btn btn-danger btn-sm" onclick="return confirm('Tem certeza que deseja excluir este comitê regional?')">Excluir</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
54
templates/listar_comites_centrais.html
Normal file
54
templates/listar_comites_centrais.html
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block title %}Listar Comitês Centrais{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<h1 class="mb-4">Lista de Comitês Centrais</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_comite_central') }}" class="btn btn-success">Novo Comitê Central</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>Responsável</th>
|
||||||
|
<th>Responsável Finanças</th>
|
||||||
|
<th>Ações</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for comite in comites %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ comite.id }}</td>
|
||||||
|
<td>{{ comite.nome }}</td>
|
||||||
|
<td>{{ comite.responsavel_rel.nome if comite.responsavel_rel else '-' }}</td>
|
||||||
|
<td>{{ comite.responsavel_financas_rel.nome if comite.responsavel_financas_rel else '-' }}</td>
|
||||||
|
<td>
|
||||||
|
<a href="{{ url_for('editar_comite_central', id=comite.id) }}" class="btn btn-primary btn-sm">Editar</a>
|
||||||
|
<a href="{{ url_for('deletar_comite_central', id=comite.id) }}" class="btn btn-danger btn-sm" onclick="return confirm('Tem certeza que deseja excluir este comitê central?')">Excluir</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
@@ -1,33 +1,58 @@
|
|||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
{% block title %}Listar Militantes{% endblock %}
|
{% block title %}Listar Materiais{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>Materiais Vendidos</h1>
|
<div class="container">
|
||||||
<a href="{{ url_for('novo_material') }}">Adicionar Novo Material</a>
|
<div class="row">
|
||||||
<table border="1">
|
<div class="col-md-12">
|
||||||
|
<h1 class="mb-4">Lista de Materiais</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_material') }}" class="btn btn-success">Novo Material</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>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>ID</th>
|
<th>ID</th>
|
||||||
<th>Militante ID</th>
|
<th>Nome</th>
|
||||||
<th>Tipo Material</th>
|
|
||||||
<th>Descrição</th>
|
<th>Descrição</th>
|
||||||
<th>Valor</th>
|
<th>Preço</th>
|
||||||
<th>Data da Venda</th>
|
<th>Quantidade</th>
|
||||||
|
<th>Tipo</th>
|
||||||
|
<th>Ações</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for material in materiais %}
|
{% for material in materiais %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ material.id }}</td>
|
<td>{{ material.id }}</td>
|
||||||
<td>{{ material.militante_id }}</td>
|
<td>{{ material.nome }}</td>
|
||||||
<td>{{ material.tipo_material_id }}</td>
|
|
||||||
<td>{{ material.descricao }}</td>
|
<td>{{ material.descricao }}</td>
|
||||||
<td>R$ {{ material.valor }}</td>
|
<td>R$ {{ "%.2f"|format(material.preco) }}</td>
|
||||||
<td>{{ material.data_venda }}</td>
|
<td>{{ material.quantidade }}</td>
|
||||||
|
<td>{{ material.tipo.nome }}</td>
|
||||||
|
<td>
|
||||||
|
<a href="{{ url_for('editar_material', id=material.id) }}" class="btn btn-primary btn-sm">Editar</a>
|
||||||
|
<a href="{{ url_for('deletar_material', id=material.id) }}" class="btn btn-danger btn-sm" onclick="return confirm('Tem certeza que deseja excluir este material?')">Excluir</a>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<a href="{{ url_for('home') }}">Home</a>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -3,55 +3,86 @@
|
|||||||
{% block title %}Listar Militantes{% endblock %}
|
{% block title %}Listar Militantes{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="row">
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<h2>Lista de Militantes</h2>
|
<h1 class="mb-4">Lista de Militantes</h1>
|
||||||
<a href="{{ url_for('novo_militante') }}" class="btn btn-primary mb-3">Novo Militante</a>
|
|
||||||
|
|
||||||
|
{% 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">
|
<table class="table table-striped table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
<th>ID</th>
|
||||||
<th>Nome</th>
|
<th>Nome</th>
|
||||||
<th>CPF</th>
|
<th>CPF</th>
|
||||||
<th>Email</th>
|
<th>Título Eleitoral</th>
|
||||||
<th>Telefone</th>
|
<th>Data de Nascimento</th>
|
||||||
<th>Endereço</th>
|
<th>Data de Entrada</th>
|
||||||
<th>Filiado</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>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for militante in militantes %}
|
{% for militante in militantes %}
|
||||||
<tr class="clickable-row" data-href="{{ url_for('editar_militante', id=militante.id) }}">
|
<tr>
|
||||||
|
<td>{{ militante.id }}</td>
|
||||||
<td>{{ militante.nome }}</td>
|
<td>{{ militante.nome }}</td>
|
||||||
<td>{{ militante.cpf }}</td>
|
<td>{{ militante.cpf }}</td>
|
||||||
<td>{{ militante.email }}</td>
|
<td>{{ militante.titulo_eleitoral }}</td>
|
||||||
<td>{{ militante.telefone }}</td>
|
<td>{{ militante.data_nascimento.strftime('%d/%m/%Y') }}</td>
|
||||||
<td>{{ militante.endereco }}</td>
|
<td>{{ militante.data_entrada_oci.strftime('%d/%m/%Y') }}</td>
|
||||||
<td>{{ 'Sim' if militante.filiado else 'Não' }}</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>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</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 %}
|
{% endblock %}
|
||||||
@@ -1,32 +1,57 @@
|
|||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
{% block title %}Listar Militantes{% endblock %}
|
{% block title %}Listar Relatórios de Cotas{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>Relatórios de Cotas Mensais</h1>
|
<div class="container">
|
||||||
<a href="{{ url_for('novo_relatorio_cotas') }}">Adicionar Novo Relatório</a>
|
<div class="row">
|
||||||
<table border="1">
|
<div class="col-md-12">
|
||||||
|
<h1 class="mb-4">Lista de Relatórios de Cotas</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_relatorio_cotas') }}" class="btn btn-success">Novo Relatório</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>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>ID</th>
|
<th>ID</th>
|
||||||
<th>Setor ID</th>
|
<th>Setor</th>
|
||||||
<th>Comitê ID</th>
|
<th>Comitê Central</th>
|
||||||
<th>Total de Cotas</th>
|
<th>Total de Cotas</th>
|
||||||
<th>Data do Relatório</th>
|
<th>Data do Relatório</th>
|
||||||
|
<th>Ações</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for relatorio in relatorios %}
|
{% for relatorio in relatorios %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ relatorio.id }}</td>
|
<td>{{ relatorio.id }}</td>
|
||||||
<td>{{ relatorio.setor_id }}</td>
|
<td>{{ relatorio.setor.nome }}</td>
|
||||||
<td>{{ relatorio.comite_id }}</td>
|
<td>{{ relatorio.comite.nome }}</td>
|
||||||
<td>R$ {{ relatorio.total_cotas }}</td>
|
<td>R$ {{ "%.2f"|format(relatorio.total_cotas) }}</td>
|
||||||
<td>{{ relatorio.data_relatorio }}</td>
|
<td>{{ relatorio.data_relatorio.strftime('%d/%m/%Y') }}</td>
|
||||||
|
<td>
|
||||||
|
<a href="{{ url_for('editar_relatorio_cotas', id=relatorio.id) }}" class="btn btn-primary btn-sm">Editar</a>
|
||||||
|
<a href="{{ url_for('deletar_relatorio_cotas', id=relatorio.id) }}" class="btn btn-danger btn-sm" onclick="return confirm('Tem certeza que deseja excluir este relatório?')">Excluir</a>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<a href="{{ url_for('home') }}">Home</a>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|||||||
56
templates/listar_relatorios_pagamentos.html
Normal file
56
templates/listar_relatorios_pagamentos.html
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block title %}Listar Relatórios de Pagamentos{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<h1 class="mb-4">Lista de Relatórios de Pagamentos</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_relatorio_pagamentos') }}" class="btn btn-success">Novo Relatório</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>Setor</th>
|
||||||
|
<th>Comitê Central</th>
|
||||||
|
<th>Total de Pagamentos</th>
|
||||||
|
<th>Data do Relatório</th>
|
||||||
|
<th>Ações</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for relatorio in relatorios %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ relatorio.id }}</td>
|
||||||
|
<td>{{ relatorio.setor.nome }}</td>
|
||||||
|
<td>{{ relatorio.comite.nome }}</td>
|
||||||
|
<td>R$ {{ "%.2f"|format(relatorio.total_pagamentos) }}</td>
|
||||||
|
<td>{{ relatorio.data_relatorio.strftime('%d/%m/%Y') }}</td>
|
||||||
|
<td>
|
||||||
|
<a href="{{ url_for('editar_relatorio_pagamentos', id=relatorio.id) }}" class="btn btn-primary btn-sm">Editar</a>
|
||||||
|
<a href="{{ url_for('deletar_relatorio_pagamentos', id=relatorio.id) }}" class="btn btn-danger btn-sm" onclick="return confirm('Tem certeza que deseja excluir este relatório?')">Excluir</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
@@ -1,32 +1,56 @@
|
|||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
{% block title %}Listar Militantes{% endblock %}
|
{% block title %}Listar Relatórios de Vendas{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>Relatórios de Vendas de Materiais</h1>
|
<div class="container">
|
||||||
<a href="{{ url_for('novo_relatorio_vendas') }}">Adicionar Novo Relatório</a>
|
<div class="row">
|
||||||
<table border="1">
|
<div class="col-md-12">
|
||||||
|
<h1 class="mb-4">Lista de Relatórios de Vendas</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_relatorio_vendas') }}" class="btn btn-success">Novo Relatório</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>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>ID</th>
|
<th>ID</th>
|
||||||
<th>Setor ID</th>
|
<th>Setor</th>
|
||||||
<th>Comitê ID</th>
|
<th>Comitê Central</th>
|
||||||
<th>Total de Vendas</th>
|
<th>Total de Vendas</th>
|
||||||
<th>Data do Relatório</th>
|
<th>Data do Relatório</th>
|
||||||
|
<th>Ações</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for relatorio in relatorios %}
|
{% for relatorio in relatorios %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ relatorio.id }}</td>
|
<td>{{ relatorio.id }}</td>
|
||||||
<td>{{ relatorio.setor_id }}</td>
|
<td>{{ relatorio.setor.nome }}</td>
|
||||||
<td>{{ relatorio.comite_id }}</td>
|
<td>{{ relatorio.comite.nome }}</td>
|
||||||
<td>R$ {{ relatorio.total_vendas }}</td>
|
<td>R$ {{ "%.2f"|format(relatorio.total_vendas) }}</td>
|
||||||
<td>{{ relatorio.data_relatorio }}</td>
|
<td>{{ relatorio.data_relatorio.strftime('%d/%m/%Y') }}</td>
|
||||||
|
<td>
|
||||||
|
<a href="{{ url_for('editar_relatorio_vendas', id=relatorio.id) }}" class="btn btn-primary btn-sm">Editar</a>
|
||||||
|
<a href="{{ url_for('deletar_relatorio_vendas', id=relatorio.id) }}" class="btn btn-danger btn-sm" onclick="return confirm('Tem certeza que deseja excluir este relatório?')">Excluir</a>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<a href="{{ url_for('home') }}">Home</a>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
56
templates/listar_setores.html
Normal file
56
templates/listar_setores.html
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block title %}Listar Setores{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<h1 class="mb-4">Lista de Setores</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_setor') }}" class="btn btn-success">Novo Setor</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>Responsável</th>
|
||||||
|
<th>Responsável Finanças</th>
|
||||||
|
<th>Comitê Regional</th>
|
||||||
|
<th>Ações</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for setor in setores %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ setor.id }}</td>
|
||||||
|
<td>{{ setor.nome }}</td>
|
||||||
|
<td>{{ setor.responsavel_rel.nome if setor.responsavel_rel else '-' }}</td>
|
||||||
|
<td>{{ setor.responsavel_financas_rel.nome if setor.responsavel_financas_rel else '-' }}</td>
|
||||||
|
<td>{{ setor.comite_regional.nome }}</td>
|
||||||
|
<td>
|
||||||
|
<a href="{{ url_for('editar_setor', id=setor.id) }}" class="btn btn-primary btn-sm">Editar</a>
|
||||||
|
<a href="{{ url_for('deletar_setor', id=setor.id) }}" class="btn btn-danger btn-sm" onclick="return confirm('Tem certeza que deseja excluir este setor?')">Excluir</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
54
templates/listar_tipos_materiais.html
Normal file
54
templates/listar_tipos_materiais.html
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block title %}Listar Tipos de Materiais{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<h1 class="mb-4">Lista de Tipos de Materiais</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_tipo_material') }}" class="btn btn-success">Novo Tipo de Material</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>Descrição</th>
|
||||||
|
<th>Preço</th>
|
||||||
|
<th>Ações</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for tipo in tipos %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ tipo.id }}</td>
|
||||||
|
<td>{{ tipo.nome }}</td>
|
||||||
|
<td>{{ tipo.descricao }}</td>
|
||||||
|
<td>R$ {{ "%.2f"|format(tipo.preco) }}</td>
|
||||||
|
<td>
|
||||||
|
<a href="{{ url_for('editar_tipo_material', id=tipo.id) }}" class="btn btn-primary btn-sm">Editar</a>
|
||||||
|
<a href="{{ url_for('deletar_tipo_material', id=tipo.id) }}" class="btn btn-danger btn-sm" onclick="return confirm('Tem certeza que deseja excluir este tipo de material?')">Excluir</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
58
templates/listar_vendas.html
Normal file
58
templates/listar_vendas.html
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block title %}Listar Vendas{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<h1 class="mb-4">Lista de Vendas</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('nova_venda') }}" class="btn btn-success">Nova Venda</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>Militante</th>
|
||||||
|
<th>Material</th>
|
||||||
|
<th>Quantidade</th>
|
||||||
|
<th>Valor Total</th>
|
||||||
|
<th>Data da Venda</th>
|
||||||
|
<th>Ações</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for venda in vendas %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ venda.id }}</td>
|
||||||
|
<td>{{ venda.militante.nome }}</td>
|
||||||
|
<td>{{ venda.material.nome }}</td>
|
||||||
|
<td>{{ venda.quantidade }}</td>
|
||||||
|
<td>R$ {{ "%.2f"|format(venda.valor_total) }}</td>
|
||||||
|
<td>{{ venda.data_venda.strftime('%d/%m/%Y') }}</td>
|
||||||
|
<td>
|
||||||
|
<a href="{{ url_for('editar_venda', id=venda.id) }}" class="btn btn-primary btn-sm">Editar</a>
|
||||||
|
<a href="{{ url_for('deletar_venda', id=venda.id) }}" class="btn btn-danger btn-sm" onclick="return confirm('Tem certeza que deseja excluir esta venda?')">Excluir</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
94
templates/nova_celula.html
Normal file
94
templates/nova_celula.html
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block title %}Nova Célula{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<h1 class="mb-4">Nova Célula</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 %}
|
||||||
|
|
||||||
|
<form method="POST" class="needs-validation" novalidate>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="nome" class="form-label">Nome</label>
|
||||||
|
<input type="text" class="form-control" id="nome" name="nome" required>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, insira o nome da célula.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="setor_id" class="form-label">Setor</label>
|
||||||
|
<select class="form-select" id="setor_id" name="setor_id" required>
|
||||||
|
<option value="">Selecione um setor</option>
|
||||||
|
{% for setor in setores %}
|
||||||
|
<option value="{{ setor.id }}">{{ setor.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, selecione um setor.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="responsavel" class="form-label">Responsável</label>
|
||||||
|
<select class="form-select" id="responsavel" name="responsavel">
|
||||||
|
<option value="">Selecione um responsável</option>
|
||||||
|
{% for militante in militantes %}
|
||||||
|
<option value="{{ militante.id }}">{{ militante.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="responsavel_financas" class="form-label">Responsável Finanças</label>
|
||||||
|
<select class="form-select" id="responsavel_financas" name="responsavel_financas">
|
||||||
|
<option value="">Selecione um responsável financeiro</option>
|
||||||
|
{% for militante in militantes %}
|
||||||
|
<option value="{{ militante.id }}">{{ militante.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="d-flex justify-content-between mt-4">
|
||||||
|
<button type="submit" class="btn btn-primary">Salvar</button>
|
||||||
|
<a href="{{ url_for('listar_celulas') }}" class="btn btn-secondary">Cancelar</a>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// Validação do formulário
|
||||||
|
(function () {
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
var forms = document.querySelectorAll('.needs-validation')
|
||||||
|
|
||||||
|
Array.prototype.slice.call(forms)
|
||||||
|
.forEach(function (form) {
|
||||||
|
form.addEventListener('submit', function (event) {
|
||||||
|
if (!form.checkValidity()) {
|
||||||
|
event.preventDefault()
|
||||||
|
event.stopPropagation()
|
||||||
|
}
|
||||||
|
|
||||||
|
form.classList.add('was-validated')
|
||||||
|
}, false)
|
||||||
|
})
|
||||||
|
})()
|
||||||
|
</script>
|
||||||
|
{% endblock %}
|
||||||
121
templates/nova_venda.html
Normal file
121
templates/nova_venda.html
Normal file
@@ -0,0 +1,121 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block title %}Nova Venda{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<h1 class="mb-4">Nova Venda</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 %}
|
||||||
|
|
||||||
|
<form method="POST" class="needs-validation" novalidate>
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="militante_id" class="form-label">Militante</label>
|
||||||
|
<select class="form-select" id="militante_id" name="militante_id" required>
|
||||||
|
<option value="">Selecione um militante</option>
|
||||||
|
{% for militante in militantes %}
|
||||||
|
<option value="{{ militante.id }}">{{ militante.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, selecione o militante.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="material_id" class="form-label">Material</label>
|
||||||
|
<select class="form-select" id="material_id" name="material_id" required>
|
||||||
|
<option value="">Selecione um material</option>
|
||||||
|
{% for material in materiais %}
|
||||||
|
<option value="{{ material.id }}" data-preco="{{ material.preco }}">{{ material.nome }} - R$ {{ "%.2f"|format(material.preco) }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, selecione o material.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="quantidade" class="form-label">Quantidade</label>
|
||||||
|
<input type="number" class="form-control" id="quantidade" name="quantidade" min="1" required>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, insira a quantidade.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="valor_total" class="form-label">Valor Total</label>
|
||||||
|
<input type="number" class="form-control" id="valor_total" name="valor_total" step="0.01" readonly required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="data_venda" class="form-label">Data da Venda</label>
|
||||||
|
<input type="date" class="form-control" id="data_venda" name="data_venda" required>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, insira a data da venda.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="d-flex justify-content-between">
|
||||||
|
<button type="submit" class="btn btn-success">Registrar</button>
|
||||||
|
<a href="{{ url_for('listar_vendas') }}" class="btn btn-outline-secondary">Voltar</a>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// Validação do formulário
|
||||||
|
(function () {
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
var forms = document.querySelectorAll('.needs-validation')
|
||||||
|
|
||||||
|
Array.prototype.slice.call(forms)
|
||||||
|
.forEach(function (form) {
|
||||||
|
form.addEventListener('submit', function (event) {
|
||||||
|
if (!form.checkValidity()) {
|
||||||
|
event.preventDefault()
|
||||||
|
event.stopPropagation()
|
||||||
|
}
|
||||||
|
|
||||||
|
form.classList.add('was-validated')
|
||||||
|
}, false)
|
||||||
|
})
|
||||||
|
})()
|
||||||
|
|
||||||
|
// Cálculo do valor total
|
||||||
|
document.getElementById('material_id').addEventListener('change', function() {
|
||||||
|
calcularValorTotal();
|
||||||
|
});
|
||||||
|
|
||||||
|
document.getElementById('quantidade').addEventListener('input', function() {
|
||||||
|
calcularValorTotal();
|
||||||
|
});
|
||||||
|
|
||||||
|
function calcularValorTotal() {
|
||||||
|
const materialSelect = document.getElementById('material_id');
|
||||||
|
const quantidadeInput = document.getElementById('quantidade');
|
||||||
|
const valorTotalInput = document.getElementById('valor_total');
|
||||||
|
|
||||||
|
if (materialSelect.value && quantidadeInput.value) {
|
||||||
|
const preco = parseFloat(materialSelect.options[materialSelect.selectedIndex].dataset.preco);
|
||||||
|
const quantidade = parseFloat(quantidadeInput.value);
|
||||||
|
const valorTotal = preco * quantidade;
|
||||||
|
|
||||||
|
valorTotalInput.value = valorTotal.toFixed(2);
|
||||||
|
} else {
|
||||||
|
valorTotalInput.value = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
{% endblock %}
|
||||||
74
templates/novo_celula.html
Normal file
74
templates/novo_celula.html
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block title %}Nova Célula{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-8 offset-md-2">
|
||||||
|
<h1 class="mb-4">Nova Célula</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 %}
|
||||||
|
|
||||||
|
<form method="post" class="mb-4">
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="nome" class="form-label">Nome:</label>
|
||||||
|
<input type="text" class="form-control" id="nome" name="nome" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="setor_id" class="form-label">Setor:</label>
|
||||||
|
<select class="form-select" id="setor_id" name="setor_id" required>
|
||||||
|
<option value="">Selecione o setor</option>
|
||||||
|
{% for setor in setores %}
|
||||||
|
<option value="{{ setor.id }}">{{ setor.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="comite_regional_id" class="form-label">Comitê Regional:</label>
|
||||||
|
<select class="form-select" id="comite_regional_id" name="comite_regional_id" required>
|
||||||
|
<option value="">Selecione o comitê</option>
|
||||||
|
{% for comite in comites %}
|
||||||
|
<option value="{{ comite.id }}">{{ comite.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="responsavel" class="form-label">Responsável:</label>
|
||||||
|
<select class="form-select" id="responsavel" name="responsavel" required>
|
||||||
|
<option value="">Selecione o responsável</option>
|
||||||
|
{% for militante in militantes %}
|
||||||
|
<option value="{{ militante.id }}">{{ militante.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="responsavel_financas" class="form-label">Responsável por Finanças:</label>
|
||||||
|
<select class="form-select" id="responsavel_financas" name="responsavel_financas" required>
|
||||||
|
<option value="">Selecione o responsável</option>
|
||||||
|
{% for militante in militantes %}
|
||||||
|
<option value="{{ militante.id }}">{{ militante.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="d-flex gap-2">
|
||||||
|
<button type="submit" class="btn btn-primary">Registrar</button>
|
||||||
|
<a href="{{ url_for('listar_celulas') }}" class="btn btn-secondary">Voltar</a>
|
||||||
|
<a href="{{ url_for('home') }}" class="btn btn-outline-primary">Início</a>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
94
templates/novo_comite.html
Normal file
94
templates/novo_comite.html
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block title %}Novo Comitê Regional{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<h1 class="mb-4">Novo Comitê Regional</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 %}
|
||||||
|
|
||||||
|
<form method="POST" class="needs-validation" novalidate>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="nome" class="form-label">Nome</label>
|
||||||
|
<input type="text" class="form-control" id="nome" name="nome" required>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, insira o nome do comitê regional.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="comite_central_id" class="form-label">Comitê Central</label>
|
||||||
|
<select class="form-select" id="comite_central_id" name="comite_central_id" required>
|
||||||
|
<option value="">Selecione um comitê central</option>
|
||||||
|
{% for comite in comites_centrais %}
|
||||||
|
<option value="{{ comite.id }}">{{ comite.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, selecione um comitê central.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="responsavel" class="form-label">Responsável</label>
|
||||||
|
<select class="form-select" id="responsavel" name="responsavel">
|
||||||
|
<option value="">Selecione um responsável</option>
|
||||||
|
{% for militante in militantes %}
|
||||||
|
<option value="{{ militante.id }}">{{ militante.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="responsavel_financas" class="form-label">Responsável Finanças</label>
|
||||||
|
<select class="form-select" id="responsavel_financas" name="responsavel_financas">
|
||||||
|
<option value="">Selecione um responsável financeiro</option>
|
||||||
|
{% for militante in militantes %}
|
||||||
|
<option value="{{ militante.id }}">{{ militante.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="d-flex justify-content-between mt-4">
|
||||||
|
<button type="submit" class="btn btn-primary">Salvar</button>
|
||||||
|
<a href="{{ url_for('listar_comites') }}" class="btn btn-secondary">Cancelar</a>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// Validação do formulário
|
||||||
|
(function () {
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
var forms = document.querySelectorAll('.needs-validation')
|
||||||
|
|
||||||
|
Array.prototype.slice.call(forms)
|
||||||
|
.forEach(function (form) {
|
||||||
|
form.addEventListener('submit', function (event) {
|
||||||
|
if (!form.checkValidity()) {
|
||||||
|
event.preventDefault()
|
||||||
|
event.stopPropagation()
|
||||||
|
}
|
||||||
|
|
||||||
|
form.classList.add('was-validated')
|
||||||
|
}, false)
|
||||||
|
})
|
||||||
|
})()
|
||||||
|
</script>
|
||||||
|
{% endblock %}
|
||||||
81
templates/novo_comite_central.html
Normal file
81
templates/novo_comite_central.html
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block title %}Novo Comitê Central{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<h1 class="mb-4">Novo Comitê Central</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 %}
|
||||||
|
|
||||||
|
<form method="POST" class="needs-validation" novalidate>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="nome" class="form-label">Nome</label>
|
||||||
|
<input type="text" class="form-control" id="nome" name="nome" required>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, insira o nome do comitê central.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="responsavel" class="form-label">Responsável</label>
|
||||||
|
<select class="form-select" id="responsavel" name="responsavel">
|
||||||
|
<option value="">Selecione um responsável</option>
|
||||||
|
{% for militante in militantes %}
|
||||||
|
<option value="{{ militante.id }}">{{ militante.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="responsavel_financas" class="form-label">Responsável Finanças</label>
|
||||||
|
<select class="form-select" id="responsavel_financas" name="responsavel_financas">
|
||||||
|
<option value="">Selecione um responsável financeiro</option>
|
||||||
|
{% for militante in militantes %}
|
||||||
|
<option value="{{ militante.id }}">{{ militante.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="d-flex justify-content-between mt-4">
|
||||||
|
<button type="submit" class="btn btn-primary">Salvar</button>
|
||||||
|
<a href="{{ url_for('listar_comites_centrais') }}" class="btn btn-secondary">Cancelar</a>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// Validação do formulário
|
||||||
|
(function () {
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
var forms = document.querySelectorAll('.needs-validation')
|
||||||
|
|
||||||
|
Array.prototype.slice.call(forms)
|
||||||
|
.forEach(function (form) {
|
||||||
|
form.addEventListener('submit', function (event) {
|
||||||
|
if (!form.checkValidity()) {
|
||||||
|
event.preventDefault()
|
||||||
|
event.stopPropagation()
|
||||||
|
}
|
||||||
|
|
||||||
|
form.classList.add('was-validated')
|
||||||
|
}, false)
|
||||||
|
})
|
||||||
|
})()
|
||||||
|
</script>
|
||||||
|
{% endblock %}
|
||||||
54
templates/novo_comite_regional.html
Normal file
54
templates/novo_comite_regional.html
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block title %}Novo Comitê Regional{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-8 offset-md-2">
|
||||||
|
<h1 class="mb-4">Novo Comitê Regional</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 %}
|
||||||
|
|
||||||
|
<form method="post" class="mb-4">
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="nome" class="form-label">Nome:</label>
|
||||||
|
<input type="text" class="form-control" id="nome" name="nome" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="responsavel" class="form-label">Responsável:</label>
|
||||||
|
<select class="form-select" id="responsavel" name="responsavel" required>
|
||||||
|
<option value="">Selecione o responsável</option>
|
||||||
|
{% for militante in militantes %}
|
||||||
|
<option value="{{ militante.id }}">{{ militante.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="responsavel_financas" class="form-label">Responsável por Finanças:</label>
|
||||||
|
<select class="form-select" id="responsavel_financas" name="responsavel_financas" required>
|
||||||
|
<option value="">Selecione o responsável</option>
|
||||||
|
{% for militante in militantes %}
|
||||||
|
<option value="{{ militante.id }}">{{ militante.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="d-flex gap-2">
|
||||||
|
<button type="submit" class="btn btn-primary">Registrar</button>
|
||||||
|
<a href="{{ url_for('listar_comites_regionais') }}" class="btn btn-secondary">Voltar</a>
|
||||||
|
<a href="{{ url_for('home') }}" class="btn btn-outline-primary">Início</a>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
74
templates/novo_endereco.html
Normal file
74
templates/novo_endereco.html
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block title %}Novo Endereço{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-8 offset-md-2">
|
||||||
|
<h1 class="mb-4">Novo Endereço</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 %}
|
||||||
|
|
||||||
|
<form method="post" class="mb-4">
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="militante_id" class="form-label">Militante:</label>
|
||||||
|
<select class="form-select" id="militante_id" name="militante_id" required>
|
||||||
|
<option value="">Selecione o militante</option>
|
||||||
|
{% for militante in militantes %}
|
||||||
|
<option value="{{ militante.id }}">{{ militante.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="logradouro" class="form-label">Logradouro:</label>
|
||||||
|
<input type="text" class="form-control" id="logradouro" name="logradouro" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="numero" class="form-label">Número:</label>
|
||||||
|
<input type="text" class="form-control" id="numero" name="numero" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="complemento" class="form-label">Complemento:</label>
|
||||||
|
<input type="text" class="form-control" id="complemento" name="complemento">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="bairro" class="form-label">Bairro:</label>
|
||||||
|
<input type="text" class="form-control" id="bairro" name="bairro" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="cidade" class="form-label">Cidade:</label>
|
||||||
|
<input type="text" class="form-control" id="cidade" name="cidade" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="estado" class="form-label">Estado:</label>
|
||||||
|
<input type="text" class="form-control" id="estado" name="estado" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="cep" class="form-label">CEP:</label>
|
||||||
|
<input type="text" class="form-control" id="cep" name="cep" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="d-flex gap-2">
|
||||||
|
<button type="submit" class="btn btn-primary">Registrar</button>
|
||||||
|
<a href="{{ url_for('listar_enderecos') }}" class="btn btn-secondary">Voltar</a>
|
||||||
|
<a href="{{ url_for('home') }}" class="btn btn-outline-primary">Início</a>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
@@ -1,35 +1,94 @@
|
|||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
{% block title %}Listar Militantes{% endblock %}
|
{% block title %}Novo Material{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>Registrar Novo Material</h1>
|
<div class="container">
|
||||||
<form method="post">
|
<div class="row">
|
||||||
<div>
|
<div class="col-md-12">
|
||||||
<label for="militante_id">ID do Militante:</label>
|
<h1 class="mb-4">Novo Material</h1>
|
||||||
<input type="number" id="militante_id" name="militante_id" required>
|
|
||||||
|
{% 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 %}
|
||||||
|
|
||||||
|
<form method="POST" class="needs-validation" novalidate>
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="nome" class="form-label">Nome</label>
|
||||||
|
<input type="text" class="form-control" id="nome" name="nome" required>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, insira o nome do material.
|
||||||
</div>
|
</div>
|
||||||
<div>
|
|
||||||
<label for="tipo_material_id">Tipo de Material:</label>
|
|
||||||
<input type="number" id="tipo_material_id" name="tipo_material_id" required>
|
|
||||||
</div>
|
</div>
|
||||||
<div>
|
|
||||||
<label for="descricao">Descrição:</label>
|
<div class="mb-3">
|
||||||
<input type="text" id="descricao" name="descricao" required>
|
<label for="descricao" class="form-label">Descrição</label>
|
||||||
|
<textarea class="form-control" id="descricao" name="descricao" rows="3" required></textarea>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, insira a descrição do material.
|
||||||
</div>
|
</div>
|
||||||
<div>
|
|
||||||
<label for="valor">Valor:</label>
|
|
||||||
<input type="number" id="valor" name="valor" step="0.01" required>
|
|
||||||
</div>
|
</div>
|
||||||
<div>
|
|
||||||
<label for="data_venda">Data da Venda:</label>
|
<div class="mb-3">
|
||||||
<input type="date" id="data_venda" name="data_venda" required>
|
<label for="preco" class="form-label">Preço</label>
|
||||||
|
<input type="number" class="form-control" id="preco" name="preco" step="0.01" required>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, insira o preço do material.
|
||||||
</div>
|
</div>
|
||||||
<div class="d-flex gap-2">
|
</div>
|
||||||
<button type="submit" class="btn btn-primary">Registrar</button>
|
|
||||||
<a href="{{ url_for('listar_materiais') }}" class="btn btn-secondary">Voltar</a>
|
<div class="mb-3">
|
||||||
<a href="{{ url_for('home') }}" class="btn btn-outline-primary">Início</a>
|
<label for="quantidade" class="form-label">Quantidade</label>
|
||||||
|
<input type="number" class="form-control" id="quantidade" name="quantidade" required>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, insira a quantidade do material.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="tipo_id" class="form-label">Tipo de Material</label>
|
||||||
|
<select class="form-select" id="tipo_id" name="tipo_id" required>
|
||||||
|
<option value="">Selecione um tipo</option>
|
||||||
|
{% for tipo in tipos %}
|
||||||
|
<option value="{{ tipo.id }}">{{ tipo.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, selecione o tipo do material.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="d-flex justify-content-between">
|
||||||
|
<button type="submit" class="btn btn-success">Registrar</button>
|
||||||
|
<a href="{{ url_for('listar_materiais') }}" class="btn btn-outline-secondary">Voltar</a>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// Validação do formulário
|
||||||
|
(function () {
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
var forms = document.querySelectorAll('.needs-validation')
|
||||||
|
|
||||||
|
Array.prototype.slice.call(forms)
|
||||||
|
.forEach(function (form) {
|
||||||
|
form.addEventListener('submit', function (event) {
|
||||||
|
if (!form.checkValidity()) {
|
||||||
|
event.preventDefault()
|
||||||
|
event.stopPropagation()
|
||||||
|
}
|
||||||
|
|
||||||
|
form.classList.add('was-validated')
|
||||||
|
}, false)
|
||||||
|
})
|
||||||
|
})()
|
||||||
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-8 offset-md-2">
|
<div class="col-md-8 offset-md-2">
|
||||||
<h1 class="mb-4">Criar Novo Militante</h1>
|
<h1 class="mb-4">Novo Militante</h1>
|
||||||
|
|
||||||
{% with messages = get_flashed_messages(with_categories=true) %}
|
{% with messages = get_flashed_messages(with_categories=true) %}
|
||||||
{% if messages %}
|
{% if messages %}
|
||||||
@@ -19,82 +19,123 @@
|
|||||||
<form method="post" class="mb-4">
|
<form method="post" class="mb-4">
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label for="nome" class="form-label">Nome:</label>
|
<label for="nome" class="form-label">Nome:</label>
|
||||||
<input type="text" class="form-control" id="nome" name="nome" required
|
<input type="text" class="form-control" id="nome" name="nome" required>
|
||||||
value="{{ dados_anteriores.nome if dados_anteriores else '' }}">
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label for="cpf" class="form-label">CPF:</label>
|
<label for="cpf" class="form-label">CPF:</label>
|
||||||
<input type="text" class="form-control" id="cpf" name="cpf" required
|
<input type="text" class="form-control" id="cpf" name="cpf" required>
|
||||||
value="{{ dados_anteriores.cpf if dados_anteriores else '' }}"
|
|
||||||
pattern="\d{3}\.?\d{3}\.?\d{3}-?\d{2}"
|
|
||||||
title="Digite um CPF no formato: xxx.xxx.xxx-xx">
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label for="email" class="form-label">Email:</label>
|
<label for="titulo_eleitoral" class="form-label">Título Eleitoral:</label>
|
||||||
<input type="email" class="form-control" id="email" name="email" required
|
<input type="text" class="form-control" id="titulo_eleitoral" name="titulo_eleitoral" required>
|
||||||
value="{{ dados_anteriores.email if dados_anteriores else '' }}">
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label for="telefone" class="form-label">Telefone:</label>
|
<label for="data_nascimento" class="form-label">Data de Nascimento:</label>
|
||||||
<input type="text" class="form-control" id="telefone" name="telefone"
|
<input type="date" class="form-control" id="data_nascimento" name="data_nascimento" required>
|
||||||
value="{{ dados_anteriores.telefone if dados_anteriores else '' }}">
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label for="endereco" class="form-label">Endereço:</label>
|
<label for="data_entrada_oci" class="form-label">Data de Entrada na OCI:</label>
|
||||||
<input type="text" class="form-control" id="endereco" name="endereco"
|
<input type="date" class="form-control" id="data_entrada_oci" name="data_entrada_oci" required>
|
||||||
value="{{ dados_anteriores.endereco if dados_anteriores else '' }}">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="mb-3 form-check">
|
|
||||||
<input type="checkbox" class="form-check-input" id="filiado" name="filiado"
|
|
||||||
{% if dados_anteriores and dados_anteriores.filiado %}checked{% endif %}>
|
|
||||||
<label class="form-check-label" for="filiado">Filiado</label>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label class="form-label">Responsabilidades:</label>
|
<label for="data_efetivacao_oci" class="form-label">Data de Efetivação na OCI:</label>
|
||||||
<div class="row">
|
<input type="date" class="form-control" id="data_efetivacao_oci" name="data_efetivacao_oci" required>
|
||||||
{% for valor, nome in responsabilidades %}
|
|
||||||
<div class="col-md-4">
|
|
||||||
<div class="form-check">
|
|
||||||
<input type="checkbox" class="form-check-input"
|
|
||||||
id="resp_{{ valor }}" name="responsabilidades"
|
|
||||||
value="{{ valor }}">
|
|
||||||
<label class="form-check-label" for="resp_{{ valor }}">
|
|
||||||
{{ nome }}
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if celulas %}
|
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label for="celula" class="form-label">Célula:</label>
|
<label for="telefone1" class="form-label">Telefone 1:</label>
|
||||||
<select class="form-select" id="celula" name="celula_id" required>
|
<input type="text" class="form-control" id="telefone1" name="telefone1" required>
|
||||||
<option value="">Selecione uma célula</option>
|
</div>
|
||||||
{% for cr in celulas_por_cr %}
|
|
||||||
<optgroup label="CR {{ cr.nome }}">
|
<div class="mb-3">
|
||||||
{% for setor in cr.setores %}
|
<label for="telefone2" class="form-label">Telefone 2:</label>
|
||||||
<optgroup label=" Setor {{ setor.nome }}">
|
<input type="text" class="form-control" id="telefone2" name="telefone2">
|
||||||
{% for celula in setor.celulas %}
|
</div>
|
||||||
<option value="{{ celula.id }}">{{ celula.nome }}</option>
|
|
||||||
{% endfor %}
|
<div class="mb-3">
|
||||||
</optgroup>
|
<label for="profissao" class="form-label">Profissão:</label>
|
||||||
{% endfor %}
|
<input type="text" class="form-control" id="profissao" name="profissao" required>
|
||||||
</optgroup>
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="regime_trabalho" class="form-label">Regime de Trabalho:</label>
|
||||||
|
<input type="text" class="form-control" id="regime_trabalho" name="regime_trabalho" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="empresa" class="form-label">Empresa:</label>
|
||||||
|
<input type="text" class="form-control" id="empresa" name="empresa" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="contratante" class="form-label">Contratante:</label>
|
||||||
|
<input type="text" class="form-control" id="contratante" name="contratante" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="instituicao_ensino" class="form-label">Instituição de Ensino:</label>
|
||||||
|
<input type="text" class="form-control" id="instituicao_ensino" name="instituicao_ensino">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="tipo_instituicao" class="form-label">Tipo de Instituição:</label>
|
||||||
|
<select class="form-select" id="tipo_instituicao" name="tipo_instituicao">
|
||||||
|
<option value="">Selecione o tipo</option>
|
||||||
|
<option value="publica">Pública</option>
|
||||||
|
<option value="privada">Privada</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="sindicato" class="form-label">Sindicato:</label>
|
||||||
|
<input type="text" class="form-control" id="sindicato" name="sindicato">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="cargo_sindical" class="form-label">Cargo Sindical:</label>
|
||||||
|
<input type="text" class="form-control" id="cargo_sindical" name="cargo_sindical">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="dirigente_sindical" class="form-label">Dirigente Sindical:</label>
|
||||||
|
<select class="form-select" id="dirigente_sindical" name="dirigente_sindical">
|
||||||
|
<option value="false">Não</option>
|
||||||
|
<option value="true">Sim</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="central_sindical" class="form-label">Central Sindical:</label>
|
||||||
|
<input type="text" class="form-control" id="central_sindical" name="central_sindical">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="setor_id" class="form-label">Setor:</label>
|
||||||
|
<select class="form-select" id="setor_id" name="setor_id" required>
|
||||||
|
<option value="">Selecione o setor</option>
|
||||||
|
{% for setor in setores %}
|
||||||
|
<option value="{{ setor.id }}">{{ setor.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="celula_id" class="form-label">Célula:</label>
|
||||||
|
<select class="form-select" id="celula_id" name="celula_id" required>
|
||||||
|
<option value="">Selecione a célula</option>
|
||||||
|
{% for celula in celulas %}
|
||||||
|
<option value="{{ celula.id }}">{{ celula.nome }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<div class="d-flex gap-2">
|
<div class="d-flex gap-2">
|
||||||
<button type="submit" class="btn btn-primary">Criar</button>
|
<button type="submit" class="btn btn-primary">Registrar</button>
|
||||||
<a href="{{ url_for('listar_militantes') }}" class="btn btn-secondary">Voltar</a>
|
<a href="{{ url_for('listar_militantes') }}" class="btn btn-secondary">Voltar</a>
|
||||||
<a href="{{ url_for('home') }}" class="btn btn-outline-primary">Início</a>
|
<a href="{{ url_for('home') }}" class="btn btn-outline-primary">Início</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6,17 +6,61 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-8 offset-md-2">
|
<div class="col-md-8 offset-md-2">
|
||||||
<h1 class="mb-4">Registrar Novo Pagamento</h1>
|
<h1 class="mb-4">Novo Pagamento</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 %}
|
||||||
|
|
||||||
<form method="post" class="mb-4">
|
<form method="post" class="mb-4">
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label for="militante_id" class="form-label">ID do Militante:</label>
|
<label for="militante_id" class="form-label">Militante:</label>
|
||||||
<input type="number" class="form-control" id="militante_id" name="militante_id" required>
|
<select class="form-select" id="militante_id" name="militante_id" required>
|
||||||
|
<option value="">Selecione o militante</option>
|
||||||
|
{% for militante in militantes %}
|
||||||
|
<option value="{{ militante.id }}">{{ militante.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label for="tipo_pagamento_id" class="form-label">Tipo de Pagamento:</label>
|
<label for="tipo_pagamento" class="form-label">Tipo de Pagamento:</label>
|
||||||
<input type="number" class="form-control" id="tipo_pagamento_id" name="tipo_pagamento_id" required>
|
<select class="form-select" id="tipo_pagamento" name="tipo_pagamento" required>
|
||||||
|
<option value="">Selecione o tipo</option>
|
||||||
|
<option value="cota">Cota</option>
|
||||||
|
<option value="jornal">Jornal</option>
|
||||||
|
<option value="assinatura">Assinatura</option>
|
||||||
|
<option value="campanha">Campanha Financeira</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="mes_referencia" class="form-label">Mês de Referência:</label>
|
||||||
|
<input type="month" class="form-control" id="mes_referencia" name="mes_referencia" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="numero_jornal" class="form-label">Número do Jornal:</label>
|
||||||
|
<input type="number" class="form-control" id="numero_jornal" name="numero_jornal">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="numero_inicial_assinatura" class="form-label">Número Inicial da Assinatura:</label>
|
||||||
|
<input type="number" class="form-control" id="numero_inicial_assinatura" name="numero_inicial_assinatura">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="numero_final_assinatura" class="form-label">Número Final da Assinatura:</label>
|
||||||
|
<input type="number" class="form-control" id="numero_final_assinatura" name="numero_final_assinatura">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="campanha_financeira" class="form-label">Campanha Financeira:</label>
|
||||||
|
<input type="text" class="form-control" id="campanha_financeira" name="campanha_financeira">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
|
|||||||
@@ -1,30 +1,92 @@
|
|||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
{% block title %}Listar Militantes{% endblock %}
|
{% block title %}Novo Relatório de Cotas{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>Registrar Novo Relatório de Cotas</h1>
|
<div class="container">
|
||||||
<form method="post">
|
<div class="row">
|
||||||
<div>
|
<div class="col-md-12">
|
||||||
<label for="setor_id">ID do Setor:</label>
|
<h1 class="mb-4">Novo Relatório de Cotas</h1>
|
||||||
<input type="number" id="setor_id" name="setor_id" required>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<label for="comite_id">ID do Comitê:</label>
|
|
||||||
<input type="number" id="comite_id" name="comite_id" required>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<label for="total_cotas">Total de Cotas:</label>
|
|
||||||
<input type="number" id="total_cotas" name="total_cotas" step="0.01" required>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<label for="data_relatorio">Data do Relatório:</label>
|
|
||||||
<input type="date" id="data_relatorio" name="data_relatorio" required>
|
|
||||||
</div>
|
|
||||||
<button type="submit">Registrar Relatório</button>
|
|
||||||
</form>
|
|
||||||
<a href="{{ url_for('listar_relatorios_cotas') }}">Voltar para Lista</a>
|
|
||||||
<a href="{{ url_for('home') }}">Home</a>
|
|
||||||
|
|
||||||
|
{% 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 %}
|
||||||
|
|
||||||
|
<form method="POST" class="needs-validation" novalidate>
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="setor_id" class="form-label">Setor</label>
|
||||||
|
<select class="form-select" id="setor_id" name="setor_id" required>
|
||||||
|
<option value="">Selecione um setor</option>
|
||||||
|
{% for setor in setores %}
|
||||||
|
<option value="{{ setor.id }}">{{ setor.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, selecione o setor.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="comite_id" class="form-label">Comitê Central</label>
|
||||||
|
<select class="form-select" id="comite_id" name="comite_id" required>
|
||||||
|
<option value="">Selecione um comitê</option>
|
||||||
|
{% for comite in comites %}
|
||||||
|
<option value="{{ comite.id }}">{{ comite.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, selecione o comitê central.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="total_cotas" class="form-label">Total de Cotas</label>
|
||||||
|
<input type="number" class="form-control" id="total_cotas" name="total_cotas" step="0.01" required>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, insira o total de cotas.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="data_relatorio" class="form-label">Data do Relatório</label>
|
||||||
|
<input type="date" class="form-control" id="data_relatorio" name="data_relatorio" required>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, insira a data do relatório.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="d-flex justify-content-between">
|
||||||
|
<button type="submit" class="btn btn-success">Registrar</button>
|
||||||
|
<a href="{{ url_for('listar_relatorios_cotas') }}" class="btn btn-outline-secondary">Voltar</a>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// Validação do formulário
|
||||||
|
(function () {
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
var forms = document.querySelectorAll('.needs-validation')
|
||||||
|
|
||||||
|
Array.prototype.slice.call(forms)
|
||||||
|
.forEach(function (form) {
|
||||||
|
form.addEventListener('submit', function (event) {
|
||||||
|
if (!form.checkValidity()) {
|
||||||
|
event.preventDefault()
|
||||||
|
event.stopPropagation()
|
||||||
|
}
|
||||||
|
|
||||||
|
form.classList.add('was-validated')
|
||||||
|
}, false)
|
||||||
|
})
|
||||||
|
})()
|
||||||
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|||||||
91
templates/novo_relatorio_pagamentos.html
Normal file
91
templates/novo_relatorio_pagamentos.html
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block title %}Novo Relatório de Pagamentos{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<h1 class="mb-4">Novo Relatório de Pagamentos</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 %}
|
||||||
|
|
||||||
|
<form method="POST" class="needs-validation" novalidate>
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="setor_id" class="form-label">Setor</label>
|
||||||
|
<select class="form-select" id="setor_id" name="setor_id" required>
|
||||||
|
<option value="">Selecione um setor</option>
|
||||||
|
{% for setor in setores %}
|
||||||
|
<option value="{{ setor.id }}">{{ setor.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, selecione o setor.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="comite_id" class="form-label">Comitê Central</label>
|
||||||
|
<select class="form-select" id="comite_id" name="comite_id" required>
|
||||||
|
<option value="">Selecione um comitê</option>
|
||||||
|
{% for comite in comites %}
|
||||||
|
<option value="{{ comite.id }}">{{ comite.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, selecione o comitê central.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="total_pagamentos" class="form-label">Total de Pagamentos</label>
|
||||||
|
<input type="number" class="form-control" id="total_pagamentos" name="total_pagamentos" step="0.01" required>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, insira o total de pagamentos.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="data_relatorio" class="form-label">Data do Relatório</label>
|
||||||
|
<input type="date" class="form-control" id="data_relatorio" name="data_relatorio" required>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, insira a data do relatório.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="d-flex justify-content-between">
|
||||||
|
<button type="submit" class="btn btn-success">Registrar</button>
|
||||||
|
<a href="{{ url_for('listar_relatorios_pagamentos') }}" class="btn btn-outline-secondary">Voltar</a>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// Validação do formulário
|
||||||
|
(function () {
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
var forms = document.querySelectorAll('.needs-validation')
|
||||||
|
|
||||||
|
Array.prototype.slice.call(forms)
|
||||||
|
.forEach(function (form) {
|
||||||
|
form.addEventListener('submit', function (event) {
|
||||||
|
if (!form.checkValidity()) {
|
||||||
|
event.preventDefault()
|
||||||
|
event.stopPropagation()
|
||||||
|
}
|
||||||
|
|
||||||
|
form.classList.add('was-validated')
|
||||||
|
}, false)
|
||||||
|
})
|
||||||
|
})()
|
||||||
|
</script>
|
||||||
|
{% endblock %}
|
||||||
@@ -1,30 +1,91 @@
|
|||||||
{% extends 'base.html' %}
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
{% block title %}Listar Militantes{% endblock %}
|
{% block title %}Novo Relatório de Vendas{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>Registrar Novo Relatório de Vendas</h1>
|
<div class="container">
|
||||||
<form method="post">
|
<div class="row">
|
||||||
<div>
|
<div class="col-md-12">
|
||||||
<label for="setor_id">ID do Setor:</label>
|
<h1 class="mb-4">Novo Relatório de Vendas</h1>
|
||||||
<input type="number" id="setor_id" name="setor_id" required>
|
|
||||||
|
{% 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 %}
|
||||||
|
|
||||||
|
<form method="POST" class="needs-validation" novalidate>
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="setor_id" class="form-label">Setor</label>
|
||||||
|
<select class="form-select" id="setor_id" name="setor_id" required>
|
||||||
|
<option value="">Selecione um setor</option>
|
||||||
|
{% for setor in setores %}
|
||||||
|
<option value="{{ setor.id }}">{{ setor.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, selecione o setor.
|
||||||
</div>
|
</div>
|
||||||
<div>
|
|
||||||
<label for="comite_id">ID do Comitê:</label>
|
|
||||||
<input type="number" id="comite_id" name="comite_id" required>
|
|
||||||
</div>
|
</div>
|
||||||
<div>
|
|
||||||
<label for="total_vendas">Total de Vendas:</label>
|
<div class="mb-3">
|
||||||
<input type="number" id="total_vendas" name="total_vendas" step="0.01" required>
|
<label for="comite_id" class="form-label">Comitê Central</label>
|
||||||
|
<select class="form-select" id="comite_id" name="comite_id" required>
|
||||||
|
<option value="">Selecione um comitê</option>
|
||||||
|
{% for comite in comites %}
|
||||||
|
<option value="{{ comite.id }}">{{ comite.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, selecione o comitê central.
|
||||||
</div>
|
</div>
|
||||||
<div>
|
|
||||||
<label for="data_relatorio">Data do Relatório:</label>
|
|
||||||
<input type="date" id="data_relatorio" name="data_relatorio" required>
|
|
||||||
</div>
|
</div>
|
||||||
<button type="submit">Registrar Relatório</button>
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="total_vendas" class="form-label">Total de Vendas</label>
|
||||||
|
<input type="number" class="form-control" id="total_vendas" name="total_vendas" step="0.01" required>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, insira o total de vendas.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="data_relatorio" class="form-label">Data do Relatório</label>
|
||||||
|
<input type="date" class="form-control" id="data_relatorio" name="data_relatorio" required>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, insira a data do relatório.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="d-flex justify-content-between">
|
||||||
|
<button type="submit" class="btn btn-success">Registrar</button>
|
||||||
|
<a href="{{ url_for('listar_relatorios_vendas') }}" class="btn btn-outline-secondary">Voltar</a>
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<a href="{{ url_for('listar_relatorios_vendas') }}">Voltar para Lista</a>
|
</div>
|
||||||
<a href="{{ url_for('home') }}">Home</a>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// Validação do formulário
|
||||||
|
(function () {
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
var forms = document.querySelectorAll('.needs-validation')
|
||||||
|
|
||||||
|
Array.prototype.slice.call(forms)
|
||||||
|
.forEach(function (form) {
|
||||||
|
form.addEventListener('submit', function (event) {
|
||||||
|
if (!form.checkValidity()) {
|
||||||
|
event.preventDefault()
|
||||||
|
event.stopPropagation()
|
||||||
|
}
|
||||||
|
|
||||||
|
form.classList.add('was-validated')
|
||||||
|
}, false)
|
||||||
|
})
|
||||||
|
})()
|
||||||
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
94
templates/novo_setor.html
Normal file
94
templates/novo_setor.html
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block title %}Novo Setor{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<h1 class="mb-4">Novo Setor</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 %}
|
||||||
|
|
||||||
|
<form method="POST" class="needs-validation" novalidate>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="nome" class="form-label">Nome</label>
|
||||||
|
<input type="text" class="form-control" id="nome" name="nome" required>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, insira o nome do setor.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="comite_regional_id" class="form-label">Comitê Regional</label>
|
||||||
|
<select class="form-select" id="comite_regional_id" name="comite_regional_id" required>
|
||||||
|
<option value="">Selecione um comitê regional</option>
|
||||||
|
{% for comite in comites %}
|
||||||
|
<option value="{{ comite.id }}">{{ comite.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, selecione um comitê regional.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="responsavel" class="form-label">Responsável</label>
|
||||||
|
<select class="form-select" id="responsavel" name="responsavel">
|
||||||
|
<option value="">Selecione um responsável</option>
|
||||||
|
{% for militante in militantes %}
|
||||||
|
<option value="{{ militante.id }}">{{ militante.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="responsavel_financas" class="form-label">Responsável Finanças</label>
|
||||||
|
<select class="form-select" id="responsavel_financas" name="responsavel_financas">
|
||||||
|
<option value="">Selecione um responsável financeiro</option>
|
||||||
|
{% for militante in militantes %}
|
||||||
|
<option value="{{ militante.id }}">{{ militante.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="d-flex justify-content-between mt-4">
|
||||||
|
<button type="submit" class="btn btn-primary">Salvar</button>
|
||||||
|
<a href="{{ url_for('listar_setores') }}" class="btn btn-secondary">Cancelar</a>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// Validação do formulário
|
||||||
|
(function () {
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
var forms = document.querySelectorAll('.needs-validation')
|
||||||
|
|
||||||
|
Array.prototype.slice.call(forms)
|
||||||
|
.forEach(function (form) {
|
||||||
|
form.addEventListener('submit', function (event) {
|
||||||
|
if (!form.checkValidity()) {
|
||||||
|
event.preventDefault()
|
||||||
|
event.stopPropagation()
|
||||||
|
}
|
||||||
|
|
||||||
|
form.classList.add('was-validated')
|
||||||
|
}, false)
|
||||||
|
})
|
||||||
|
})()
|
||||||
|
</script>
|
||||||
|
{% endblock %}
|
||||||
74
templates/novo_tipo_material.html
Normal file
74
templates/novo_tipo_material.html
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block title %}Novo Tipo de Material{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<h1 class="mb-4">Novo Tipo de Material</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 %}
|
||||||
|
|
||||||
|
<form method="POST" class="needs-validation" novalidate>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="nome" class="form-label">Nome</label>
|
||||||
|
<input type="text" class="form-control" id="nome" name="nome" required>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, insira o nome do tipo de material.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-6 mb-3">
|
||||||
|
<label for="preco" class="form-label">Preço</label>
|
||||||
|
<input type="number" class="form-control" id="preco" name="preco" step="0.01" min="0" required>
|
||||||
|
<div class="invalid-feedback">
|
||||||
|
Por favor, insira o preço do tipo de material.
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12 mb-3">
|
||||||
|
<label for="descricao" class="form-label">Descrição</label>
|
||||||
|
<textarea class="form-control" id="descricao" name="descricao" rows="3"></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="d-flex justify-content-between mt-4">
|
||||||
|
<button type="submit" class="btn btn-primary">Salvar</button>
|
||||||
|
<a href="{{ url_for('listar_tipos_materiais') }}" class="btn btn-secondary">Cancelar</a>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// Validação do formulário
|
||||||
|
(function () {
|
||||||
|
'use strict'
|
||||||
|
|
||||||
|
var forms = document.querySelectorAll('.needs-validation')
|
||||||
|
|
||||||
|
Array.prototype.slice.call(forms)
|
||||||
|
.forEach(function (form) {
|
||||||
|
form.addEventListener('submit', function (event) {
|
||||||
|
if (!form.checkValidity()) {
|
||||||
|
event.preventDefault()
|
||||||
|
event.stopPropagation()
|
||||||
|
}
|
||||||
|
|
||||||
|
form.classList.add('was-validated')
|
||||||
|
}, false)
|
||||||
|
})
|
||||||
|
})()
|
||||||
|
</script>
|
||||||
|
{% endblock %}
|
||||||
1
templates/novo_tipo_pagamento.html
Normal file
1
templates/novo_tipo_pagamento.html
Normal file
@@ -0,0 +1 @@
|
|||||||
|
|
||||||
@@ -6,11 +6,8 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-8 offset-md-2">
|
<div class="col-md-8 offset-md-2">
|
||||||
<div class="card">
|
<h1 class="mb-4">Novo Usuário</h1>
|
||||||
<div class="card-header">
|
|
||||||
<h3>Cadastro de Novo Usuário</h3>
|
|
||||||
</div>
|
|
||||||
<div class="card-body">
|
|
||||||
{% with messages = get_flashed_messages(with_categories=true) %}
|
{% with messages = get_flashed_messages(with_categories=true) %}
|
||||||
{% if messages %}
|
{% if messages %}
|
||||||
{% for category, message in messages %}
|
{% for category, message in messages %}
|
||||||
@@ -19,40 +16,59 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
|
|
||||||
<form method="POST">
|
<form method="post" class="mb-4">
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label for="username" class="form-label">Nome de usuário</label>
|
<label for="militante_id" class="form-label">Militante:</label>
|
||||||
|
<select class="form-select" id="militante_id" name="militante_id" required>
|
||||||
|
<option value="">Selecione o militante</option>
|
||||||
|
{% for militante in militantes %}
|
||||||
|
<option value="{{ militante.id }}">{{ militante.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="setor_id" class="form-label">Setor:</label>
|
||||||
|
<select class="form-select" id="setor_id" name="setor_id" required>
|
||||||
|
<option value="">Selecione o setor</option>
|
||||||
|
{% for setor in setores %}
|
||||||
|
<option value="{{ setor.id }}">{{ setor.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="comite_id" class="form-label">Comitê Central:</label>
|
||||||
|
<select class="form-select" id="comite_id" name="comite_id" required>
|
||||||
|
<option value="">Selecione o comitê</option>
|
||||||
|
{% for comite in comites %}
|
||||||
|
<option value="{{ comite.id }}">{{ comite.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="username" class="form-label">Nome de Usuário:</label>
|
||||||
<input type="text" class="form-control" id="username" name="username" required>
|
<input type="text" class="form-control" id="username" name="username" required>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label for="email" class="form-label">E-mail</label>
|
<label for="password" class="form-label">Senha:</label>
|
||||||
<input type="email" class="form-control" id="email" name="email" required>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="mb-3">
|
|
||||||
<label for="password" class="form-label">Senha</label>
|
|
||||||
<input type="password" class="form-control" id="password" name="password" required>
|
<input type="password" class="form-control" id="password" name="password" required>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label for="confirm_password" class="form-label">Confirmar Senha</label>
|
<label for="confirm_password" class="form-label">Confirmar Senha:</label>
|
||||||
<input type="password" class="form-control" id="confirm_password" name="confirm_password" required>
|
<input type="password" class="form-control" id="confirm_password" name="confirm_password" required>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if session.get('is_admin') %}
|
<div class="d-flex gap-2">
|
||||||
<div class="mb-3 form-check">
|
<button type="submit" class="btn btn-primary">Registrar</button>
|
||||||
<input type="checkbox" class="form-check-input" id="is_admin" name="is_admin">
|
<a href="{{ url_for('listar_usuarios') }}" class="btn btn-secondary">Voltar</a>
|
||||||
<label class="form-check-label" for="is_admin">Usuário Administrador</label>
|
<a href="{{ url_for('home') }}" class="btn btn-outline-primary">Início</a>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<button type="submit" class="btn btn-primary">Cadastrar</button>
|
|
||||||
<a href="{{ url_for('home') }}" class="btn btn-secondary">Voltar</a>
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
64
templates/novo_venda.html
Normal file
64
templates/novo_venda.html
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block title %}Nova Venda{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-8 offset-md-2">
|
||||||
|
<h1 class="mb-4">Registrar Nova Venda</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 %}
|
||||||
|
|
||||||
|
<form method="post" class="mb-4">
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="militante_id" class="form-label">Militante:</label>
|
||||||
|
<select class="form-select" id="militante_id" name="militante_id" required>
|
||||||
|
<option value="">Selecione o militante</option>
|
||||||
|
{% for militante in militantes %}
|
||||||
|
<option value="{{ militante.id }}">{{ militante.nome }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="material_id" class="form-label">Material:</label>
|
||||||
|
<select class="form-select" id="material_id" name="material_id" required>
|
||||||
|
<option value="">Selecione o material</option>
|
||||||
|
{% for material in materiais %}
|
||||||
|
<option value="{{ material.id }}">{{ material.descricao }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="quantidade" class="form-label">Quantidade:</label>
|
||||||
|
<input type="number" class="form-control" id="quantidade" name="quantidade" min="1" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="valor_total" class="form-label">Valor Total:</label>
|
||||||
|
<input type="number" class="form-control" id="valor_total" name="valor_total" step="0.01" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="data_venda" class="form-label">Data da Venda:</label>
|
||||||
|
<input type="date" class="form-control" id="data_venda" name="data_venda" required>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="d-flex gap-2">
|
||||||
|
<button type="submit" class="btn btn-primary">Registrar</button>
|
||||||
|
<a href="{{ url_for('listar_vendas') }}" class="btn btn-secondary">Voltar</a>
|
||||||
|
<a href="{{ url_for('home') }}" class="btn btn-outline-primary">Início</a>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
Reference in New Issue
Block a user