blob: 0e96dece53935a28b56ff588f78210f15f0434a5 (
plain)
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
|
{% extends "base.html" %}
{% block content %}
<div id="title" class="text-center">
<h2>{{ beer_data.brewer if beer_data != None else 'DELICOUS BREWER' }}</h2>
<h2>{{ beer_data.name if beer_data != None else 'DELICOUS BEER' }}</h2>
</div>
<div id="stats">
<table class="table">
<tr>
<th scope="col">Parent Style</th>
<th scope="col">Specific Style</th>
<th scope="col">Alcohol by Volume </th>
</tr>
<tr>
<td>{{ beer_data.parent_style if beer_data != None else 'ASS BEER' }}</td>
<td>{{ beer_data.base_style if beer_data != None else 'TURBO ASS BEER' }}</td>
<td>{{ beer_data.abv if beer_data != None else 'BETWEEN 0 and 100' }} (drinks like: {{beer_data.drinks_like|round(2)}})</td>
</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>
{% 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 %}
|