From 9e6acb09e745b67907be05011aef699ca24f81a2 Mon Sep 17 00:00:00 2001 From: brookjeynes Date: Mon, 16 Feb 2026 11:03:02 +1000 Subject: [PATCH] feat(views/login): add login templates Signed-off-by: brookjeynes --- internal/views/login/login-form.templ | 40 +++++++++++++++++++++++++++ internal/views/login/login.go | 12 ++++++++ internal/views/login/login.templ | 39 ++++++++++++++++++++++++++ 3 files changed, 91 insertions(+) create mode 100644 internal/views/login/login-form.templ create mode 100644 internal/views/login/login.go create mode 100644 internal/views/login/login.templ diff --git a/internal/views/login/login-form.templ b/internal/views/login/login-form.templ new file mode 100644 index 0000000..020b8ac --- /dev/null +++ b/internal/views/login/login-form.templ @@ -0,0 +1,40 @@ +package login + +templ LoginFormContent(params LoginFormParams) { + + + +} diff --git a/internal/views/login/login.go b/internal/views/login/login.go new file mode 100644 index 0000000..a2ac72c --- /dev/null +++ b/internal/views/login/login.go @@ -0,0 +1,12 @@ +package login + +type LoginPageParams struct { + ReturnUrl string + ErrorCode string +} + +type LoginFormParams struct { + ReturnUrl string + Handle string + ErrorMessage string +} diff --git a/internal/views/login/login.templ b/internal/views/login/login.templ new file mode 100644 index 0000000..29577e7 --- /dev/null +++ b/internal/views/login/login.templ @@ -0,0 +1,39 @@ +package login + +import "shelf.app/internal/layouts/base" + +templ LoginPage(params LoginPageParams) { + @layouts.Base(layouts.BaseParams{Title: "login"}) { +
+
+ @LoginFormContent(LoginFormParams{ + ReturnUrl: params.ReturnUrl, + Handle: "", + ErrorMessage: "", + }) +
+
+ if params.ErrorCode != "" { +

+ switch (params.ErrorCode) { + case "access_denied": + You have not authorized the app. + case "session": + Server failed to create user session. + case "handle": + Server failed to validate your handle. + default: + Internal Server error. + } + Please try again. +

+ } +
+
+ } +} -- 2.51.2