Commit 9dcf271a by Hiago Rafael

Criando telas HTML: base, cadastro, lista e editar

parent 6b5a9e8a
env/
*.db
<!DOCTYPE html>
<html>
<head>
<title>Fazenda</title>
<meta charset="UTF-8">
<title>Fazenda 🐄</title>
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
</head>
<body>
<h1>Sistema da Fazenda 🐄</h1>
{% block content %}{% endblock %}
<header>
<h1>🐄 Sistema de Animais da Fazenda</h1>
<nav>
<a href="/">Lista</a>
<a href="/cadastro">Cadastrar</a>
</nav>
<hr>
</header>
<main>
{% block content %}
{% endblock %}
</main>
</body>
</html>
\ No newline at end of file
......@@ -2,11 +2,17 @@
{% block content %}
<h2>Cadastrar Animal</h2>
<form>
<input type="text" placeholder="Nome" required>
<input type="text" placeholder="Espécie" required>
<input type="number" placeholder="Idade" required>
<input type="number" placeholder="Peso" required>
<form action="/cadastrar" method="POST">
<input type="text" name="nome" placeholder="Nome" required><br><br>
<input type="text" name="especie" placeholder="Espécie" required><br><br>
<input type="number" name="idade" placeholder="Idade" required><br><br>
<input type="number" name="peso" placeholder="Peso" step="0.1" required><br><br>
<button type="submit">Cadastrar</button>
</form>
{% endblock %}
\ No newline at end of file
{% extends 'base.html' %}
{% block content %}
<h2>Editar Animal</h2>
<form action="/atualizar/{{ animal.id }}" method="POST">
<input type="text" name="nome" value="{{ animal.nome }}" required><br><br>
<input type="text" name="especie" value="{{ animal.especie }}" required><br><br>
<input type="number" name="idade" value="{{ animal.idade }}" required><br><br>
<input type="number" name="peso" value="{{ animal.peso }}" step="0.1" required><br><br>
<button type="submit">Atualizar</button>
</form>
{% endblock %}
\ No newline at end of file
{% extends 'base.html' %}
{% block content %}
<h2>Lista de Animais</h2>
<table border="1">
<tr>
<th>ID</th>
<th>Nome</th>
<th>Espécie</th>
<th>Idade</th>
<th>Peso</th>
<th>Ações</th>
</tr>
{% for animal in animais %}
<tr>
<td>{{ animal.id }}</td>
<td>{{ animal.nome }}</td>
<td>{{ animal.especie }}</td>
<td>{{ animal.idade }}</td>
<td>{{ animal.peso }}</td>
<td>
<a href="/editar/{{ animal.id }}">Editar</a> |
<a href="/deletar/{{ animal.id }}">Excluir</a>
</td>
</tr>
{% endfor %}
</table>
{% endblock %}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment