Files
inventory-app/inventory-app/templates/doorboy.html
Madis Mägi 83d72f355e
All checks were successful
ci/woodpecker/manual/woodpecker Pipeline was successful
Add user cards view
2023-08-14 04:35:27 +03:00

81 lines
3.0 KiB
HTML

{% extends 'base.html' %}
{% block content %}
<div class="container">
<p>Press to open:</p>
<ul>
<li><a class="waves-effect waves-light btn" href="/m/doorboy/grounddoor/open">Ground door</a> the one on street level facing KBFI</li>
<li><a class="waves-effect waves-light btn" href="/m/doorboy/frontdoor/open">Front door</a> the one from ground door 5 floors upward</li>
<li><a class="waves-effect waves-light btn" href="/m/doorboy/backdoor/open">Back door</a> on 5th floor on the Pancake cafeteria side. Note: ground door on cafeteria side is open whenever the cafeteria is open. Other times use the ground door listed above.</li>
<li><a class="waves-effect waves-light btn {% if not workshop_access%}disabled{%endif%}" href="/m/doorboy/workshopdoor/open">Workshop door</a> also known as the dirty room</li>
<!--
<li>Coming later: <a class="waves-effect waves-light btn" href="/m/doorboy/server/open">Server room door</a></li>
-->
</ul>
<p>Manage your keycards or keyfobs here:</p>
<a href="/m/doorboy/me" class="waves-effect waves-light btn"><i class="material-icons left">person</i>My cards</a>
<p>Recent door open requests via Slack or the buttons above</p>
<table>
<thead>
<tr>
<th>&nbsp;</th>
<th>When</th>
<th>Who</th>
<th>Door</th>
</tr>
</thead>
<tbody>
{% for o in latest_events %}
<tr>
<td>{% if o.approved %}<i class="material-icons">check_circle</i>{% else %}&nbsp;{% endif %}</td>
<td>{{ o.timestamp | timeago }}</td>
<td><a href="/m/user/{{ o.member_id }}">{% if o.member %}{{ o.member }}{% else %}{{ o.member_id }}{% endif %}</a></td>
<td>{{ o.door }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<p>Please claim keycards or keyfobs associated with you here!</p>
<table>
<thead>
<tr>
<th>&nbsp;</th>
<th>Last seen</th>
<th>&nbsp;</th>
<th>Who</th>
<th>UID hash tail</th>
<th>Granted</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
{% for o in latest_swipes %}
<tr>
<td>
{% if o.inventory and o.inventory.owner %}
&nbsp;
{% else %}
<i class="material-icons">error</i>{% endif %}
</td>
<td>{{ (o.last_seen or o.timestamp) | timeago }}</td>
<td>{{ o.door }}</td>
<td>{% if o.inventory and o.inventory.owner %}<a href="/m/user/{{ o.inventory.owner.username }}">{{ o.inventory.owner.username | display_name }}</a>{% else %}Unknown{% endif %}</td>
<td><a href="/m/doorboy/{{ o._id }}/events">{{ o.token.uid_hash[-6:] }}</a></td>
<td>{% if o.success %}<i class="material-icons">check_circle</i>{% else %}&nbsp;{% endif %}</td>
<td>{% if o.inventory and o.inventory.owner %}{{ o.token.comment }}{% else %}<a class="waves-effect waves-light btn" href="/m/doorboy/{{ o._id }}/claim">This is mine!</a>{% endif %}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock %}