// Code generated by qtc from "base.qtpl". DO NOT EDIT. // See https://github.com/valyala/quicktemplate for details. // This is a base page template. All the other template pages implement this interface. // //line templates/base.qtpl:3 package templates //line templates/base.qtpl:3 import "context" //line templates/base.qtpl:4 import "crypto/rand" //line templates/base.qtpl:5 import "encoding/hex" //line templates/base.qtpl:6 import "strconv" //line templates/base.qtpl:7 import "time" //line templates/base.qtpl:9 import ( qtio422016 "io" qt422016 "github.com/valyala/quicktemplate" ) //line templates/base.qtpl:9 var ( _ = qtio422016.Copy _ = qt422016.AcquireByteBuffer ) //line templates/base.qtpl:11 var Slug = "" var Session = "" func init() { Session = hex.EncodeToString(generateSmallTimeID()) } func generateSmallTimeID() []byte { b := make([]byte, 4) _, err := rand.Read(b) if err != nil { panic(err) } return b } //line templates/base.qtpl:29 type Page interface { //line templates/base.qtpl:29 Title(ctx context.Context) string //line templates/base.qtpl:29 StreamTitle(qw422016 *qt422016.Writer, ctx context.Context) //line templates/base.qtpl:29 WriteTitle(qq422016 qtio422016.Writer, ctx context.Context) //line templates/base.qtpl:29 Content(ctx context.Context) string //line templates/base.qtpl:29 StreamContent(qw422016 *qt422016.Writer, ctx context.Context) //line templates/base.qtpl:29 WriteContent(qq422016 qtio422016.Writer, ctx context.Context) //line templates/base.qtpl:29 Script(ctx context.Context) string //line templates/base.qtpl:29 StreamScript(qw422016 *qt422016.Writer, ctx context.Context) //line templates/base.qtpl:29 WriteScript(qq422016 qtio422016.Writer, ctx context.Context) //line templates/base.qtpl:29 Navbar(ctx context.Context) string //line templates/base.qtpl:29 StreamNavbar(qw422016 *qt422016.Writer, ctx context.Context) //line templates/base.qtpl:29 WriteNavbar(qq422016 qtio422016.Writer, ctx context.Context) //line templates/base.qtpl:29 } //line templates/base.qtpl:38 func FromUInttoString(u *uint) string { if u != nil { return strconv.FormatUint(uint64(*u), 10) } return "" } //line templates/base.qtpl:48 func TimeFormat(t time.Time) string { return t.Format("02.01.2006") } //line templates/base.qtpl:53 func Ignore[T any](v T, _ error) T { return v } //line templates/base.qtpl:59 func IsAuthenticationDisabled(ctx context.Context) bool { t, ok := ctx.Value("disableAuthentication").(bool) return ok && t } //line templates/base.qtpl:65 func IsLoggedIn(ctx context.Context) bool { t, ok := ctx.Value("logged").(bool) return ok && t } // Page prints a page implementing Page interface. //line templates/base.qtpl:72 func StreamPageTemplate(qw422016 *qt422016.Writer, p Page, ctx context.Context) { //line templates/base.qtpl:72 qw422016.N().S(`