clubmanager/templates/shift_reports.rs.html

53 lines
1.3 KiB
HTML
Raw Permalink 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">
2023-11-05 18:46:46 +00:00
<thead class="text-xs text-gray-700 bg-gray-50">
2023-11-05 16:38:15 +00:00
<tr>
2023-11-05 18:46:46 +00:00
<th scope="col" class="px-6 py-3">Shift ID</th>
<th scope="col" class="px-6 py-3">Shift Start</th>
<th scope="col" class="px-6 py-3">Shift End</th>
<th></th>
2023-11-05 16:38:15 +00:00
</tr>
</thead>
<tbody>
@for shift in shifts {
2023-11-05 20:16:21 +00:00
<tr class="bg-white even:bg-neutral-50 border-b">
2023-11-05 18:46:46 +00:00
<td scope="row" class="text-center px-6 py-3">@shift.id</td>
<td class="text-center px-6 py-3">@shift.start.format("%A, %b %m - %H:%M")</td>
<td class="text-center px-6 py-3">
2023-11-05 16:38:15 +00:00
@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>
2023-11-05 18:46:46 +00:00
<td hx-boost="true" class="px-6 py-4">
<a href="/shifts/@shift.id/report" class="text-center font-medium text-blue-600 hover:underline">
2023-11-05 18:17:30 +00:00
View Shift
2023-11-05 16:38:15 +00:00
</a>
</td>
</tr>
}
</tbody>
</table>
</div>
2023-10-24 13:17:34 +00:00
})