From 37c5c9428e507daf31129f8a5acc2fdab10ef411 Mon Sep 17 00:00:00 2001 From: Ruidy Date: Sun, 19 May 2024 21:29:23 +0200 Subject: [PATCH] Login page using templ --- internal/server/handle_auth.go | 5 ++--- internal/view/layout/public.templ | 2 +- internal/view/layout/public_templ.go | 2 +- internal/view/login.templ | 26 +++++--------------------- internal/view/login_templ.go | 8 +++++--- 5 files changed, 14 insertions(+), 29 deletions(-) diff --git a/internal/server/handle_auth.go b/internal/server/handle_auth.go index 12f86a1..890f6ce 100644 --- a/internal/server/handle_auth.go +++ b/internal/server/handle_auth.go @@ -9,6 +9,7 @@ import ( "github.com/markbates/goth/gothic" "github.com/rjNemo/rentease/internal/auth" + "github.com/rjNemo/rentease/internal/view" ) var indexTemplate = `{{range $key,$value:=.Providers}} @@ -71,8 +72,6 @@ func handleProvider() echo.HandlerFunc { func handleLoginPage(as *auth.Service) echo.HandlerFunc { return func(c echo.Context) error { - t, _ := template.New("foo").Parse(indexTemplate) - return t.Execute(c.Response(), as.GetProviderIndex()) - //return renderTempl(c, http.StatusOK, view.Login(as.GetProviderIndex())) + return renderTempl(c, http.StatusOK, view.Login(as.GetProviderIndex())) } } diff --git a/internal/view/layout/public.templ b/internal/view/layout/public.templ index 3acb3f2..3ea0cf6 100644 --- a/internal/view/layout/public.templ +++ b/internal/view/layout/public.templ @@ -48,7 +48,7 @@ templ PublicLayout() { - +