cerrado @ 1e45ae2ea3497958b2ea6a20137955cfc3bbc964

  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:41
 83func IsLoggedIn(ctx context.Context) bool {
 84	t, ok := ctx.Value("logged").(bool)
 85	return ok && t
 86}
 87
 88// Page prints a page implementing Page interface.
 89
 90//line templates/base.qtpl:48
 91func StreamPageTemplate(qw422016 *qt422016.Writer, p Page, ctx context.Context) {
 92//line templates/base.qtpl:48
 93	qw422016.N().S(`
 94<!DOCTYPE html>
 95<html lang="en">
 96  <head>
 97    <meta charset="utf-8">
 98    <link rel="icon" href="data:,">
 99    <title>`)
100//line templates/base.qtpl:54
101	p.StreamTitle(qw422016, ctx)
102//line templates/base.qtpl:54
103	qw422016.N().S(`</title> 
104    <link rel="stylesheet" href="/static/main`)
105//line templates/base.qtpl:55
106	qw422016.E().S(Slug)
107//line templates/base.qtpl:55
108	qw422016.N().S(`.css">
109    <meta content="text/html;charset=utf-8" http-equiv="Content-Type">
110    <meta name="viewport" content="width=device-width, initial-scale=1" />
111  </head>
112  <body>
113    `)
114//line templates/base.qtpl:60
115	p.StreamNavbar(qw422016, ctx)
116//line templates/base.qtpl:60
117	qw422016.N().S(`
118    <div class="container">
119      `)
120//line templates/base.qtpl:62
121	p.StreamContent(qw422016, ctx)
122//line templates/base.qtpl:62
123	qw422016.N().S(`
124    </div>
125  </body>
126  `)
127//line templates/base.qtpl:65
128	p.StreamScript(qw422016, ctx)
129//line templates/base.qtpl:65
130	qw422016.N().S(`
131</html>
132`)
133//line templates/base.qtpl:67
134}
135
136//line templates/base.qtpl:67
137func WritePageTemplate(qq422016 qtio422016.Writer, p Page, ctx context.Context) {
138//line templates/base.qtpl:67
139	qw422016 := qt422016.AcquireWriter(qq422016)
140//line templates/base.qtpl:67
141	StreamPageTemplate(qw422016, p, ctx)
142//line templates/base.qtpl:67
143	qt422016.ReleaseWriter(qw422016)
144//line templates/base.qtpl:67
145}
146
147//line templates/base.qtpl:67
148func PageTemplate(p Page, ctx context.Context) string {
149//line templates/base.qtpl:67
150	qb422016 := qt422016.AcquireByteBuffer()
151//line templates/base.qtpl:67
152	WritePageTemplate(qb422016, p, ctx)
153//line templates/base.qtpl:67
154	qs422016 := string(qb422016.B)
155//line templates/base.qtpl:67
156	qt422016.ReleaseByteBuffer(qb422016)
157//line templates/base.qtpl:67
158	return qs422016
159//line templates/base.qtpl:67
160}