diff --git a/src/application/routes/app/bags.rs b/src/application/routes/app/bags.rs index 9cb60ba..790c1b9 100644 --- a/src/application/routes/app/bags.rs +++ b/src/application/routes/app/bags.rs @@ -44,6 +44,8 @@ pub(crate) async fn bag_detail_page( version_info: &crate::VERSION_INFO, base_url: crate::base_url(), bag: view, + roaster_slug: roaster.slug.clone(), + roast_slug: roast.slug.clone(), }; render_html(template).map(IntoResponse::into_response) diff --git a/src/application/routes/app/brews.rs b/src/application/routes/app/brews.rs index 8d11ba7..b367e1b 100644 --- a/src/application/routes/app/brews.rs +++ b/src/application/routes/app/brews.rs @@ -50,6 +50,8 @@ pub(crate) async fn brew_detail_page( version_info: &crate::VERSION_INFO, base_url: crate::base_url(), brew: view, + roaster_slug: roaster.slug.clone(), + roast_slug: roast.slug.clone(), }; render_html(template).map(IntoResponse::into_response) diff --git a/src/application/routes/app/cups.rs b/src/application/routes/app/cups.rs index e0a514e..0ade4c7 100644 --- a/src/application/routes/app/cups.rs +++ b/src/application/routes/app/cups.rs @@ -55,6 +55,9 @@ pub(crate) async fn cup_detail_page( version_info: &crate::VERSION_INFO, base_url: crate::base_url(), cup: view, + roaster_slug: roaster.slug.clone(), + roast_slug: roast.slug.clone(), + cafe_slug: cafe.slug.clone(), }; render_html(template).map(IntoResponse::into_response) diff --git a/src/application/routes/app/roasts.rs b/src/application/routes/app/roasts.rs index b1bf46f..b7dc6d1 100644 --- a/src/application/routes/app/roasts.rs +++ b/src/application/routes/app/roasts.rs @@ -37,6 +37,7 @@ pub(crate) async fn roast_detail_page( version_info: &crate::VERSION_INFO, base_url: crate::base_url(), roast: view, + roaster_slug, }; render_html(template).map(IntoResponse::into_response) diff --git a/src/presentation/web/templates.rs b/src/presentation/web/templates.rs index 57c205c..2092a0f 100644 --- a/src/presentation/web/templates.rs +++ b/src/presentation/web/templates.rs @@ -219,6 +219,8 @@ pub struct BagDetailTemplate { pub version_info: &'static crate::VersionInfo, pub base_url: &'static str, pub bag: BagDetailView, + pub roaster_slug: String, + pub roast_slug: String, } #[derive(Template)] @@ -229,6 +231,8 @@ pub struct BrewDetailTemplate { pub version_info: &'static crate::VersionInfo, pub base_url: &'static str, pub brew: BrewDetailView, + pub roaster_slug: String, + pub roast_slug: String, } #[derive(Template)] @@ -239,6 +243,9 @@ pub struct CupDetailTemplate { pub version_info: &'static crate::VersionInfo, pub base_url: &'static str, pub cup: CupDetailView, + pub roaster_slug: String, + pub roast_slug: String, + pub cafe_slug: String, } #[derive(Template)] @@ -249,6 +256,7 @@ pub struct RoastDetailTemplate { pub version_info: &'static crate::VersionInfo, pub base_url: &'static str, pub roast: RoastDetailView, + pub roaster_slug: String, } #[derive(Template)] diff --git a/src/presentation/web/views/bags.rs b/src/presentation/web/views/bags.rs index 6c6128c..6d36d8e 100644 --- a/src/presentation/web/views/bags.rs +++ b/src/presentation/web/views/bags.rs @@ -89,6 +89,9 @@ pub struct BagDetailView { // Map pub map_countries: String, pub map_max: u32, + // Slugs (for breadcrumbs) + pub roaster_slug: String, + pub roast_slug: String, // Dates pub created_date: String, pub created_time: String, @@ -112,6 +115,8 @@ impl BagDetailView { id: bag.bag.id.to_string(), roast_name: bag.roast_name, roaster_name: bag.roaster_name, + roaster_slug: roaster.slug.clone(), + roast_slug: roast.slug.clone(), origin: coffee.origin, origin_flag: coffee.origin_flag, region: coffee.region, diff --git a/src/presentation/web/views/cups.rs b/src/presentation/web/views/cups.rs index 4d08a7b..e135d6a 100644 --- a/src/presentation/web/views/cups.rs +++ b/src/presentation/web/views/cups.rs @@ -63,6 +63,10 @@ pub struct CupDetailView { // Map pub map_countries: String, pub map_max: u32, + // Slugs (for breadcrumbs) + pub roaster_slug: String, + pub roast_slug: String, + pub cafe_slug: String, // Dates pub created_date: String, pub created_time: String, @@ -106,6 +110,9 @@ impl CupDetailView { cafe_country: cafe.country.clone(), cafe_country_flag, cafe_website: cafe.website.clone(), + roaster_slug: roaster.slug.clone(), + roast_slug: roast.slug.clone(), + cafe_slug: cafe.slug.clone(), map_countries, map_max, created_date: cup.cup.created_at.format("%Y-%m-%d").to_string(), diff --git a/templates/pages/bag.html b/templates/pages/bag.html index d592f64..9ed9ce7 100644 --- a/templates/pages/bag.html +++ b/templates/pages/bag.html @@ -27,13 +27,13 @@ {# ── Coffee + map ── #}