vioott's picture
feat(genres): add and alphabetically sort extended list of book genres in start and profile forms
b797ec7
raw
history blame
2.26 kB
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
<title>Bem-vindo!</title>
<script>
function mostrarPerfis() {
document.getElementById('existing-profiles').classList.remove('hidden');
document.getElementById('formulario-perfil').classList.add('hidden');
document.getElementById('link-ja-tenho').classList.add('hidden');
document.getElementById('link-criar').classList.remove('hidden');
}
</script>
</head>
<body>
<form method="POST">
<h1>Vamos criar seu perfil?</h1>
<div class="small-link" id="link-ja-tenho">
<a href="#" onclick="mostrarPerfis(); return false;">Já tenho perfil</a>
</div>
<div class="small-link hidden" id="link-criar">
<a href="/">Criar perfil</a>
</div>
<div id="existing-profiles" class="hidden">
<h2>Perfis existentes</h2>
<ul>
{% for id, data in profiles.items() %}
<li><a href="/perfil/{{ id }}">{{ data.name or "Usuário " ~ id }}</a></li>
{% endfor %}
</ul>
</div>
<div id="formulario-perfil">
<label for="name">Seu nome:</label>
<input type="text" id="name" name="name" required><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 %}
<label class="genre-label" for="{{ genre }}">
<input type="checkbox" id="{{ genre }}" name="preferences" value="{{ genre }}">
{{ genre.title() }}
</label>
{% endfor %}
</div>
<br>
<button type="submit">Começar</button>
</div>
</form>
</body>
</html>