auth/web/error.qtpl.go

159 lines
3.6 KiB
Go
Raw Permalink Normal View History

2022-01-31 16:15:38 +00:00
// Code generated by qtc from "error.qtpl". DO NOT EDIT.
// See https://github.com/valyala/quicktemplate for details.
//line web/error.qtpl:1
package web
//line web/error.qtpl:1
import (
"errors"
"source.toby3d.me/toby3d/auth/internal/domain"
2022-01-31 16:15:38 +00:00
)
//line web/error.qtpl:7
import (
qtio422016 "io"
qt422016 "github.com/valyala/quicktemplate"
)
//line web/error.qtpl:7
var (
_ = qtio422016.Copy
_ = qt422016.AcquireByteBuffer
)
//line web/error.qtpl:7
type ErrorPage struct {
BaseOf
Error error
}
//line web/error.qtpl:13
2023-08-06 00:42:38 +00:00
func (p *ErrorPage) streamtitle(qw422016 *qt422016.Writer) {
2022-01-31 16:15:38 +00:00
//line web/error.qtpl:13
qw422016.N().S(` `)
//line web/error.qtpl:14
2023-08-06 00:42:38 +00:00
qw422016.E().S(p.t("Error"))
2022-01-31 16:15:38 +00:00
//line web/error.qtpl:14
qw422016.N().S(` `)
//line web/error.qtpl:15
}
//line web/error.qtpl:15
2023-08-06 00:42:38 +00:00
func (p *ErrorPage) writetitle(qq422016 qtio422016.Writer) {
2022-01-31 16:15:38 +00:00
//line web/error.qtpl:15
qw422016 := qt422016.AcquireWriter(qq422016)
//line web/error.qtpl:15
2023-08-06 00:42:38 +00:00
p.streamtitle(qw422016)
2022-01-31 16:15:38 +00:00
//line web/error.qtpl:15
qt422016.ReleaseWriter(qw422016)
//line web/error.qtpl:15
}
//line web/error.qtpl:15
2023-08-06 00:42:38 +00:00
func (p *ErrorPage) title() string {
2022-01-31 16:15:38 +00:00
//line web/error.qtpl:15
qb422016 := qt422016.AcquireByteBuffer()
//line web/error.qtpl:15
2023-08-06 00:42:38 +00:00
p.writetitle(qb422016)
2022-01-31 16:15:38 +00:00
//line web/error.qtpl:15
qs422016 := string(qb422016.B)
//line web/error.qtpl:15
qt422016.ReleaseByteBuffer(qb422016)
//line web/error.qtpl:15
return qs422016
//line web/error.qtpl:15
}
//line web/error.qtpl:17
2023-08-06 00:42:38 +00:00
func (p *ErrorPage) streambody(qw422016 *qt422016.Writer) {
2022-01-31 16:15:38 +00:00
//line web/error.qtpl:17
qw422016.N().S(` <main> `)
//line web/error.qtpl:19
err := new(domain.Error)
//line web/error.qtpl:19
qw422016.N().S(` `)
//line web/error.qtpl:20
if errors.As(p.Error, err) {
//line web/error.qtpl:20
qw422016.N().S(` <h1>`)
//line web/error.qtpl:21
qw422016.E().S(err.Code.String())
//line web/error.qtpl:21
qw422016.N().S(`</h1> `)
//line web/error.qtpl:23
if err.Description != "" {
//line web/error.qtpl:23
qw422016.N().S(` <p>`)
//line web/error.qtpl:24
qw422016.E().S(err.Description)
//line web/error.qtpl:24
qw422016.N().S(`</p> `)
//line web/error.qtpl:25
}
//line web/error.qtpl:25
qw422016.N().S(` `)
//line web/error.qtpl:27
if err.URI != "" {
//line web/error.qtpl:27
qw422016.N().S(` <a rel="noreferrer noopener" href="`)
//line web/error.qtpl:29
2022-01-31 16:15:38 +00:00
qw422016.E().S(err.URI)
//line web/error.qtpl:29
2022-01-31 16:15:38 +00:00
qw422016.N().S(`" target="_blank"> `)
//line web/error.qtpl:32
2023-08-06 00:42:38 +00:00
qw422016.E().S(p.t("How do I fix it?"))
//line web/error.qtpl:32
2022-01-31 16:15:38 +00:00
qw422016.N().S(` </a> `)
//line web/error.qtpl:34
2022-01-31 16:15:38 +00:00
}
//line web/error.qtpl:34
2022-01-31 16:15:38 +00:00
qw422016.N().S(` `)
//line web/error.qtpl:35
2022-01-31 16:15:38 +00:00
} else {
//line web/error.qtpl:35
2022-01-31 16:15:38 +00:00
qw422016.N().S(` <h1>`)
//line web/error.qtpl:36
2023-08-06 00:42:38 +00:00
qw422016.E().S(p.t("Error"))
//line web/error.qtpl:36
2022-01-31 16:15:38 +00:00
qw422016.N().S(`</h1> <p>`)
//line web/error.qtpl:37
2022-01-31 16:15:38 +00:00
qw422016.E().S(p.Error.Error())
//line web/error.qtpl:37
2022-01-31 16:15:38 +00:00
qw422016.N().S(`</p> `)
//line web/error.qtpl:38
2022-01-31 16:15:38 +00:00
}
//line web/error.qtpl:38
2022-01-31 16:15:38 +00:00
qw422016.N().S(` </main> `)
//line web/error.qtpl:40
2022-01-31 16:15:38 +00:00
}
//line web/error.qtpl:40
2023-08-06 00:42:38 +00:00
func (p *ErrorPage) writebody(qq422016 qtio422016.Writer) {
//line web/error.qtpl:40
2022-01-31 16:15:38 +00:00
qw422016 := qt422016.AcquireWriter(qq422016)
//line web/error.qtpl:40
2023-08-06 00:42:38 +00:00
p.streambody(qw422016)
//line web/error.qtpl:40
2022-01-31 16:15:38 +00:00
qt422016.ReleaseWriter(qw422016)
//line web/error.qtpl:40
2022-01-31 16:15:38 +00:00
}
//line web/error.qtpl:40
2023-08-06 00:42:38 +00:00
func (p *ErrorPage) body() string {
//line web/error.qtpl:40
2022-01-31 16:15:38 +00:00
qb422016 := qt422016.AcquireByteBuffer()
//line web/error.qtpl:40
2023-08-06 00:42:38 +00:00
p.writebody(qb422016)
//line web/error.qtpl:40
2022-01-31 16:15:38 +00:00
qs422016 := string(qb422016.B)
//line web/error.qtpl:40
2022-01-31 16:15:38 +00:00
qt422016.ReleaseByteBuffer(qb422016)
//line web/error.qtpl:40
2022-01-31 16:15:38 +00:00
return qs422016
//line web/error.qtpl:40
2022-01-31 16:15:38 +00:00
}