From dda69c030ff36311cd9d57b32401497a0a4a647c Mon Sep 17 00:00:00 2001 From: Ben Burwell Date: Sun, 28 Jul 2019 16:46:27 -0400 Subject: fix up template --- app.py | 2 +- templates/beerpage.jinja2 | 214 ++++++++++++++++++++++++---------------------- 2 files changed, 113 insertions(+), 103 deletions(-) diff --git a/app.py b/app.py index 3b6b83e..de3035a 100644 --- a/app.py +++ b/app.py @@ -89,7 +89,7 @@ def get_beer_details(brewery_id, beer_id): attr_beer_objects.append(BeerInfo(item[0], item_brewer, item_result)) return render_template('beerpage.jinja2', beer_data=beerinfo, attrs=ATTRS, similar_beers=similar_beer_objects, attr=attr, - direction=direction, attr_beers=attr_beer_objects, style_preds=similar_beer, + direction=direction, attr_beers=attr_beer_objects, style_preds=similar_beers, style_map=style_map) if style != None: style_beers = translate_to_style(full_id, style) diff --git a/templates/beerpage.jinja2 b/templates/beerpage.jinja2 index 6c523b4..303f629 100644 --- a/templates/beerpage.jinja2 +++ b/templates/beerpage.jinja2 @@ -73,23 +73,22 @@ function drawAnnotations() {
-
Beers like {{ beer_data.name }}
-
@@ -115,117 +114,117 @@ function drawAnnotations() {
Show me similar beers in the style of
@@ -234,27 +233,38 @@ function drawAnnotations() { {% if attr_beers %}
Beers like {{ beer_data.name }} but {{ direction }} {{ attr }}
- - - - +
BeerStyleABV
+ + + + + {% for attr_beer in attr_beers %} - + {% endfor %}
BeerStyleABV
{{ attr_beer.brewer }} - {{ attr_beer.name }} {{attr_beer.base_style}} {{attr_beer.abv}}
{% endif %} {% if style_beers %}
Beers like {{ beer_data.name }} but in the {{ style }} style
-