🎨 Format templates source code

This commit is contained in:
Maxim Lebedev 2023-08-06 06:42:38 +06:00
parent 5f30a94fdb
commit 45e571abfd
Signed by: toby3d
GPG key ID: 1F14E25B7C119FC5
12 changed files with 169 additions and 191 deletions

View file

@ -16,15 +16,15 @@
State string
} %}
{% func (p *AuthorizePage) Title() %}
{% func (p *AuthorizePage) title() %}
{% if name := p.Client.GetName(); name != "" %}
{%= p.T("Authorize %s", name) %}
{%= p.t("Authorize %s", name) %}
{% else %}
{%= p.T("Authorize application") %}
{%= p.t("Authorize application") %}
{% endif %}
{% endfunc %}
{% func (p *AuthorizePage) Body() %}
{% func (p *AuthorizePage) body() %}
<header>
{% if p.Client.GetLogo() != nil %}
<img class=""
@ -62,7 +62,7 @@
role="img"
aria-label="closed lock with key">🔐</span>
{%= p.T(`This client uses %sPKCE%s with the %s%s%s method.`, `<abbr title="Proof of Key Code Exchange">`,
{%= p.t(`This client uses %sPKCE%s with the %s%s%s method.`, `<abbr title="Proof of Key Code Exchange">`,
`</abbr>`, `<code>`, p.CodeChallengeMethod, `</code>`) %}
</p>
{% else %}
@ -72,10 +72,10 @@
role="img"
aria-label="unlock">🔓</span>
{%= p.T(`This client does not use %sPKCE%s!`, `<abbr title="Proof of Key Code Exchange">`, `</abbr>`) %}
{%= p.t(`This client does not use %sPKCE%s!`, `<abbr title="Proof of Key Code Exchange">`, `</abbr>`) %}
</summary>
<p>
{%= p.T(`%sProof of Key Code Exchange%s is a mechanism that protects against attackers in the middle hijacking `+
{%= p.t(`%sProof of Key Code Exchange%s is a mechanism that protects against attackers in the middle hijacking `+
`your application's authentication process. You can still authorize this application without this protection, `+
`but you must independently verify the security of this connection. If you have any doubts - stop the process `+
` and contact the developers.`, `<dfn id="PKCE">`, `</dfn>`) %}
@ -112,7 +112,7 @@
{% if len(p.Scope) > 0 %}
<fieldset>
<legend>{%= p.T("Scopes") %}</legend>
<legend>{%= p.t("Scopes") %}</legend>
{% for _, scope := range p.Scope %}
<div>
@ -129,7 +129,7 @@
</fieldset>
{% else %}
<aside>
<p>{%= p.T(`No scopes is requested: the application will only get your profile URL.`) %}</p>
<p>{%= p.t(`No scopes is requested: the application will only get your profile URL.`) %}</p>
</aside>
{% endif %}
@ -173,18 +173,18 @@
name="authorize"
value="deny">
{%= p.T("Deny") %}
{%= p.t("Deny") %}
</button>
<button type="submit"
name="authorize"
value="allow">
{%= p.T("Allow") %}
{%= p.t("Allow") %}
</button>
<aside>
<p>{%= p.T(`You will be redirected to %s%s%s`, `<code>`, p.RedirectURI, `</code>`) %}</p>
<p>{%= p.t(`You will be redirected to %s%s%s`, `<code>`, p.RedirectURI, `</code>`) %}</p>
</aside>
</form>
</main>

View file

@ -38,7 +38,7 @@ type AuthorizePage struct {
}
//line web/authorize.qtpl:19
func (p *AuthorizePage) StreamTitle(qw422016 *qt422016.Writer) {
func (p *AuthorizePage) streamtitle(qw422016 *qt422016.Writer) {
//line web/authorize.qtpl:19
qw422016.N().S(`
`)
@ -48,7 +48,7 @@ func (p *AuthorizePage) StreamTitle(qw422016 *qt422016.Writer) {
qw422016.N().S(`
`)
//line web/authorize.qtpl:21
p.StreamT(qw422016, "Authorize %s", name)
p.streamt(qw422016, "Authorize %s", name)
//line web/authorize.qtpl:21
qw422016.N().S(`
`)
@ -58,7 +58,7 @@ func (p *AuthorizePage) StreamTitle(qw422016 *qt422016.Writer) {
qw422016.N().S(`
`)
//line web/authorize.qtpl:23
p.StreamT(qw422016, "Authorize application")
p.streamt(qw422016, "Authorize application")
//line web/authorize.qtpl:23
qw422016.N().S(`
`)
@ -71,22 +71,22 @@ func (p *AuthorizePage) StreamTitle(qw422016 *qt422016.Writer) {
}
//line web/authorize.qtpl:25
func (p *AuthorizePage) WriteTitle(qq422016 qtio422016.Writer) {
func (p *AuthorizePage) writetitle(qq422016 qtio422016.Writer) {
//line web/authorize.qtpl:25
qw422016 := qt422016.AcquireWriter(qq422016)
//line web/authorize.qtpl:25
p.StreamTitle(qw422016)
p.streamtitle(qw422016)
//line web/authorize.qtpl:25
qt422016.ReleaseWriter(qw422016)
//line web/authorize.qtpl:25
}
//line web/authorize.qtpl:25
func (p *AuthorizePage) Title() string {
func (p *AuthorizePage) title() string {
//line web/authorize.qtpl:25
qb422016 := qt422016.AcquireByteBuffer()
//line web/authorize.qtpl:25
p.WriteTitle(qb422016)
p.writetitle(qb422016)
//line web/authorize.qtpl:25
qs422016 := string(qb422016.B)
//line web/authorize.qtpl:25
@ -97,7 +97,7 @@ func (p *AuthorizePage) Title() string {
}
//line web/authorize.qtpl:27
func (p *AuthorizePage) StreamBody(qw422016 *qt422016.Writer) {
func (p *AuthorizePage) streambody(qw422016 *qt422016.Writer) {
//line web/authorize.qtpl:27
qw422016.N().S(`
<header>
@ -199,7 +199,7 @@ func (p *AuthorizePage) StreamBody(qw422016 *qt422016.Writer) {
`)
//line web/authorize.qtpl:65
p.StreamT(qw422016, `This client uses %sPKCE%s with the %s%s%s method.`, `<abbr title="Proof of Key Code Exchange">`,
p.streamt(qw422016, `This client uses %sPKCE%s with the %s%s%s method.`, `<abbr title="Proof of Key Code Exchange">`,
`</abbr>`, `<code>`, p.CodeChallengeMethod, `</code>`)
//line web/authorize.qtpl:66
qw422016.N().S(`
@ -217,14 +217,14 @@ func (p *AuthorizePage) StreamBody(qw422016 *qt422016.Writer) {
`)
//line web/authorize.qtpl:75
p.StreamT(qw422016, `This client does not use %sPKCE%s!`, `<abbr title="Proof of Key Code Exchange">`, `</abbr>`)
p.streamt(qw422016, `This client does not use %sPKCE%s!`, `<abbr title="Proof of Key Code Exchange">`, `</abbr>`)
//line web/authorize.qtpl:75
qw422016.N().S(`
</summary>
<p>
`)
//line web/authorize.qtpl:78
p.StreamT(qw422016, `%sProof of Key Code Exchange%s is a mechanism that protects against attackers in the middle hijacking `+
p.streamt(qw422016, `%sProof of Key Code Exchange%s is a mechanism that protects against attackers in the middle hijacking `+
`your application's authentication process. You can still authorize this application without this protection, `+
`but you must independently verify the security of this connection. If you have any doubts - stop the process `+
` and contact the developers.`, `<dfn id="PKCE">`, `</dfn>`)
@ -301,7 +301,7 @@ func (p *AuthorizePage) StreamBody(qw422016 *qt422016.Writer) {
<fieldset>
<legend>`)
//line web/authorize.qtpl:115
p.StreamT(qw422016, "Scopes")
p.streamt(qw422016, "Scopes")
//line web/authorize.qtpl:115
qw422016.N().S(`</legend>
@ -342,7 +342,7 @@ func (p *AuthorizePage) StreamBody(qw422016 *qt422016.Writer) {
<aside>
<p>`)
//line web/authorize.qtpl:132
p.StreamT(qw422016, `No scopes is requested: the application will only get your profile URL.`)
p.streamt(qw422016, `No scopes is requested: the application will only get your profile URL.`)
//line web/authorize.qtpl:132
qw422016.N().S(`</p>
</aside>
@ -466,7 +466,7 @@ func (p *AuthorizePage) StreamBody(qw422016 *qt422016.Writer) {
`)
//line web/authorize.qtpl:176
p.StreamT(qw422016, "Deny")
p.streamt(qw422016, "Deny")
//line web/authorize.qtpl:176
qw422016.N().S(`
</button>
@ -477,7 +477,7 @@ func (p *AuthorizePage) StreamBody(qw422016 *qt422016.Writer) {
`)
//line web/authorize.qtpl:183
p.StreamT(qw422016, "Allow")
p.streamt(qw422016, "Allow")
//line web/authorize.qtpl:183
qw422016.N().S(`
</button>
@ -485,7 +485,7 @@ func (p *AuthorizePage) StreamBody(qw422016 *qt422016.Writer) {
<aside>
<p>`)
//line web/authorize.qtpl:187
p.StreamT(qw422016, `You will be redirected to %s%s%s`, `<code>`, p.RedirectURI, `</code>`)
p.streamt(qw422016, `You will be redirected to %s%s%s`, `<code>`, p.RedirectURI, `</code>`)
//line web/authorize.qtpl:187
qw422016.N().S(`</p>
</aside>
@ -496,22 +496,22 @@ func (p *AuthorizePage) StreamBody(qw422016 *qt422016.Writer) {
}
//line web/authorize.qtpl:191
func (p *AuthorizePage) WriteBody(qq422016 qtio422016.Writer) {
func (p *AuthorizePage) writebody(qq422016 qtio422016.Writer) {
//line web/authorize.qtpl:191
qw422016 := qt422016.AcquireWriter(qq422016)
//line web/authorize.qtpl:191
p.StreamBody(qw422016)
p.streambody(qw422016)
//line web/authorize.qtpl:191
qt422016.ReleaseWriter(qw422016)
//line web/authorize.qtpl:191
}
//line web/authorize.qtpl:191
func (p *AuthorizePage) Body() string {
func (p *AuthorizePage) body() string {
//line web/authorize.qtpl:191
qb422016 := qt422016.AcquireByteBuffer()
//line web/authorize.qtpl:191
p.WriteBody(qb422016)
p.writebody(qb422016)
//line web/authorize.qtpl:191
qs422016 := string(qb422016.B)
//line web/authorize.qtpl:191

View file

@ -8,11 +8,11 @@
) %}
{% interface Page {
Body()
Head()
Lang()
Title()
T(format message.Reference, args ...any)
body()
head()
lang()
t(format message.Reference, args ...any)
title()
} %}
{% code type BaseOf struct {
@ -22,7 +22,7 @@
} %}
{% stripspace %}
{% func (p *BaseOf) Lang() %}
{% func (p *BaseOf) lang() %}
{% if p.Language != language.Und %}
{%s p.Language.String() %}
{% else %}
@ -32,11 +32,11 @@ en
{% endstripspace %}
{% collapsespace %}
{% func (p *BaseOf) Title() %}
{% func (p *BaseOf) title() %}
{%s p.Config.Name %}
{% endfunc %}
{% func (p *BaseOf) Head() %}
{% func (p *BaseOf) head() %}
{% comment %}https://evilmartians.com/chronicles/how-to-favicon-in-2021-six-files-that-fit-most-needs{% endcomment %}
<link rel="icon"
href="/favicon.ico"
@ -53,25 +53,25 @@ en
href="/manifest.webmanifest">
{% endfunc %}
{% func (p *BaseOf) Body() %}{% endfunc %}
{% func (p *BaseOf) body() %}{% endfunc %}
{% func Template(p Page) %}
<!DOCTYPE html>
<html class="page"
lang="{%= p.Lang() %}">
lang="{%= p.lang() %}">
<head>
<meta charset="utf-8">
<meta name="viewport"
content="width=device-width, initial-scale=1.0">
{%= p.Head() %}
{%= p.head() %}
<title>{%= p.Title() %}</title>
<title>{%= p.title() %}</title>
</head>
<body class="page__body body">
{%= p.Body() %}
{%= p.body() %}
{% code
var path, vcsRevision string
@ -92,7 +92,7 @@ en
{% if vcsRevision != "" %}
<footer>
<small>
{%= p.T("version") %}
{%= p.t("version") %}
<a href="https://{%s path %}/commit/{%s vcsRevision %}"
target="_blank">
{%s vcsRevision[:7] -%}
@ -104,7 +104,7 @@ en
</html>
{% endfunc %}
{% func (p BaseOf) T(format message.Reference, args ...any) %}
{% func (p BaseOf) t(format message.Reference, args ...any) %}
{%s= p.Printer.Sprintf(format, args...) %}
{% endfunc %}
{% endcollapsespace %}

View file

@ -30,35 +30,35 @@ var (
//line web/baseof.qtpl:10
type Page interface {
//line web/baseof.qtpl:10
Body() string
body() string
//line web/baseof.qtpl:10
StreamBody(qw422016 *qt422016.Writer)
streambody(qw422016 *qt422016.Writer)
//line web/baseof.qtpl:10
WriteBody(qq422016 qtio422016.Writer)
writebody(qq422016 qtio422016.Writer)
//line web/baseof.qtpl:10
Head() string
head() string
//line web/baseof.qtpl:10
StreamHead(qw422016 *qt422016.Writer)
streamhead(qw422016 *qt422016.Writer)
//line web/baseof.qtpl:10
WriteHead(qq422016 qtio422016.Writer)
writehead(qq422016 qtio422016.Writer)
//line web/baseof.qtpl:10
Lang() string
lang() string
//line web/baseof.qtpl:10
StreamLang(qw422016 *qt422016.Writer)
streamlang(qw422016 *qt422016.Writer)
//line web/baseof.qtpl:10
WriteLang(qq422016 qtio422016.Writer)
writelang(qq422016 qtio422016.Writer)
//line web/baseof.qtpl:10
Title() string
t(format message.Reference, args ...any) string
//line web/baseof.qtpl:10
StreamTitle(qw422016 *qt422016.Writer)
streamt(qw422016 *qt422016.Writer, format message.Reference, args ...any)
//line web/baseof.qtpl:10
WriteTitle(qq422016 qtio422016.Writer)
writet(qq422016 qtio422016.Writer, format message.Reference, args ...any)
//line web/baseof.qtpl:10
T(format message.Reference, args ...any) string
title() string
//line web/baseof.qtpl:10
StreamT(qw422016 *qt422016.Writer, format message.Reference, args ...any)
streamtitle(qw422016 *qt422016.Writer)
//line web/baseof.qtpl:10
WriteT(qq422016 qtio422016.Writer, format message.Reference, args ...any)
writetitle(qq422016 qtio422016.Writer)
//line web/baseof.qtpl:10
}
@ -70,7 +70,7 @@ type BaseOf struct {
}
//line web/baseof.qtpl:25
func (p *BaseOf) StreamLang(qw422016 *qt422016.Writer) {
func (p *BaseOf) streamlang(qw422016 *qt422016.Writer) {
//line web/baseof.qtpl:26
if p.Language != language.Und {
//line web/baseof.qtpl:27
@ -85,22 +85,22 @@ func (p *BaseOf) StreamLang(qw422016 *qt422016.Writer) {
}
//line web/baseof.qtpl:31
func (p *BaseOf) WriteLang(qq422016 qtio422016.Writer) {
func (p *BaseOf) writelang(qq422016 qtio422016.Writer) {
//line web/baseof.qtpl:31
qw422016 := qt422016.AcquireWriter(qq422016)
//line web/baseof.qtpl:31
p.StreamLang(qw422016)
p.streamlang(qw422016)
//line web/baseof.qtpl:31
qt422016.ReleaseWriter(qw422016)
//line web/baseof.qtpl:31
}
//line web/baseof.qtpl:31
func (p *BaseOf) Lang() string {
func (p *BaseOf) lang() string {
//line web/baseof.qtpl:31
qb422016 := qt422016.AcquireByteBuffer()
//line web/baseof.qtpl:31
p.WriteLang(qb422016)
p.writelang(qb422016)
//line web/baseof.qtpl:31
qs422016 := string(qb422016.B)
//line web/baseof.qtpl:31
@ -111,7 +111,7 @@ func (p *BaseOf) Lang() string {
}
//line web/baseof.qtpl:35
func (p *BaseOf) StreamTitle(qw422016 *qt422016.Writer) {
func (p *BaseOf) streamtitle(qw422016 *qt422016.Writer) {
//line web/baseof.qtpl:35
qw422016.N().S(` `)
//line web/baseof.qtpl:36
@ -122,22 +122,22 @@ func (p *BaseOf) StreamTitle(qw422016 *qt422016.Writer) {
}
//line web/baseof.qtpl:37
func (p *BaseOf) WriteTitle(qq422016 qtio422016.Writer) {
func (p *BaseOf) writetitle(qq422016 qtio422016.Writer) {
//line web/baseof.qtpl:37
qw422016 := qt422016.AcquireWriter(qq422016)
//line web/baseof.qtpl:37
p.StreamTitle(qw422016)
p.streamtitle(qw422016)
//line web/baseof.qtpl:37
qt422016.ReleaseWriter(qw422016)
//line web/baseof.qtpl:37
}
//line web/baseof.qtpl:37
func (p *BaseOf) Title() string {
func (p *BaseOf) title() string {
//line web/baseof.qtpl:37
qb422016 := qt422016.AcquireByteBuffer()
//line web/baseof.qtpl:37
p.WriteTitle(qb422016)
p.writetitle(qb422016)
//line web/baseof.qtpl:37
qs422016 := string(qb422016.B)
//line web/baseof.qtpl:37
@ -148,7 +148,7 @@ func (p *BaseOf) Title() string {
}
//line web/baseof.qtpl:39
func (p *BaseOf) StreamHead(qw422016 *qt422016.Writer) {
func (p *BaseOf) streamhead(qw422016 *qt422016.Writer) {
//line web/baseof.qtpl:39
qw422016.N().S(` `)
//line web/baseof.qtpl:40
@ -157,22 +157,22 @@ func (p *BaseOf) StreamHead(qw422016 *qt422016.Writer) {
}
//line web/baseof.qtpl:54
func (p *BaseOf) WriteHead(qq422016 qtio422016.Writer) {
func (p *BaseOf) writehead(qq422016 qtio422016.Writer) {
//line web/baseof.qtpl:54
qw422016 := qt422016.AcquireWriter(qq422016)
//line web/baseof.qtpl:54
p.StreamHead(qw422016)
p.streamhead(qw422016)
//line web/baseof.qtpl:54
qt422016.ReleaseWriter(qw422016)
//line web/baseof.qtpl:54
}
//line web/baseof.qtpl:54
func (p *BaseOf) Head() string {
func (p *BaseOf) head() string {
//line web/baseof.qtpl:54
qb422016 := qt422016.AcquireByteBuffer()
//line web/baseof.qtpl:54
p.WriteHead(qb422016)
p.writehead(qb422016)
//line web/baseof.qtpl:54
qs422016 := string(qb422016.B)
//line web/baseof.qtpl:54
@ -183,27 +183,27 @@ func (p *BaseOf) Head() string {
}
//line web/baseof.qtpl:56
func (p *BaseOf) StreamBody(qw422016 *qt422016.Writer) {
func (p *BaseOf) streambody(qw422016 *qt422016.Writer) {
//line web/baseof.qtpl:56
}
//line web/baseof.qtpl:56
func (p *BaseOf) WriteBody(qq422016 qtio422016.Writer) {
func (p *BaseOf) writebody(qq422016 qtio422016.Writer) {
//line web/baseof.qtpl:56
qw422016 := qt422016.AcquireWriter(qq422016)
//line web/baseof.qtpl:56
p.StreamBody(qw422016)
p.streambody(qw422016)
//line web/baseof.qtpl:56
qt422016.ReleaseWriter(qw422016)
//line web/baseof.qtpl:56
}
//line web/baseof.qtpl:56
func (p *BaseOf) Body() string {
func (p *BaseOf) body() string {
//line web/baseof.qtpl:56
qb422016 := qt422016.AcquireByteBuffer()
//line web/baseof.qtpl:56
p.WriteBody(qb422016)
p.writebody(qb422016)
//line web/baseof.qtpl:56
qs422016 := string(qb422016.B)
//line web/baseof.qtpl:56
@ -218,19 +218,19 @@ func StreamTemplate(qw422016 *qt422016.Writer, p Page) {
//line web/baseof.qtpl:58
qw422016.N().S(` <!DOCTYPE html> <html class="page" lang="`)
//line web/baseof.qtpl:61
p.StreamLang(qw422016)
p.streamlang(qw422016)
//line web/baseof.qtpl:61
qw422016.N().S(`"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> `)
//line web/baseof.qtpl:68
p.StreamHead(qw422016)
p.streamhead(qw422016)
//line web/baseof.qtpl:68
qw422016.N().S(` <title>`)
//line web/baseof.qtpl:70
p.StreamTitle(qw422016)
p.streamtitle(qw422016)
//line web/baseof.qtpl:70
qw422016.N().S(`</title> </head> <body class="page__body body"> `)
//line web/baseof.qtpl:74
p.StreamBody(qw422016)
p.streambody(qw422016)
//line web/baseof.qtpl:74
qw422016.N().S(` `)
//line web/baseof.qtpl:77
@ -255,7 +255,7 @@ func StreamTemplate(qw422016 *qt422016.Writer, p Page) {
//line web/baseof.qtpl:92
qw422016.N().S(` <footer> <small> `)
//line web/baseof.qtpl:95
p.StreamT(qw422016, "version")
p.streamt(qw422016, "version")
//line web/baseof.qtpl:95
qw422016.N().S(` <a href="https://`)
//line web/baseof.qtpl:96
@ -304,7 +304,7 @@ func Template(p Page) string {
}
//line web/baseof.qtpl:107
func (p BaseOf) StreamT(qw422016 *qt422016.Writer, format message.Reference, args ...any) {
func (p BaseOf) streamt(qw422016 *qt422016.Writer, format message.Reference, args ...any) {
//line web/baseof.qtpl:107
qw422016.N().S(` `)
//line web/baseof.qtpl:108
@ -315,22 +315,22 @@ func (p BaseOf) StreamT(qw422016 *qt422016.Writer, format message.Reference, arg
}
//line web/baseof.qtpl:109
func (p BaseOf) WriteT(qq422016 qtio422016.Writer, format message.Reference, args ...any) {
func (p BaseOf) writet(qq422016 qtio422016.Writer, format message.Reference, args ...any) {
//line web/baseof.qtpl:109
qw422016 := qt422016.AcquireWriter(qq422016)
//line web/baseof.qtpl:109
p.StreamT(qw422016, format, args...)
p.streamt(qw422016, format, args...)
//line web/baseof.qtpl:109
qt422016.ReleaseWriter(qw422016)
//line web/baseof.qtpl:109
}
//line web/baseof.qtpl:109
func (p BaseOf) T(format message.Reference, args ...any) string {
func (p BaseOf) t(format message.Reference, args ...any) string {
//line web/baseof.qtpl:109
qb422016 := qt422016.AcquireByteBuffer()
//line web/baseof.qtpl:109
p.WriteT(qb422016, format, args...)
p.writet(qb422016, format, args...)
//line web/baseof.qtpl:109
qs422016 := string(qb422016.B)
//line web/baseof.qtpl:109

View file

@ -8,7 +8,7 @@
} %}
{% collapsespace %}
{% func (p *CallbackPage) Body() %}
{% func (p *CallbackPage) body() %}
{% if p.Token != nil %}
<h1>{%s p.Token.Me.String() %}</h1>
<small>{%s p.Token.AccessToken %}</small>

View file

@ -29,7 +29,7 @@ type CallbackPage struct {
}
//line web/callback.qtpl:11
func (p *CallbackPage) StreamBody(qw422016 *qt422016.Writer) {
func (p *CallbackPage) streambody(qw422016 *qt422016.Writer) {
//line web/callback.qtpl:11
qw422016.N().S(` `)
//line web/callback.qtpl:12
@ -52,22 +52,22 @@ func (p *CallbackPage) StreamBody(qw422016 *qt422016.Writer) {
}
//line web/callback.qtpl:16
func (p *CallbackPage) WriteBody(qq422016 qtio422016.Writer) {
func (p *CallbackPage) writebody(qq422016 qtio422016.Writer) {
//line web/callback.qtpl:16
qw422016 := qt422016.AcquireWriter(qq422016)
//line web/callback.qtpl:16
p.StreamBody(qw422016)
p.streambody(qw422016)
//line web/callback.qtpl:16
qt422016.ReleaseWriter(qw422016)
//line web/callback.qtpl:16
}
//line web/callback.qtpl:16
func (p *CallbackPage) Body() string {
func (p *CallbackPage) body() string {
//line web/callback.qtpl:16
qb422016 := qt422016.AcquireByteBuffer()
//line web/callback.qtpl:16
p.WriteBody(qb422016)
p.writebody(qb422016)
//line web/callback.qtpl:16
qs422016 := string(qb422016.B)
//line web/callback.qtpl:16

View file

@ -10,11 +10,11 @@
} %}
{% collapsespace %}
{% func (p *ErrorPage) Title() %}
{%s p.T("Error") %}
{% func (p *ErrorPage) title() %}
{%s p.t("Error") %}
{% endfunc %}
{% func (p *ErrorPage) Body() %}
{% func (p *ErrorPage) body() %}
<main>
{% code err := new(domain.Error) %}
{% if errors.As(p.Error, err) %}
@ -29,11 +29,11 @@
href="{%s err.URI %}"
target="_blank">
{%s p.T("How do I fix it?") %}
{%s p.t("How do I fix it?") %}
</a>
{% endif %}
{% else %}
<h1>{%s p.T("Error") %}</h1>
<h1>{%s p.t("Error") %}</h1>
<p>{%s p.Error.Error() %}</p>
{% endif %}
</main>

View file

@ -31,33 +31,33 @@ type ErrorPage struct {
}
//line web/error.qtpl:13
func (p *ErrorPage) StreamTitle(qw422016 *qt422016.Writer) {
func (p *ErrorPage) streamtitle(qw422016 *qt422016.Writer) {
//line web/error.qtpl:13
qw422016.N().S(` `)
//line web/error.qtpl:14
qw422016.E().S(p.T("Error"))
qw422016.E().S(p.t("Error"))
//line web/error.qtpl:14
qw422016.N().S(` `)
//line web/error.qtpl:15
}
//line web/error.qtpl:15
func (p *ErrorPage) WriteTitle(qq422016 qtio422016.Writer) {
func (p *ErrorPage) writetitle(qq422016 qtio422016.Writer) {
//line web/error.qtpl:15
qw422016 := qt422016.AcquireWriter(qq422016)
//line web/error.qtpl:15
p.StreamTitle(qw422016)
p.streamtitle(qw422016)
//line web/error.qtpl:15
qt422016.ReleaseWriter(qw422016)
//line web/error.qtpl:15
}
//line web/error.qtpl:15
func (p *ErrorPage) Title() string {
func (p *ErrorPage) title() string {
//line web/error.qtpl:15
qb422016 := qt422016.AcquireByteBuffer()
//line web/error.qtpl:15
p.WriteTitle(qb422016)
p.writetitle(qb422016)
//line web/error.qtpl:15
qs422016 := string(qb422016.B)
//line web/error.qtpl:15
@ -68,7 +68,7 @@ func (p *ErrorPage) Title() string {
}
//line web/error.qtpl:17
func (p *ErrorPage) StreamBody(qw422016 *qt422016.Writer) {
func (p *ErrorPage) streambody(qw422016 *qt422016.Writer) {
//line web/error.qtpl:17
qw422016.N().S(` <main> `)
//line web/error.qtpl:19
@ -105,7 +105,7 @@ func (p *ErrorPage) StreamBody(qw422016 *qt422016.Writer) {
//line web/error.qtpl:29
qw422016.N().S(`" target="_blank"> `)
//line web/error.qtpl:32
qw422016.E().S(p.T("How do I fix it?"))
qw422016.E().S(p.t("How do I fix it?"))
//line web/error.qtpl:32
qw422016.N().S(` </a> `)
//line web/error.qtpl:34
@ -117,7 +117,7 @@ func (p *ErrorPage) StreamBody(qw422016 *qt422016.Writer) {
//line web/error.qtpl:35
qw422016.N().S(` <h1>`)
//line web/error.qtpl:36
qw422016.E().S(p.T("Error"))
qw422016.E().S(p.t("Error"))
//line web/error.qtpl:36
qw422016.N().S(`</h1> <p>`)
//line web/error.qtpl:37
@ -132,22 +132,22 @@ func (p *ErrorPage) StreamBody(qw422016 *qt422016.Writer) {
}
//line web/error.qtpl:40
func (p *ErrorPage) WriteBody(qq422016 qtio422016.Writer) {
func (p *ErrorPage) writebody(qq422016 qtio422016.Writer) {
//line web/error.qtpl:40
qw422016 := qt422016.AcquireWriter(qq422016)
//line web/error.qtpl:40
p.StreamBody(qw422016)
p.streambody(qw422016)
//line web/error.qtpl:40
qt422016.ReleaseWriter(qw422016)
//line web/error.qtpl:40
}
//line web/error.qtpl:40
func (p *ErrorPage) Body() string {
func (p *ErrorPage) body() string {
//line web/error.qtpl:40
qb422016 := qt422016.AcquireByteBuffer()
//line web/error.qtpl:40
p.WriteBody(qb422016)
p.writebody(qb422016)
//line web/error.qtpl:40
qs422016 := string(qb422016.B)
//line web/error.qtpl:40

View file

@ -9,15 +9,15 @@
} %}
{% collapsespace %}
{% func (p *HomePage) Head() %}
{%= p.BaseOf.Head() %}
{% func (p *HomePage) head() %}
{%= p.BaseOf.head() %}
{% for i := range p.Client.RedirectURI %}
<link rel="redirect_uri"
href="{%s p.Client.RedirectURI[i].String() %}">
{% endfor %}
{% endfunc %}
{% func (p *HomePage) Body() %}
{% func (p *HomePage) body() %}
<header class="h-app h-x-app">
<img class="u-logo"
src="{%s p.Client.GetLogo().String() %}"
@ -50,6 +50,7 @@
"client_id": p.Client.ID.String(),
"redirect_uri": p.Client.RedirectURI[0].String(),
"response_type": domain.ResponseTypeCode.String(),
"scope": domain.Scopes{domain.ScopeEmail, domain.ScopeProfile}.String(),
"state": p.State,
} %}
<input type="hidden"
@ -57,15 +58,6 @@
value="{%s value %}">
{% endfor %}
{% for _, scope := range []domain.Scope{
domain.ScopeEmail,
domain.ScopeProfile,
} %}
<input type="hidden"
name="scope[]"
value="{%s scope.String() %}">
{% endfor %}
<input type="url"
name="me"
placeholder="https://example.com/"
@ -73,7 +65,7 @@
autocomplete="url"
required>
<button type="submit">{%= p.T("Sign In") %}</button>
<button type="submit">{%= p.t("Sign In") %}</button>
</form>
</main>
{% endfunc %}

View file

@ -30,11 +30,11 @@ type HomePage struct {
}
//line web/home.qtpl:12
func (p *HomePage) StreamHead(qw422016 *qt422016.Writer) {
func (p *HomePage) streamhead(qw422016 *qt422016.Writer) {
//line web/home.qtpl:12
qw422016.N().S(` `)
//line web/home.qtpl:13
p.BaseOf.StreamHead(qw422016)
p.BaseOf.streamhead(qw422016)
//line web/home.qtpl:13
qw422016.N().S(` `)
//line web/home.qtpl:14
@ -53,22 +53,22 @@ func (p *HomePage) StreamHead(qw422016 *qt422016.Writer) {
}
//line web/home.qtpl:18
func (p *HomePage) WriteHead(qq422016 qtio422016.Writer) {
func (p *HomePage) writehead(qq422016 qtio422016.Writer) {
//line web/home.qtpl:18
qw422016 := qt422016.AcquireWriter(qq422016)
//line web/home.qtpl:18
p.StreamHead(qw422016)
p.streamhead(qw422016)
//line web/home.qtpl:18
qt422016.ReleaseWriter(qw422016)
//line web/home.qtpl:18
}
//line web/home.qtpl:18
func (p *HomePage) Head() string {
func (p *HomePage) head() string {
//line web/home.qtpl:18
qb422016 := qt422016.AcquireByteBuffer()
//line web/home.qtpl:18
p.WriteHead(qb422016)
p.writehead(qb422016)
//line web/home.qtpl:18
qs422016 := string(qb422016.B)
//line web/home.qtpl:18
@ -79,7 +79,7 @@ func (p *HomePage) Head() string {
}
//line web/home.qtpl:20
func (p *HomePage) StreamBody(qw422016 *qt422016.Writer) {
func (p *HomePage) streambody(qw422016 *qt422016.Writer) {
//line web/home.qtpl:20
qw422016.N().S(` <header class="h-app h-x-app"> <img class="u-logo" src="`)
//line web/home.qtpl:23
@ -103,66 +103,52 @@ func (p *HomePage) StreamBody(qw422016 *qt422016.Writer) {
"client_id": p.Client.ID.String(),
"redirect_uri": p.Client.RedirectURI[0].String(),
"response_type": domain.ResponseTypeCode.String(),
"scope": domain.Scopes{domain.ScopeEmail, domain.ScopeProfile}.String(),
"state": p.State,
} {
//line web/home.qtpl:54
//line web/home.qtpl:55
qw422016.N().S(` <input type="hidden" name="`)
//line web/home.qtpl:56
//line web/home.qtpl:57
qw422016.E().S(name)
//line web/home.qtpl:56
//line web/home.qtpl:57
qw422016.N().S(`" value="`)
//line web/home.qtpl:57
//line web/home.qtpl:58
qw422016.E().S(value)
//line web/home.qtpl:57
qw422016.N().S(`"> `)
//line web/home.qtpl:58
}
//line web/home.qtpl:58
qw422016.N().S(` `)
//line web/home.qtpl:60
for _, scope := range []domain.Scope{
domain.ScopeEmail,
domain.ScopeProfile,
} {
//line web/home.qtpl:63
qw422016.N().S(` <input type="hidden" name="scope[]" value="`)
//line web/home.qtpl:66
qw422016.E().S(scope.String())
//line web/home.qtpl:66
qw422016.N().S(`"> `)
//line web/home.qtpl:67
//line web/home.qtpl:59
}
//line web/home.qtpl:67
//line web/home.qtpl:59
qw422016.N().S(` <input type="url" name="me" placeholder="https://example.com/" inputmode="url" autocomplete="url" required> <button type="submit">`)
//line web/home.qtpl:76
p.StreamT(qw422016, "Sign In")
//line web/home.qtpl:76
//line web/home.qtpl:68
p.streamt(qw422016, "Sign In")
//line web/home.qtpl:68
qw422016.N().S(`</button> </form> </main> `)
//line web/home.qtpl:79
//line web/home.qtpl:71
}
//line web/home.qtpl:79
func (p *HomePage) WriteBody(qq422016 qtio422016.Writer) {
//line web/home.qtpl:79
//line web/home.qtpl:71
func (p *HomePage) writebody(qq422016 qtio422016.Writer) {
//line web/home.qtpl:71
qw422016 := qt422016.AcquireWriter(qq422016)
//line web/home.qtpl:79
p.StreamBody(qw422016)
//line web/home.qtpl:79
//line web/home.qtpl:71
p.streambody(qw422016)
//line web/home.qtpl:71
qt422016.ReleaseWriter(qw422016)
//line web/home.qtpl:79
//line web/home.qtpl:71
}
//line web/home.qtpl:79
func (p *HomePage) Body() string {
//line web/home.qtpl:79
//line web/home.qtpl:71
func (p *HomePage) body() string {
//line web/home.qtpl:71
qb422016 := qt422016.AcquireByteBuffer()
//line web/home.qtpl:79
p.WriteBody(qb422016)
//line web/home.qtpl:79
//line web/home.qtpl:71
p.writebody(qb422016)
//line web/home.qtpl:71
qs422016 := string(qb422016.B)
//line web/home.qtpl:79
//line web/home.qtpl:71
qt422016.ReleaseByteBuffer(qb422016)
//line web/home.qtpl:79
//line web/home.qtpl:71
return qs422016
//line web/home.qtpl:79
//line web/home.qtpl:71
}

View file

@ -4,9 +4,9 @@
} %}
{% collapsespace %}
{% func (p *TicketPage) Body() %}
{% func (p *TicketPage) body() %}
<header>
<h1>{%= p.T("TicketAuth") %}</h1>
<h1>{%= p.t("TicketAuth") %}</h1>
</header>
<main>
@ -25,7 +25,7 @@
{% endif %}
<div>
<label for="subject">{%= p.T("Recipient") %}</label>
<label for="subject">{%= p.t("Recipient") %}</label>
<input id="subject"
type="url"
name="subject"
@ -35,7 +35,7 @@
</div>
<div>
<label for="resource">{%= p.T("Resource") %}</label>
<label for="resource">{%= p.t("Resource") %}</label>
<input id="resource"
type="url"
name="resource"
@ -44,7 +44,7 @@
required>
</div>
<button type="submit">{%= p.T("Send") %}</button>
<button type="submit">{%= p.t("Send") %}</button>
</form>
</main>
{% endfunc %}

View file

@ -24,11 +24,11 @@ type TicketPage struct {
}
//line web/ticket.qtpl:7
func (p *TicketPage) StreamBody(qw422016 *qt422016.Writer) {
func (p *TicketPage) streambody(qw422016 *qt422016.Writer) {
//line web/ticket.qtpl:7
qw422016.N().S(` <header> <h1>`)
//line web/ticket.qtpl:9
p.StreamT(qw422016, "TicketAuth")
p.streamt(qw422016, "TicketAuth")
//line web/ticket.qtpl:9
qw422016.N().S(`</h1> </header> <main> <form class="" accept-charset="utf-8" action="/ticket/send" autocomplete="off" enctype="application/x-www-form-urlencoded" method="post" target="_self"> `)
//line web/ticket.qtpl:21
@ -44,37 +44,37 @@ func (p *TicketPage) StreamBody(qw422016 *qt422016.Writer) {
//line web/ticket.qtpl:25
qw422016.N().S(` <div> <label for="subject">`)
//line web/ticket.qtpl:28
p.StreamT(qw422016, "Recipient")
p.streamt(qw422016, "Recipient")
//line web/ticket.qtpl:28
qw422016.N().S(`</label> <input id="subject" type="url" name="subject" inputmode="url" placeholder="https://bob.example.org/" required> </div> <div> <label for="resource">`)
//line web/ticket.qtpl:38
p.StreamT(qw422016, "Resource")
p.streamt(qw422016, "Resource")
//line web/ticket.qtpl:38
qw422016.N().S(`</label> <input id="resource" type="url" name="resource" inputmode="url" placeholder="https://alice.example.com/private/" required> </div> <button type="submit">`)
//line web/ticket.qtpl:47
p.StreamT(qw422016, "Send")
p.streamt(qw422016, "Send")
//line web/ticket.qtpl:47
qw422016.N().S(`</button> </form> </main> `)
//line web/ticket.qtpl:50
}
//line web/ticket.qtpl:50
func (p *TicketPage) WriteBody(qq422016 qtio422016.Writer) {
func (p *TicketPage) writebody(qq422016 qtio422016.Writer) {
//line web/ticket.qtpl:50
qw422016 := qt422016.AcquireWriter(qq422016)
//line web/ticket.qtpl:50
p.StreamBody(qw422016)
p.streambody(qw422016)
//line web/ticket.qtpl:50
qt422016.ReleaseWriter(qw422016)
//line web/ticket.qtpl:50
}
//line web/ticket.qtpl:50
func (p *TicketPage) Body() string {
func (p *TicketPage) body() string {
//line web/ticket.qtpl:50
qb422016 := qt422016.AcquireByteBuffer()
//line web/ticket.qtpl:50
p.WriteBody(qb422016)
p.writebody(qb422016)
//line web/ticket.qtpl:50
qs422016 := string(qb422016.B)
//line web/ticket.qtpl:50