feat: revamp schedule and home pages

This commit is contained in:
2026-06-13 17:04:09 +02:00
parent 70a6e9a6b5
commit f2213bd4aa
3 changed files with 9 additions and 15 deletions

View File

@@ -1,6 +1,6 @@
{{define "title"}}Home{{end}} {{define "title"}}Home{{end}}
{{define "content"}} {{define "content"}}
<div class="flex flex-col gap-10"> <div class="flex flex-col gap-8 pb-12">
{{if .User}} {{if .User}}
<div hx-get="/api/catalog/continue" hx-trigger="load" hx-swap="outerHTML"> <div hx-get="/api/catalog/continue" hx-trigger="load" hx-swap="outerHTML">
{{template "continue_watching_skeleton"}} {{template "continue_watching_skeleton"}}
@@ -13,7 +13,9 @@
<section class="w-full"> <section class="w-full">
<div class="mb-4 flex items-end justify-between gap-3"> <div class="mb-4 flex items-end justify-between gap-3">
<h2 class="text-base font-normal text-foreground">Currently Airing</h2> <div>
<h2 class="text-base font-normal text-foreground">Airing & Popular</h2>
</div>
{{template "section_action" dict "Href" "/browse?status=airing&order_by=popularity&sort=asc" "Label" "View all"}} {{template "section_action" dict "Href" "/browse?status=airing&order_by=popularity&sort=asc" "Label" "View all"}}
</div> </div>
<div hx-get="/api/catalog/airing" hx-trigger="load" hx-swap="outerHTML"> <div hx-get="/api/catalog/airing" hx-trigger="load" hx-swap="outerHTML">
@@ -21,15 +23,6 @@
</div> </div>
</section> </section>
<section class="w-full">
<div class="mb-4 flex items-end justify-between gap-3">
<h2 class="text-base font-normal text-foreground">Most Popular</h2>
{{template "section_action" dict "Href" "/browse?order_by=popularity&sort=asc" "Label" "View all"}}
</div>
<div hx-get="/api/catalog/popular" hx-trigger="load" hx-swap="outerHTML">
{{template "catalog_skeleton"}}
</div>
</section>
</div> </div>
{{end}} {{end}}

View File

@@ -78,7 +78,7 @@ func TestRenderWithFragment(t *testing.T) {
if err := render.Render(w); err != nil { if err := render.Render(w); err != nil {
t.Fatalf("Render error: %v", err) t.Fatalf("Render error: %v", err)
} }
if !strings.Contains(w.Body.String(), "Currently Airing") { if !strings.Contains(w.Body.String(), "Airing & Popular") {
t.Error("expected content block in fragment render") t.Error("expected content block in fragment render")
} }
} }
@@ -115,7 +115,7 @@ func TestExecuteFragmentValid(t *testing.T) {
if err != nil { if err != nil {
t.Fatalf("ExecuteFragment error: %v", err) t.Fatalf("ExecuteFragment error: %v", err)
} }
if !strings.Contains(buf.String(), "Currently Airing") { if !strings.Contains(buf.String(), "Airing & Popular") {
t.Error("expected content in fragment output") t.Error("expected content in fragment output")
} }
} }

View File

@@ -1,10 +1,11 @@
{{define "title"}}Schedule{{end}} {{define "title"}}Broadcast Guide{{end}}
{{define "scripts"}}<script type="module" src="/dist/static/schedule_board.js" defer></script>{{end}} {{define "scripts"}}<script type="module" src="/dist/static/schedule_board.js" defer></script>{{end}}
{{define "content"}} {{define "content"}}
<div class="flex flex-col gap-12 pb-24"> <div class="flex flex-col gap-12 pb-24">
<section class="px-1"> <section class="px-1">
<div class="flex flex-col gap-2"> <div class="flex flex-col gap-2">
<h1 class="text-4xl font-normal tracking-[-0.02em] text-foreground">Schedule</h1> <h1 class="text-3xl font-normal tracking-[-0.02em] text-foreground">Broadcast Guide</h1>
<p class="max-w-2xl text-sm leading-6 text-foreground-muted">Times come from external broadcast metadata and may not match when episodes become playable from the provider.</p>
</div> </div>
</section> </section>