aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorBen Cohen <ben@kensho.com>2019-07-28 14:01:54 -0400
committerBen Cohen <ben@kensho.com>2019-07-28 14:01:54 -0400
commit150be03c35a1794f5a2ea330411361cf40fc91e7 (patch)
tree7d1e07d1fcd94e6bc288d3baa96b32dc239cf5a0 /templates
parentb7bd395b891dbef721f13f6e5a7de3961a0b492e (diff)
parenta60be578d65dd0e06e468623412814d861b6e8d7 (diff)
merge
Diffstat (limited to 'templates')
-rw-r--r--templates/beerpage.jinja240
-rw-r--r--templates/similar.jinja22
2 files changed, 27 insertions, 15 deletions
diff --git a/templates/beerpage.jinja2 b/templates/beerpage.jinja2
index c99045d..f16660c 100644
--- a/templates/beerpage.jinja2
+++ b/templates/beerpage.jinja2
@@ -18,20 +18,32 @@
</tr>
</table>
</div>
- <div class="row">
- <select>
- <option value="3">Much more</option>
- <option value="2">More</option>
- <option value="1">Little more</option>
- <option value="-1">Little less</option>
- <option value="-2">Less</option>
- <option value="-3">Much less</option>
- </select>
- <select>
- {% for attr in attrs %}
+ <form action="" method="post">
+ <p>
+ Show me beers which are
+ <select name="direction">
+ <option value="3">Much more</option>
+ <option value="2">More</option>
+ <option value="1">Little more</option>
+ <option value="-1">Little less</option>
+ <option value="-2">Less</option>
+ <option value="-3">Much less</option>
+ </select>
+ <select name="attr">
+ {% for attr in attrs %}
<option value="{{ attr }}"> {{ attr }}</option>
- {% endfor %}
- </select>
- </div>
+ {% endfor %}
+ </select>
+ <input type="submit" value="Go">
+ </p>
+ </form>
+ {% if direction and attr %}
+ <h5>Beers like {{ beer_data.name }} but {{ direction }} {{ attr }}</h5>
+ <ul>
+ {% for similar_beer in similar_beers %}
+ <li>{{ similar_beer }}</li>
+ {% endfor %}
+ </ul>
+ {% endif %}
{% endblock %}
diff --git a/templates/similar.jinja2 b/templates/similar.jinja2
index b7a57f7..4bdd748 100644
--- a/templates/similar.jinja2
+++ b/templates/similar.jinja2
@@ -1,6 +1,6 @@
{% extends "base.html" %}
{% block content %}
-<h1>Similar Beers</h1>
+<h1>Beers Like {{ orig }} but {{ dir }} {{ attr }}</h1>
<ul>
{% for beer in beers %}
<li>{{ beer }}</li>