Files
Anh-Thy04 378fcb0b93 filters
2025-06-20 00:52:49 +02:00

63 lines
3.1 KiB
HTML

{% extends 'base.html' %}
{% block content %}
<div class="col-md-9 ms-sm-auto col-lg-10 px-md-4">
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
<h1 class="display-4 fw-bold" style="color: #313A4D;">Logs</h1>
</div>
<div class="col-md-12">
<div class="card mb-4"></div>
</div>
<div class="col-md-12">
<div class="card mb-4">
<div class="card-body">
<h5 class="card-title fs-4">Logs</h5>
<form method="get" class="mb-3">
<div class="row g-2 align-items-center">
<div class="col-md-4">
<select name="order" class="form-select">
<option value="desc" {% if request.args.get('order', 'desc') == 'desc' %}selected{% endif %}>Newest First</option>
<option value="asc" {% if request.args.get('order') == 'asc' %}selected{% endif %}>Oldest First</option>
</select>
</div>
<div class="col-auto d-flex gap-2">
<button type="submit" class="btn btn-secondary">Sort</button>
</div>
</div>
</form>
<div class="log-container" style="max-height: 250px; overflow-y: auto;">
<table class="table table-sm table-hover">
<thead>
<tr>
<th scope="col" class="fs-5" style="width: 21%">Time</th>
<th scope="col" class="fs-5" style="width: 42%">Numberplate</th>
<th scope="col" class="fs-5">Gate Status</th>
<th scope="col" class="fs-5">Actions</th>
</tr>
</thead>
<tbody>
{% for log in logs %}
<tr>
<td><small class="fs-6">{{ log.dateLogged.strftime('%H:%M:%S') }}</small></td>
<td><small class="fs-6">{{ log.plate }}</small></td>
<td>
<span class="badge bg-secondary fs-6">
{{ log.allowed }}
</span>
</td>
<td>
<form method="POST" action="{{ url_for('dash.delete_log', id=log.id) }}" style="display:inline;" onsubmit="return confirm('Are you sure you want to delete this log entry?');">
<button type="submit" class="btn btn-sm btn-secondary">Delete</button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
{% endblock %}