feat(ui): refresh auth, entry, admin, and secondary pages
Apply the new design-system primitives across the remaining pages so the whole app shares one visual language: - Auth/entry: redesigned index, login, register (centered card layout, SVG icons, semantic tokens) - Admin: sidebar nav with icons, cohesive admin dashboard/users/library/ processing-issues/settings (tables use border-line + hover states; scan/websocket attributes preserved) - Secondary: analytics (stat cards), devices, progress, conflicts, queue, profile + form/modal all migrated to .card/.btn/.input primitives and SVG action icons - Docs + API explorer + setup wizard + collection/rules/modals + unlinked books + book-detail modals: consistent chrome, modal scrims use --surface-overlay, close buttons use icon-btn - reader.templ and error.templ intentionally left unchanged
This commit is contained in:
+26
-24
@@ -1,7 +1,9 @@
|
||||
package templates
|
||||
|
||||
import "bookhoard/internal/handlers"
|
||||
import "fmt"
|
||||
import (
|
||||
"bookhoard/internal/handlers"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
templ Progress(user User, progressData []handlers.ProgressWithMedia, errorMessage string) {
|
||||
<!DOCTYPE html>
|
||||
@@ -17,19 +19,19 @@ templ Progress(user User, progressData []handlers.ProgressWithMedia, errorMessag
|
||||
@Header(user, "/progress")
|
||||
<div class="w-full px-4 sm:px-6 lg:px-8 py-8">
|
||||
<div class="mb-8">
|
||||
<h1 class="text-3xl font-bold" style="color: var(--text-primary)">Reading Progress</h1>
|
||||
<p style="color: var(--text-secondary)">Track your reading progress across all devices</p>
|
||||
<h1 class="text-2xl font-bold tracking-tight text-content">Reading Progress</h1>
|
||||
<p class="text-content-muted">Track your reading progress across all devices</p>
|
||||
</div>
|
||||
<div id="progress-container" class="space-y-6">
|
||||
if len(progressData) == 0 {
|
||||
<div class="text-center py-16" style="color: var(--text-secondary)">
|
||||
<div class="text-6xl mb-4">📖</div>
|
||||
<h3 class="text-xl font-semibold mb-2" style="color: var(--text-primary)">No Progress Yet</h3>
|
||||
<div class="text-center py-16 text-content-muted">
|
||||
<div class="mb-4 flex justify-center">@Icon("book-open", "h-12 w-12")</div>
|
||||
<h3 class="text-xl font-semibold mb-2 text-content">No Progress Yet</h3>
|
||||
<p>Start reading a book to track your progress</p>
|
||||
</div>
|
||||
}
|
||||
for _, item := range progressData {
|
||||
<div class="card p-6 rounded-lg border" style="background-color: var(--bg-secondary); border-color: var(--border);">
|
||||
<div class="card p-6">
|
||||
<div class="flex gap-6">
|
||||
<div class="flex-shrink-0">
|
||||
<img
|
||||
@@ -44,27 +46,27 @@ templ Progress(user User, progressData []handlers.ProgressWithMedia, errorMessag
|
||||
<div>
|
||||
<a
|
||||
href={ "/media/" + item.MediaItemID.String() }
|
||||
style="color: var(--text-primary); text-decoration: none;"
|
||||
class="text-content no-underline"
|
||||
>
|
||||
<h3 class="font-semibold text-lg hover:opacity-80">{ item.Title }</h3>
|
||||
</a>
|
||||
if item.Author != "" {
|
||||
<p class="text-sm" style="color: var(--text-secondary)">by { item.Author }</p>
|
||||
<p class="text-sm text-content-muted">by { item.Author }</p>
|
||||
}
|
||||
</div>
|
||||
<div class="text-right">
|
||||
<span class="text-2xl font-bold" style="color: var(--accent)">{ item.ProgressPercentage }%</span>
|
||||
<span class="text-2xl font-bold text-brand">{ item.ProgressPercentage }%</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-4">
|
||||
<div class="w-full bg-gray-700 rounded-full h-3">
|
||||
<div class="h-3 rounded-full transition-all" style={ "width: " + fmt.Sprintf("%.1f", item.ProgressPercentage) + "%; background-color: var(--accent);" }></div>
|
||||
<div class="w-full bg-surface rounded-full h-3">
|
||||
<div class="h-3 rounded-full transition-all bg-brand" style={ "width: " + fmt.Sprintf("%.1f", item.ProgressPercentage) + "%" }></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid grid-cols-1 md:grid-cols-3 gap-4 text-sm">
|
||||
<div>
|
||||
<p style="color: var(--text-secondary)">Current Position</p>
|
||||
<p style="color: var(--text-primary)">
|
||||
<p class="text-content-muted">Current Position</p>
|
||||
<p class="text-content">
|
||||
if item.FormatGroup == "reflowable" {
|
||||
if item.EstimatedPages > 0 {
|
||||
{ fmt.Sprintf("Page %d of %d (est.)", item.CurrentPage, item.EstimatedPages) }
|
||||
@@ -77,29 +79,29 @@ templ Progress(user User, progressData []handlers.ProgressWithMedia, errorMessag
|
||||
</p>
|
||||
</div>
|
||||
<div>
|
||||
<p style="color: var(--text-secondary)">Last Updated</p>
|
||||
<p style="color: var(--text-primary)">{ item.LastUpdated }</p>
|
||||
<p class="text-content-muted">Last Updated</p>
|
||||
<p class="text-content">{ item.LastUpdated }</p>
|
||||
</div>
|
||||
<div>
|
||||
<p style="color: var(--text-secondary)">Synced From</p>
|
||||
<p class="text-content-muted">Synced From</p>
|
||||
<div class="flex items-center gap-2">
|
||||
<span class="text-xl">{ item.DeviceIcon }</span>
|
||||
<span style="color: var(--text-primary)">{ item.DeviceName }</span>
|
||||
<span class="text-content">{ item.DeviceName }</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
if item.DeviceIcon != "" {
|
||||
<div class="mt-3 pt-3 border-t" style="border-color: var(--border);">
|
||||
<div class="flex items-center gap-2 text-xs" style="color: var(--text-secondary);">
|
||||
<span>🔄</span>
|
||||
<div class="mt-3 pt-3 border-t border-line">
|
||||
<div class="flex items-center gap-2 text-xs text-content-muted">
|
||||
@Icon("sync", "h-4 w-4")
|
||||
<span>Last sync from <strong>{ item.DeviceName }</strong></span>
|
||||
<span>({ item.DeviceType })</span>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
if item.EpubCFI != "" {
|
||||
<div class="mt-2 text-xs" style="color: var(--text-secondary);">
|
||||
<span>📍</span>
|
||||
<div class="mt-2 text-xs text-content-muted">
|
||||
@Icon("bookmark", "h-4 w-4")
|
||||
<span>CFI: { item.EpubCFI }</span>
|
||||
</div>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user