Files
The-Workers-Club/templates/admin_reqs_off.html

32 lines
1.8 KiB
HTML

TPL_ADMIN_REQS_BODY = """
<section class="rounded-2xl border border-slate-800 bg-slate-900/60 p-4 overflow-x-auto">
<div class="flex items-center justify-between">
<h1 class="text-xl font-bold mb-3">Time-off Requests</h1>
<a class="text-sm underline text-slate-300" href="{{ url_for('admin_requests_export') }}">Export CSV</a>
</div>
<table class="min-w-full text-sm">
<thead class="text-slate-300">
<tr><th class="py-2 text-left">User</th><th class="py-2 text-left">Date</th><th class="py-2 text-left">Status</th><th class="py-2 text-left">Note</th><th class="py-2 text-left">Requested</th><th class="py-2 text-left">Action</th></tr>
</thead>
<tbody class="divide-y divide-slate-800">
{% for r in rows %}
<tr>
<td class="py-2">{{ r.user.username }}</td>
<td class="py-2">{{ r.date }}</td>
<td class="py-2 capitalize">{{ r.status }}</td>
<td class="py-2">{{ r.note or '' }}</td>
<td class="py-2">{{ r.created_at.strftime('%Y-%m-%d %H:%M') }}</td>
<td class="py-2">
{% if r.status == 'pending' %}
<div class="flex gap-2">
<form method="post" action="{{ url_for('admin_requests_action', req_id=r.id, action='approve') }}"><input type="hidden" name="csrf_token" value="{{ csrf_token() }}"><button class="px-3 py-1.5 rounded-lg bg-emerald-600 hover:bg-emerald-700" type="submit">Approve</button></form>
<form method="post" action="{{ url_for('admin_requests_action', req_id=r.id, action='deny') }}"><input type="hidden" name="csrf_token" value="{{ csrf_token() }}"><button class="px-3 py-1.5 rounded-lg border border-slate-700 hover:border-slate-500" type="submit">Deny</button></form>
</div>
{% else %}<span class="text-slate-400"></span>{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</section>
"""