aboutsummaryrefslogtreecommitdiff
path: root/templates/base.qtpl.go
blob: b2356feb0c1d6dd3aa6cd1105c63a81005a9093f (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
152
153
154
// 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 base.qtpl:3
package templates

//line base.qtpl:3
import "strconv"

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

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

	qt422016 "github.com/valyala/quicktemplate"
)

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

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

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

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

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

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

// Page prints a page implementing Page interface.

//line base.qtpl:39
func StreamPageTemplate(qw422016 *qt422016.Writer, p Page) {
//line base.qtpl:39
	qw422016.N().S(`
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <link rel="icon" href="data:,">
    <title>`)
//line base.qtpl:45
	p.StreamTitle(qw422016)
//line base.qtpl:45
	qw422016.N().S(`</title> 
    <link rel="stylesheet" href="/static/main`)
//line base.qtpl:46
	qw422016.E().S(Slug)
//line 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>
    <div class="alert alert-warning text-center" role="alert">
        This project is under development, things may be broken or incomplete.
    </div>
    `)
//line base.qtpl:54
	p.StreamNavbar(qw422016)
//line base.qtpl:54
	qw422016.N().S(`
    <div class="container">
      `)
//line base.qtpl:56
	p.StreamContent(qw422016)
//line base.qtpl:56
	qw422016.N().S(`
    </div>
  </body>
  `)
//line base.qtpl:59
	p.StreamScript(qw422016)
//line base.qtpl:59
	qw422016.N().S(`
</html>
`)
//line base.qtpl:61
}

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

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