refactor: switch watchlist IDs from global to JSON script tag
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
{{define "title"}}Browse{{end}}
|
{{define "title"}}Browse{{end}}
|
||||||
|
{{define "scripts"}}{{end}}
|
||||||
{{define "content"}}
|
{{define "content"}}
|
||||||
{{if .WatchlistIDs}}<script>window.__WATCHLIST_IDS__={{.WatchlistIDs}}</script>{{end}}
|
{{if .WatchlistIDs}}<script type="application/json" id="watchlist-ids-json">{{.WatchlistIDs}}</script>{{end}}
|
||||||
{{template "browse_content" .}}
|
{{template "browse_content" .}}
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
@@ -70,7 +71,7 @@
|
|||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
{{define "browse_sentinel"}}
|
{{define "browse_sentinel"}}
|
||||||
<div hx-get="/browse?q={{.Query}}&type={{.Type}}&status={{.Status}}&order_by={{.OrderBy}}&sort={{.Sort}}&studio={{.Studio}}&sfw={{.SFW}}{{ if .Genres }}&{{genresParams .Genres}}{{ end }}&page={{.NextPage}}"
|
<div hx-get='{{browseURL . (dict "page" .NextPage)}}'
|
||||||
hx-trigger="intersect once"
|
hx-trigger="intersect once"
|
||||||
hx-swap="outerHTML"
|
hx-swap="outerHTML"
|
||||||
hx-target="this"
|
hx-target="this"
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
{{define "title"}}Watch {{.Anime.Title}}{{end}}
|
{{define "title"}}Watch {{.Anime.Title}}{{end}}
|
||||||
|
{{define "scripts"}}<script type="module" src="/dist/static/player/main.js" defer></script>{{end}}
|
||||||
{{define "content"}}
|
{{define "content"}}
|
||||||
{{if .WatchlistIDs}}<script>window.__WATCHLIST_IDS__={{.WatchlistIDs}}</script>{{end}}
|
{{if .WatchlistIDs}}<script type="application/json" id="watchlist-ids-json">{{.WatchlistIDs}}</script>{{end}}
|
||||||
{{$anime := .Anime}}
|
{{$anime := .Anime}}
|
||||||
{{$episodes := .Episodes}}
|
{{$episodes := .Episodes}}
|
||||||
{{$currentEpID := .CurrentEpID}}
|
{{$currentEpID := .CurrentEpID}}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
{{define "title"}}Watchlist{{end}}
|
{{define "title"}}Watchlist{{end}}
|
||||||
|
{{define "scripts"}}{{end}}
|
||||||
{{define "content"}}
|
{{define "content"}}
|
||||||
{{if .WatchlistIDs}}<script>window.__WATCHLIST_IDS__={{.WatchlistIDs}}</script>{{end}}
|
{{if .WatchlistIDs}}<script type="application/json" id="watchlist-ids-json">{{.WatchlistIDs}}</script>{{end}}
|
||||||
<div id="watchlist-content" class="flex w-full flex-col gap-6">
|
<div id="watchlist-content" class="flex w-full flex-col gap-6">
|
||||||
<h1 class="text-xl font-normal tracking-[-0.02em] text-foreground">Watchlist</h1>
|
<h1 class="text-xl font-normal tracking-[-0.02em] text-foreground">Watchlist</h1>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user