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:
2026-08-05 16:01:22 -04:00
parent 28e40e302c
commit a075a5061f
54 changed files with 2740 additions and 2128 deletions
+46 -44
View File
@@ -14,39 +14,41 @@ templ CollectionRules(user User, collection CollectionData) {
@Header(user, "/collections")
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
<div class="mb-6">
<button @click="backToCollection()" class="btn-secondary px-4 py-2 rounded-lg mb-4">
Back to Collection
<button @click="backToCollection()" class="btn btn-secondary mb-4">
@Icon("arrow-left", "h-4 w-4")
Back to Collection
</button>
<div class="flex items-center gap-4">
<div class="text-4xl" style="color: { collection.Color }">{ collection.Icon }</div>
<div>
<h1 class="text-3xl font-bold" style="color: var(--text-primary)">{ collection.Name }</h1>
<p style="color: var(--text-secondary)">Auto-Assign Rules</p>
<h1 class="text-2xl font-bold tracking-tight text-content">{ collection.Name }</h1>
<p class="text-content-muted">Auto-Assign Rules</p>
</div>
</div>
</div>
<div class="mb-8">
<h2 class="text-2xl font-bold mb-4" style="color: var(--text-primary)">Existing Rules</h2>
<h2 class="text-2xl font-bold tracking-tight text-content mb-4">Existing Rules</h2>
<div id="rules-container" class="space-y-4">
<div id="no-rules" class="card p-6 rounded-lg border text-center" style="background-color: var(--bg-secondary); border-color: var(--border);">
<div class="text-4xl mb-2">📋</div>
<h3 class="text-lg font-semibold mb-2" style="color: var(--text-primary)">No Rules Yet</h3>
<p style="color: var(--text-secondary)">Create auto-assign rules to automatically add books to this collection</p>
<div id="no-rules" class="card p-6 text-center">
<div class="mb-2 flex justify-center">
@Icon("list", "h-10 w-10 text-content-muted")
</div>
<h3 class="text-lg font-semibold mb-2 text-content">No Rules Yet</h3>
<p class="text-content-muted">Create auto-assign rules to automatically add books to this collection</p>
</div>
</div>
</div>
<div class="mb-8">
<h2 class="text-2xl font-bold mb-4" style="color: var(--text-primary)">Create New Rule</h2>
<h2 class="text-2xl font-bold tracking-tight text-content mb-4">Create New Rule</h2>
<form id="rule-form" @submit="handleCreateRule($event)">
<input type="hidden" id="collection-id" value="{ collection.ID }"/>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-6">
<div>
<label class="block text-sm font-medium mb-2" style="color: var(--text-secondary)">Field</label>
<label class="block text-xs font-semibold uppercase tracking-wide text-content-muted mb-2">Field</label>
<select
id="rule-field"
required
class="w-full px-4 py-2 border rounded-lg"
style="background-color: var(--bg-primary); color: var(--text-primary); border-color: var(--border);"
class="input"
>
<option value="">Select field...</option>
<option value="genre">Genre</option>
@@ -59,12 +61,11 @@ templ CollectionRules(user User, collection CollectionData) {
</select>
</div>
<div>
<label class="block text-sm font-medium mb-2" style="color: var(--text-secondary)">Operator</label>
<label class="block text-xs font-semibold uppercase tracking-wide text-content-muted mb-2">Operator</label>
<select
id="rule-operator"
required
class="w-full px-4 py-2 border rounded-lg"
style="background-color: var(--bg-primary); color: var(--text-primary); border-color: var(--border);"
class="input"
>
<option value="">Select operator...</option>
<option value="equals">equals</option>
@@ -79,13 +80,12 @@ templ CollectionRules(user User, collection CollectionData) {
</div>
</div>
<div class="mb-6">
<label class="block text-sm font-medium mb-2" style="color: var(--text-secondary)">Value</label>
<label class="block text-xs font-semibold uppercase tracking-wide text-content-muted mb-2">Value</label>
<input
type="text"
id="rule-value"
required
class="w-full px-4 py-2 border rounded-lg"
style="background-color: var(--bg-primary); color: var(--text-primary); border-color: var(--border);"
class="input"
placeholder="e.g., Science Fiction"
/>
</div>
@@ -97,16 +97,16 @@ templ CollectionRules(user User, collection CollectionData) {
checked
class="w-5 h-5 rounded"
/>
<span style="color: var(--text-primary)">Enable Rule</span>
<span class="text-content">Enable Rule</span>
</label>
<p class="text-xs mt-1" style="color: var(--text-secondary)">Uncheck to disable without deleting</p>
<p class="text-xs mt-1 text-content-muted">Uncheck to disable without deleting</p>
</div>
<div class="mb-6">
<label class="block text-sm font-medium mb-2" style="color: var(--text-secondary)">Priority</label>
<label class="block text-xs font-semibold uppercase tracking-wide text-content-muted mb-2">Priority</label>
<div class="flex gap-4">
<label class="flex items-center space-x-2 cursor-pointer">
<input type="radio" name="priority" value="1" class="w-4 h-4"/>
<span style="color: var(--text-primary)">High</span>
<span class="text-content">High</span>
</label>
<label class="flex items-center space-x-2 cursor-pointer">
<input
@@ -116,7 +116,7 @@ templ CollectionRules(user User, collection CollectionData) {
checked
class="w-4 h-4"
/>
<span style="color: var(--text-primary)">Medium</span>
<span class="text-content">Medium</span>
</label>
<label class="flex items-center space-x-2 cursor-pointer">
<input
@@ -125,36 +125,38 @@ templ CollectionRules(user User, collection CollectionData) {
value="3"
class="w-4 h-4"
/>
<span style="color: var(--text-primary)">Low</span>
<span class="text-content">Low</span>
</label>
</div>
</div>
<div class="flex justify-end space-x-3">
<button type="button" @click="testRule()" class="btn-secondary px-4 py-2 rounded-lg">
🧪 Test Rule
<button type="button" @click="testRule()" class="btn btn-secondary">
@Icon("play", "h-4 w-4")
Test Rule
</button>
<button type="button" @click="clearForm()" class="btn-secondary px-4 py-2 rounded-lg">
<button type="button" @click="clearForm()" class="btn btn-secondary">
Clear
</button>
<button type="submit" class="btn-primary px-4 py-2 rounded-lg">
Add Rule
<button type="submit" class="btn btn-primary">
@Icon("plus", "h-4 w-4")
Add Rule
</button>
</div>
</form>
<div id="test-results" class="hidden card p-6 rounded-lg border mb-6" style="background-color: var(--bg-primary); border-color: var(--border);">
<h3 class="font-semibold mb-3" style="color: var(--text-primary)">Rule Test Results</h3>
<p class="text-sm mb-2" style="color: var(--text-secondary)">Books that would be added by this rule:</p>
<div id="test-results" class="hidden card p-6 mb-6">
<h3 class="font-semibold mb-3 text-content">Rule Test Results</h3>
<p class="text-sm mb-2 text-content-muted">Books that would be added by this rule:</p>
<div id="test-results-list" class="max-h-64 overflow-y-auto space-y-2"></div>
</div>
</div>
<div class="card p-6 rounded-lg border" style="background-color: var(--bg-primary); border-color: var(--border);">
<h2 class="text-xl font-bold mb-4" style="color: var(--text-primary)">Rule Examples</h2>
<div class="card p-6">
<h2 class="text-xl font-bold mb-4 text-content">Rule Examples</h2>
<div class="space-y-4">
<div class="flex items-start gap-4">
<div class="flex-shrink-0 w-8 h-8 rounded-full flex items-center justify-center font-bold" style="background-color: var(--accent);">1</div>
<div class="flex-shrink-0 w-8 h-8 rounded-full flex items-center justify-center font-bold bg-brand text-surface">1</div>
<div>
<p class="font-medium" style="color: var(--text-primary)">Add all Science Fiction books</p>
<code class="block mt-1 text-sm" style="color: var(--text-secondary); background-color: var(--bg-secondary); padding: 4px 8px; border-radius: 4px;">
<p class="font-medium text-content">Add all Science Fiction books</p>
<code class="block mt-1 text-sm text-content-muted bg-surface-raised px-2 py-1 rounded">
Field: genre
<br/>
Operator: equals
@@ -164,10 +166,10 @@ templ CollectionRules(user User, collection CollectionData) {
</div>
</div>
<div class="flex items-start gap-4">
<div class="flex-shrink-0 w-8 h-8 rounded-full flex items-center justify-center font-bold" style="background-color: var(--accent);">2</div>
<div class="flex-shrink-0 w-8 h-8 rounded-full flex items-center justify-center font-bold bg-brand text-surface">2</div>
<div>
<p class="font-medium" style="color: var(--text-primary)">Add books from a specific series</p>
<code class="block mt-1 text-sm" style="color: var(--text-secondary); background-color: var(--bg-secondary); padding: 4px 8px; border-radius: 4px;">
<p class="font-medium text-content">Add books from a specific series</p>
<code class="block mt-1 text-sm text-content-muted bg-surface-raised px-2 py-1 rounded">
Field: series
<br/>
Operator: starts with
@@ -177,10 +179,10 @@ templ CollectionRules(user User, collection CollectionData) {
</div>
</div>
<div class="flex items-start gap-4">
<div class="flex-shrink-0 w-8 h-8 rounded-full flex items-center justify-center font-bold" style="background-color: var(--accent);">3</div>
<div class="flex-shrink-0 w-8 h-8 rounded-full flex items-center justify-center font-bold bg-brand text-surface">3</div>
<div>
<p class="font-medium" style="color: var(--text-primary)">Add books published in a year range</p>
<code class="block mt-1 text-sm" style="color: var(--text-secondary); background-color: var(--bg-secondary); padding: 4px 8px; border-radius: 4px;">
<p class="font-medium text-content">Add books published in a year range</p>
<code class="block mt-1 text-sm text-content-muted bg-surface-raised px-2 py-1 rounded">
Field: copyright_year
<br/>
Operator: greater than