ui
This commit is contained in:
@@ -9,9 +9,9 @@
|
||||
</h1>
|
||||
{% if has_courts %}
|
||||
<form method="get" action="{{ base_path }}" class="flex items-center gap-2">
|
||||
<label class="text-sm text-gray-600">{{ t(key="court-label", lang=lang) }}</label>
|
||||
<label class="text-sm font-medium text-gray-600">{{ t(key="court-label", lang=lang) }}</label>
|
||||
<input type="hidden" name="week" value="{{ week }}">
|
||||
<select name="court" onchange="this.form.submit()" class="rounded border-gray-300 text-sm">
|
||||
<select name="court" onchange="this.form.submit()" class="select select-bordered select-sm">
|
||||
{% for c in courts %}
|
||||
<option value="{{ c.id }}" {% if c.selected %}selected{% endif %}>{{ c.name }}</option>
|
||||
{% endfor %}
|
||||
@@ -22,26 +22,26 @@
|
||||
|
||||
{% if has_courts %}
|
||||
<div class="mb-3 flex flex-wrap items-center justify-between gap-2">
|
||||
<div class="flex gap-2">
|
||||
<div class="join">
|
||||
<a href="{{ base_path }}?court={{ court_id }}&week={{ prev_week }}"
|
||||
class="rounded border bg-white px-3 py-1 text-sm hover:bg-gray-100">← {{ t(key="prev-week", lang=lang) }}</a>
|
||||
class="btn btn-sm join-item">« {{ t(key="prev-week", lang=lang) }}</a>
|
||||
<a href="{{ base_path }}?court={{ court_id }}&week={{ this_week }}"
|
||||
class="rounded border bg-white px-3 py-1 text-sm hover:bg-gray-100">{{ t(key="this-week", lang=lang) }}</a>
|
||||
class="btn btn-sm join-item">{{ t(key="this-week", lang=lang) }}</a>
|
||||
<a href="{{ base_path }}?court={{ court_id }}&week={{ next_week }}"
|
||||
class="rounded border bg-white px-3 py-1 text-sm hover:bg-gray-100">{{ t(key="next-week", lang=lang) }} →</a>
|
||||
class="btn btn-sm join-item">{{ t(key="next-week", lang=lang) }} »</a>
|
||||
</div>
|
||||
<div class="text-sm font-medium text-gray-600">{{ court_name }} · {{ week_label }}</div>
|
||||
<div class="text-sm font-medium text-gray-500">{{ court_name }} · {{ week_label }}</div>
|
||||
</div>
|
||||
|
||||
<div class="overflow-auto rounded-lg border bg-white">
|
||||
<div class="overflow-x-auto rounded-lg border border-gray-200 bg-white shadow-sm">
|
||||
<table class="w-full border-collapse text-sm">
|
||||
<thead>
|
||||
<tr class="bg-gray-100">
|
||||
<th class="w-16 border p-2"></th>
|
||||
<th class="w-16 border border-gray-200 p-2"></th>
|
||||
{% for d in days %}
|
||||
<th class="border p-2 text-center">
|
||||
<th class="border border-gray-200 p-2 text-center">
|
||||
<div class="font-semibold">{{ t(key=d.key, lang=lang) }}</div>
|
||||
<div class="text-xs font-normal text-gray-500">{{ d.num }}</div>
|
||||
<div class="text-xs font-normal text-gray-400">{{ d.num }}</div>
|
||||
</th>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
@@ -49,24 +49,24 @@
|
||||
<tbody>
|
||||
{% for row in rows %}
|
||||
<tr>
|
||||
<td class="border p-2 text-center font-medium text-gray-500">{{ row.hour_label }}</td>
|
||||
<td class="border border-gray-200 bg-gray-50 p-2 text-center font-medium text-gray-500">{{ row.hour_label }}</td>
|
||||
{% for cell in row.cells %}
|
||||
<td class="h-14 border p-1 align-top">
|
||||
<td class="h-14 border border-gray-200 p-1 align-top">
|
||||
{% if cell.booked %}
|
||||
{% if is_admin %}
|
||||
<a href="/admin/booking/{{ cell.booking_id }}"
|
||||
class="block h-full rounded px-1 py-1 text-xs font-medium text-white"
|
||||
class="block h-full rounded px-1 py-1 text-xs font-medium text-white shadow-sm transition hover:opacity-90"
|
||||
style="background-color: {{ cell.color }}">{{ cell.name }}</a>
|
||||
{% else %}
|
||||
<div class="h-full rounded px-1 py-1 text-xs font-medium text-white"
|
||||
<div class="h-full rounded px-1 py-1 text-xs font-medium text-white shadow-sm"
|
||||
style="background-color: {{ cell.color }}" title="{{ cell.name }}">{{ t(key="booked", lang=lang) }}</div>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% if is_admin %}
|
||||
<a href="/admin/booking?court={{ court_id }}&date={{ cell.date }}&hour={{ cell.hour }}"
|
||||
class="block h-full rounded px-1 py-1 text-xs text-gray-400 hover:bg-gray-100">+</a>
|
||||
class="flex h-full items-center justify-center rounded text-lg text-gray-300 transition hover:bg-gray-100 hover:text-gray-500">+</a>
|
||||
{% else %}
|
||||
<div class="h-full px-1 py-1 text-xs text-gray-300">{{ t(key="free", lang=lang) }}</div>
|
||||
<div class="px-1 py-1 text-xs text-gray-300">{{ t(key="free", lang=lang) }}</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</td>
|
||||
@@ -77,6 +77,8 @@
|
||||
</table>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="rounded-lg border bg-white p-8 text-center text-gray-500">{{ t(key="no-courts", lang=lang) }}</div>
|
||||
<div class="card border border-gray-200 bg-white shadow-sm">
|
||||
<div class="card-body items-center text-center text-gray-500">{{ t(key="no-courts", lang=lang) }}</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock content %}
|
||||
|
||||
Reference in New Issue
Block a user