]> rtime.felk.cvut.cz Git - coffee/coffee-flask.git/blob - templates/user.html
Add support for multiple identifiers per user
[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 count or count_mate%}
11     <p>You've had {{ count }} coffee{% if count != 1 %}s{% endif %} and {{ count_mate }} Club-Mate today.</p>
12     {% endif %}
13
14     <img src="{{ url_for('coffee_graph_history', _external=True, stamp=stamp) }}">
15     <img src="{{ url_for('coffee_graph_flavors', _external=True, stamp=stamp) }}">
16
17     <p>
18         {% if flavors %}
19         <form>
20         {% for flavor in flavors %}
21         <input type="button" value="{{ flavor }}" onclick="addCoffee(this.value)">
22         {% endfor %}
23         </form>
24         {% endif %}
25     </p>
26     <p>
27         <form>
28             <label for="username">Username:</label>
29             <input id="username" type="text" name="name">
30             <input type="button" value="rename" onclick="renameUser()">
31         </form>
32     </p>
33     <form>
34         <table style="padding: 2px">
35             <tr>
36                 <td colspan="4" align="center"><b>Identifiers:</b></td>
37             </tr>
38             {% for id in identifiers %}
39             <tr>
40                 <td><input type="text" id="identifier_name_{{ loop.index }}" value="{{ id[2] }}" /></td>
41                 <td {% if iid == id[1] %} style="font-weight: bold" {% endif %}>#<span id="identifier_{{ loop.index }}">{{ id[1] }}</span></td>
42                 <td><input type="button" value="rename" onclick="renameIdentifier({{ loop.index }})" /></td>
43                 <td><input type="button" value="remove" onclick="disableIdentifier({{ id[1] }})" /></td>
44             </tr>
45             {% endfor %}
46             <tr>
47                 <td><input type="button" id="addIdentifier" value="add identifier" onclick="addIdentifier_start()" /></td>
48                 <td colspan="2" style="visibility: hidden" id="labelIdentifier"><b>Use your identifier.</b></td>
49                 <td><input type="button" id="abortIdentifier" value="abort" disabled onclick="addIdentifier_finish()" /></td>
50             </tr>
51         </table>
52     </form>
53 {% else %}
54     <p>Use your card/token to log in...</p>
55
56     <img src="{{ url_for('coffee_graph_history', _external=True, stamp=stamp) }}">
57     <img src="{{ url_for('coffee_graph_flavors', _external=True, stamp=stamp, days=7) }}">
58 {% endif %}