65 lines
2.2 KiB
HTML
65 lines
2.2 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}Zeiterfassung aller Benutzer{% endblock title %}
|
|
|
|
{% block content %}
|
|
<div class="container mx-auto py-8 px-4">
|
|
<h1 class="text-2xl font-bold mb-4">Zeiterfassung (alle Benutzer)</h1>
|
|
|
|
{% with messages = get_flashed_messages(with_categories=true) %}
|
|
{% if messages %}
|
|
{% for category, message in messages %}
|
|
<div class="bg-{{category}}-500 text-white p-2 mb-2 rounded">
|
|
{{ message }}
|
|
</div>
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% endwith %}
|
|
|
|
<div class="overflow-x-auto">
|
|
<table class="table-auto w-full text-left">
|
|
<thead>
|
|
<tr class="border-b">
|
|
<th class="px-2 py-1">ID</th>
|
|
<th class="px-2 py-1">Benutzer</th>
|
|
<th class="px-2 py-1">Aktivität</th>
|
|
<th class="px-2 py-1">Start</th>
|
|
<th class="px-2 py-1">Ende</th>
|
|
<th class="px-2 py-1">Dauer</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for entry in time_entries %}
|
|
<tr class="border-b">
|
|
<td class="px-2 py-1">{{ entry.id }}</td>
|
|
<td class="px-2 py-1">{{ entry.username }}</td>
|
|
<td class="px-2 py-1">{{ entry.activity }}</td>
|
|
<td class="px-2 py-1">{{ entry.start_time }}</td>
|
|
<td class="px-2 py-1">
|
|
{% if entry.end_time %}
|
|
{{ entry.end_time }}
|
|
{% else %}
|
|
<span class="text-sm text-gray-600">läuft …</span>
|
|
{% endif %}
|
|
</td>
|
|
<td class="px-2 py-1">
|
|
{% if entry.end_time %}
|
|
<!-- Beispielhafter Zeitunterschied in Minuten -->
|
|
{% set duration = (entry.end_time|datetime - entry.start_time|datetime).total_seconds() / 60 %}
|
|
{{ duration|round(2) }} Minuten
|
|
{% else %}
|
|
...
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<a href="{{ url_for('admin_panel') }}"
|
|
class="inline-block bg-blue-500 text-white px-4 py-2 rounded mt-4 hover:bg-blue-600">
|
|
Zurück zum Admin-Menü
|
|
</a>
|
|
</div>
|
|
{% endblock content %}
|