clubmanager/templates/shift_reports.rs.html

54 lines
1.2 KiB
HTML
Raw Normal View History

2023-10-24 13:17:34 +00:00
@use super::base_html;
2023-11-05 15:03:15 +00:00
@use super::components::return_to_main_html;
2023-10-24 13:17:34 +00:00
@use cm_lib::models::Shift;
@(shifts: Vec<Shift>)
@:base_html({
2023-11-05 16:38:15 +00:00
<div class="fixed right-0 top-0 pr-4 pt-4">
@:return_to_main_html()
</div>
<h1 class="text-4xl underline text-center pt-4 pb-6">
Shift Reports
</h1>
<div class="flex">
<table class="m-auto table-auto w-4/5">
<thead>
<tr>
<th>Shift ID</th>
<th>Shift Start</th>
<th>Shift End</th>
</tr>
</thead>
<tbody>
@for shift in shifts {
<tr class="odd:bg-neutral-200">
<td class="text-center">@shift.id</td>
2023-11-05 18:17:30 +00:00
<td class="text-center">@shift.start.format("%A, %b %m - %H:%M")</td>
2023-11-05 16:38:15 +00:00
<td class="text-center">
@if let Some(end) = shift.end {
2023-11-05 18:17:30 +00:00
@end.format("%A, %b %m - %H:%M")
2023-11-05 16:38:15 +00:00
} else {
Currently Open
}
</td>
<td hx-boost="true" class="flex justify-end">
<a href="/shifts/@shift.id/report">
2023-11-05 18:17:30 +00:00
<button type="button" class="text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5">
View Shift
</button>
2023-11-05 16:38:15 +00:00
</a>
</td>
</tr>
}
</tbody>
</table>
</div>
2023-10-24 13:17:34 +00:00
})