diff --git a/internal/router/frontend.go b/internal/router/frontend.go index 5c39575..7af29fc 100644 --- a/internal/router/frontend.go +++ b/internal/router/frontend.go @@ -168,7 +168,7 @@ func registerFrontendRoutes(cfg *Config) { } pendingList := convertPending(pendingMaps) var buf bytes.Buffer - err = templates.Devices(user, devices, pendingList).Render(c.Request().Context(), &buf) + err = templates.Devices(user, devices, pendingList, cfg.Cfg.BaseURL).Render(c.Request().Context(), &buf) if err != nil { return err } diff --git a/templates/devices.templ b/templates/devices.templ index 32074ec..a4837c8 100644 --- a/templates/devices.templ +++ b/templates/devices.templ @@ -2,17 +2,18 @@ package templates import "bookhoard/internal/handlers" -templ Devices(user User, devices []handlers.DeviceInfo, pendingRegistrations []PendingRegistrationData) { +templ Devices(user User, devices []handlers.DeviceInfo, pendingRegistrations []PendingRegistrationData, baseURL string) {
{ device.DeviceType }
-DEVICE SYNC CONFIGURATION
+ + if device.DeviceType == "kobo" { + +Paste this URL into Kobo's api_endpoint setting
Enter this token in the KOReader plugin settings
+⚠️ Old token will immediately stop working
+DEVICE SYNC CONFIGURATION
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if device.DeviceType == "kobo" { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "Paste this URL into Kobo's api_endpoint setting
Enter this token in the KOReader plugin settings
⚠️ Old token will immediately stop working
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var7 string - templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(reg.DeviceType) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/devices.templ`, Line: 114, Col: 27} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, " - Expires in ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var9 string + templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(reg.DeviceType) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/devices.templ`, Line: 180, Col: 27} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 35, " - Expires in ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var10 string + templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(reg.ExpiresAt) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/devices.templ`, Line: 180, Col: 58} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "
Loading mappings...
Loading mappings...