clubmanager/templates/dancers.rs.html

68 lines
2.7 KiB
HTML
Raw Permalink Normal View History

2023-11-05 15:03:15 +00:00
@use super::base_html;
@use super::components::return_to_main_html;
2023-11-06 19:14:04 +00:00
@use super::components::dancer_html;
@use cm_lib::models::Dancer;
2023-11-05 15:03:15 +00:00
2023-11-06 19:14:04 +00:00
@(dancers: Vec<Dancer>)
2023-11-05 15:03:15 +00:00
@:base_html({
2023-11-05 15:18:17 +00:00
<div class="fixed right-0 top-0 pr-4 pt-4">
@:return_to_main_html()
</div>
2023-11-05 15:03:15 +00:00
<h1 class="text-4xl underline text-center pt-4 pb-6">
2023-11-15 22:04:59 +00:00
Dancers
</h1>
2023-11-17 11:12:55 +00:00
<form hx-post="/api/dancers" hx-target="find #dancer_list" hx-swap="beforeend" hx-on::after-request="if(event.detail.successful) this.reset()">
2023-11-15 22:04:59 +00:00
<table class="m-auto table-auto w-4/5">
<thead class="text-xs text-gray-700 bg-gray-50">
<tr>
<th scope="col" class="px-6 py-3">Name</th>
<th scope="col" class="px-6 py-3">Stage Name</th>
<th></th>
</tr>
</thead>
2023-11-15 22:04:59 +00:00
<tbody id="dancer_list">
<tr class="bg-white even:bg-neutral-50 border-b">
<td>
<div class="relative">
<input type="text" id="name" name="name"
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-gray-900 bg-transparent rounded-lg border-2 border-gray-300 appearance-none focus:outline-none focus:ring-0 focus:border-blue-600 peer"
placeholder=" " />
<label for="name"
class="absolute text-sm text-gray-500 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-white px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">
Name
</label>
</div>
</td>
<td>
<div class="relative">
<input type="text" id="stage_name" name="stage_name"
class="block px-2.5 pb-2.5 pt-4 w-full text-sm text-gray-900 bg-transparent rounded-lg border-2 border-gray-300 appearance-none focus:outline-none focus:ring-0 focus:border-blue-600 peer"
placeholder=" " />
<label for="stage_name"
class="absolute text-sm text-gray-500 duration-300 transform -translate-y-4 scale-75 top-2 z-10 origin-[0] bg-white px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-2 peer-focus:scale-75 peer-focus:-translate-y-4 left-1">
Stage Name
</label>
</div>
</td>
2023-11-15 22:04:59 +00:00
<td class="w-12">
<button type="submit" class="focus:outline-none text-white bg-green-700 hover:bg-green-800 focus:ring-4 focus:ring-green-300 font-medium rounded-lg text-sm w-12 h-12">+</button>
</td>
2023-11-15 22:04:59 +00:00
</tr>
@for dancer in dancers.into_iter() {
2023-11-06 19:14:04 +00:00
2023-11-15 22:04:59 +00:00
@:dancer_html(dancer)
2023-11-06 19:14:04 +00:00
2023-11-15 22:04:59 +00:00
}
</tbody>
</table>
</form>
2023-11-05 15:03:15 +00:00
})