diff --git a/web/components/anime/pending.templ b/web/components/anime/pending.templ index 8b4de59..0937ed8 100644 --- a/web/components/anime/pending.templ +++ b/web/components/anime/pending.templ @@ -2,11 +2,11 @@ package anime import ( "fmt" - "mal/web/templates" + "mal/web/shared/layout" ) templ Pending(id int) { - @templates.Layout("mal - anime pending", true) { + @layout.Layout("mal - anime pending", true) {
diff --git a/web/components/anime_list.templ b/web/components/anime_list.templ index 26c2051..d3448c6 100644 --- a/web/components/anime_list.templ +++ b/web/components/anime_list.templ @@ -2,7 +2,7 @@ package ui import ( "fmt" - "mal/internal/jikan" + "mal/integrations/jikan" ) templ InfiniteAnimeList(animes []jikan.Anime, hasNext bool, nextURL string, containerID string) { diff --git a/web/templates/layout.templ b/web/shared/layout/layout.templ similarity index 99% rename from web/templates/layout.templ rename to web/shared/layout/layout.templ index 259364a..5eed504 100644 --- a/web/templates/layout.templ +++ b/web/shared/layout/layout.templ @@ -1,4 +1,4 @@ -package templates +package layout import "mal/web/components/icons" diff --git a/web/templates/anime.templ b/web/templates/anime.templ index 1f36926..bf6bbc4 100644 --- a/web/templates/anime.templ +++ b/web/templates/anime.templ @@ -9,10 +9,11 @@ import ( "mal/web/components" watchlistcomponents "mal/web/components/watchlist" "mal/web/shared" + "mal/web/shared/layout" ) templ AnimeDetails(anime jikan.Anime, currentStatus string, nextEpisode int) { - @Layout("mal - " + anime.DisplayTitle(), true) { + @layout.Layout("mal - " + anime.DisplayTitle(), true) {
diff --git a/web/templates/auth.templ b/web/templates/auth.templ index 708dee4..5df9ef9 100644 --- a/web/templates/auth.templ +++ b/web/templates/auth.templ @@ -1,7 +1,9 @@ package templates +import "mal/web/shared/layout" + templ Login(formError string, username string) { - @Layout("Login", false) { + @layout.Layout("Login", false) {

Sign in

diff --git a/web/templates/catalog.templ b/web/templates/catalog.templ index 1628d4c..4f4c84a 100644 --- a/web/templates/catalog.templ +++ b/web/templates/catalog.templ @@ -1,11 +1,12 @@ package templates -import "mal/internal/jikan" -import "mal/internal/shared/ui" +import "mal/integrations/jikan" +import "mal/web/components" import "fmt" +import "mal/web/shared/layout" templ Catalog() { - @Layout("mal - catalog", true) { + @layout.Layout("mal - catalog", true) {
@ui.LoadingIndicator("Loading catalog") diff --git a/web/templates/continue_watching.templ b/web/templates/continue_watching.templ index da177cc..627c21a 100644 --- a/web/templates/continue_watching.templ +++ b/web/templates/continue_watching.templ @@ -2,12 +2,13 @@ package templates import ( "fmt" - "mal/internal/database" - "mal/internal/shared/ui" + "mal/internal/db" + "mal/web/components" + "mal/web/shared/layout" ) -templ ContinueWatching(entries []database.GetContinueWatchingEntriesRow) { - @Layout("mal - continue watching", true) { +templ ContinueWatching(entries []db.GetContinueWatchingEntriesRow) { + @layout.Layout("mal - continue watching", true) {

Continue watching

Pick up where you left off.

@@ -53,7 +54,7 @@ templ ContinueWatching(entries []database.GetContinueWatchingEntriesRow) { } } -func continueWatchingURL(entry database.GetContinueWatchingEntriesRow) string { +func continueWatchingURL(entry db.GetContinueWatchingEntriesRow) string { episode := 1 if entry.CurrentEpisode.Valid && entry.CurrentEpisode.Int64 > 0 { episode = int(entry.CurrentEpisode.Int64) @@ -62,6 +63,6 @@ func continueWatchingURL(entry database.GetContinueWatchingEntriesRow) string { return fmt.Sprintf("/watch/%d/%d", entry.AnimeID, episode) } -func displayContinueWatchingTitle(entry database.GetContinueWatchingEntriesRow) string { - return database.DisplayTitle(entry.TitleEnglish, entry.TitleJapanese, entry.TitleOriginal) +func displayContinueWatchingTitle(entry db.GetContinueWatchingEntriesRow) string { + return db.DisplayTitle(entry.TitleEnglish, entry.TitleJapanese, entry.TitleOriginal) } diff --git a/web/templates/discovery.templ b/web/templates/discovery.templ index d72d2ba..fb5f3b6 100644 --- a/web/templates/discovery.templ +++ b/web/templates/discovery.templ @@ -1,11 +1,12 @@ package templates -import "mal/internal/jikan" -import "mal/internal/shared/ui" +import "mal/integrations/jikan" +import "mal/web/components" import "fmt" +import "mal/web/shared/layout" templ Discover() { - @Layout("mal - discover", true) { + @layout.Layout("mal - discover", true) {

Discover

diff --git a/web/templates/index.templ b/web/templates/index.templ index 4ccf679..70f0d08 100644 --- a/web/templates/index.templ +++ b/web/templates/index.templ @@ -2,13 +2,14 @@ package templates import ( "fmt" - "mal/internal/jikan" - "mal/internal/shared/ui" + "mal/integrations/jikan" + "mal/web/components" + "mal/web/shared/layout" "net/url" ) templ Search(q string) { - @Layout("mal - search", true) { + @layout.Layout("mal - search", true) { if q != "" {