aboutsummaryrefslogtreecommitdiff
path: root/templates/base.qtpl.go
diff options
context:
space:
mode:
authorGabriel A. Giovanini <mail@gabrielgio.me>2024-05-05 19:02:43 +0200
committerGabriel A. Giovanini <mail@gabrielgio.me>2024-05-05 19:02:43 +0200
commitf5b5f72f7eaf14692b8036c3698037c647b2423a (patch)
treef74eb37277771fd1dceec702d1f3820fb553dc2a /templates/base.qtpl.go
parent129c73757036a8073467a2046bc73e95918f1ca1 (diff)
downloadcerrado-f5b5f72f7eaf14692b8036c3698037c647b2423a.tar.gz
cerrado-f5b5f72f7eaf14692b8036c3698037c647b2423a.tar.bz2
cerrado-f5b5f72f7eaf14692b8036c3698037c647b2423a.zip
feat: Add qtc templating
Diffstat (limited to 'templates/base.qtpl.go')
-rw-r--r--templates/base.qtpl.go217
1 files changed, 217 insertions, 0 deletions
diff --git a/templates/base.qtpl.go b/templates/base.qtpl.go
new file mode 100644
index 0000000..8d93fa8
--- /dev/null
+++ b/templates/base.qtpl.go
@@ -0,0 +1,217 @@
+// 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:5
+import (
+ qtio422016 "io"
+
+ qt422016 "github.com/valyala/quicktemplate"
+)
+
+//line base.qtpl:5
+var (
+ _ = qtio422016.Copy
+ _ = qt422016.AcquireByteBuffer
+)
+
+//line base.qtpl:6
+type Page interface {
+//line base.qtpl:6
+ Title() string
+//line base.qtpl:6
+ StreamTitle(qw422016 *qt422016.Writer)
+//line base.qtpl:6
+ WriteTitle(qq422016 qtio422016.Writer)
+//line base.qtpl:6
+ Content() string
+//line base.qtpl:6
+ StreamContent(qw422016 *qt422016.Writer)
+//line base.qtpl:6
+ WriteContent(qq422016 qtio422016.Writer)
+//line base.qtpl:6
+ Script() string
+//line base.qtpl:6
+ StreamScript(qw422016 *qt422016.Writer)
+//line base.qtpl:6
+ WriteScript(qq422016 qtio422016.Writer)
+//line base.qtpl:6
+}
+
+//line base.qtpl:14
+func FromUInttoString(u *uint) string {
+ if u != nil {
+ return strconv.FormatUint(uint64(*u), 10)
+ }
+ return ""
+}
+
+// Page prints a page implementing Page interface.
+
+//line base.qtpl:24
+func StreamPageTemplate(qw422016 *qt422016.Writer, p Page) {
+//line base.qtpl:24
+ qw422016.N().S(`
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title>img | `)
+//line base.qtpl:28
+ p.StreamTitle(qw422016)
+//line base.qtpl:28
+ qw422016.N().S(`</title>
+ <link rel="stylesheet" href="/static/main.css">
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ </head>
+ <body>
+ <div>
+ `)
+//line base.qtpl:34
+ p.StreamContent(qw422016)
+//line base.qtpl:34
+ qw422016.N().S(`
+ </div>
+ </body>
+ `)
+//line base.qtpl:37
+ p.StreamScript(qw422016)
+//line base.qtpl:37
+ qw422016.N().S(`
+</html>
+`)
+//line base.qtpl:39
+}
+
+//line base.qtpl:39
+func WritePageTemplate(qq422016 qtio422016.Writer, p Page) {
+//line base.qtpl:39
+ qw422016 := qt422016.AcquireWriter(qq422016)
+//line base.qtpl:39
+ StreamPageTemplate(qw422016, p)
+//line base.qtpl:39
+ qt422016.ReleaseWriter(qw422016)
+//line base.qtpl:39
+}
+
+//line base.qtpl:39
+func PageTemplate(p Page) string {
+//line base.qtpl:39
+ qb422016 := qt422016.AcquireByteBuffer()
+//line base.qtpl:39
+ WritePageTemplate(qb422016, p)
+//line base.qtpl:39
+ qs422016 := string(qb422016.B)
+//line base.qtpl:39
+ qt422016.ReleaseByteBuffer(qb422016)
+//line base.qtpl:39
+ return qs422016
+//line base.qtpl:39
+}
+
+//line base.qtpl:41
+type BasePage struct{}
+
+//line base.qtpl:42
+func (p *BasePage) StreamTitle(qw422016 *qt422016.Writer) {
+//line base.qtpl:42
+ qw422016.N().S(`Empty`)
+//line base.qtpl:42
+}
+
+//line base.qtpl:42
+func (p *BasePage) WriteTitle(qq422016 qtio422016.Writer) {
+//line base.qtpl:42
+ qw422016 := qt422016.AcquireWriter(qq422016)
+//line base.qtpl:42
+ p.StreamTitle(qw422016)
+//line base.qtpl:42
+ qt422016.ReleaseWriter(qw422016)
+//line base.qtpl:42
+}
+
+//line base.qtpl:42
+func (p *BasePage) Title() string {
+//line base.qtpl:42
+ qb422016 := qt422016.AcquireByteBuffer()
+//line base.qtpl:42
+ p.WriteTitle(qb422016)
+//line base.qtpl:42
+ qs422016 := string(qb422016.B)
+//line base.qtpl:42
+ qt422016.ReleaseByteBuffer(qb422016)
+//line base.qtpl:42
+ return qs422016
+//line base.qtpl:42
+}
+
+//line base.qtpl:43
+func (p *BasePage) StreamBody(qw422016 *qt422016.Writer) {
+//line base.qtpl:43
+ qw422016.N().S(`HelloWorld`)
+//line base.qtpl:43
+}
+
+//line base.qtpl:43
+func (p *BasePage) WriteBody(qq422016 qtio422016.Writer) {
+//line base.qtpl:43
+ qw422016 := qt422016.AcquireWriter(qq422016)
+//line base.qtpl:43
+ p.StreamBody(qw422016)
+//line base.qtpl:43
+ qt422016.ReleaseWriter(qw422016)
+//line base.qtpl:43
+}
+
+//line base.qtpl:43
+func (p *BasePage) Body() string {
+//line base.qtpl:43
+ qb422016 := qt422016.AcquireByteBuffer()
+//line base.qtpl:43
+ p.WriteBody(qb422016)
+//line base.qtpl:43
+ qs422016 := string(qb422016.B)
+//line base.qtpl:43
+ qt422016.ReleaseByteBuffer(qb422016)
+//line base.qtpl:43
+ return qs422016
+//line base.qtpl:43
+}
+
+//line base.qtpl:44
+func (p *BasePage) StreamScript(qw422016 *qt422016.Writer) {
+//line base.qtpl:44
+}
+
+//line base.qtpl:44
+func (p *BasePage) WriteScript(qq422016 qtio422016.Writer) {
+//line base.qtpl:44
+ qw422016 := qt422016.AcquireWriter(qq422016)
+//line base.qtpl:44
+ p.StreamScript(qw422016)
+//line base.qtpl:44
+ qt422016.ReleaseWriter(qw422016)
+//line base.qtpl:44
+}
+
+//line base.qtpl:44
+func (p *BasePage) Script() string {
+//line base.qtpl:44
+ qb422016 := qt422016.AcquireByteBuffer()
+//line base.qtpl:44
+ p.WriteScript(qb422016)
+//line base.qtpl:44
+ qs422016 := string(qb422016.B)
+//line base.qtpl:44
+ qt422016.ReleaseByteBuffer(qb422016)
+//line base.qtpl:44
+ return qs422016
+//line base.qtpl:44
+}