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