Spaces:
Sleeping
Sleeping
feat(genres): add and alphabetically sort extended list of book genres in start and profile forms
Browse files- templates/profile.html +13 -5
- templates/start.html +15 -7
templates/profile.html
CHANGED
|
@@ -12,12 +12,20 @@
|
|
| 12 |
<input type="text" id="name" name="name" value="{{ history.get('name', '') }}"><br><br>
|
| 13 |
|
| 14 |
<p>Quais gêneros de livros você gosta?</p>
|
| 15 |
-
{%
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
<br><button type="submit">Salvar preferências</button>
|
| 22 |
</form>
|
| 23 |
</body>
|
|
|
|
| 12 |
<input type="text" id="name" name="name" value="{{ history.get('name', '') }}"><br><br>
|
| 13 |
|
| 14 |
<p>Quais gêneros de livros você gosta?</p>
|
| 15 |
+
{% set genres = [
|
| 16 |
+
'aventura', 'autoajuda', 'biografia', 'ciência', 'drama', 'educação',
|
| 17 |
+
'espiritualidade', 'fantasia', 'ficção', 'filosofia', 'história', 'humor',
|
| 18 |
+
'mistério', 'negócios', 'não-ficção', 'poesia', 'romance', 'tecnologia', 'terror'
|
| 19 |
+
] %}
|
| 20 |
|
| 21 |
+
<div class="genre-grid">
|
| 22 |
+
{% for genre in genres %}
|
| 23 |
+
<input type="checkbox" id="{{ genre }}" name="preferences" value="{{ genre }}"
|
| 24 |
+
{% if genre in history.get('preferences', []) %}checked{% endif %}>
|
| 25 |
+
<label for="{{ genre }}">{{ genre.title() }}</label><br>
|
| 26 |
+
{% endfor %}
|
| 27 |
+
</div>
|
| 28 |
+
|
| 29 |
<br><button type="submit">Salvar preferências</button>
|
| 30 |
</form>
|
| 31 |
</body>
|
templates/start.html
CHANGED
|
@@ -41,13 +41,21 @@
|
|
| 41 |
<input type="text" id="name" name="name" required><br><br>
|
| 42 |
|
| 43 |
<p>Quais gêneros de livros você gosta?</p>
|
| 44 |
-
|
| 45 |
-
{%
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
|
| 52 |
<br>
|
| 53 |
<button type="submit">Começar</button>
|
|
|
|
| 41 |
<input type="text" id="name" name="name" required><br><br>
|
| 42 |
|
| 43 |
<p>Quais gêneros de livros você gosta?</p>
|
| 44 |
+
|
| 45 |
+
{% set genres = [
|
| 46 |
+
'aventura', 'autoajuda', 'biografia', 'ciência', 'drama', 'educação',
|
| 47 |
+
'espiritualidade', 'fantasia', 'ficção', 'filosofia', 'história', 'humor',
|
| 48 |
+
'mistério', 'negócios', 'não-ficção', 'poesia', 'romance', 'tecnologia', 'terror'
|
| 49 |
+
] %}
|
| 50 |
+
|
| 51 |
+
<div class="genre-grid">
|
| 52 |
+
{% for genre in genres %}
|
| 53 |
+
<label class="genre-label" for="{{ genre }}">
|
| 54 |
+
<input type="checkbox" id="{{ genre }}" name="preferences" value="{{ genre }}">
|
| 55 |
+
{{ genre.title() }}
|
| 56 |
+
</label>
|
| 57 |
+
{% endfor %}
|
| 58 |
+
</div>
|
| 59 |
|
| 60 |
<br>
|
| 61 |
<button type="submit">Começar</button>
|