-
- {{if .Rank}}#{{.Rank}}{{end}}
-
{{.Title}}
- In library
-
- {{if .Author}}
{{.Author}}
{{end}}
-
- {{if .Status}}{{.Status}}{{end}}
-
- {{if .Genres}}
-
- {{range .Genres}}{{.}}{{end}}
-
- {{end}}
- {{if .SourceURL}}
-
- {{end}}
+ class="group flex gap-3 rounded-xl border border-teal-700 bg-teal-950 p-3 hover:border-teal-400 transition-colors min-w-0">
+ {{if .Cover}}
+

+ {{end}}
+
+
+ {{if .Rank}}#{{.Rank}}{{end}}
+
{{.Title}}
+ In library
+ {{if .Author}}
{{.Author}}
{{end}}
+
+ {{if .Status}}{{.Status}}{{end}}
+ {{range .Genres}}{{.}}{{end}}
+
+ {{if .SourceURL}}
+
+ {{end}}
{{else}}
- {{/* Book not yet in local library */}}
-
- {{if .Cover}}
-

- {{end}}
-
-
- {{if .Rank}}#{{.Rank}}{{end}}
-
{{.Title}}
-
- {{if .Author}}
{{.Author}}
{{end}}
-
- {{if .Status}}{{.Status}}{{end}}
-
- {{if .Genres}}
-
- {{range .Genres}}{{.}}{{end}}
-
- {{end}}
- {{if .SourceURL}}
-
- {{end}}
+ class="group flex gap-3 rounded-xl border border-zinc-800 bg-zinc-900 p-3 hover:border-amber-500 transition-colors min-w-0">
+ {{if .Cover}}
+

+ {{end}}
+
+
+ {{if .Rank}}#{{.Rank}}{{end}}
+
{{.Title}}
+ {{if .Author}}
{{.Author}}
{{end}}
+
+ {{if .Status}}{{.Status}}{{end}}
+ {{range .Genres}}{{.}}{{end}}
+
+ {{if .SourceURL}}
+
+ {{end}}
{{end}}
{{else}}
-
No ranking data available. Click "Refresh Rankings" to fetch from novelfire.net.
+
No ranking data. Use the page buttons above to fetch from novelfire.net.
{{end}}
@@ -704,12 +699,14 @@ type refreshPage struct {
Pages int // 0 means "all pages"
}
-// rankingRefreshPages defines the ordered set of refresh buttons shown on the
-// ranking page. Pages == 0 means "fetch all pages".
+// rankingRefreshPages defines the pagination buttons shown on the ranking page.
+// Each entry fetches that many pages from novelfire.net (100 novels per page).
+// Pages == 0 means fetch all pages.
var rankingRefreshPages = []refreshPage{
- {"Top 100", 1},
- {"Top 300", 3},
- {"Top 500", 5},
+ {"p.1 (top 100)", 1},
+ {"p.1–3 (top 300)", 3},
+ {"p.1–5 (top 500)", 5},
+ {"p.1–10 (top 1000)", 10},
{"All", 0},
}
@@ -729,13 +726,13 @@ func (s *Server) handleRanking(w http.ResponseWriter, r *http.Request) {
t := template.Must(template.New("ranking").Parse(rankingTmpl))
var buf bytes.Buffer
_ = t.Execute(&buf, struct {
- Books interface{}
- CachedAt string
- RefreshPages []refreshPage
+ Books interface{}
+ CachedAt string
+ Pages []refreshPage
}{
- Books: toRankingViewItems(rankingItems, s.writer.LocalSlugs()),
- CachedAt: cachedAt,
- RefreshPages: rankingRefreshPages,
+ Books: toRankingViewItems(rankingItems, s.writer.LocalSlugs()),
+ CachedAt: cachedAt,
+ Pages: rankingRefreshPages,
})
s.respond(w, r, "Rankings", buf.String())
}