From 707df264534695d39f42f422ae9cbb9e43e8890a Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Sat, 31 Jan 2026 18:25:29 -0500 Subject: [PATCH] feat: add UI templates for device and queue management - Add devices management template - Add conflicts resolution template - Add queue management template - Update admin templates with navigation links --- templates/admin_library_templ.go | 2 +- templates/admin_profile_templ.go | 6 +- templates/admin_templ.go | 2 +- templates/conflicts.templ | 204 +++++++++++++ templates/conflicts_templ.go | 48 ++++ templates/devices.templ | 472 +++++++++++++++++++++++++++++++ templates/devices_templ.go | 48 ++++ templates/header_templ.go | 2 +- templates/queue.templ | 162 +++++++++++ templates/queue_templ.go | 48 ++++ 10 files changed, 988 insertions(+), 6 deletions(-) create mode 100644 templates/conflicts.templ create mode 100644 templates/conflicts_templ.go create mode 100644 templates/devices.templ create mode 100644 templates/devices_templ.go create mode 100644 templates/queue.templ create mode 100644 templates/queue_templ.go diff --git a/templates/admin_library_templ.go b/templates/admin_library_templ.go index 8607508..903e2b2 100644 --- a/templates/admin_library_templ.go +++ b/templates/admin_library_templ.go @@ -36,7 +36,7 @@ func AdminLibrary(user User) templ.Component { var templ_7745c5c3_Var2 string templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(user.Username) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `admin_library.templ`, Line: 55, Col: 91} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/admin_library.templ`, Line: 55, Col: 91} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) if templ_7745c5c3_Err != nil { diff --git a/templates/admin_profile_templ.go b/templates/admin_profile_templ.go index b669ab2..38e57eb 100644 --- a/templates/admin_profile_templ.go +++ b/templates/admin_profile_templ.go @@ -36,7 +36,7 @@ func AdminProfile(user User) templ.Component { var templ_7745c5c3_Var2 string templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(user.Username) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `admin_profile.templ`, Line: 55, Col: 91} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/admin_profile.templ`, Line: 55, Col: 91} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) if templ_7745c5c3_Err != nil { @@ -49,7 +49,7 @@ func AdminProfile(user User) templ.Component { var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(user.Username) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `admin_profile.templ`, Line: 101, Col: 92} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/admin_profile.templ`, Line: 101, Col: 92} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { @@ -62,7 +62,7 @@ func AdminProfile(user User) templ.Component { var templ_7745c5c3_Var4 string templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(user.Email) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `admin_profile.templ`, Line: 110, Col: 87} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/admin_profile.templ`, Line: 110, Col: 87} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) if templ_7745c5c3_Err != nil { diff --git a/templates/admin_templ.go b/templates/admin_templ.go index 5cefb85..237d8ac 100644 --- a/templates/admin_templ.go +++ b/templates/admin_templ.go @@ -36,7 +36,7 @@ func Admin(user User) templ.Component { var templ_7745c5c3_Var2 string templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(user.Username) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `admin.templ`, Line: 55, Col: 91} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/admin.templ`, Line: 55, Col: 91} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) if templ_7745c5c3_Err != nil { diff --git a/templates/conflicts.templ b/templates/conflicts.templ new file mode 100644 index 0000000..79ef86d --- /dev/null +++ b/templates/conflicts.templ @@ -0,0 +1,204 @@ +package templates + +templ Conflicts(user User) { + + + + + + Sync Conflicts - Bookmann + + + + + + + + @Header(user, "/conflicts") + +
+
+
+
+

Sync Conflicts

+

Resolve conflicts when reading progress differs across devices

+
+
+ + +
+
+ +
+ Total: 0 + Unresolved: 0 + Resolved: 0 +
+
+ +
+
+

Loading conflicts...

+
+ + + + + + +
+ + + + +} diff --git a/templates/conflicts_templ.go b/templates/conflicts_templ.go new file mode 100644 index 0000000..f571344 --- /dev/null +++ b/templates/conflicts_templ.go @@ -0,0 +1,48 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.977 +package templates + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +func Conflicts(user User) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "Sync Conflicts - Bookmann") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = Header(user, "/conflicts").Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "

Sync Conflicts

Resolve conflicts when reading progress differs across devices

Total: 0 Unresolved: 0 Resolved: 0

Loading conflicts...

No Conflicts

Your devices are in sync! No conflicts to resolve.

Resolve Conflict

Book Title

Resolution Options

Manual Progress

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/templates/devices.templ b/templates/devices.templ new file mode 100644 index 0000000..b65a767 --- /dev/null +++ b/templates/devices.templ @@ -0,0 +1,472 @@ +package templates + +templ Devices(user User) { + + + + + + Device Management - Bookmann + + + + + + + @Header(user, "/devices") + +
+ +
+
+
+

Device Management

+

Manage your reading devices and sync settings

+
+ +
+
+ + +
+ +
+
+

Loading devices...

+
+ + + + + + +
+ + + + + + +
+ + + + + + + + + + +} diff --git a/templates/devices_templ.go b/templates/devices_templ.go new file mode 100644 index 0000000..35cbeb1 --- /dev/null +++ b/templates/devices_templ.go @@ -0,0 +1,48 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.977 +package templates + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +func Devices(user User) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "Device Management - Bookmann") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = Header(user, "/devices").Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "

Device Management

Manage your reading devices and sync settings

Loading devices...

📱

No Devices Yet

Add your reading devices to enable cross-device sync

Pending Device Registrations

Sync Queue

Add New Device

Enter your device's unique identifier

Device Settings

Allow this device to sync reading progress

Automatically sync changes

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/templates/header_templ.go b/templates/header_templ.go index 0ef8f2a..f3d2b96 100644 --- a/templates/header_templ.go +++ b/templates/header_templ.go @@ -36,7 +36,7 @@ func Header(user User, currentPath string) templ.Component { var templ_7745c5c3_Var2 string templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(user.Username) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `header.templ`, Line: 97, Col: 116} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/header.templ`, Line: 97, Col: 116} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) if templ_7745c5c3_Err != nil { diff --git a/templates/queue.templ b/templates/queue.templ new file mode 100644 index 0000000..7874aae --- /dev/null +++ b/templates/queue.templ @@ -0,0 +1,162 @@ +package templates + +templ Queue(user User) { + + + + + + Sync Queue - Bookmann + + + + + + + + @Header(user, "/queue") + +
+
+
+
+

Sync Queue

+

Monitor and manage offline sync queue

+
+
+ + + +
+
+ +
+
+
0
+
Pending
+
+
+
0
+
Processing
+
+
+
0
+
Completed
+
+
+
0
+
Failed
+
+
+
+ +
+
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
+ +
+
+

Loading queue...

+
+ + + + + + +
+ + + + +} diff --git a/templates/queue_templ.go b/templates/queue_templ.go new file mode 100644 index 0000000..63d809e --- /dev/null +++ b/templates/queue_templ.go @@ -0,0 +1,48 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.977 +package templates + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +func Queue(user User) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "Sync Queue - Bookmann") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = Header(user, "/queue").Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "

Sync Queue

Monitor and manage offline sync queue

0
Pending
0
Processing
0
Completed
0
Failed

Loading queue...

📭

Queue Empty

No items in the sync queue

Queue Item Details

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate