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