From 0d1ae305b5207d49912d23bc84f777db25e9109c Mon Sep 17 00:00:00 2001 From: mkelvers Date: Tue, 16 Jun 2026 10:47:52 +0200 Subject: [PATCH] refactor: extract anime template sections into components --- templates/anime.gohtml | 177 ++--------------------------------------- 1 file changed, 5 insertions(+), 172 deletions(-) diff --git a/templates/anime.gohtml b/templates/anime.gohtml index 285e13c..724ebff 100644 --- a/templates/anime.gohtml +++ b/templates/anime.gohtml @@ -1,115 +1,3 @@ -{{define "anime_characters"}} -
-

Characters & Cast

-
- {{range (slice .Items 0 (min (len .Items) 10))}} -
-
- {{.Character.Name}} -
-
- {{.Character.Name}} - {{.Role}} - {{if .VoiceActors}} - {{(index .VoiceActors 0).Person.Name}} - {{end}} -
-
- {{end}} -
-
-{{end}} - -{{define "anime_recommendations"}} -{{if .Items}} -
-

Recommendations

-
- {{range (slice .Items 0 (min (len .Items) 8))}} - -
- {{.Entry.Title}} -
- {{.Entry.Title}} -
- {{end}} -
-
-{{end}} -{{end}} - -{{define "anime_recommendations_loading"}} -
-
-

Recommendations

-
- {{range (seq 8)}} -
-
-
-
- {{end}} -
-
-
-{{end}} - -{{define "anime_statistics"}} -{{if .Items}} -
-
- Watching - {{.Items.Watching}} -
-
- Completed - {{.Items.Completed}} -
-
- On Hold - {{.Items.OnHold}} -
-
- Dropped - {{.Items.Dropped}} -
-
- Plan to Watch - {{.Items.PlanToWatch}} -
-
-{{end}} -{{end}} - -{{define "anime_themes"}} -{{if or .Items.Openings .Items.Endings}} -
-
-

Openings

-
- {{range .Items.Openings}} -
{{.}}
- {{end}} -
-
-
-

Endings

-
- {{range .Items.Endings}} -
{{.}}
- {{end}} -
-
-
-{{else}} -
No theme songs available.
-{{end}} -{{end}} - {{define "title"}}{{.Anime.DisplayTitle}}{{end}} {{define "scripts"}}{{end}} {{define "content"}} @@ -169,15 +57,7 @@
-
-

Synopsis

-

{{if $anime.Synopsis}}{{$anime.Synopsis}}{{else}}No synopsis available.{{end}}

- {{if and $anime.Synopsis (gt (len $anime.Synopsis) 400)}} - - {{end}} -
+ {{template "anime_synopsis" dict "Anime" $anime}}
-
-
-

Characters & Cast

-
- {{range (seq 5)}} -
-
-
-
-
-
-
- {{end}} -
-
-
+ {{template "anime_characters_loading" dict "AnimeID" $anime.MalID}}
-
-
-

Recommendations

-
- {{range (seq 8)}} -
-
-
-
- {{end}} -
-
-
+ {{template "anime_recommendations_initial_loading" dict "AnimeID" $anime.MalID}}
- - -
+{{template "anime_themes_dialog" dict "AnimeID" $anime.MalID}} {{end}}