2025-02-21 18:42:56 +01:00
// Code generated by templ - DO NOT EDIT.
// templ: version: v0.3.819
package component
//lint:file-ignore SA4006 This context is only used if a nested component is present.
import "github.com/a-h/templ"
import templruntime "github.com/a-h/templ/runtime"
type PageOptions struct {
Title string
Head func ( ) templ . Component
}
type PageOptionFunc func ( opts * PageOptions )
func WithTitle ( title string ) PageOptionFunc {
return func ( opts * PageOptions ) {
if title != "" {
2025-02-22 09:42:15 +01:00
opts . Title = title + " | ClearCase"
2025-02-21 18:42:56 +01:00
} else {
2025-02-22 09:42:15 +01:00
opts . Title = "ClearCase"
2025-02-21 18:42:56 +01:00
}
}
}
func WithHead ( fn func ( ) templ . Component ) PageOptionFunc {
return func ( opts * PageOptions ) {
opts . Head = fn
}
}
func NewPageOptions ( funcs ... PageOptionFunc ) * PageOptions {
opts := & PageOptions {
Title : "" ,
Head : nil ,
}
for _ , fn := range funcs {
fn ( opts )
}
return opts
}
func Page ( funcs ... PageOptionFunc ) templ . Component {
return templruntime . GeneratedTemplate ( func ( templ_7745c5c3_Input templruntime . GeneratedComponentInput ) ( templ_7745c5c3_Err error ) {
templ_7745c5c3_W , ctx := templ_7745c5c3_Input . Writer , templ_7745c5c3_Input . Context
if templ_7745c5c3_CtxErr := ctx . Err ( ) ; templ_7745c5c3_CtxErr != nil {
return templ_7745c5c3_CtxErr
}
templ_7745c5c3_Buffer , templ_7745c5c3_IsBuffer := templruntime . GetBuffer ( templ_7745c5c3_W )
if ! templ_7745c5c3_IsBuffer {
defer func ( ) {
templ_7745c5c3_BufErr := templruntime . ReleaseBuffer ( templ_7745c5c3_Buffer )
if templ_7745c5c3_Err == nil {
templ_7745c5c3_Err = templ_7745c5c3_BufErr
}
} ( )
}
ctx = templ . InitializeContext ( ctx )
templ_7745c5c3_Var1 := templ . GetChildren ( ctx )
if templ_7745c5c3_Var1 == nil {
templ_7745c5c3_Var1 = templ . NopComponent
}
ctx = templ . ClearChildren ( ctx )
opts := NewPageOptions ( funcs ... )
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 1 , "<!doctype html><html data-theme=\"dark\"><head><meta charset=\"utf-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"><title>" )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2 , templ_7745c5c3_Err = templ . JoinStringErrs ( opts . Title )
if templ_7745c5c3_Err != nil {
return templ . Error { Err : templ_7745c5c3_Err , FileName : ` internal/http/handler/webui/common/component/page.templ ` , Line : 45 , Col : 22 }
}
_ , templ_7745c5c3_Err = templ_7745c5c3_Buffer . WriteString ( templ . EscapeString ( templ_7745c5c3_Var2 ) )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 2 , "</title><link rel=\"icon\" type=\"image/x-icon\" href=\"" )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3 , templ_7745c5c3_Err = templ . JoinStringErrs ( string ( BaseURL ( ctx , WithPath ( "/assets/favicon.ico" ) ) ) )
if templ_7745c5c3_Err != nil {
return templ . Error { Err : templ_7745c5c3_Err , FileName : ` internal/http/handler/webui/common/component/page.templ ` , Line : 46 , Col : 100 }
}
_ , templ_7745c5c3_Err = templ_7745c5c3_Buffer . WriteString ( templ . EscapeString ( templ_7745c5c3_Var3 ) )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 3 , "\"><link rel=\"stylesheet\" href=\"" )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4 , templ_7745c5c3_Err = templ . JoinStringErrs ( string ( BaseURL ( ctx , WithPath ( "/assets/bulma.min.css" ) ) ) )
if templ_7745c5c3_Err != nil {
return templ . Error { Err : templ_7745c5c3_Err , FileName : ` internal/http/handler/webui/common/component/page.templ ` , Line : 47 , Col : 88 }
}
_ , templ_7745c5c3_Err = templ_7745c5c3_Buffer . WriteString ( templ . EscapeString ( templ_7745c5c3_Var4 ) )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 4 , "\"><link rel=\"stylesheet\" href=\"" )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5 , templ_7745c5c3_Err = templ . JoinStringErrs ( string ( BaseURL ( ctx , WithPath ( "/assets/fontawesome/css/all.min.css" ) ) ) )
if templ_7745c5c3_Err != nil {
return templ . Error { Err : templ_7745c5c3_Err , FileName : ` internal/http/handler/webui/common/component/page.templ ` , Line : 48 , Col : 102 }
}
_ , templ_7745c5c3_Err = templ_7745c5c3_Buffer . WriteString ( templ . EscapeString ( templ_7745c5c3_Var5 ) )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 5 , "\"><link rel=\"stylesheet\" href=\"" )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6 , templ_7745c5c3_Err = templ . JoinStringErrs ( string ( BaseURL ( ctx , WithPath ( "/assets/style.css" ) ) ) )
if templ_7745c5c3_Err != nil {
return templ . Error { Err : templ_7745c5c3_Err , FileName : ` internal/http/handler/webui/common/component/page.templ ` , Line : 49 , Col : 84 }
}
_ , templ_7745c5c3_Err = templ_7745c5c3_Buffer . WriteString ( templ . EscapeString ( templ_7745c5c3_Var6 ) )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 6 , "\"><script src=\"" )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7 , templ_7745c5c3_Err = templ . JoinStringErrs ( string ( BaseURL ( ctx , WithPath ( "/assets/htmx.min.js" ) ) ) )
if templ_7745c5c3_Err != nil {
return templ . Error { Err : templ_7745c5c3_Err , FileName : ` internal/http/handler/webui/common/component/page.templ ` , Line : 50 , Col : 70 }
}
_ , templ_7745c5c3_Err = templ_7745c5c3_Buffer . WriteString ( templ . EscapeString ( templ_7745c5c3_Var7 ) )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 7 , "\"></script>" )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
if opts . Head != nil {
templ_7745c5c3_Err = opts . Head ( ) . Render ( ctx , templ_7745c5c3_Buffer )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
}
templ_7745c5c3_Err = templruntime . WriteString ( templ_7745c5c3_Buffer , 8 , "</head><body hx-boost=\"true\" class=\"is-fullheight\"><div id=\"main\" class=\"is-fullheight\">" )
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 = templruntime . WriteString ( templ_7745c5c3_Buffer , 9 , "</div><script type=\"text/javascript\">\n\t\t\t\thtmx.config.responseHandling = [\n\t\t\t\t\t{code:\"204\", swap: false}, // 204 - No Content by default does nothing, but is not an error\n\t\t\t\t\t{code:\"[23]..\", swap: true}, // 200 & 300 responses are non-errors and are swapped\n\t\t\t\t\t{code:\"[45]..\", swap: true, error:true}, // 400 & 500 responses are not swapped and are errors\n\t\t\t\t];\n\t\t\t</script></body></html>" )
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
return nil
} )
}
var _ = templruntime . GeneratedTemplate