From 1494c4f0483511564b171e1637d488ba1163e8e3 Mon Sep 17 00:00:00 2001 From: Zynh0722 Date: Fri, 3 Nov 2023 05:53:27 -0700 Subject: [PATCH] ada endpoint used --- src/main.rs | 7 ++++++- templates/ada.rs.html | 12 ++++++++++++ templates/components/ada_list.rs.html | 5 +++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 templates/ada.rs.html create mode 100644 templates/components/ada_list.rs.html diff --git a/src/main.rs b/src/main.rs index c5e3b50..f172479 100644 --- a/src/main.rs +++ b/src/main.rs @@ -30,7 +30,7 @@ use std::net::SocketAddr; use tower_http::services::{ServeDir, ServeFile}; use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt}; -use crate::templates::shift_reports_html; +use crate::templates::*; include!(concat!(env!("OUT_DIR"), "/templates.rs")); @@ -77,6 +77,7 @@ async fn main() { let app = Router::new() .nest("/api", api::router()) .route("/", get(root)) + .route("/ada", get(ada)) .route("/shift_reports", get(shift_reports)) .route("/shifts/:id/drinks", get(drinks)) .route("/shifts/:id/report", get(shift_report)) @@ -141,3 +142,7 @@ async fn shift_reports(State(state): State) -> impl IntoResponse { render!(shift_reports_html, shifts) } + +async fn ada() -> impl IntoResponse { + render!(ada_html) +} diff --git a/templates/ada.rs.html b/templates/ada.rs.html new file mode 100644 index 0000000..e485ba6 --- /dev/null +++ b/templates/ada.rs.html @@ -0,0 +1,12 @@ +@use super::base_html; +@use super::components::ada_list_html; + +@() + +@:base_html({ + +
+ @:ada_list_html() +
+ +}) diff --git a/templates/components/ada_list.rs.html b/templates/components/ada_list.rs.html new file mode 100644 index 0000000..3318a4c --- /dev/null +++ b/templates/components/ada_list.rs.html @@ -0,0 +1,5 @@ +@() + +
+ Oops, there should be a list here! +