Melhorada interface dos formulários. Adicionado a opção de editar os Militantes direto da Lista
This commit is contained in:
@@ -1,19 +1,68 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block title %}Listar Militantes{% endblock %}
|
||||
{% block title %}Novo Militante{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Criar Novo Militante</h1>
|
||||
<form method="post">
|
||||
Nome: <input type="text" name="nome" required><br>
|
||||
CPF: <input type="text" name="cpf" required><br>
|
||||
Email: <input type="email" name="email" required><br>
|
||||
Telefone: <input type="text" name="telefone"><br>
|
||||
Endereço: <input type="text" name="endereco"><br>
|
||||
Filiado: <input type="checkbox" name="filiado"><br>
|
||||
<input type="submit" value="Criar">
|
||||
</form>
|
||||
<a href="{{ url_for('home') }}">Home</a>
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-8 offset-md-2">
|
||||
<h1 class="mb-4">Criar Novo Militante</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
|
||||
value="{{ dados_anteriores.nome if dados_anteriores else '' }}">
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="cpf" class="form-label">CPF:</label>
|
||||
<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 class="mb-3">
|
||||
<label for="email" class="form-label">Email:</label>
|
||||
<input type="email" class="form-control" id="email" name="email" required
|
||||
value="{{ dados_anteriores.email if dados_anteriores else '' }}">
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="telefone" class="form-label">Telefone:</label>
|
||||
<input type="text" class="form-control" id="telefone" name="telefone"
|
||||
value="{{ dados_anteriores.telefone if dados_anteriores else '' }}">
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
<label for="endereco" class="form-label">Endereço:</label>
|
||||
<input type="text" class="form-control" id="endereco" name="endereco"
|
||||
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 class="d-flex gap-2">
|
||||
<button type="submit" class="btn btn-primary">Criar</button>
|
||||
<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>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user