]> rtime.felk.cvut.cz Git - coffee/coffee-flask.git/commitdiff
Move Events block before user rename/id block
authorMichal Sojka <michal.sojka@cvut.cz>
Tue, 18 Aug 2020 19:12:09 +0000 (21:12 +0200)
committerMichal Sojka <michal.sojka@cvut.cz>
Wed, 19 Aug 2020 22:28:02 +0000 (00:28 +0200)
Events block will probably be used more often, so this will result in
less scrolling.

templates/user.html

index 0a8597bd70a2f100889caabeba985ca8a4751427..f878f0c7607ded6888595360dcc8f34f8ed5fca9 100644 (file)
@@ -31,6 +31,9 @@
 }
 </style>
 
+{###############}
+{# Graphs etc. #}
+{###############}
 {% if name %}
     <form style="position: absolute; right: 15%; width: 15%; height: 15%;">
         <button type="button" id="logout_button" onclick="logout()" style="width: 100%; height: 100%;">logout</button>
         </form>
         {% endif %}
     </p>
-    <br />
-    <p>
-        <form>
-            <label for="username">Username:</label>
-            <input id="username" type="text" name="name">
-            <input type="button" value="rename" onclick="renameUser()">
-        </form>
-    </p>
-    <form>
-        <table style="padding: 2px">
-            <tr>
-                <td colspan="4" align="center"><b>Identifiers:</b></td>
-            </tr>
-            {% for id in identifiers %}
-            <tr>
-                <td><input type="text" id="identifier_name_{{ loop.index }}" value="{{ id[2] }}" /></td>
-                <td {% if iid == id[1] %} style="font-weight: bold" {% endif %}>#<span id="identifier_{{ loop.index }}">{{ id[1] }}</span></td>
-                <td><input type="button" value="rename" onclick="renameIdentifier({{ loop.index }})" /></td>
-                <td><input type="button" value="remove" onclick="disableIdentifier('{{ id[1] }}')" /></td>
-            </tr>
-            {% endfor %}
-            <tr>
-                <td><input type="button" id="addIdentifier" value="add identifier" onclick="addIdentifier_start()" /></td>
-                <td colspan="2" style="visibility: hidden" id="labelIdentifier"><b>Use your identifier.</b></td>
-                <td><input type="button" id="abortIdentifier" value="abort" disabled onclick="addIdentifier_finish()" /></td>
-            </tr>
-        </table>
-    </form>
 {% else %}
     <p>Use your card/token to log in...</p>
 
     <img src="{{ url_for('coffee_graph_flavors', _external=True, stamp=stamp, days=7) }}">
 {% endif %}
 
+{##########}
+{# Events #}
+{##########}
     <br />
     <form>
       {%- macro event_box(title, events) -%}
         {{ event_box('milk container', ['MILK_CONTAINER_CLEANED', 'MILK_CONTAINER_CLEANED_WITH_TABLET'] ) }}
       </div>
     </form>
+
+{##################################}
+{# User name and chip idnetifiers #}
+{##################################}
+{% if name %}
+    <br />
+    <p>
+        <form>
+            <label for="username">Username:</label>
+            <input id="username" type="text" name="name">
+            <input type="button" value="rename" onclick="renameUser()">
+        </form>
+    </p>
+    <form>
+        <table style="padding: 2px">
+            <tr>
+                <td colspan="4" align="center"><b>Identifiers:</b></td>
+            </tr>
+            {% for id in identifiers %}
+            <tr>
+                <td><input type="text" id="identifier_name_{{ loop.index }}" value="{{ id[2] }}" /></td>
+                <td {% if iid == id[1] %} style="font-weight: bold" {% endif %}>#<span id="identifier_{{ loop.index }}">{{ id[1] }}</span></td>
+                <td><input type="button" value="rename" onclick="renameIdentifier({{ loop.index }})" /></td>
+                <td><input type="button" value="remove" onclick="disableIdentifier('{{ id[1] }}')" /></td>
+            </tr>
+            {% endfor %}
+            <tr>
+                <td><input type="button" id="addIdentifier" value="add identifier" onclick="addIdentifier_start()" /></td>
+                <td colspan="2" style="visibility: hidden" id="labelIdentifier"><b>Use your identifier.</b></td>
+                <td><input type="button" id="abortIdentifier" value="abort" disabled onclick="addIdentifier_finish()" /></td>
+            </tr>
+        </table>
+    </form>
+{% endif %}