347 lines
9.1 KiB
Go
347 lines
9.1 KiB
Go
// 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 "http5/status"
|
|
|
|
//line templates/base.qtpl:5
|
|
import (
|
|
qtio422016 "io"
|
|
|
|
qt422016 "github.com/valyala/quicktemplate"
|
|
)
|
|
|
|
//line templates/base.qtpl:5
|
|
var (
|
|
_ = qtio422016.Copy
|
|
_ = qt422016.AcquireByteBuffer
|
|
)
|
|
|
|
//line templates/base.qtpl:6
|
|
type Page interface {
|
|
//line templates/base.qtpl:6
|
|
Header() string
|
|
//line templates/base.qtpl:6
|
|
StreamHeader(qw422016 *qt422016.Writer)
|
|
//line templates/base.qtpl:6
|
|
WriteHeader(qq422016 qtio422016.Writer)
|
|
//line templates/base.qtpl:6
|
|
Title(BaseTitle, PageTitle string) string
|
|
//line templates/base.qtpl:6
|
|
StreamTitle(qw422016 *qt422016.Writer, BaseTitle, PageTitle string)
|
|
//line templates/base.qtpl:6
|
|
WriteTitle(qq422016 qtio422016.Writer, BaseTitle, PageTitle string)
|
|
//line templates/base.qtpl:6
|
|
Body() string
|
|
//line templates/base.qtpl:6
|
|
StreamBody(qw422016 *qt422016.Writer)
|
|
//line templates/base.qtpl:6
|
|
WriteBody(qq422016 qtio422016.Writer)
|
|
//line templates/base.qtpl:6
|
|
Footer(st status.Status) string
|
|
//line templates/base.qtpl:6
|
|
StreamFooter(qw422016 *qt422016.Writer, st status.Status)
|
|
//line templates/base.qtpl:6
|
|
WriteFooter(qq422016 qtio422016.Writer, st status.Status)
|
|
//line templates/base.qtpl:6
|
|
}
|
|
|
|
// Base page implementation. Other pages may inherit from it if they need
|
|
// overriding only certain Page methods
|
|
|
|
//line templates/base.qtpl:17
|
|
type BasePage struct {
|
|
BaseTitle string
|
|
PageTitle string
|
|
Status status.Status
|
|
LogOutURL string
|
|
BootstrapCSS string
|
|
CommonCSS string
|
|
LoginCSS string
|
|
DMMonoCSS string
|
|
}
|
|
|
|
//line templates/base.qtpl:28
|
|
func (p *BasePage) StreamTitle(qw422016 *qt422016.Writer, BaseTitle, PageTitle string) {
|
|
//line templates/base.qtpl:28
|
|
qw422016.N().S(`
|
|
`)
|
|
//line templates/base.qtpl:29
|
|
qw422016.E().S(BaseTitle)
|
|
//line templates/base.qtpl:29
|
|
qw422016.N().S(` - `)
|
|
//line templates/base.qtpl:29
|
|
qw422016.E().S(PageTitle)
|
|
//line templates/base.qtpl:29
|
|
qw422016.N().S(`
|
|
`)
|
|
//line templates/base.qtpl:30
|
|
}
|
|
|
|
//line templates/base.qtpl:30
|
|
func (p *BasePage) WriteTitle(qq422016 qtio422016.Writer, BaseTitle, PageTitle string) {
|
|
//line templates/base.qtpl:30
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
//line templates/base.qtpl:30
|
|
p.StreamTitle(qw422016, BaseTitle, PageTitle)
|
|
//line templates/base.qtpl:30
|
|
qt422016.ReleaseWriter(qw422016)
|
|
//line templates/base.qtpl:30
|
|
}
|
|
|
|
//line templates/base.qtpl:30
|
|
func (p *BasePage) Title(BaseTitle, PageTitle string) string {
|
|
//line templates/base.qtpl:30
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
|
//line templates/base.qtpl:30
|
|
p.WriteTitle(qb422016, BaseTitle, PageTitle)
|
|
//line templates/base.qtpl:30
|
|
qs422016 := string(qb422016.B)
|
|
//line templates/base.qtpl:30
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
|
//line templates/base.qtpl:30
|
|
return qs422016
|
|
//line templates/base.qtpl:30
|
|
}
|
|
|
|
//line templates/base.qtpl:32
|
|
func (p *BasePage) StreamBody(qw422016 *qt422016.Writer) {
|
|
//line templates/base.qtpl:32
|
|
qw422016.N().S(`This is a base body`)
|
|
//line templates/base.qtpl:32
|
|
}
|
|
|
|
//line templates/base.qtpl:32
|
|
func (p *BasePage) WriteBody(qq422016 qtio422016.Writer) {
|
|
//line templates/base.qtpl:32
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
//line templates/base.qtpl:32
|
|
p.StreamBody(qw422016)
|
|
//line templates/base.qtpl:32
|
|
qt422016.ReleaseWriter(qw422016)
|
|
//line templates/base.qtpl:32
|
|
}
|
|
|
|
//line templates/base.qtpl:32
|
|
func (p *BasePage) Body() string {
|
|
//line templates/base.qtpl:32
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
|
//line templates/base.qtpl:32
|
|
p.WriteBody(qb422016)
|
|
//line templates/base.qtpl:32
|
|
qs422016 := string(qb422016.B)
|
|
//line templates/base.qtpl:32
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
|
//line templates/base.qtpl:32
|
|
return qs422016
|
|
//line templates/base.qtpl:32
|
|
}
|
|
|
|
// Page prints a page implementing Page interface.
|
|
|
|
//line templates/base.qtpl:35
|
|
func StreamPageTemplate(qw422016 *qt422016.Writer, p Page) {
|
|
//line templates/base.qtpl:35
|
|
qw422016.N().S(`
|
|
`)
|
|
//line templates/base.qtpl:36
|
|
p.StreamHeader(qw422016)
|
|
//line templates/base.qtpl:36
|
|
qw422016.N().S(`
|
|
`)
|
|
//line templates/base.qtpl:37
|
|
p.StreamBody(qw422016)
|
|
//line templates/base.qtpl:37
|
|
qw422016.N().S(`
|
|
`)
|
|
//line templates/base.qtpl:38
|
|
p.StreamFooter(qw422016, status.GetStatus())
|
|
//line templates/base.qtpl:38
|
|
qw422016.N().S(`
|
|
`)
|
|
//line templates/base.qtpl:39
|
|
}
|
|
|
|
//line templates/base.qtpl:39
|
|
func WritePageTemplate(qq422016 qtio422016.Writer, p Page) {
|
|
//line templates/base.qtpl:39
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
//line templates/base.qtpl:39
|
|
StreamPageTemplate(qw422016, p)
|
|
//line templates/base.qtpl:39
|
|
qt422016.ReleaseWriter(qw422016)
|
|
//line templates/base.qtpl:39
|
|
}
|
|
|
|
//line templates/base.qtpl:39
|
|
func PageTemplate(p Page) string {
|
|
//line templates/base.qtpl:39
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
|
//line templates/base.qtpl:39
|
|
WritePageTemplate(qb422016, p)
|
|
//line templates/base.qtpl:39
|
|
qs422016 := string(qb422016.B)
|
|
//line templates/base.qtpl:39
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
|
//line templates/base.qtpl:39
|
|
return qs422016
|
|
//line templates/base.qtpl:39
|
|
}
|
|
|
|
//line templates/base.qtpl:42
|
|
func (p *BasePage) StreamHeader(qw422016 *qt422016.Writer) {
|
|
//line templates/base.qtpl:42
|
|
qw422016.N().S(`
|
|
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<title>`)
|
|
//line templates/base.qtpl:46
|
|
p.StreamTitle(qw422016, p.BaseTitle, p.PageTitle)
|
|
//line templates/base.qtpl:46
|
|
qw422016.N().S(`</title>
|
|
<meta charset="utf-8">
|
|
<meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport">
|
|
<link href="/favicon.ico" rel="icon">
|
|
<link href="`)
|
|
//line templates/base.qtpl:50
|
|
qw422016.E().S(p.BootstrapCSS)
|
|
//line templates/base.qtpl:50
|
|
qw422016.N().S(`" rel="stylesheet">
|
|
<link href="`)
|
|
//line templates/base.qtpl:51
|
|
qw422016.E().S(p.CommonCSS)
|
|
//line templates/base.qtpl:51
|
|
qw422016.N().S(`" rel="stylesheet">
|
|
<div class="page-header mb-lg-5">
|
|
<h2 class="mb-3 font-weight-normal d0g-head">`)
|
|
//line templates/base.qtpl:53
|
|
qw422016.E().S(p.BaseTitle)
|
|
//line templates/base.qtpl:53
|
|
qw422016.N().S(`</h2>
|
|
<p>welcome, <span class="text-success">admin</span>.</p>
|
|
</div>
|
|
</head>
|
|
<body class="text-center">
|
|
`)
|
|
//line templates/base.qtpl:58
|
|
}
|
|
|
|
//line templates/base.qtpl:58
|
|
func (p *BasePage) WriteHeader(qq422016 qtio422016.Writer) {
|
|
//line templates/base.qtpl:58
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
//line templates/base.qtpl:58
|
|
p.StreamHeader(qw422016)
|
|
//line templates/base.qtpl:58
|
|
qt422016.ReleaseWriter(qw422016)
|
|
//line templates/base.qtpl:58
|
|
}
|
|
|
|
//line templates/base.qtpl:58
|
|
func (p *BasePage) Header() string {
|
|
//line templates/base.qtpl:58
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
|
//line templates/base.qtpl:58
|
|
p.WriteHeader(qb422016)
|
|
//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
|
|
}
|
|
|
|
//line templates/base.qtpl:64
|
|
func (p *BasePage) StreamFooter(qw422016 *qt422016.Writer, st status.Status) {
|
|
//line templates/base.qtpl:64
|
|
qw422016.N().S(`
|
|
</body>
|
|
<footer class="footer">
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
<div class="col-auto">
|
|
<span class="text-muted">status: </span>
|
|
`)
|
|
//line templates/base.qtpl:71
|
|
switch st.Get() {
|
|
//line templates/base.qtpl:72
|
|
case status.Busy:
|
|
//line templates/base.qtpl:72
|
|
qw422016.N().S(`
|
|
<span class="text-info">busy</span>
|
|
`)
|
|
//line templates/base.qtpl:74
|
|
case status.Error:
|
|
//line templates/base.qtpl:74
|
|
qw422016.N().S(`
|
|
<span class="text-danger">error</span>
|
|
`)
|
|
//line templates/base.qtpl:76
|
|
case status.OK:
|
|
//line templates/base.qtpl:76
|
|
qw422016.N().S(`
|
|
<span class="text-light">idle</span>
|
|
`)
|
|
//line templates/base.qtpl:78
|
|
}
|
|
//line templates/base.qtpl:78
|
|
qw422016.N().S(`
|
|
</div>
|
|
<div class="col">
|
|
</div>
|
|
<div class="col-1">
|
|
<a href="`)
|
|
//line templates/base.qtpl:83
|
|
qw422016.E().S(p.LogOutURL)
|
|
//line templates/base.qtpl:83
|
|
qw422016.N().S(`">logout</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
|
|
<!-- other status
|
|
<span class="text-info">busy</span>
|
|
<span class="text-light">idle</span>
|
|
<span class="text-danger">error</span>
|
|
-->
|
|
|
|
</html>
|
|
`)
|
|
//line templates/base.qtpl:96
|
|
}
|
|
|
|
//line templates/base.qtpl:96
|
|
func (p *BasePage) WriteFooter(qq422016 qtio422016.Writer, st status.Status) {
|
|
//line templates/base.qtpl:96
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
//line templates/base.qtpl:96
|
|
p.StreamFooter(qw422016, st)
|
|
//line templates/base.qtpl:96
|
|
qt422016.ReleaseWriter(qw422016)
|
|
//line templates/base.qtpl:96
|
|
}
|
|
|
|
//line templates/base.qtpl:96
|
|
func (p *BasePage) Footer(st status.Status) string {
|
|
//line templates/base.qtpl:96
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
|
//line templates/base.qtpl:96
|
|
p.WriteFooter(qb422016, st)
|
|
//line templates/base.qtpl:96
|
|
qs422016 := string(qb422016.B)
|
|
//line templates/base.qtpl:96
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
|
//line templates/base.qtpl:96
|
|
return qs422016
|
|
//line templates/base.qtpl:96
|
|
}
|