2025-02-19 14:27:14 -03:00
|
|
|
{% extends 'base.html' %}
|
|
|
|
|
|
2025-04-03 10:30:48 -03:00
|
|
|
{% block title %}Listar Materiais{% endblock %}
|
2025-02-19 14:27:14 -03:00
|
|
|
|
|
|
|
|
{% block content %}
|
2025-04-03 10:30:48 -03:00
|
|
|
<div class="container">
|
|
|
|
|
<div class="row">
|
|
|
|
|
<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>
|
|
|
|
|
<tr>
|
|
|
|
|
<th>ID</th>
|
|
|
|
|
<th>Nome</th>
|
|
|
|
|
<th>Descrição</th>
|
|
|
|
|
<th>Preço</th>
|
|
|
|
|
<th>Quantidade</th>
|
|
|
|
|
<th>Tipo</th>
|
|
|
|
|
<th>Ações</th>
|
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
{% for material in materiais %}
|
|
|
|
|
<tr>
|
|
|
|
|
<td>{{ material.id }}</td>
|
|
|
|
|
<td>{{ material.nome }}</td>
|
|
|
|
|
<td>{{ material.descricao }}</td>
|
|
|
|
|
<td>R$ {{ "%.2f"|format(material.preco) }}</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>
|
|
|
|
|
{% endfor %}
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-02-19 14:27:14 -03:00
|
|
|
{% endblock %}
|