all repos — homestead @ 75b25fe3db2fd9880379a851f0545beeb0109976

Code for my website

mount publisher underneath main website app

Alan Pearce
commit

75b25fe3db2fd9880379a851f0545beeb0109976

parent

00b167281daf5e813724bee25733598f2f68fcf0

1 file changed, 26 insertions(+), 3 deletions(-)

changed files
M domain/content/publisher/templates/index.go → domain/content/publisher/templates/index.go
@@ -8,14 +8,37 @@ base "alin.ovh/homestead/domain/web/templates"
) type PageSettings struct { - User string + User string + IsLoggedIn bool base.PageSettings } func IndexPage(site base.SiteSettings, page PageSettings) g.Node { return Layout(site, page.PageSettings, - P( - g.Textf("Hello, %s", page.User), + Div( + H1(g.Textf("Welcome, %s!", page.User)), + g.If(page.IsLoggedIn, + Div( + P(g.Text("You are currently logged in.")), + P( + A( + g.Attr("href", "/admin/auth/logout"), + g.Text("Logout"), + ), + ), + ), + ), + g.If(!page.IsLoggedIn, + Div( + P(g.Text("Please log in to access protected features.")), + P( + A( + g.Attr("href", "/admin/auth/login"), + g.Text("Login"), + ), + ), + ), + ), ), ) }