cerrado @ dcc9a54fc8a1c52bb8cded28c4f445248bc597a6

  1// Code generated by qtc from "base.qtpl". DO NOT EDIT.
  2// See https://github.com/valyala/quicktemplate for details.
  3
  4// This is a base page template. All the other template pages implement this interface.
  5//
  6
  7//line templates/base.qtpl:3
  8package templates
  9
 10//line templates/base.qtpl:3
 11import "context"
 12
 13//line templates/base.qtpl:4
 14import "strconv"
 15
 16//line templates/base.qtpl:5
 17import "time"
 18
 19//line templates/base.qtpl:7
 20import (
 21	qtio422016 "io"
 22
 23	qt422016 "github.com/valyala/quicktemplate"
 24)
 25
 26//line templates/base.qtpl:7
 27var (
 28	_ = qtio422016.Copy
 29	_ = qt422016.AcquireByteBuffer
 30)
 31
 32//line templates/base.qtpl:8
 33var Slug = ""
 34
 35//line templates/base.qtpl:12
 36type Page interface {
 37//line templates/base.qtpl:12
 38	Title(ctx context.Context) string
 39//line templates/base.qtpl:12
 40	StreamTitle(qw422016 *qt422016.Writer, ctx context.Context)
 41//line templates/base.qtpl:12
 42	WriteTitle(qq422016 qtio422016.Writer, ctx context.Context)
 43//line templates/base.qtpl:12
 44	Content(ctx context.Context) string
 45//line templates/base.qtpl:12
 46	StreamContent(qw422016 *qt422016.Writer, ctx context.Context)
 47//line templates/base.qtpl:12
 48	WriteContent(qq422016 qtio422016.Writer, ctx context.Context)
 49//line templates/base.qtpl:12
 50	Script(ctx context.Context) string
 51//line templates/base.qtpl:12
 52	StreamScript(qw422016 *qt422016.Writer, ctx context.Context)
 53//line templates/base.qtpl:12
 54	WriteScript(qq422016 qtio422016.Writer, ctx context.Context)
 55//line templates/base.qtpl:12
 56	Navbar(ctx context.Context) string
 57//line templates/base.qtpl:12
 58	StreamNavbar(qw422016 *qt422016.Writer, ctx context.Context)
 59//line templates/base.qtpl:12
 60	WriteNavbar(qq422016 qtio422016.Writer, ctx context.Context)
 61//line templates/base.qtpl:12
 62}
 63
 64//line templates/base.qtpl:21
 65func FromUInttoString(u *uint) string {
 66	if u != nil {
 67		return strconv.FormatUint(uint64(*u), 10)
 68	}
 69	return ""
 70}
 71
 72//line templates/base.qtpl:31
 73func TimeFormat(t time.Time) string {
 74	return t.Format("02.01.2006")
 75}
 76
 77//line templates/base.qtpl:36
 78func Ignore[T any](v T, _ error) T {
 79	return v
 80}
 81
 82//line templates/base.qtpl:42
 83func IsAuthenticationDisabled(ctx context.Context) bool {
 84	t, ok := ctx.Value("disableAuthentication").(bool)
 85	return ok && t
 86}
 87
 88//line templates/base.qtpl:48
 89func IsLoggedIn(ctx context.Context) bool {
 90	t, ok := ctx.Value("logged").(bool)
 91	return ok && t
 92}
 93
 94// Page prints a page implementing Page interface.
 95
 96//line templates/base.qtpl:55
 97func StreamPageTemplate(qw422016 *qt422016.Writer, p Page, ctx context.Context) {
 98//line templates/base.qtpl:55
 99	qw422016.N().S(`
100<!DOCTYPE html>
101<html lang="en">
102  <head>
103    <meta charset="utf-8">
104    <link rel="icon" href="data:,">
105    <title>`)
106//line templates/base.qtpl:61
107	p.StreamTitle(qw422016, ctx)
108//line templates/base.qtpl:61
109	qw422016.N().S(`</title> 
110    <link rel="stylesheet" href="/static/main`)
111//line templates/base.qtpl:62
112	qw422016.E().S(Slug)
113//line templates/base.qtpl:62
114	qw422016.N().S(`.css">
115    <meta content="text/html;charset=utf-8" http-equiv="Content-Type">
116    <meta name="viewport" content="width=device-width, initial-scale=1" />
117  </head>
118  <body>
119    `)
120//line templates/base.qtpl:67
121	p.StreamNavbar(qw422016, ctx)
122//line templates/base.qtpl:67
123	qw422016.N().S(`
124    <div class="container">
125      `)
126//line templates/base.qtpl:69
127	p.StreamContent(qw422016, ctx)
128//line templates/base.qtpl:69
129	qw422016.N().S(`
130    </div>
131  </body>
132  `)
133//line templates/base.qtpl:72
134	p.StreamScript(qw422016, ctx)
135//line templates/base.qtpl:72
136	qw422016.N().S(`
137</html>
138`)
139//line templates/base.qtpl:74
140}
141
142//line templates/base.qtpl:74
143func WritePageTemplate(qq422016 qtio422016.Writer, p Page, ctx context.Context) {
144//line templates/base.qtpl:74
145	qw422016 := qt422016.AcquireWriter(qq422016)
146//line templates/base.qtpl:74
147	StreamPageTemplate(qw422016, p, ctx)
148//line templates/base.qtpl:74
149	qt422016.ReleaseWriter(qw422016)
150//line templates/base.qtpl:74
151}
152
153//line templates/base.qtpl:74
154func PageTemplate(p Page, ctx context.Context) string {
155//line templates/base.qtpl:74
156	qb422016 := qt422016.AcquireByteBuffer()
157//line templates/base.qtpl:74
158	WritePageTemplate(qb422016, p, ctx)
159//line templates/base.qtpl:74
160	qs422016 := string(qb422016.B)
161//line templates/base.qtpl:74
162	qt422016.ReleaseByteBuffer(qb422016)
163//line templates/base.qtpl:74
164	return qs422016
165//line templates/base.qtpl:74
166}