diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/beerpage.jinja2 | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/templates/beerpage.jinja2 b/templates/beerpage.jinja2 index 0e96dec..f6e0b2e 100644 --- a/templates/beerpage.jinja2 +++ b/templates/beerpage.jinja2 @@ -18,30 +18,32 @@ </tr> </table> </div> - <form action="" method="post" class="form-inline"> - <p> - Show me beers which are - <select name="direction" class="form-control"> - <option {% if direction == '3' %}selected{% endif %} value="3">Much more</option> - <option {% if direction == '2' %}selected{% endif %} value="2">More</option> - <option {% if direction == '1' %}selected{% endif %} value="1">Little more</option> - <option {% if direction == '-1' %}selected{% endif %} value="-1">Little less</option> - <option {% if direction == '-2' %}selected{% endif %} value="-2">Less</option> - <option {% if direction == '-3' %}selected{% endif %} value="-3">Much less</option> - </select> - <select name="attr" class="form-control"> - {% for a in attrs %} - <option {% if a == attr %}selected{% endif %} value="{{ a }}">{{ a }}</option> - {% endfor %} - </select> - <input type="submit" value="Go" class="btn btn-outline-primary"> - </p> + <form action="" method="post" class="form-inline alert alert-secondary"> + Show me beers which are + <select name="direction" class="form-control"> + <option {% if direction == '3' %}selected{% endif %} value="3">Much more</option> + <option {% if direction == '2' %}selected{% endif %} value="2">More</option> + <option {% if direction == '1' %}selected{% endif %} value="1">Little more</option> + <option {% if direction == '-1' %}selected{% endif %} value="-1">Little less</option> + <option {% if direction == '-2' %}selected{% endif %} value="-2">Less</option> + <option {% if direction == '-3' %}selected{% endif %} value="-3">Much less</option> + </select> + <select name="attr" class="form-control"> + {% for a in attrs %} + <option {% if a == attr %}selected{% endif %} value="{{ a }}">{{ a }}</option> + {% endfor %} + </select> + <input type="submit" value="Go" class="btn btn-outline-primary"> </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> + {% for sb in similar_beers %} + <li> + <a href="{{ url_for('get_beer_details', brewery_id=sb.brewery_id, beer_id=sb.id) }}"> + {{ sb.name }} ({{ sb.base_style }} by {{ sb.brewer }}) + </a> + </li> {% endfor %} </ul> {% endif %} |