aboutsummaryrefslogtreecommitdiff
path: root/templates/base.qtpl.go
blob: f8ff91f23386053a256a62cf482aaaaa4f68d5f7 (plain)
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
// 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 "strconv"

//line templates/base.qtpl:4
import "time"

//line templates/base.qtpl:6
import (
	qtio422016 "io"

	qt422016 "github.com/valyala/quicktemplate"
)

//line templates/base.qtpl:6
var (
	_ = qtio422016.Copy
	_ = qt422016.AcquireByteBuffer
)

//line templates/base.qtpl:7
var Slug = ""

//line templates/base.qtpl:11
type Page interface {
//line templates/base.qtpl:11
	Title() string
//line templates/base.qtpl:11
	StreamTitle(qw422016 *qt422016.Writer)
//line templates/base.qtpl:11
	WriteTitle(qq422016 qtio422016.Writer)
//line templates/base.qtpl:11
	Content() string
//line templates/base.qtpl:11
	StreamContent(qw422016 *qt422016.Writer)
//line templates/base.qtpl:11
	WriteContent(qq422016 qtio422016.Writer)
//line templates/base.qtpl:11
	Script() string
//line templates/base.qtpl:11
	StreamScript(qw422016 *qt422016.Writer)
//line templates/base.qtpl:11
	WriteScript(qq422016 qtio422016.Writer)
//line templates/base.qtpl:11
	Navbar() string
//line templates/base.qtpl:11
	StreamNavbar(qw422016 *qt422016.Writer)
//line templates/base.qtpl:11
	WriteNavbar(qq422016 qtio422016.Writer)
//line templates/base.qtpl:11
}

//line templates/base.qtpl:20
func FromUInttoString(u *uint) string {
	if u != nil {
		return strconv.FormatUint(uint64(*u), 10)
	}
	return ""
}

//line templates/base.qtpl:28
func TimeFormat(t time.Time) string {
	return t.Format("02.01.2006")
}

//line templates/base.qtpl:33
func Ignore[T any](v T, _ error) T {
	return v
}

// Page prints a page implementing Page interface.

//line templates/base.qtpl:39
func StreamPageTemplate(qw422016 *qt422016.Writer, p Page) {
//line templates/base.qtpl:39
	qw422016.N().S(`
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <link rel="icon" href="data:,">
    <title>`)
//line templates/base.qtpl:45
	p.StreamTitle(qw422016)
//line templates/base.qtpl:45
	qw422016.N().S(`</title> 
    <link rel="stylesheet" href="/static/main`)
//line templates/base.qtpl:46
	qw422016.E().S(Slug)
//line templates/base.qtpl:46
	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:51
	p.StreamNavbar(qw422016)
//line templates/base.qtpl:51
	qw422016.N().S(`
    <div class="container">
      `)
//line templates/base.qtpl:53
	p.StreamContent(qw422016)
//line templates/base.qtpl:53
	qw422016.N().S(`
    </div>
  </body>
  `)
//line templates/base.qtpl:56
	p.StreamScript(qw422016)
//line templates/base.qtpl:56
	qw422016.N().S(`
</html>
`)
//line templates/base.qtpl:58
}

//line templates/base.qtpl:58
func WritePageTemplate(qq422016 qtio422016.Writer, p Page) {
//line templates/base.qtpl:58
	qw422016 := qt422016.AcquireWriter(qq422016)
//line templates/base.qtpl:58
	StreamPageTemplate(qw422016, p)
//line templates/base.qtpl:58
	qt422016.ReleaseWriter(qw422016)
//line templates/base.qtpl:58
}

//line templates/base.qtpl:58
func PageTemplate(p Page) string {
//line templates/base.qtpl:58
	qb422016 := qt422016.AcquireByteBuffer()
//line templates/base.qtpl:58
	WritePageTemplate(qb422016, p)
//line templates/base.qtpl:58
	qs422016 := string(qb422016.B)
//line templates/base.qtpl:58
	qt422016.ReleaseByteBuffer(qb422016)
//line templates/base.qtpl:58
	return qs422016
//line templates/base.qtpl:58
}