From e21474ca55078c58416a20dccdf817292b75c446 Mon Sep 17 00:00:00 2001 From: mkelvers Date: Sat, 18 Apr 2026 05:55:22 +0200 Subject: [PATCH] feat(ui): add anime episodes section --- internal/server/routes.go | 1 + internal/templates/anime.templ | 38 ++++++++++++++++++++++------------ 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/internal/server/routes.go b/internal/server/routes.go index 1b8714c..ceff675 100644 --- a/internal/server/routes.go +++ b/internal/server/routes.go @@ -51,6 +51,7 @@ func NewRouter(cfg Config) http.Handler { mux.HandleFunc("/studios/", animeHandler.HandleStudioDetails) mux.HandleFunc("/api/studios/", animeHandler.HandleAPIStudioAnime) + mux.HandleFunc("/api/episodes/", animeHandler.HandleAPIEpisodes) // Auth Endpoints mux.HandleFunc("/login", func(w http.ResponseWriter, r *http.Request) { if r.Method == http.MethodGet { diff --git a/internal/templates/anime.templ b/internal/templates/anime.templ index 5f54254..b6804bf 100644 --- a/internal/templates/anime.templ +++ b/internal/templates/anime.templ @@ -36,9 +36,15 @@ templ AnimeDetails(anime jikan.Anime, currentStatus string) { { anime.ShortDuration() } } -
+
+
@WatchlistDropdown(anime.MalID, anime.Title, anime.TitleEnglish, anime.TitleJapanese, anime.ImageURL(), currentStatus, anime.Airing) + Watch
+
if anime.Synopsis != "" {

{ anime.Synopsis }

@@ -48,18 +54,24 @@ templ AnimeDetails(anime jikan.Anime, currentStatus string) {
-
-

Related

-
- @ui.LoadingIndicator("Loading relations") -
-
-
-

Recommendations

-
- @ui.LoadingIndicator("Loading recommendations") -
-
+
+

Episodes

+
+ @ui.LoadingIndicator("Loading episodes") +
+
+
+

Related

+
+ @ui.LoadingIndicator("Loading relations") +
+
+
+

Recommendations

+
+ @ui.LoadingIndicator("Loading recommendations") +
+