mount publisher underneath main website app
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"), + ), + ), + ), + ), ), ) }