diff --git a/src/main.rs b/src/main.rs index 555bf32..08c5245 100644 --- a/src/main.rs +++ b/src/main.rs @@ -92,6 +92,7 @@ async fn main() { .route("/shift_reports", get(shift_reports)) .route("/shifts/:id/drinks", get(drinks)) .route("/shifts/:id/report", get(shift_report)) + .route("/shifts/:id/shows", get(shows)) .fallback_service(fallback_handler) .with_state(state); @@ -160,3 +161,7 @@ async fn shift_reports(State(state): State) -> impl IntoResponse { async fn ada() -> impl IntoResponse { render!(ada_html) } + +async fn shows(Path(id): Path) -> impl IntoResponse { + render!(shows_html, id) +} diff --git a/templates/components/home_fragment.rs.html b/templates/components/home_fragment.rs.html index 306fb0e..e1cebf6 100644 --- a/templates/components/home_fragment.rs.html +++ b/templates/components/home_fragment.rs.html @@ -7,16 +7,16 @@
@:shift_button_html(open_shift.as_ref())
- @if open_shift.is_some() { + @if let Some(open_shift) = open_shift {
- diff --git a/templates/shows.rs.html b/templates/shows.rs.html new file mode 100644 index 0000000..9995570 --- /dev/null +++ b/templates/shows.rs.html @@ -0,0 +1,22 @@ +@use super::base_html; +@use super::components::return_to_main_html; + +@(shift_id: u32) + +@:base_html({ + +
+
+ @:return_to_main_html() +
+ +
+ + +
+
+ +})