224 lines
8.8 KiB
Go
224 lines
8.8 KiB
Go
|
// Code generated by templ - DO NOT EDIT.
|
||
|
|
||
|
// templ: version: v0.2.598
|
||
|
package layouts
|
||
|
|
||
|
//lint:file-ignore SA4006 This context is only used if a nested component is present.
|
||
|
|
||
|
import "github.com/a-h/templ"
|
||
|
import "context"
|
||
|
import "io"
|
||
|
import "bytes"
|
||
|
|
||
|
import "git.staur.ca/stobbsm/clustvirt/view/components"
|
||
|
|
||
|
func StaticPage(title string, subtitle string, navBarItems []components.NavItem) templ.Component {
|
||
|
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||
|
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||
|
if !templ_7745c5c3_IsBuffer {
|
||
|
templ_7745c5c3_Buffer = templ.GetBuffer()
|
||
|
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||
|
}
|
||
|
ctx = templ.InitializeContext(ctx)
|
||
|
templ_7745c5c3_Var1 := templ.GetChildren(ctx)
|
||
|
if templ_7745c5c3_Var1 == nil {
|
||
|
templ_7745c5c3_Var1 = templ.NopComponent
|
||
|
}
|
||
|
ctx = templ.ClearChildren(ctx)
|
||
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!doctype html>")
|
||
|
if templ_7745c5c3_Err != nil {
|
||
|
return templ_7745c5c3_Err
|
||
|
}
|
||
|
var templ_7745c5c3_Var2 = []any{"text-uigrey-100", "bg-uigrey-900"}
|
||
|
templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...)
|
||
|
if templ_7745c5c3_Err != nil {
|
||
|
return templ_7745c5c3_Err
|
||
|
}
|
||
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<html class=\"")
|
||
|
if templ_7745c5c3_Err != nil {
|
||
|
return templ_7745c5c3_Err
|
||
|
}
|
||
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ.CSSClasses(templ_7745c5c3_Var2).String()))
|
||
|
if templ_7745c5c3_Err != nil {
|
||
|
return templ_7745c5c3_Err
|
||
|
}
|
||
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"><head><title>Clustvirt</title><link href=\"/static/css/style.css\" type=\"text/css\" rel=\"stylesheet\"></head><body><header>")
|
||
|
if templ_7745c5c3_Err != nil {
|
||
|
return templ_7745c5c3_Err
|
||
|
}
|
||
|
templ_7745c5c3_Err = header(title, subtitle, navBarItems).Render(ctx, templ_7745c5c3_Buffer)
|
||
|
if templ_7745c5c3_Err != nil {
|
||
|
return templ_7745c5c3_Err
|
||
|
}
|
||
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</header>")
|
||
|
if templ_7745c5c3_Err != nil {
|
||
|
return templ_7745c5c3_Err
|
||
|
}
|
||
|
var templ_7745c5c3_Var3 = []any{"flex", "flex-col", "gap-2"}
|
||
|
templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var3...)
|
||
|
if templ_7745c5c3_Err != nil {
|
||
|
return templ_7745c5c3_Err
|
||
|
}
|
||
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div id=\"content\" name=\"content\" class=\"")
|
||
|
if templ_7745c5c3_Err != nil {
|
||
|
return templ_7745c5c3_Err
|
||
|
}
|
||
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ.CSSClasses(templ_7745c5c3_Var3).String()))
|
||
|
if templ_7745c5c3_Err != nil {
|
||
|
return templ_7745c5c3_Err
|
||
|
}
|
||
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
|
||
|
if templ_7745c5c3_Err != nil {
|
||
|
return templ_7745c5c3_Err
|
||
|
}
|
||
|
templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer)
|
||
|
if templ_7745c5c3_Err != nil {
|
||
|
return templ_7745c5c3_Err
|
||
|
}
|
||
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><footer>")
|
||
|
if templ_7745c5c3_Err != nil {
|
||
|
return templ_7745c5c3_Err
|
||
|
}
|
||
|
templ_7745c5c3_Err = footer().Render(ctx, templ_7745c5c3_Buffer)
|
||
|
if templ_7745c5c3_Err != nil {
|
||
|
return templ_7745c5c3_Err
|
||
|
}
|
||
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</footer></body></html>")
|
||
|
if templ_7745c5c3_Err != nil {
|
||
|
return templ_7745c5c3_Err
|
||
|
}
|
||
|
if !templ_7745c5c3_IsBuffer {
|
||
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
|
||
|
}
|
||
|
return templ_7745c5c3_Err
|
||
|
})
|
||
|
}
|
||
|
|
||
|
func hero(title string) templ.Component {
|
||
|
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||
|
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||
|
if !templ_7745c5c3_IsBuffer {
|
||
|
templ_7745c5c3_Buffer = templ.GetBuffer()
|
||
|
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||
|
}
|
||
|
ctx = templ.InitializeContext(ctx)
|
||
|
templ_7745c5c3_Var4 := templ.GetChildren(ctx)
|
||
|
if templ_7745c5c3_Var4 == nil {
|
||
|
templ_7745c5c3_Var4 = templ.NopComponent
|
||
|
}
|
||
|
ctx = templ.ClearChildren(ctx)
|
||
|
var templ_7745c5c3_Var5 = []any{"text-2xl", "font-bold", "text-uiblue-200", "md:order-1"}
|
||
|
templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var5...)
|
||
|
if templ_7745c5c3_Err != nil {
|
||
|
return templ_7745c5c3_Err
|
||
|
}
|
||
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<h1 class=\"")
|
||
|
if templ_7745c5c3_Err != nil {
|
||
|
return templ_7745c5c3_Err
|
||
|
}
|
||
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ.CSSClasses(templ_7745c5c3_Var5).String()))
|
||
|
if templ_7745c5c3_Err != nil {
|
||
|
return templ_7745c5c3_Err
|
||
|
}
|
||
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
|
||
|
if templ_7745c5c3_Err != nil {
|
||
|
return templ_7745c5c3_Err
|
||
|
}
|
||
|
var templ_7745c5c3_Var6 string
|
||
|
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(title)
|
||
|
if templ_7745c5c3_Err != nil {
|
||
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layouts/staticpage.templ`, Line: 26, Col: 80}
|
||
|
}
|
||
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
|
||
|
if templ_7745c5c3_Err != nil {
|
||
|
return templ_7745c5c3_Err
|
||
|
}
|
||
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</h1>")
|
||
|
if templ_7745c5c3_Err != nil {
|
||
|
return templ_7745c5c3_Err
|
||
|
}
|
||
|
if !templ_7745c5c3_IsBuffer {
|
||
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
|
||
|
}
|
||
|
return templ_7745c5c3_Err
|
||
|
})
|
||
|
}
|
||
|
|
||
|
func header(title string, subtitle string, navBarItems []components.NavItem) templ.Component {
|
||
|
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||
|
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||
|
if !templ_7745c5c3_IsBuffer {
|
||
|
templ_7745c5c3_Buffer = templ.GetBuffer()
|
||
|
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||
|
}
|
||
|
ctx = templ.InitializeContext(ctx)
|
||
|
templ_7745c5c3_Var7 := templ.GetChildren(ctx)
|
||
|
if templ_7745c5c3_Var7 == nil {
|
||
|
templ_7745c5c3_Var7 = templ.NopComponent
|
||
|
}
|
||
|
ctx = templ.ClearChildren(ctx)
|
||
|
var templ_7745c5c3_Var8 = []any{"text-lg", "font-semibold", "italic", "h-6"}
|
||
|
templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var8...)
|
||
|
if templ_7745c5c3_Err != nil {
|
||
|
return templ_7745c5c3_Err
|
||
|
}
|
||
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<h2 class=\"")
|
||
|
if templ_7745c5c3_Err != nil {
|
||
|
return templ_7745c5c3_Err
|
||
|
}
|
||
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ.CSSClasses(templ_7745c5c3_Var8).String()))
|
||
|
if templ_7745c5c3_Err != nil {
|
||
|
return templ_7745c5c3_Err
|
||
|
}
|
||
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">")
|
||
|
if templ_7745c5c3_Err != nil {
|
||
|
return templ_7745c5c3_Err
|
||
|
}
|
||
|
var templ_7745c5c3_Var9 string
|
||
|
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(subtitle)
|
||
|
if templ_7745c5c3_Err != nil {
|
||
|
return templ.Error{Err: templ_7745c5c3_Err, FileName: `view/layouts/staticpage.templ`, Line: 30, Col: 72}
|
||
|
}
|
||
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
|
||
|
if templ_7745c5c3_Err != nil {
|
||
|
return templ_7745c5c3_Err
|
||
|
}
|
||
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</h2>")
|
||
|
if templ_7745c5c3_Err != nil {
|
||
|
return templ_7745c5c3_Err
|
||
|
}
|
||
|
templ_7745c5c3_Err = components.NavBar(hero(title), navBarItems).Render(ctx, templ_7745c5c3_Buffer)
|
||
|
if templ_7745c5c3_Err != nil {
|
||
|
return templ_7745c5c3_Err
|
||
|
}
|
||
|
if !templ_7745c5c3_IsBuffer {
|
||
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
|
||
|
}
|
||
|
return templ_7745c5c3_Err
|
||
|
})
|
||
|
}
|
||
|
|
||
|
func footer() templ.Component {
|
||
|
return templ.ComponentFunc(func(ctx context.Context, templ_7745c5c3_W io.Writer) (templ_7745c5c3_Err error) {
|
||
|
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templ_7745c5c3_W.(*bytes.Buffer)
|
||
|
if !templ_7745c5c3_IsBuffer {
|
||
|
templ_7745c5c3_Buffer = templ.GetBuffer()
|
||
|
defer templ.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||
|
}
|
||
|
ctx = templ.InitializeContext(ctx)
|
||
|
templ_7745c5c3_Var10 := templ.GetChildren(ctx)
|
||
|
if templ_7745c5c3_Var10 == nil {
|
||
|
templ_7745c5c3_Var10 = templ.NopComponent
|
||
|
}
|
||
|
ctx = templ.ClearChildren(ctx)
|
||
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"flex gap-4 md:gap-6 sm:gap-8 divide divide-solid\"><div id=\"footer_left\" class=\"flex-auto basis-1/4 md:basis-1/3 p-2\">Left</div><div id=\"footer_middle\" class=\"flex-auto basis-1/2 md:basis-1/3 p-2\">Middle</div><div id=\"footer_right\" class=\"flex-auto basis-1/4 md:basis-1/3 p-2\">Right</div></div>")
|
||
|
if templ_7745c5c3_Err != nil {
|
||
|
return templ_7745c5c3_Err
|
||
|
}
|
||
|
if !templ_7745c5c3_IsBuffer {
|
||
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteTo(templ_7745c5c3_W)
|
||
|
}
|
||
|
return templ_7745c5c3_Err
|
||
|
})
|
||
|
}
|