diff --git a/src/main.rs b/src/main.rs index 08c5245..9da3b36 100644 --- a/src/main.rs +++ b/src/main.rs @@ -5,7 +5,7 @@ mod tracing_handler; use cm_lib::{ hx_request::HxRequest, - models::{Drink, Shift}, + models::{Drink, Shift, Dancer}, render, report::GenerateDrinkReport, schema::shifts, @@ -162,6 +162,14 @@ async fn ada() -> impl IntoResponse { render!(ada_html) } -async fn shows(Path(id): Path) -> impl IntoResponse { - render!(shows_html, id) +async fn shows(State(state): State, Path(id): Path) -> impl IntoResponse { + let dancers: Vec = { + use cm_lib::schema::dancers::dsl::*; + + let mut conn = state.connection.get().await.unwrap(); + + dancers.load(&mut conn).await.unwrap() + }; + + render!(shows_html, id, dancers) } diff --git a/templates/shows.rs.html b/templates/shows.rs.html index 9995570..911b878 100644 --- a/templates/shows.rs.html +++ b/templates/shows.rs.html @@ -1,22 +1,29 @@ @use super::base_html; @use super::components::return_to_main_html; +@use cm_lib::models::Dancer; -@(shift_id: u32) +@(shift_id: u32, dancers: Vec) @:base_html({ -
-
- @:return_to_main_html() +
+
+ @:return_to_main_html() +
+ +
+ + + + +
-
- - -
-
- })