vioott's picture
feat(genres): add and alphabetically sort extended list of book genres in start and profile forms
b797ec7
raw
history blame
1.22 kB
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
<title>Perfil do Usuário</title>
</head>
<body>
<h1>Bem-vindo, usuário {{ user_id }}</h1>
<form method="POST">
<label for="name">Seu nome:</label><br>
<input type="text" id="name" name="name" value="{{ history.get('name', '') }}"><br><br>
<p>Quais gêneros de livros você gosta?</p>
{% set genres = [
'aventura', 'autoajuda', 'biografia', 'ciência', 'drama', 'educação',
'espiritualidade', 'fantasia', 'ficção', 'filosofia', 'história', 'humor',
'mistério', 'negócios', 'não-ficção', 'poesia', 'romance', 'tecnologia', 'terror'
] %}
<div class="genre-grid">
{% for genre in genres %}
<input type="checkbox" id="{{ genre }}" name="preferences" value="{{ genre }}"
{% if genre in history.get('preferences', []) %}checked{% endif %}>
<label for="{{ genre }}">{{ genre.title() }}</label><br>
{% endfor %}
</div>
<br><button type="submit">Salvar preferências</button>
</form>
</body>
</html>