clubmanager/templates/dancers.rs.html

56 lines
2.2 KiB
HTML

@use super::base_html;
@use super::components::return_to_main_html;
@use super::components::dancer_html;
@use cm_lib::models::Dancer;
@(dancers: Vec<Dancer>)
@:base_html({
<div class="fixed right-0 top-0 pr-4 pt-4">
@:return_to_main_html()
</div>
<form hx-post="/api/dancers" hx-target="next #dancer_list" hx-swap="afterbegin" hx-on::after-request=" if(event.detail.successful) this.reset()">
<div class="flex w-3/5">
<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>
<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>
<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 px-5 py-2.5">+</button>
</div>
</form>
<table>
<thead>
<tr>
<th>Name</th>
<th>Stage Name</th>
</tr>
</thead>
<tbody id="dancer_list">
@for dancer in dancers.into_iter() {
@:dancer_html(dancer)
}
</tbody>
</table>
})