tenis booking site done by claude
This commit is contained in:
64
ht_booking/assets/views/admin/booking_form.html
Normal file
64
ht_booking/assets/views/admin/booking_form.html
Normal file
@@ -0,0 +1,64 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}
|
||||
{% if mode == "edit" %}{{ t(key="edit-booking", lang=lang) }}{% else %}{{ t(key="add-booking", lang=lang) }}{% endif %}
|
||||
{% endblock title %}
|
||||
|
||||
{% block content %}
|
||||
<div class="mx-auto max-w-md">
|
||||
<div class="mb-4 flex items-center justify-between">
|
||||
<h1 class="text-2xl font-bold">
|
||||
{% if mode == "edit" %}{{ t(key="edit-booking", lang=lang) }}{% else %}{{ t(key="add-booking", lang=lang) }}{% endif %}
|
||||
</h1>
|
||||
<a href="/admin" class="text-sm text-blue-600 hover:underline">← {{ t(key="back-to-calendar", lang=lang) }}</a>
|
||||
</div>
|
||||
|
||||
<form method="post" action="{{ action }}" class="space-y-3 rounded-lg border bg-white p-4">
|
||||
<input type="hidden" name="court_id" value="{{ court_id }}">
|
||||
<div class="text-sm text-gray-600">{{ t(key="court-label", lang=lang) }}: <strong>{{ court_name }}</strong></div>
|
||||
<div>
|
||||
<label class="block text-sm text-gray-600">{{ t(key="date", lang=lang) }}</label>
|
||||
<input type="date" name="date" value="{{ date }}" required class="w-full rounded border-gray-300 text-sm">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm text-gray-600">{{ t(key="hour", lang=lang) }}</label>
|
||||
<select name="hour" class="w-full rounded border-gray-300 text-sm">
|
||||
{% for h in hours %}
|
||||
<option value="{{ h.v }}" {% if h.v == hour %}selected{% endif %}>{{ h.label }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm text-gray-600">{{ t(key="booking-color", lang=lang) }}</label>
|
||||
<input type="color" name="color" value="{{ color }}" class="h-9 w-16 rounded border-gray-300">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm text-gray-600">{{ t(key="booking-name", lang=lang) }}</label>
|
||||
<input name="name" value="{{ name }}" required class="w-full rounded border-gray-300 text-sm">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm text-gray-600">{{ t(key="booking-contact", lang=lang) }}</label>
|
||||
<input name="contact" value="{{ contact }}" class="w-full rounded border-gray-300 text-sm">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm text-gray-600">{{ t(key="booking-note", lang=lang) }}</label>
|
||||
<textarea name="note" rows="3" class="w-full rounded border-gray-300 text-sm">{{ note }}</textarea>
|
||||
</div>
|
||||
<div class="flex items-center gap-2">
|
||||
<button class="rounded bg-gray-900 px-4 py-2 text-sm text-white hover:bg-gray-700">
|
||||
{{ t(key="save", lang=lang) }}
|
||||
</button>
|
||||
<a href="/admin" class="rounded border px-4 py-2 text-sm hover:bg-gray-100">{{ t(key="cancel", lang=lang) }}</a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
{% if mode == "edit" %}
|
||||
<form method="post" action="/admin/booking/{{ booking_id }}/delete" class="mt-3"
|
||||
onsubmit="return confirm('{{ t(key="confirm-delete", lang=lang) }}');">
|
||||
<button class="rounded bg-red-600 px-4 py-2 text-sm text-white hover:bg-red-700">
|
||||
{{ t(key="delete", lang=lang) }}
|
||||
</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock content %}
|
||||
51
ht_booking/assets/views/admin/courts.html
Normal file
51
ht_booking/assets/views/admin/courts.html
Normal file
@@ -0,0 +1,51 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}{{ t(key="manage-courts", lang=lang) }}{% endblock title %}
|
||||
|
||||
{% block content %}
|
||||
<div class="mb-4 flex items-center justify-between">
|
||||
<h1 class="text-2xl font-bold">{{ t(key="manage-courts", lang=lang) }}</h1>
|
||||
<a href="/admin" class="text-sm text-blue-600 hover:underline">← {{ t(key="back-to-calendar", lang=lang) }}</a>
|
||||
</div>
|
||||
|
||||
<div class="mb-6 overflow-auto rounded-lg border bg-white">
|
||||
<table class="w-full text-sm">
|
||||
<thead>
|
||||
<tr class="bg-gray-100 text-left">
|
||||
<th class="p-2">{{ t(key="court-name", lang=lang) }}</th>
|
||||
<th class="p-2">{{ t(key="court-surface", lang=lang) }}</th>
|
||||
<th class="p-2">{{ t(key="court-indoor", lang=lang) }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for c in courts %}
|
||||
<tr class="border-t">
|
||||
<td class="p-2">{{ c.name }}</td>
|
||||
<td class="p-2">{{ c.surface }}</td>
|
||||
<td class="p-2">{{ c.indoor }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="max-w-md rounded-lg border bg-white p-4">
|
||||
<h2 class="mb-3 font-semibold">{{ t(key="add-court", lang=lang) }}</h2>
|
||||
<form method="post" action="/admin/courts" class="space-y-3">
|
||||
<div>
|
||||
<label class="block text-sm text-gray-600">{{ t(key="court-name", lang=lang) }}</label>
|
||||
<input name="name" required class="w-full rounded border-gray-300 text-sm">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm text-gray-600">{{ t(key="court-surface", lang=lang) }}</label>
|
||||
<input name="surface" class="w-full rounded border-gray-300 text-sm">
|
||||
</div>
|
||||
<label class="flex items-center gap-2 text-sm">
|
||||
<input type="checkbox" name="indoor" value="1"> {{ t(key="court-indoor", lang=lang) }}
|
||||
</label>
|
||||
<button class="rounded bg-gray-900 px-4 py-2 text-sm text-white hover:bg-gray-700">
|
||||
{{ t(key="add-court", lang=lang) }}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
25
ht_booking/assets/views/admin/login.html
Normal file
25
ht_booking/assets/views/admin/login.html
Normal file
@@ -0,0 +1,25 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}{{ t(key="login-title", lang=lang) }}{% endblock title %}
|
||||
|
||||
{% block content %}
|
||||
<div class="mx-auto mt-8 max-w-sm rounded-lg border bg-white p-6">
|
||||
<h1 class="mb-4 text-xl font-bold">{{ t(key="login-title", lang=lang) }}</h1>
|
||||
{% if error %}
|
||||
<div class="mb-3 rounded bg-red-100 px-3 py-2 text-sm text-red-700">{{ t(key="login-error", lang=lang) }}</div>
|
||||
{% endif %}
|
||||
<form method="post" action="/admin/login" class="space-y-3">
|
||||
<div>
|
||||
<label class="block text-sm text-gray-600">{{ t(key="email", lang=lang) }}</label>
|
||||
<input type="email" name="email" required class="w-full rounded border-gray-300 text-sm">
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-sm text-gray-600">{{ t(key="password", lang=lang) }}</label>
|
||||
<input type="password" name="password" required class="w-full rounded border-gray-300 text-sm">
|
||||
</div>
|
||||
<button class="w-full rounded bg-gray-900 py-2 text-sm text-white hover:bg-gray-700">
|
||||
{{ t(key="login-button", lang=lang) }}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
Reference in New Issue
Block a user