feat: add video download link to wrapup HTML page
Some checks failed
CI / Check / Test (push) Failing after 41s

This commit is contained in:
2026-06-03 01:06:11 +02:00
parent e905842b62
commit 857896f057
4 changed files with 18 additions and 2 deletions

View File

@@ -437,4 +437,5 @@ pub struct WrapUpPageTemplate<'a> {
pub genre_max: u32,
pub rating_pcts: [f64; 5],
pub genre_pcts: Vec<f64>,
pub video_url: Option<String>,
}

View File

@@ -10,6 +10,9 @@
{% if report.total_watch_time_minutes > 0 %}
<div class="wu-detail">{{ watch_time_display }} of watch time</div>
{% endif %}
{% if let Some(url) = video_url %}
<a href="{{ url }}" class="wu-video-link" download>Download Video</a>
{% endif %}
</section>
<section class="wu-section">

View File

@@ -232,6 +232,7 @@ fn render_wrapup(
report: &WrapUpReport,
year: i32,
ctx: &application::ports::HtmlPageContext,
video_url: Option<String>,
) -> 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))
}

View File

@@ -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; }