diff --git a/scraper/internal/server/ui.go b/scraper/internal/server/ui.go index cc38530..00d781a 100644 --- a/scraper/internal/server/ui.go +++ b/scraper/internal/server/ui.go @@ -124,7 +124,15 @@ const homeTmpl = `

libnovel

Browse Rankings -

{{len .Books}} book{{if ne (len .Books) 1}}s{{end}} on disk

+

{{len .Books}} book{{if ne (len .Books) 1}}s{{end}} on disk

+ + +
+ + +
@@ -163,6 +171,7 @@ const homeTmpl = ` hx-push-url="true" hx-swap="innerHTML" data-slug="{{.Slug}}" + data-filter="{{.Title}} {{.Author}} {{.Status}} {{range .Genres}}{{.}} {{end}}" class="book-card group block rounded-xl border border-zinc-800 bg-zinc-900 p-5 hover:border-amber-500 transition-colors cursor-pointer">
{{if .Cover}} @@ -187,46 +196,64 @@ const homeTmpl = ` ` @@ -293,8 +320,16 @@ const rankingTmpl = `
+ +
+ + +
+ -
+
{{range .Books}} {{if .Local}} {{/* Book is in local library — wrap entire card in a clickable link */}} @@ -303,6 +338,7 @@ const rankingTmpl = ` hx-target="#main-content" hx-push-url="true" hx-swap="innerHTML" + data-filter="{{.Title}} {{.Author}} {{.Status}} {{range .Genres}}{{.}} {{end}}" class="group block rounded-xl border border-teal-700 bg-teal-950 p-4 hover:border-teal-400 transition-colors">
{{if .Cover}} @@ -323,12 +359,25 @@ const rankingTmpl = ` {{range .Genres}}{{.}}{{end}}
{{end}} + {{if .SourceURL}} + + {{end}}
{{else}} {{/* Book not yet in local library */}} -
+
{{if .Cover}} cover @@ -348,7 +397,7 @@ const rankingTmpl = `
{{end}} {{if .SourceURL}} -
+ {{end}}
@@ -367,7 +424,33 @@ const rankingTmpl = `

No ranking data available. Click "Refresh Rankings" to fetch from novelfire.net.

{{end}}
-
` +
+ +` // rankingViewItem enriches a RankingItem with whether it is present in the // local book library, so the template can highlight it differently. @@ -611,6 +694,14 @@ const bookTmpl = `

{{.Meta.Title}}

{{if .Meta.SourceURL}} + + + + + Source +