diff --git a/crates/adapters/template-askama/src/lib.rs b/crates/adapters/template-askama/src/lib.rs index c57f194..bfc2274 100644 --- a/crates/adapters/template-askama/src/lib.rs +++ b/crates/adapters/template-askama/src/lib.rs @@ -437,4 +437,5 @@ pub struct WrapUpPageTemplate<'a> { pub genre_max: u32, pub rating_pcts: [f64; 5], pub genre_pcts: Vec, + pub video_url: Option, } diff --git a/crates/adapters/template-askama/templates/wrapup.html b/crates/adapters/template-askama/templates/wrapup.html index 8da50e3..d117372 100644 --- a/crates/adapters/template-askama/templates/wrapup.html +++ b/crates/adapters/template-askama/templates/wrapup.html @@ -10,6 +10,9 @@ {% if report.total_watch_time_minutes > 0 %}
{{ watch_time_display }} of watch time
{% endif %} + {% if let Some(url) = video_url %} + Download Video + {% endif %}
diff --git a/crates/presentation/src/handlers/wrapup.rs b/crates/presentation/src/handlers/wrapup.rs index 2c09045..3a603d5 100644 --- a/crates/presentation/src/handlers/wrapup.rs +++ b/crates/presentation/src/handlers/wrapup.rs @@ -232,6 +232,7 @@ fn render_wrapup( report: &WrapUpReport, year: i32, ctx: &application::ports::HtmlPageContext, + video_url: Option, ) -> axum::response::Response { let rating_max = report .rating_distribution @@ -263,6 +264,7 @@ fn render_wrapup( genre_max, rating_pcts, genre_pcts, + video_url, }; render_page(tmpl) } @@ -301,8 +303,9 @@ pub async fn get_user_wrapup_html( None => return StatusCode::NOT_FOUND.into_response(), }; + let video_url = format!("/api/v1/wrapups/{}/video", record.id.value()); let ctx = super::html::build_page_context(&state, viewer, csrf.0).await; - render_wrapup(&report, year, &ctx) + render_wrapup(&report, year, &ctx, Some(video_url)) } pub async fn get_global_wrapup_html( @@ -339,6 +342,7 @@ pub async fn get_global_wrapup_html( None => return StatusCode::NOT_FOUND.into_response(), }; + let video_url = format!("/api/v1/wrapups/{}/video", record.id.value()); let ctx = super::html::build_page_context(&state, viewer, csrf.0).await; - render_wrapup(&report, year, &ctx) + render_wrapup(&report, year, &ctx, Some(video_url)) } diff --git a/static/style.css b/static/style.css index a69abea..b7353cf 100644 --- a/static/style.css +++ b/static/style.css @@ -1196,6 +1196,14 @@ form button[type="submit"]:hover { animation: wu-fade-in 0.6s ease-out both; } .wu-hero { min-height: 50vh; padding-top: 4rem; } +.wu-video-link { + display: inline-block; margin-top: 1.5rem; + padding: 0.5rem 1.5rem; + background: var(--primary); color: #1a1a24; + border-radius: 999px; font-weight: 700; font-size: 0.85rem; + text-decoration: none; transition: opacity 0.2s; +} +.wu-video-link:hover { opacity: 0.85; } .wu-eyebrow { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.15em; opacity: 0.5; margin-bottom: 0.5rem; } .wu-year { font-size: 3rem; opacity: 0.4; margin-bottom: 0.25rem; font-weight: 800; } .wu-big-number { font-size: 5rem; font-weight: 800; color: var(--primary); line-height: 1.1; }