auth/web/home.qtpl.go

163 lines
4.4 KiB
Go
Raw Normal View History

// Code generated by qtc from "home.qtpl". DO NOT EDIT.
// See https://github.com/valyala/quicktemplate for details.
//line web/home.qtpl:1
package web
//line web/home.qtpl:1
import (
"source.toby3d.me/toby3d/auth/internal/domain"
)
//line web/home.qtpl:5
import (
qtio422016 "io"
qt422016 "github.com/valyala/quicktemplate"
)
//line web/home.qtpl:5
var (
_ = qtio422016.Copy
_ = qt422016.AcquireByteBuffer
)
//line web/home.qtpl:5
type HomePage struct {
BaseOf
2022-01-20 19:50:15 +00:00
Client *domain.Client
State string
}
//line web/home.qtpl:12
2023-08-06 00:42:38 +00:00
func (p *HomePage) streamhead(qw422016 *qt422016.Writer) {
//line web/home.qtpl:12
qw422016.N().S(` `)
//line web/home.qtpl:13
2023-08-06 00:42:38 +00:00
p.BaseOf.streamhead(qw422016)
//line web/home.qtpl:13
qw422016.N().S(` `)
//line web/home.qtpl:14
2022-01-20 19:50:15 +00:00
for i := range p.Client.RedirectURI {
//line web/home.qtpl:14
qw422016.N().S(` <link rel="redirect_uri" href="`)
2023-01-16 10:19:22 +00:00
//line web/home.qtpl:16
2022-01-20 19:50:15 +00:00
qw422016.E().S(p.Client.RedirectURI[i].String())
//line web/home.qtpl:16
2023-01-16 10:19:22 +00:00
qw422016.N().S(`"> `)
//line web/home.qtpl:17
}
//line web/home.qtpl:17
2023-01-16 10:19:22 +00:00
qw422016.N().S(` `)
//line web/home.qtpl:18
}
2023-01-16 10:19:22 +00:00
//line web/home.qtpl:18
2023-08-06 00:42:38 +00:00
func (p *HomePage) writehead(qq422016 qtio422016.Writer) {
2023-01-16 10:19:22 +00:00
//line web/home.qtpl:18
qw422016 := qt422016.AcquireWriter(qq422016)
2023-01-16 10:19:22 +00:00
//line web/home.qtpl:18
2023-08-06 00:42:38 +00:00
p.streamhead(qw422016)
2023-01-16 10:19:22 +00:00
//line web/home.qtpl:18
qt422016.ReleaseWriter(qw422016)
2023-01-16 10:19:22 +00:00
//line web/home.qtpl:18
}
2023-01-16 10:19:22 +00:00
//line web/home.qtpl:18
2023-08-06 00:42:38 +00:00
func (p *HomePage) head() string {
2023-01-16 10:19:22 +00:00
//line web/home.qtpl:18
qb422016 := qt422016.AcquireByteBuffer()
2023-01-16 10:19:22 +00:00
//line web/home.qtpl:18
2023-08-06 00:42:38 +00:00
p.writehead(qb422016)
2023-01-16 10:19:22 +00:00
//line web/home.qtpl:18
qs422016 := string(qb422016.B)
2023-01-16 10:19:22 +00:00
//line web/home.qtpl:18
qt422016.ReleaseByteBuffer(qb422016)
2023-01-16 10:19:22 +00:00
//line web/home.qtpl:18
return qs422016
2023-01-16 10:19:22 +00:00
//line web/home.qtpl:18
}
2023-01-16 10:19:22 +00:00
//line web/home.qtpl:20
2023-08-06 00:42:38 +00:00
func (p *HomePage) streambody(qw422016 *qt422016.Writer) {
2023-01-16 10:19:22 +00:00
//line web/home.qtpl:20
2023-08-07 03:10:00 +00:00
qw422016.N().S(` <header class="h-app h-x-app"> `)
//line web/home.qtpl:22
if p.Client.Logo != nil {
//line web/home.qtpl:22
qw422016.N().S(` <img class="u-logo" src="`)
2023-01-16 10:19:22 +00:00
//line web/home.qtpl:24
2023-08-07 03:10:00 +00:00
qw422016.E().S(p.Client.Logo.String())
2023-01-16 10:19:22 +00:00
//line web/home.qtpl:24
2023-08-07 03:10:00 +00:00
qw422016.N().S(`" alt="`)
//line web/home.qtpl:25
qw422016.E().S(p.Client.Name)
//line web/home.qtpl:25
qw422016.N().S(`" crossorigin="anonymous" decoding="async" height="140" importance="high" referrerpolicy="no-referrer-when-downgrade" width="140"> `)
//line web/home.qtpl:32
}
//line web/home.qtpl:32
qw422016.N().S(` <h1> <a class="p-name u-url" href="`)
2023-01-16 10:19:22 +00:00
//line web/home.qtpl:36
2023-08-07 03:10:00 +00:00
qw422016.E().S(p.Client.URL.String())
2023-01-16 10:19:22 +00:00
//line web/home.qtpl:36
2023-08-07 03:10:00 +00:00
qw422016.N().S(`"> `)
//line web/home.qtpl:38
qw422016.E().S(p.Client.Name)
//line web/home.qtpl:38
qw422016.N().S(` </a> </h1> </header> <main> <form class="" method="get" action="/authorize" enctype="application/x-www-form-urlencoded" accept-charset="utf-8" target="_self"> `)
2023-08-07 03:10:00 +00:00
//line web/home.qtpl:51
for name, value := range map[string]string{
"client_id": p.Client.ID.String(),
"redirect_uri": p.Client.RedirectURI[0].String(),
2022-01-20 19:50:15 +00:00
"response_type": domain.ResponseTypeCode.String(),
2023-08-06 00:42:38 +00:00
"scope": domain.Scopes{domain.ScopeEmail, domain.ScopeProfile}.String(),
"state": p.State,
} {
2023-01-16 10:19:22 +00:00
//line web/home.qtpl:57
2023-08-07 03:10:00 +00:00
qw422016.N().S(` <input type="hidden" name="`)
//line web/home.qtpl:59
2023-08-06 00:42:38 +00:00
qw422016.E().S(name)
2023-08-07 03:10:00 +00:00
//line web/home.qtpl:59
2023-08-06 00:42:38 +00:00
qw422016.N().S(`" value="`)
2023-08-07 03:10:00 +00:00
//line web/home.qtpl:60
2023-08-06 00:42:38 +00:00
qw422016.E().S(value)
2023-08-07 03:10:00 +00:00
//line web/home.qtpl:60
2023-01-16 10:19:22 +00:00
qw422016.N().S(`"> `)
2023-08-07 03:10:00 +00:00
//line web/home.qtpl:61
}
2023-08-07 03:10:00 +00:00
//line web/home.qtpl:61
2022-01-20 19:50:15 +00:00
qw422016.N().S(` <input type="url" name="me" placeholder="https://example.com/" inputmode="url" autocomplete="url" required> <button type="submit">`)
2023-08-07 03:10:00 +00:00
//line web/home.qtpl:70
2023-08-06 00:42:38 +00:00
p.streamt(qw422016, "Sign In")
2023-08-07 03:10:00 +00:00
//line web/home.qtpl:70
2022-01-20 19:50:15 +00:00
qw422016.N().S(`</button> </form> </main> `)
2023-08-07 03:10:00 +00:00
//line web/home.qtpl:73
}
2023-08-07 03:10:00 +00:00
//line web/home.qtpl:73
2023-08-06 00:42:38 +00:00
func (p *HomePage) writebody(qq422016 qtio422016.Writer) {
2023-08-07 03:10:00 +00:00
//line web/home.qtpl:73
qw422016 := qt422016.AcquireWriter(qq422016)
2023-08-07 03:10:00 +00:00
//line web/home.qtpl:73
2023-08-06 00:42:38 +00:00
p.streambody(qw422016)
2023-08-07 03:10:00 +00:00
//line web/home.qtpl:73
qt422016.ReleaseWriter(qw422016)
2023-08-07 03:10:00 +00:00
//line web/home.qtpl:73
}
2023-08-07 03:10:00 +00:00
//line web/home.qtpl:73
2023-08-06 00:42:38 +00:00
func (p *HomePage) body() string {
2023-08-07 03:10:00 +00:00
//line web/home.qtpl:73
qb422016 := qt422016.AcquireByteBuffer()
2023-08-07 03:10:00 +00:00
//line web/home.qtpl:73
2023-08-06 00:42:38 +00:00
p.writebody(qb422016)
2023-08-07 03:10:00 +00:00
//line web/home.qtpl:73
qs422016 := string(qb422016.B)
2023-08-07 03:10:00 +00:00
//line web/home.qtpl:73
qt422016.ReleaseByteBuffer(qb422016)
2023-08-07 03:10:00 +00:00
//line web/home.qtpl:73
return qs422016
2023-08-07 03:10:00 +00:00
//line web/home.qtpl:73
}