]> rtime.felk.cvut.cz Git - coffee/coffee-flask.git/blob - templates/user.html
5ad7b901584c6fa01eab306c41af6fc878197bc6
[coffee/coffee-flask.git] / templates / user.html
1 {% if name %}
2     <form style="position: absolute; right: 15%; width: 15%; height: 15%;">
3         <button type="button" id="logout_button" onclick="logout()" style="width: 100%; height: 100%;">logout</button>
4     </form>
5
6     <h1>Hello, {{ name }}!</h1>
7
8     <p id="nextStep"></p>
9
10     {% if counts|length > 0 %}
11     <p>You've had
12     {% for c in counts %}
13         {%- if counts|length > 1 -%}
14             {%- if loop.last -%}
15                 {%- if counts|length > 2 -%}
16                     ,
17                 {% endif %}
18                 and
19             {%- elif not loop.first -%}
20                 ,
21             {% endif %}
22         {% endif %}
23         {{ c[1] }}
24         {% if c[0] == "" %}
25             other beverage
26         {%- else -%}
27             {{ c[0] }}
28         {%- endif -%}
29         {%- if c[1] != 1 -%}s{%- endif -%}
30     {% endfor %}
31     today.</p>
32     {% endif %}
33
34     <img src="{{ url_for('coffee_graph_history', _external=True, stamp=stamp) }}">
35     <img src="{{ url_for('coffee_graph_flavors', _external=True, stamp=stamp) }}">
36
37     <p>
38         {% if flavors %}
39         <form>
40         {% for flavor in flavors %}
41         <input type="button" value="{{ flavor }}" onclick="addCoffee(this.value)" style="padding: 1.2%; margin: 3px">
42         {% endfor %}
43         </form>
44         {% endif %}
45     </p>
46     <br />
47     <p>
48         <form>
49             <label for="username">Username:</label>
50             <input id="username" type="text" name="name">
51             <input type="button" value="rename" onclick="renameUser()">
52         </form>
53     </p>
54     <form>
55         <table style="padding: 2px">
56             <tr>
57                 <td colspan="4" align="center"><b>Identifiers:</b></td>
58             </tr>
59             {% for id in identifiers %}
60             <tr>
61                 <td><input type="text" id="identifier_name_{{ loop.index }}" value="{{ id[2] }}" /></td>
62                 <td {% if iid == id[1] %} style="font-weight: bold" {% endif %}>#<span id="identifier_{{ loop.index }}">{{ id[1] }}</span></td>
63                 <td><input type="button" value="rename" onclick="renameIdentifier({{ loop.index }})" /></td>
64                 <td><input type="button" value="remove" onclick="disableIdentifier('{{ id[1] }}')" /></td>
65             </tr>
66             {% endfor %}
67             <tr>
68                 <td><input type="button" id="addIdentifier" value="add identifier" onclick="addIdentifier_start()" /></td>
69                 <td colspan="2" style="visibility: hidden" id="labelIdentifier"><b>Use your identifier.</b></td>
70                 <td><input type="button" id="abortIdentifier" value="abort" disabled onclick="addIdentifier_finish()" /></td>
71             </tr>
72         </table>
73     </form>
74 {% else %}
75     <p>Use your card/token to log in...</p>
76
77     <img src="{{ url_for('coffee_graph_history', _external=True, stamp=stamp) }}">
78     <img src="{{ url_for('coffee_graph_flavors', _external=True, stamp=stamp, days=7) }}">
79 {% endif %}