File size: 2,257 Bytes
809791b
 
 
a204d40
 
1387ef8
 
 
 
 
 
 
 
 
 
809791b
 
a204d40
 
 
809791b
1387ef8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b797ec7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1387ef8
 
 
a204d40
1387ef8
a204d40
 
809791b
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<!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>