package connect import ( "amadan.net/oficina/estilo.git/homeconnect" "embed" ) func Templates() embed.FS { return homeconnect.Templates() } type PageData = homeconnect.PageData func Page(state, label string, translate ...func(string) string) PageData { t := func(k string) string { return English[k] } if len(translate) > 0 && translate[0] != nil { t = translate[0] } p := PageData{Address: label} switch state { case "start": p.Action = "/account/home" p.PostAction = true p.ActionLabel = t("start_action") case "confirm": p.Action = "/account/home/confirm" p.PostAction = true p.ActionLabel = t("confirm_action") case "unknown": p.Action = "/signin/local" p.ActionLabel = t("local_action") case "signedout": p.Action = "/signin" p.ActionLabel = t("signedout_action") case "success": p.Action = "/" p.ActionLabel = t("documents_action") default: state = "failed" p.Action = "/signin/local" p.ActionLabel = t("local_action") } p.Title = t(state + "_title") p.Body = t(state + "_body") if state == "start" || state == "confirm" { p.CancelLabel = t("cancel_action") } return p } // English is the copy the apps render for connecting an account. It // never names the hub: the account is "your Oficina account" (Paul, // 2026-09-23), worded as Docs' approved docs.home.* strings are. The // signed-out state speaks the door's words (estilo chrome.English). var English = map[string]string{ "signedout_title": "You’re signed out", "signedout_body": "You can sign in again with your Oficina account.", "signedout_action": "Sign in", "start_title": "Connect your Oficina account", "start_body": "Use your Oficina account to sign in to this account. Your content and sharing settings stay as they are.", "start_action": "Connect", "cancel_action": "Back", "confirm_title": "Confirm account connection", "confirm_body": "Connect the account below to the Oficina account you just signed in to.", "confirm_action": "Connect accounts", "unknown_title": "Oficina account not connected", "unknown_body": "Sign in to your existing account, then connect your Oficina account from the account menu.", "local_action": "Sign in to your existing account", "failed_title": "Could not connect accounts", "failed_body": "Return to the app and start again.", "success_title": "Accounts connected", "success_body": "You can now use your Oficina account to sign in to this account.", "documents_action": "Back to the app", "menu_action": "Connect your Oficina account", }