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,30 +1,91 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block title %}Listar Militantes{% endblock %}
|
||||
{% block title %}Novo Relatório de Vendas{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Registrar Novo Relatório de Vendas</h1>
|
||||
<form method="post">
|
||||
<div>
|
||||
<label for="setor_id">ID do Setor:</label>
|
||||
<input type="number" id="setor_id" name="setor_id" required>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<h1 class="mb-4">Novo 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 }}">{{ 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_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>
|
||||
</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_vendas">Total de Vendas:</label>
|
||||
<input type="number" id="total_vendas" name="total_vendas" 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_vendas') }}">Voltar para Lista</a>
|
||||
<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 %}
|
||||
|
||||
Reference in New Issue
Block a user