💄 Format and regenerate templates

This commit is contained in:
Maxim Lebedev 2022-07-28 23:13:24 +05:00
parent 80937fbb8d
commit 8fa0715116
Signed by: toby3d
GPG Key ID: 1F14E25B7C119FC5
12 changed files with 440 additions and 446 deletions

View File

@ -1,15 +1,17 @@
{% import "source.toby3d.me/toby3d/auth/internal/domain" %} {% import (
"source.toby3d.me/toby3d/auth/internal/domain"
) %}
{% code type AuthorizePage struct { {% code type AuthorizePage struct {
BaseOf BaseOf
CSRF []byte
Providers []*domain.Provider
Scope domain.Scopes Scope domain.Scopes
CodeChallengeMethod domain.CodeChallengeMethod
ResponseType domain.ResponseType
Client *domain.Client Client *domain.Client
Me *domain.Me Me *domain.Me
RedirectURI *domain.URL RedirectURI *domain.URL
CodeChallengeMethod domain.CodeChallengeMethod Providers []*domain.Provider
ResponseType domain.ResponseType CSRF []byte
CodeChallenge string CodeChallenge string
State string State string
} %} } %}
@ -25,8 +27,7 @@
{% func (p *AuthorizePage) Body() %} {% func (p *AuthorizePage) Body() %}
<header> <header>
{% if p.Client.GetLogo() != nil %} {% if p.Client.GetLogo() != nil %}
<img <img class=""
alt="{%s p.Client.GetName() %}"
crossorigin="anonymous" crossorigin="anonymous"
decoding="async" decoding="async"
height="140" height="140"
@ -34,6 +35,7 @@
loading="lazy" loading="lazy"
referrerpolicy="no-referrer-when-downgrade" referrerpolicy="no-referrer-when-downgrade"
src="{%s p.Client.GetLogo().String() %}" src="{%s p.Client.GetLogo().String() %}"
alt="{%s p.Client.GetName() %}"
width="140"> width="140">
{% endif %} {% endif %}
@ -53,7 +55,7 @@
</header> </header>
<main> <main>
<form <form class=""
accept-charset="utf-8" accept-charset="utf-8"
action="/api/authorize" action="/api/authorize"
autocomplete="off" autocomplete="off"
@ -63,8 +65,7 @@
target="_self"> target="_self">
{% if p.CSRF != nil %} {% if p.CSRF != nil %}
<input <input type="hidden"
type="hidden"
name="_csrf" name="_csrf"
value="{%z p.CSRF %}"> value="{%z p.CSRF %}">
{% endif %} {% endif %}
@ -75,8 +76,7 @@
"response_type": p.ResponseType.String(), "response_type": p.ResponseType.String(),
"state": p.State, "state": p.State,
} %} } %}
<input <input type="hidden"
type="hidden"
name="{%s key %}" name="{%s key %}"
value="{%s val %}"> value="{%s val %}">
{% endfor %} {% endfor %}
@ -88,8 +88,7 @@
{% for _, scope := range p.Scope %} {% for _, scope := range p.Scope %}
<div> <div>
<label> <label>
<input <input type="checkbox"
type="checkbox"
name="scope[]" name="scope[]"
value="{%s scope.String() %}" value="{%s scope.String() %}"
checked> checked>
@ -102,33 +101,28 @@
{% endif %} {% endif %}
{% if p.CodeChallenge != "" %} {% if p.CodeChallenge != "" %}
<input <input type="hidden"
type="hidden"
name="code_challenge" name="code_challenge"
value="{%s p.CodeChallenge %}"> value="{%s p.CodeChallenge %}">
<input <input type="hidden"
type="hidden"
name="code_challenge_method" name="code_challenge_method"
value="{%s p.CodeChallengeMethod.String() %}"> value="{%s p.CodeChallengeMethod.String() %}">
{% endif %} {% endif %}
{% if p.Me != nil %} {% if p.Me != nil %}
<input <input type="hidden"
type="hidden"
name="me" name="me"
value="{%s p.Me.String() %}"> value="{%s p.Me.String() %}">
{% endif %} {% endif %}
{% if len(p.Providers) > 0 %} {% if len(p.Providers) > 0 %}
<select <select name="provider"
name="provider"
autocomplete autocomplete
required> required>
{% for _, provider := range p.Providers %} {% for _, provider := range p.Providers %}
<option <option value="{%s provider.UID %}"
value="{%s provider.UID %}"
{% if provider.UID == "mastodon" %}selected{% endif %}> {% if provider.UID == "mastodon" %}selected{% endif %}>
{%s provider.Name %} {%s provider.Name %}
@ -136,19 +130,19 @@
{% endfor %} {% endfor %}
</select> </select>
{% else %} {% else %}
<input type="hidden" name="provider" value="direct"> <input type="hidden"
name="provider"
value="direct">
{% endif %} {% endif %}
<button <button type="submit"
type="submit"
name="authorize" name="authorize"
value="deny"> value="deny">
{%= p.T("Deny") %} {%= p.T("Deny") %}
</button> </button>
<button <button type="submit"
type="submit"
name="authorize" name="authorize"
value="allow"> value="allow">

View File

@ -5,111 +5,108 @@
package web package web
//line web/authorize.qtpl:1 //line web/authorize.qtpl:1
import "source.toby3d.me/toby3d/auth/internal/domain" import (
"source.toby3d.me/toby3d/auth/internal/domain"
)
//line web/authorize.qtpl:3 //line web/authorize.qtpl:5
import ( import (
qtio422016 "io" qtio422016 "io"
qt422016 "github.com/valyala/quicktemplate" qt422016 "github.com/valyala/quicktemplate"
) )
//line web/authorize.qtpl:3 //line web/authorize.qtpl:5
var ( var (
_ = qtio422016.Copy _ = qtio422016.Copy
_ = qt422016.AcquireByteBuffer _ = qt422016.AcquireByteBuffer
) )
//line web/authorize.qtpl:3 //line web/authorize.qtpl:5
type AuthorizePage struct { type AuthorizePage struct {
BaseOf BaseOf
CSRF []byte
Providers []*domain.Provider
Scope domain.Scopes Scope domain.Scopes
CodeChallengeMethod domain.CodeChallengeMethod
ResponseType domain.ResponseType
Client *domain.Client Client *domain.Client
Me *domain.Me Me *domain.Me
RedirectURI *domain.URL RedirectURI *domain.URL
CodeChallengeMethod domain.CodeChallengeMethod Providers []*domain.Provider
ResponseType domain.ResponseType CSRF []byte
CodeChallenge string CodeChallenge string
State string State string
} }
//line web/authorize.qtpl:17 //line web/authorize.qtpl:19
func (p *AuthorizePage) StreamTitle(qw422016 *qt422016.Writer) { func (p *AuthorizePage) StreamTitle(qw422016 *qt422016.Writer) {
//line web/authorize.qtpl:17 //line web/authorize.qtpl:19
qw422016.N().S(` qw422016.N().S(`
`) `)
//line web/authorize.qtpl:18 //line web/authorize.qtpl:20
if p.Client.GetName() == "" { if p.Client.GetName() == "" {
//line web/authorize.qtpl:18 //line web/authorize.qtpl:20
qw422016.N().S(` qw422016.N().S(`
`) `)
//line web/authorize.qtpl:19 //line web/authorize.qtpl:21
p.StreamT(qw422016, "Authorize %s", p.Client.GetName()) p.StreamT(qw422016, "Authorize %s", p.Client.GetName())
//line web/authorize.qtpl:19 //line web/authorize.qtpl:21
qw422016.N().S(` qw422016.N().S(`
`) `)
//line web/authorize.qtpl:20 //line web/authorize.qtpl:22
} else { } else {
//line web/authorize.qtpl:20 //line web/authorize.qtpl:22
qw422016.N().S(` qw422016.N().S(`
`) `)
//line web/authorize.qtpl:21 //line web/authorize.qtpl:23
p.StreamT(qw422016, "Authorize application") p.StreamT(qw422016, "Authorize application")
//line web/authorize.qtpl:21 //line web/authorize.qtpl:23
qw422016.N().S(` qw422016.N().S(`
`) `)
//line web/authorize.qtpl:22 //line web/authorize.qtpl:24
} }
//line web/authorize.qtpl:22 //line web/authorize.qtpl:24
qw422016.N().S(` qw422016.N().S(`
`) `)
//line web/authorize.qtpl:23 //line web/authorize.qtpl:25
} }
//line web/authorize.qtpl:23 //line web/authorize.qtpl:25
func (p *AuthorizePage) WriteTitle(qq422016 qtio422016.Writer) { func (p *AuthorizePage) WriteTitle(qq422016 qtio422016.Writer) {
//line web/authorize.qtpl:23 //line web/authorize.qtpl:25
qw422016 := qt422016.AcquireWriter(qq422016) qw422016 := qt422016.AcquireWriter(qq422016)
//line web/authorize.qtpl:23 //line web/authorize.qtpl:25
p.StreamTitle(qw422016) p.StreamTitle(qw422016)
//line web/authorize.qtpl:23 //line web/authorize.qtpl:25
qt422016.ReleaseWriter(qw422016) qt422016.ReleaseWriter(qw422016)
//line web/authorize.qtpl:23 //line web/authorize.qtpl:25
} }
//line web/authorize.qtpl:23 //line web/authorize.qtpl:25
func (p *AuthorizePage) Title() string { func (p *AuthorizePage) Title() string {
//line web/authorize.qtpl:23 //line web/authorize.qtpl:25
qb422016 := qt422016.AcquireByteBuffer() qb422016 := qt422016.AcquireByteBuffer()
//line web/authorize.qtpl:23 //line web/authorize.qtpl:25
p.WriteTitle(qb422016) p.WriteTitle(qb422016)
//line web/authorize.qtpl:23 //line web/authorize.qtpl:25
qs422016 := string(qb422016.B) qs422016 := string(qb422016.B)
//line web/authorize.qtpl:23 //line web/authorize.qtpl:25
qt422016.ReleaseByteBuffer(qb422016) qt422016.ReleaseByteBuffer(qb422016)
//line web/authorize.qtpl:23 //line web/authorize.qtpl:25
return qs422016 return qs422016
//line web/authorize.qtpl:23 //line web/authorize.qtpl:25
} }
//line web/authorize.qtpl:25 //line web/authorize.qtpl:27
func (p *AuthorizePage) StreamBody(qw422016 *qt422016.Writer) { func (p *AuthorizePage) StreamBody(qw422016 *qt422016.Writer) {
//line web/authorize.qtpl:25 //line web/authorize.qtpl:27
qw422016.N().S(` qw422016.N().S(`
<header> <header>
`) `)
//line web/authorize.qtpl:27 //line web/authorize.qtpl:29
if p.Client.GetLogo() != nil { if p.Client.GetLogo() != nil {
//line web/authorize.qtpl:27 //line web/authorize.qtpl:29
qw422016.N().S(` qw422016.N().S(`
<img <img class=""
alt="`)
//line web/authorize.qtpl:29
qw422016.E().S(p.Client.GetName())
//line web/authorize.qtpl:29
qw422016.N().S(`"
crossorigin="anonymous" crossorigin="anonymous"
decoding="async" decoding="async"
height="140" height="140"
@ -117,74 +114,79 @@ func (p *AuthorizePage) StreamBody(qw422016 *qt422016.Writer) {
loading="lazy" loading="lazy"
referrerpolicy="no-referrer-when-downgrade" referrerpolicy="no-referrer-when-downgrade"
src="`) src="`)
//line web/authorize.qtpl:36 //line web/authorize.qtpl:37
qw422016.E().S(p.Client.GetLogo().String()) qw422016.E().S(p.Client.GetLogo().String())
//line web/authorize.qtpl:36 //line web/authorize.qtpl:37
qw422016.N().S(`"
alt="`)
//line web/authorize.qtpl:38
qw422016.E().S(p.Client.GetName())
//line web/authorize.qtpl:38
qw422016.N().S(`" qw422016.N().S(`"
width="140"> width="140">
`) `)
//line web/authorize.qtpl:38 //line web/authorize.qtpl:40
} }
//line web/authorize.qtpl:38 //line web/authorize.qtpl:40
qw422016.N().S(` qw422016.N().S(`
<h2> <h2>
`) `)
//line web/authorize.qtpl:41 //line web/authorize.qtpl:43
if p.Client.GetURL() != nil { if p.Client.GetURL() != nil {
//line web/authorize.qtpl:41 //line web/authorize.qtpl:43
qw422016.N().S(` qw422016.N().S(`
<a href="`) <a href="`)
//line web/authorize.qtpl:42 //line web/authorize.qtpl:44
qw422016.E().S(p.Client.GetURL().String()) qw422016.E().S(p.Client.GetURL().String())
//line web/authorize.qtpl:42 //line web/authorize.qtpl:44
qw422016.N().S(`"> qw422016.N().S(`">
`) `)
//line web/authorize.qtpl:43 //line web/authorize.qtpl:45
} }
//line web/authorize.qtpl:43 //line web/authorize.qtpl:45
qw422016.N().S(` qw422016.N().S(`
`) `)
//line web/authorize.qtpl:44 //line web/authorize.qtpl:46
if p.Client.GetName() != "" { if p.Client.GetName() != "" {
//line web/authorize.qtpl:44 //line web/authorize.qtpl:46
qw422016.N().S(` qw422016.N().S(`
`) `)
//line web/authorize.qtpl:45 //line web/authorize.qtpl:47
qw422016.E().S(p.Client.GetName()) qw422016.E().S(p.Client.GetName())
//line web/authorize.qtpl:45 //line web/authorize.qtpl:47
qw422016.N().S(` qw422016.N().S(`
`) `)
//line web/authorize.qtpl:46 //line web/authorize.qtpl:48
} else { } else {
//line web/authorize.qtpl:46 //line web/authorize.qtpl:48
qw422016.N().S(` qw422016.N().S(`
`) `)
//line web/authorize.qtpl:47 //line web/authorize.qtpl:49
qw422016.E().S(p.Client.ID.String()) qw422016.E().S(p.Client.ID.String())
//line web/authorize.qtpl:47 //line web/authorize.qtpl:49
qw422016.N().S(` qw422016.N().S(`
`) `)
//line web/authorize.qtpl:48 //line web/authorize.qtpl:50
} }
//line web/authorize.qtpl:48 //line web/authorize.qtpl:50
qw422016.N().S(` qw422016.N().S(`
`) `)
//line web/authorize.qtpl:49 //line web/authorize.qtpl:51
if p.Client.GetURL() != nil { if p.Client.GetURL() != nil {
//line web/authorize.qtpl:49 //line web/authorize.qtpl:51
qw422016.N().S(` qw422016.N().S(`
</a> </a>
`) `)
//line web/authorize.qtpl:51 //line web/authorize.qtpl:53
} }
//line web/authorize.qtpl:51 //line web/authorize.qtpl:53
qw422016.N().S(` qw422016.N().S(`
</h2> </h2>
</header> </header>
<main> <main>
<form <form class=""
accept-charset="utf-8" accept-charset="utf-8"
action="/api/authorize" action="/api/authorize"
autocomplete="off" autocomplete="off"
@ -194,36 +196,34 @@ func (p *AuthorizePage) StreamBody(qw422016 *qt422016.Writer) {
target="_self"> target="_self">
`) `)
//line web/authorize.qtpl:65 //line web/authorize.qtpl:67
if p.CSRF != nil { if p.CSRF != nil {
//line web/authorize.qtpl:65 //line web/authorize.qtpl:67
qw422016.N().S(` qw422016.N().S(`
<input <input type="hidden"
type="hidden"
name="_csrf" name="_csrf"
value="`) value="`)
//line web/authorize.qtpl:69 //line web/authorize.qtpl:70
qw422016.E().Z(p.CSRF) qw422016.E().Z(p.CSRF)
//line web/authorize.qtpl:69 //line web/authorize.qtpl:70
qw422016.N().S(`"> qw422016.N().S(`">
`) `)
//line web/authorize.qtpl:70 //line web/authorize.qtpl:71
} }
//line web/authorize.qtpl:70 //line web/authorize.qtpl:71
qw422016.N().S(` qw422016.N().S(`
`) `)
//line web/authorize.qtpl:72 //line web/authorize.qtpl:73
for key, val := range map[string]string{ for key, val := range map[string]string{
"client_id": p.Client.ID.String(), "client_id": p.Client.ID.String(),
"redirect_uri": p.RedirectURI.String(), "redirect_uri": p.RedirectURI.String(),
"response_type": p.ResponseType.String(), "response_type": p.ResponseType.String(),
"state": p.State, "state": p.State,
} { } {
//line web/authorize.qtpl:77 //line web/authorize.qtpl:78
qw422016.N().S(` qw422016.N().S(`
<input <input type="hidden"
type="hidden"
name="`) name="`)
//line web/authorize.qtpl:80 //line web/authorize.qtpl:80
qw422016.E().S(key) qw422016.E().S(key)
@ -259,188 +259,182 @@ func (p *AuthorizePage) StreamBody(qw422016 *qt422016.Writer) {
qw422016.N().S(` qw422016.N().S(`
<div> <div>
<label> <label>
<input <input type="checkbox"
type="checkbox"
name="scope[]" name="scope[]"
value="`) value="`)
//line web/authorize.qtpl:94 //line web/authorize.qtpl:93
qw422016.E().S(scope.String()) qw422016.E().S(scope.String())
//line web/authorize.qtpl:94 //line web/authorize.qtpl:93
qw422016.N().S(`" qw422016.N().S(`"
checked> checked>
`) `)
//line web/authorize.qtpl:97 //line web/authorize.qtpl:96
qw422016.E().S(scope.String()) qw422016.E().S(scope.String())
//line web/authorize.qtpl:97 //line web/authorize.qtpl:96
qw422016.N().S(` qw422016.N().S(`
</label> </label>
</div> </div>
`) `)
//line web/authorize.qtpl:100 //line web/authorize.qtpl:99
} }
//line web/authorize.qtpl:100 //line web/authorize.qtpl:99
qw422016.N().S(` qw422016.N().S(`
</fieldset> </fieldset>
`) `)
//line web/authorize.qtpl:102 //line web/authorize.qtpl:101
} }
//line web/authorize.qtpl:102 //line web/authorize.qtpl:101
qw422016.N().S(` qw422016.N().S(`
`) `)
//line web/authorize.qtpl:104 //line web/authorize.qtpl:103
if p.CodeChallenge != "" { if p.CodeChallenge != "" {
//line web/authorize.qtpl:104 //line web/authorize.qtpl:103
qw422016.N().S(` qw422016.N().S(`
<input <input type="hidden"
type="hidden"
name="code_challenge" name="code_challenge"
value="`) value="`)
//line web/authorize.qtpl:108 //line web/authorize.qtpl:106
qw422016.E().S(p.CodeChallenge) qw422016.E().S(p.CodeChallenge)
//line web/authorize.qtpl:108 //line web/authorize.qtpl:106
qw422016.N().S(`"> qw422016.N().S(`">
<input <input type="hidden"
type="hidden"
name="code_challenge_method" name="code_challenge_method"
value="`) value="`)
//line web/authorize.qtpl:113 //line web/authorize.qtpl:110
qw422016.E().S(p.CodeChallengeMethod.String()) qw422016.E().S(p.CodeChallengeMethod.String())
//line web/authorize.qtpl:113 //line web/authorize.qtpl:110
qw422016.N().S(`"> qw422016.N().S(`">
`) `)
//line web/authorize.qtpl:114 //line web/authorize.qtpl:111
} }
//line web/authorize.qtpl:114 //line web/authorize.qtpl:111
qw422016.N().S(` qw422016.N().S(`
`) `)
//line web/authorize.qtpl:116 //line web/authorize.qtpl:113
if p.Me != nil { if p.Me != nil {
//line web/authorize.qtpl:116 //line web/authorize.qtpl:113
qw422016.N().S(` qw422016.N().S(`
<input <input type="hidden"
type="hidden"
name="me" name="me"
value="`) value="`)
//line web/authorize.qtpl:120 //line web/authorize.qtpl:116
qw422016.E().S(p.Me.String()) qw422016.E().S(p.Me.String())
//line web/authorize.qtpl:120 //line web/authorize.qtpl:116
qw422016.N().S(`"> qw422016.N().S(`">
`) `)
//line web/authorize.qtpl:121 //line web/authorize.qtpl:117
} }
//line web/authorize.qtpl:121 //line web/authorize.qtpl:117
qw422016.N().S(` qw422016.N().S(`
`) `)
//line web/authorize.qtpl:123 //line web/authorize.qtpl:119
if len(p.Providers) > 0 { if len(p.Providers) > 0 {
//line web/authorize.qtpl:123 //line web/authorize.qtpl:119
qw422016.N().S(` qw422016.N().S(`
<select <select name="provider"
name="provider"
autocomplete autocomplete
required> required>
`) `)
//line web/authorize.qtpl:129 //line web/authorize.qtpl:124
for _, provider := range p.Providers { for _, provider := range p.Providers {
//line web/authorize.qtpl:129 //line web/authorize.qtpl:124
qw422016.N().S(` qw422016.N().S(`
<option <option value="`)
value="`) //line web/authorize.qtpl:125
//line web/authorize.qtpl:131
qw422016.E().S(provider.UID) qw422016.E().S(provider.UID)
//line web/authorize.qtpl:131 //line web/authorize.qtpl:125
qw422016.N().S(`" qw422016.N().S(`"
`) `)
//line web/authorize.qtpl:132 //line web/authorize.qtpl:126
if provider.UID == "mastodon" { if provider.UID == "mastodon" {
//line web/authorize.qtpl:132 //line web/authorize.qtpl:126
qw422016.N().S(`selected`) qw422016.N().S(`selected`)
//line web/authorize.qtpl:132 //line web/authorize.qtpl:126
} }
//line web/authorize.qtpl:132 //line web/authorize.qtpl:126
qw422016.N().S(`> qw422016.N().S(`>
`) `)
//line web/authorize.qtpl:134 //line web/authorize.qtpl:128
qw422016.E().S(provider.Name) qw422016.E().S(provider.Name)
//line web/authorize.qtpl:134 //line web/authorize.qtpl:128
qw422016.N().S(` qw422016.N().S(`
</option> </option>
`) `)
//line web/authorize.qtpl:136 //line web/authorize.qtpl:130
} }
//line web/authorize.qtpl:136 //line web/authorize.qtpl:130
qw422016.N().S(` qw422016.N().S(`
</select> </select>
`) `)
//line web/authorize.qtpl:138 //line web/authorize.qtpl:132
} else { } else {
//line web/authorize.qtpl:138 //line web/authorize.qtpl:132
qw422016.N().S(` qw422016.N().S(`
<input type="hidden" name="provider" value="direct"> <input type="hidden"
name="provider"
value="direct">
`) `)
//line web/authorize.qtpl:140 //line web/authorize.qtpl:136
} }
//line web/authorize.qtpl:140 //line web/authorize.qtpl:136
qw422016.N().S(` qw422016.N().S(`
<button <button type="submit"
type="submit"
name="authorize" name="authorize"
value="deny"> value="deny">
`) `)
//line web/authorize.qtpl:147 //line web/authorize.qtpl:142
p.StreamT(qw422016, "Deny") p.StreamT(qw422016, "Deny")
//line web/authorize.qtpl:147 //line web/authorize.qtpl:142
qw422016.N().S(` qw422016.N().S(`
</button> </button>
<button <button type="submit"
type="submit"
name="authorize" name="authorize"
value="allow"> value="allow">
`) `)
//line web/authorize.qtpl:155 //line web/authorize.qtpl:149
p.StreamT(qw422016, "Allow") p.StreamT(qw422016, "Allow")
//line web/authorize.qtpl:155 //line web/authorize.qtpl:149
qw422016.N().S(` qw422016.N().S(`
</button> </button>
</form> </form>
</main> </main>
`) `)
//line web/authorize.qtpl:159 //line web/authorize.qtpl:153
} }
//line web/authorize.qtpl:159 //line web/authorize.qtpl:153
func (p *AuthorizePage) WriteBody(qq422016 qtio422016.Writer) { func (p *AuthorizePage) WriteBody(qq422016 qtio422016.Writer) {
//line web/authorize.qtpl:159 //line web/authorize.qtpl:153
qw422016 := qt422016.AcquireWriter(qq422016) qw422016 := qt422016.AcquireWriter(qq422016)
//line web/authorize.qtpl:159 //line web/authorize.qtpl:153
p.StreamBody(qw422016) p.StreamBody(qw422016)
//line web/authorize.qtpl:159 //line web/authorize.qtpl:153
qt422016.ReleaseWriter(qw422016) qt422016.ReleaseWriter(qw422016)
//line web/authorize.qtpl:159 //line web/authorize.qtpl:153
} }
//line web/authorize.qtpl:159 //line web/authorize.qtpl:153
func (p *AuthorizePage) Body() string { func (p *AuthorizePage) Body() string {
//line web/authorize.qtpl:159 //line web/authorize.qtpl:153
qb422016 := qt422016.AcquireByteBuffer() qb422016 := qt422016.AcquireByteBuffer()
//line web/authorize.qtpl:159 //line web/authorize.qtpl:153
p.WriteBody(qb422016) p.WriteBody(qb422016)
//line web/authorize.qtpl:159 //line web/authorize.qtpl:153
qs422016 := string(qb422016.B) qs422016 := string(qb422016.B)
//line web/authorize.qtpl:159 //line web/authorize.qtpl:153
qt422016.ReleaseByteBuffer(qb422016) qt422016.ReleaseByteBuffer(qb422016)
//line web/authorize.qtpl:159 //line web/authorize.qtpl:153
return qs422016 return qs422016
//line web/authorize.qtpl:159 //line web/authorize.qtpl:153
} }

View File

@ -38,22 +38,18 @@
{% 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 %} {% comment %}https://evilmartians.com/chronicles/how-to-favicon-in-2021-six-files-that-fit-most-needs{% endcomment %}
<link <link rel="icon"
rel="icon"
href="{%s p.Config.Server.StaticURLPrefix %}/favicon.ico" href="{%s p.Config.Server.StaticURLPrefix %}/favicon.ico"
sizes="any"> sizes="any">
<link <link rel="icon"
rel="icon"
href="{%s p.Config.Server.StaticURLPrefix %}/icon.svg" href="{%s p.Config.Server.StaticURLPrefix %}/icon.svg"
type="image/svg+xml"> type="image/svg+xml">
<link <link rel="apple-touch-icon"
rel="apple-touch-icon"
href="{%s p.Config.Server.StaticURLPrefix %}/apple-touch-icon.png"> href="{%s p.Config.Server.StaticURLPrefix %}/apple-touch-icon.png">
<link <link rel="manifest"
rel="manifest"
href="{%s p.Config.Server.StaticURLPrefix %}/manifest.webmanifest"> href="{%s p.Config.Server.StaticURLPrefix %}/manifest.webmanifest">
{% endfunc %} {% endfunc %}
@ -61,15 +57,12 @@
{% func Template(p Page) %} {% func Template(p Page) %}
<!DOCTYPE html> <!DOCTYPE html>
<html <html class="page"
class="page"
lang="{%= p.Lang() %}"> lang="{%= p.Lang() %}">
<head> <head>
<meta charset="UTF-8"> <meta charset="utf-8">
<meta <meta name="viewport" content="width=device-width, initial-scale=1.0">
name="viewport"
content="width=device-width, initial-scale=1.0">
{%= p.Head() %} {%= p.Head() %}

View File

@ -153,103 +153,103 @@ func (p *BaseOf) StreamHead(qw422016 *qt422016.Writer) {
qw422016.N().S(` `) qw422016.N().S(` `)
//line web/baseof.qtpl:40 //line web/baseof.qtpl:40
qw422016.N().S(` <link rel="icon" href="`) qw422016.N().S(` <link rel="icon" href="`)
//line web/baseof.qtpl:43 //line web/baseof.qtpl:42
qw422016.E().S(p.Config.Server.StaticURLPrefix) qw422016.E().S(p.Config.Server.StaticURLPrefix)
//line web/baseof.qtpl:43 //line web/baseof.qtpl:42
qw422016.N().S(`/favicon.ico" sizes="any"> <link rel="icon" href="`) qw422016.N().S(`/favicon.ico" sizes="any"> <link rel="icon" href="`)
//line web/baseof.qtpl:48 //line web/baseof.qtpl:46
qw422016.E().S(p.Config.Server.StaticURLPrefix) qw422016.E().S(p.Config.Server.StaticURLPrefix)
//line web/baseof.qtpl:48 //line web/baseof.qtpl:46
qw422016.N().S(`/icon.svg" type="image/svg+xml"> <link rel="apple-touch-icon" href="`) qw422016.N().S(`/icon.svg" type="image/svg+xml"> <link rel="apple-touch-icon" href="`)
//line web/baseof.qtpl:53 //line web/baseof.qtpl:50
qw422016.E().S(p.Config.Server.StaticURLPrefix) qw422016.E().S(p.Config.Server.StaticURLPrefix)
//line web/baseof.qtpl:53 //line web/baseof.qtpl:50
qw422016.N().S(`/apple-touch-icon.png"> <link rel="manifest" href="`) qw422016.N().S(`/apple-touch-icon.png"> <link rel="manifest" href="`)
//line web/baseof.qtpl:57 //line web/baseof.qtpl:53
qw422016.E().S(p.Config.Server.StaticURLPrefix) qw422016.E().S(p.Config.Server.StaticURLPrefix)
//line web/baseof.qtpl:57 //line web/baseof.qtpl:53
qw422016.N().S(`/manifest.webmanifest"> `) qw422016.N().S(`/manifest.webmanifest"> `)
//line web/baseof.qtpl:58 //line web/baseof.qtpl:54
} }
//line web/baseof.qtpl:58 //line web/baseof.qtpl:54
func (p *BaseOf) WriteHead(qq422016 qtio422016.Writer) { func (p *BaseOf) WriteHead(qq422016 qtio422016.Writer) {
//line web/baseof.qtpl:58 //line web/baseof.qtpl:54
qw422016 := qt422016.AcquireWriter(qq422016) qw422016 := qt422016.AcquireWriter(qq422016)
//line web/baseof.qtpl:58 //line web/baseof.qtpl:54
p.StreamHead(qw422016) p.StreamHead(qw422016)
//line web/baseof.qtpl:58 //line web/baseof.qtpl:54
qt422016.ReleaseWriter(qw422016) qt422016.ReleaseWriter(qw422016)
//line web/baseof.qtpl:58 //line web/baseof.qtpl:54
} }
//line web/baseof.qtpl:58 //line web/baseof.qtpl:54
func (p *BaseOf) Head() string { func (p *BaseOf) Head() string {
//line web/baseof.qtpl:58 //line web/baseof.qtpl:54
qb422016 := qt422016.AcquireByteBuffer() qb422016 := qt422016.AcquireByteBuffer()
//line web/baseof.qtpl:58 //line web/baseof.qtpl:54
p.WriteHead(qb422016) p.WriteHead(qb422016)
//line web/baseof.qtpl:58 //line web/baseof.qtpl:54
qs422016 := string(qb422016.B) qs422016 := string(qb422016.B)
//line web/baseof.qtpl:58 //line web/baseof.qtpl:54
qt422016.ReleaseByteBuffer(qb422016) qt422016.ReleaseByteBuffer(qb422016)
//line web/baseof.qtpl:58 //line web/baseof.qtpl:54
return qs422016 return qs422016
//line web/baseof.qtpl:58 //line web/baseof.qtpl:54
} }
//line web/baseof.qtpl:60 //line web/baseof.qtpl:56
func (p *BaseOf) StreamBody(qw422016 *qt422016.Writer) { func (p *BaseOf) StreamBody(qw422016 *qt422016.Writer) {
//line web/baseof.qtpl:60 //line web/baseof.qtpl:56
} }
//line web/baseof.qtpl:60 //line web/baseof.qtpl:56
func (p *BaseOf) WriteBody(qq422016 qtio422016.Writer) { func (p *BaseOf) WriteBody(qq422016 qtio422016.Writer) {
//line web/baseof.qtpl:60 //line web/baseof.qtpl:56
qw422016 := qt422016.AcquireWriter(qq422016) qw422016 := qt422016.AcquireWriter(qq422016)
//line web/baseof.qtpl:60 //line web/baseof.qtpl:56
p.StreamBody(qw422016) p.StreamBody(qw422016)
//line web/baseof.qtpl:60 //line web/baseof.qtpl:56
qt422016.ReleaseWriter(qw422016) qt422016.ReleaseWriter(qw422016)
//line web/baseof.qtpl:60 //line web/baseof.qtpl:56
} }
//line web/baseof.qtpl:60 //line web/baseof.qtpl:56
func (p *BaseOf) Body() string { func (p *BaseOf) Body() string {
//line web/baseof.qtpl:60 //line web/baseof.qtpl:56
qb422016 := qt422016.AcquireByteBuffer() qb422016 := qt422016.AcquireByteBuffer()
//line web/baseof.qtpl:60 //line web/baseof.qtpl:56
p.WriteBody(qb422016) p.WriteBody(qb422016)
//line web/baseof.qtpl:60 //line web/baseof.qtpl:56
qs422016 := string(qb422016.B) qs422016 := string(qb422016.B)
//line web/baseof.qtpl:60 //line web/baseof.qtpl:56
qt422016.ReleaseByteBuffer(qb422016) qt422016.ReleaseByteBuffer(qb422016)
//line web/baseof.qtpl:60 //line web/baseof.qtpl:56
return qs422016 return qs422016
//line web/baseof.qtpl:60 //line web/baseof.qtpl:56
} }
//line web/baseof.qtpl:62 //line web/baseof.qtpl:58
func StreamTemplate(qw422016 *qt422016.Writer, p Page) { func StreamTemplate(qw422016 *qt422016.Writer, p Page) {
//line web/baseof.qtpl:62 //line web/baseof.qtpl:58
qw422016.N().S(` <!DOCTYPE html> <html class="page" lang="`) qw422016.N().S(` <!DOCTYPE html> <html class="page" lang="`)
//line web/baseof.qtpl:66 //line web/baseof.qtpl:61
p.StreamLang(qw422016) p.StreamLang(qw422016)
//line web/baseof.qtpl:66 //line web/baseof.qtpl:61
qw422016.N().S(`"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> `) qw422016.N().S(`"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> `)
//line web/baseof.qtpl:74 //line web/baseof.qtpl:67
p.StreamHead(qw422016) p.StreamHead(qw422016)
//line web/baseof.qtpl:74 //line web/baseof.qtpl:67
qw422016.N().S(` <title>`) qw422016.N().S(` <title>`)
//line web/baseof.qtpl:76 //line web/baseof.qtpl:69
p.StreamTitle(qw422016) p.StreamTitle(qw422016)
//line web/baseof.qtpl:76 //line web/baseof.qtpl:69
qw422016.N().S(`</title> </head> <body class="page__body body"> `) qw422016.N().S(`</title> </head> <body class="page__body body"> `)
//line web/baseof.qtpl:79 //line web/baseof.qtpl:72
p.StreamBody(qw422016) p.StreamBody(qw422016)
//line web/baseof.qtpl:79 //line web/baseof.qtpl:72
qw422016.N().S(` `) qw422016.N().S(` `)
//line web/baseof.qtpl:82 //line web/baseof.qtpl:75
var path, vcsRevision string var path, vcsRevision string
if bi, ok := debug.ReadBuildInfo(); ok { if bi, ok := debug.ReadBuildInfo(); ok {
@ -264,94 +264,94 @@ func StreamTemplate(qw422016 *qt422016.Writer, p Page) {
} }
} }
//line web/baseof.qtpl:95 //line web/baseof.qtpl:88
qw422016.N().S(` `) qw422016.N().S(` `)
//line web/baseof.qtpl:97 //line web/baseof.qtpl:90
if vcsRevision != "" { if vcsRevision != "" {
//line web/baseof.qtpl:97 //line web/baseof.qtpl:90
qw422016.N().S(` <footer> <small> `) qw422016.N().S(` <footer> <small> `)
//line web/baseof.qtpl:100 //line web/baseof.qtpl:93
p.StreamT(qw422016, "version") p.StreamT(qw422016, "version")
//line web/baseof.qtpl:100 //line web/baseof.qtpl:93
qw422016.N().S(` <a href="https://`) qw422016.N().S(` <a href="https://`)
//line web/baseof.qtpl:101 //line web/baseof.qtpl:94
qw422016.E().S(path) qw422016.E().S(path)
//line web/baseof.qtpl:101 //line web/baseof.qtpl:94
qw422016.N().S(`/commit/`) qw422016.N().S(`/commit/`)
//line web/baseof.qtpl:101 //line web/baseof.qtpl:94
qw422016.E().S(vcsRevision) qw422016.E().S(vcsRevision)
//line web/baseof.qtpl:101 //line web/baseof.qtpl:94
qw422016.N().S(`" target="_blank"> `) qw422016.N().S(`" target="_blank"> `)
//line web/baseof.qtpl:102 //line web/baseof.qtpl:95
qw422016.E().S(vcsRevision[:7]) qw422016.E().S(vcsRevision[:7])
//line web/baseof.qtpl:102 //line web/baseof.qtpl:95
qw422016.N().S(`</a> </small> </footer> `) qw422016.N().S(`</a> </small> </footer> `)
//line web/baseof.qtpl:106 //line web/baseof.qtpl:99
} }
//line web/baseof.qtpl:106 //line web/baseof.qtpl:99
qw422016.N().S(` </body> </html> `) qw422016.N().S(` </body> </html> `)
//line web/baseof.qtpl:109 //line web/baseof.qtpl:102
} }
//line web/baseof.qtpl:109 //line web/baseof.qtpl:102
func WriteTemplate(qq422016 qtio422016.Writer, p Page) { func WriteTemplate(qq422016 qtio422016.Writer, p Page) {
//line web/baseof.qtpl:109 //line web/baseof.qtpl:102
qw422016 := qt422016.AcquireWriter(qq422016) qw422016 := qt422016.AcquireWriter(qq422016)
//line web/baseof.qtpl:109 //line web/baseof.qtpl:102
StreamTemplate(qw422016, p) StreamTemplate(qw422016, p)
//line web/baseof.qtpl:109 //line web/baseof.qtpl:102
qt422016.ReleaseWriter(qw422016) qt422016.ReleaseWriter(qw422016)
//line web/baseof.qtpl:109 //line web/baseof.qtpl:102
} }
//line web/baseof.qtpl:109 //line web/baseof.qtpl:102
func Template(p Page) string { func Template(p Page) string {
//line web/baseof.qtpl:109 //line web/baseof.qtpl:102
qb422016 := qt422016.AcquireByteBuffer() qb422016 := qt422016.AcquireByteBuffer()
//line web/baseof.qtpl:109 //line web/baseof.qtpl:102
WriteTemplate(qb422016, p) WriteTemplate(qb422016, p)
//line web/baseof.qtpl:109 //line web/baseof.qtpl:102
qs422016 := string(qb422016.B) qs422016 := string(qb422016.B)
//line web/baseof.qtpl:109 //line web/baseof.qtpl:102
qt422016.ReleaseByteBuffer(qb422016) qt422016.ReleaseByteBuffer(qb422016)
//line web/baseof.qtpl:109 //line web/baseof.qtpl:102
return qs422016 return qs422016
//line web/baseof.qtpl:109 //line web/baseof.qtpl:102
} }
//line web/baseof.qtpl:111 //line web/baseof.qtpl:104
func (p *BaseOf) StreamT(qw422016 *qt422016.Writer, format string, args ...interface{}) { func (p *BaseOf) StreamT(qw422016 *qt422016.Writer, format string, args ...interface{}) {
//line web/baseof.qtpl:111 //line web/baseof.qtpl:104
qw422016.N().S(` `) qw422016.N().S(` `)
//line web/baseof.qtpl:112 //line web/baseof.qtpl:105
qw422016.E().S(p.Printer.Sprintf(format, args...)) qw422016.E().S(p.Printer.Sprintf(format, args...))
//line web/baseof.qtpl:112 //line web/baseof.qtpl:105
qw422016.N().S(` `) qw422016.N().S(` `)
//line web/baseof.qtpl:113 //line web/baseof.qtpl:106
} }
//line web/baseof.qtpl:113 //line web/baseof.qtpl:106
func (p *BaseOf) WriteT(qq422016 qtio422016.Writer, format string, args ...interface{}) { func (p *BaseOf) WriteT(qq422016 qtio422016.Writer, format string, args ...interface{}) {
//line web/baseof.qtpl:113 //line web/baseof.qtpl:106
qw422016 := qt422016.AcquireWriter(qq422016) qw422016 := qt422016.AcquireWriter(qq422016)
//line web/baseof.qtpl:113 //line web/baseof.qtpl:106
p.StreamT(qw422016, format, args...) p.StreamT(qw422016, format, args...)
//line web/baseof.qtpl:113 //line web/baseof.qtpl:106
qt422016.ReleaseWriter(qw422016) qt422016.ReleaseWriter(qw422016)
//line web/baseof.qtpl:113 //line web/baseof.qtpl:106
} }
//line web/baseof.qtpl:113 //line web/baseof.qtpl:106
func (p *BaseOf) T(format string, args ...interface{}) string { func (p *BaseOf) T(format string, args ...interface{}) string {
//line web/baseof.qtpl:113 //line web/baseof.qtpl:106
qb422016 := qt422016.AcquireByteBuffer() qb422016 := qt422016.AcquireByteBuffer()
//line web/baseof.qtpl:113 //line web/baseof.qtpl:106
p.WriteT(qb422016, format, args...) p.WriteT(qb422016, format, args...)
//line web/baseof.qtpl:113 //line web/baseof.qtpl:106
qs422016 := string(qb422016.B) qs422016 := string(qb422016.B)
//line web/baseof.qtpl:113 //line web/baseof.qtpl:106
qt422016.ReleaseByteBuffer(qb422016) qt422016.ReleaseByteBuffer(qb422016)
//line web/baseof.qtpl:113 //line web/baseof.qtpl:106
return qs422016 return qs422016
//line web/baseof.qtpl:113 //line web/baseof.qtpl:106
} }

View File

@ -1,4 +1,6 @@
{% import "source.toby3d.me/toby3d/auth/internal/domain" %} {% import (
"source.toby3d.me/toby3d/auth/internal/domain"
) %}
{% code type CallbackPage struct { {% code type CallbackPage struct {
BaseOf BaseOf

View File

@ -5,72 +5,74 @@
package web package web
//line web/callback.qtpl:1 //line web/callback.qtpl:1
import "source.toby3d.me/toby3d/auth/internal/domain" import (
"source.toby3d.me/toby3d/auth/internal/domain"
)
//line web/callback.qtpl:3 //line web/callback.qtpl:5
import ( import (
qtio422016 "io" qtio422016 "io"
qt422016 "github.com/valyala/quicktemplate" qt422016 "github.com/valyala/quicktemplate"
) )
//line web/callback.qtpl:3 //line web/callback.qtpl:5
var ( var (
_ = qtio422016.Copy _ = qtio422016.Copy
_ = qt422016.AcquireByteBuffer _ = qt422016.AcquireByteBuffer
) )
//line web/callback.qtpl:3 //line web/callback.qtpl:5
type CallbackPage struct { type CallbackPage struct {
BaseOf BaseOf
Token *domain.Token Token *domain.Token
} }
//line web/callback.qtpl:9 //line web/callback.qtpl:11
func (p *CallbackPage) StreamBody(qw422016 *qt422016.Writer) { func (p *CallbackPage) StreamBody(qw422016 *qt422016.Writer) {
//line web/callback.qtpl:9 //line web/callback.qtpl:11
qw422016.N().S(` `) qw422016.N().S(` `)
//line web/callback.qtpl:10 //line web/callback.qtpl:12
if p.Token != nil { if p.Token != nil {
//line web/callback.qtpl:10 //line web/callback.qtpl:12
qw422016.N().S(` <h1>`) qw422016.N().S(` <h1>`)
//line web/callback.qtpl:11 //line web/callback.qtpl:13
qw422016.E().S(p.Token.Me.String()) qw422016.E().S(p.Token.Me.String())
//line web/callback.qtpl:11 //line web/callback.qtpl:13
qw422016.N().S(`</h1> <small>`) qw422016.N().S(`</h1> <small>`)
//line web/callback.qtpl:12 //line web/callback.qtpl:14
qw422016.E().S(p.Token.AccessToken) qw422016.E().S(p.Token.AccessToken)
//line web/callback.qtpl:12 //line web/callback.qtpl:14
qw422016.N().S(`</small> `) qw422016.N().S(`</small> `)
//line web/callback.qtpl:13 //line web/callback.qtpl:15
} }
//line web/callback.qtpl:13 //line web/callback.qtpl:15
qw422016.N().S(` `) qw422016.N().S(` `)
//line web/callback.qtpl:14 //line web/callback.qtpl:16
} }
//line web/callback.qtpl:14 //line web/callback.qtpl:16
func (p *CallbackPage) WriteBody(qq422016 qtio422016.Writer) { func (p *CallbackPage) WriteBody(qq422016 qtio422016.Writer) {
//line web/callback.qtpl:14 //line web/callback.qtpl:16
qw422016 := qt422016.AcquireWriter(qq422016) qw422016 := qt422016.AcquireWriter(qq422016)
//line web/callback.qtpl:14 //line web/callback.qtpl:16
p.StreamBody(qw422016) p.StreamBody(qw422016)
//line web/callback.qtpl:14 //line web/callback.qtpl:16
qt422016.ReleaseWriter(qw422016) qt422016.ReleaseWriter(qw422016)
//line web/callback.qtpl:14 //line web/callback.qtpl:16
} }
//line web/callback.qtpl:14 //line web/callback.qtpl:16
func (p *CallbackPage) Body() string { func (p *CallbackPage) Body() string {
//line web/callback.qtpl:14 //line web/callback.qtpl:16
qb422016 := qt422016.AcquireByteBuffer() qb422016 := qt422016.AcquireByteBuffer()
//line web/callback.qtpl:14 //line web/callback.qtpl:16
p.WriteBody(qb422016) p.WriteBody(qb422016)
//line web/callback.qtpl:14 //line web/callback.qtpl:16
qs422016 := string(qb422016.B) qs422016 := string(qb422016.B)
//line web/callback.qtpl:14 //line web/callback.qtpl:16
qt422016.ReleaseByteBuffer(qb422016) qt422016.ReleaseByteBuffer(qb422016)
//line web/callback.qtpl:14 //line web/callback.qtpl:16
return qs422016 return qs422016
//line web/callback.qtpl:14 //line web/callback.qtpl:16
} }

View File

@ -25,8 +25,7 @@
{% endif %} {% endif %}
{% if err.URI != "" %} {% if err.URI != "" %}
<a <a rel="noreferrer noopener"
rel="noreferrer noopener"
href="{%s err.URI %}" href="{%s err.URI %}"
target="_blank"> target="_blank">

View File

@ -100,59 +100,59 @@ func (p *ErrorPage) StreamBody(qw422016 *qt422016.Writer) {
if err.URI != "" { if err.URI != "" {
//line web/error.qtpl:27 //line web/error.qtpl:27
qw422016.N().S(` <a rel="noreferrer noopener" href="`) qw422016.N().S(` <a rel="noreferrer noopener" href="`)
//line web/error.qtpl:30 //line web/error.qtpl:29
qw422016.E().S(err.URI) qw422016.E().S(err.URI)
//line web/error.qtpl:30 //line web/error.qtpl:29
qw422016.N().S(`" target="_blank"> `) qw422016.N().S(`" target="_blank"> `)
//line web/error.qtpl:33 //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:33 //line web/error.qtpl:32
qw422016.N().S(` </a> `) qw422016.N().S(` </a> `)
//line web/error.qtpl:35 //line web/error.qtpl:34
} }
//line web/error.qtpl:35 //line web/error.qtpl:34
qw422016.N().S(` `) qw422016.N().S(` `)
//line web/error.qtpl:36 //line web/error.qtpl:35
} else { } else {
//line web/error.qtpl:36 //line web/error.qtpl:35
qw422016.N().S(` <h1>`) qw422016.N().S(` <h1>`)
//line web/error.qtpl:37 //line web/error.qtpl:36
qw422016.E().S(p.T("Error")) qw422016.E().S(p.T("Error"))
//line web/error.qtpl:37 //line web/error.qtpl:36
qw422016.N().S(`</h1> <p>`) qw422016.N().S(`</h1> <p>`)
//line web/error.qtpl:38 //line web/error.qtpl:37
qw422016.E().S(p.Error.Error()) qw422016.E().S(p.Error.Error())
//line web/error.qtpl:38 //line web/error.qtpl:37
qw422016.N().S(`</p> `) qw422016.N().S(`</p> `)
//line web/error.qtpl:39 //line web/error.qtpl:38
} }
//line web/error.qtpl:39 //line web/error.qtpl:38
qw422016.N().S(` </main> `) qw422016.N().S(` </main> `)
//line web/error.qtpl:41 //line web/error.qtpl:40
} }
//line web/error.qtpl:41 //line web/error.qtpl:40
func (p *ErrorPage) WriteBody(qq422016 qtio422016.Writer) { func (p *ErrorPage) WriteBody(qq422016 qtio422016.Writer) {
//line web/error.qtpl:41 //line web/error.qtpl:40
qw422016 := qt422016.AcquireWriter(qq422016) qw422016 := qt422016.AcquireWriter(qq422016)
//line web/error.qtpl:41 //line web/error.qtpl:40
p.StreamBody(qw422016) p.StreamBody(qw422016)
//line web/error.qtpl:41 //line web/error.qtpl:40
qt422016.ReleaseWriter(qw422016) qt422016.ReleaseWriter(qw422016)
//line web/error.qtpl:41 //line web/error.qtpl:40
} }
//line web/error.qtpl:41 //line web/error.qtpl:40
func (p *ErrorPage) Body() string { func (p *ErrorPage) Body() string {
//line web/error.qtpl:41 //line web/error.qtpl:40
qb422016 := qt422016.AcquireByteBuffer() qb422016 := qt422016.AcquireByteBuffer()
//line web/error.qtpl:41 //line web/error.qtpl:40
p.WriteBody(qb422016) p.WriteBody(qb422016)
//line web/error.qtpl:41 //line web/error.qtpl:40
qs422016 := string(qb422016.B) qs422016 := string(qb422016.B)
//line web/error.qtpl:41 //line web/error.qtpl:40
qt422016.ReleaseByteBuffer(qb422016) qt422016.ReleaseByteBuffer(qb422016)
//line web/error.qtpl:41 //line web/error.qtpl:40
return qs422016 return qs422016
//line web/error.qtpl:41 //line web/error.qtpl:40
} }

View File

@ -1,4 +1,6 @@
{% import "source.toby3d.me/toby3d/auth/internal/domain" %} {% import (
"source.toby3d.me/toby3d/auth/internal/domain"
) %}
{% code type HomePage struct { {% code type HomePage struct {
BaseOf BaseOf
@ -16,8 +18,7 @@
{% func (p *HomePage) Body() %} {% func (p *HomePage) Body() %}
<header class="h-app h-x-app"> <header class="h-app h-x-app">
<img <img class="u-logo"
class="u-logo"
src="{%s p.Client.GetLogo().String() %}" src="{%s p.Client.GetLogo().String() %}"
alt="{%s p.Client.GetName() %}" alt="{%s p.Client.GetName() %}"
crossorigin="anonymous" crossorigin="anonymous"
@ -28,8 +29,7 @@
width="140"> width="140">
<h1> <h1>
<a <a class="p-name u-url"
class="p-name u-url"
href="{%s p.Client.GetURL().String() %}"> href="{%s p.Client.GetURL().String() %}">
{%s p.Client.GetName() %} {%s p.Client.GetName() %}
@ -38,37 +38,34 @@
</header> </header>
<main> <main>
<form <form class=""
method="get" method="get"
action="/authorize" action="/authorize"
enctype="application/x-www-form-urlencoded" enctype="application/x-www-form-urlencoded"
accept-charset="utf-8" accept-charset="utf-8"
target="_self"> target="_self">
{% for name, value := range map[string]string { {% for name, value := range map[string]string{
"client_id": p.Client.ID.String(), "client_id": p.Client.ID.String(),
"redirect_uri": p.Client.RedirectURI[0].String(), "redirect_uri": p.Client.RedirectURI[0].String(),
"response_type": domain.ResponseTypeCode.String(), "response_type": domain.ResponseTypeCode.String(),
"state": p.State, "state": p.State,
} %} } %}
<input <input type="hidden"
type="hidden"
name="{%s name %}" name="{%s name %}"
value="{%s value %}"> value="{%s value %}">
{% endfor %} {% endfor %}
{% for _, scope := domain.Scopes{ {% for _, scope := range []domain.Scope{
domain.ScopeProfile,
domain.ScopeEmail, domain.ScopeEmail,
domain.ScopeProfile,
} %} } %}
<input <input type="hidden"
type="hidden"
name="scope[]" name="scope[]"
value="{%s scope.String() %}"> value="{%s scope.String() %}">
{% endfor %} {% endfor %}
<input <input type="url"
type="url"
name="me" name="me"
placeholder="https://example.com/" placeholder="https://example.com/"
inputmode="url" inputmode="url"

View File

@ -5,88 +5,90 @@
package web package web
//line web/home.qtpl:1 //line web/home.qtpl:1
import "source.toby3d.me/toby3d/auth/internal/domain" import (
"source.toby3d.me/toby3d/auth/internal/domain"
)
//line web/home.qtpl:3 //line web/home.qtpl:5
import ( import (
qtio422016 "io" qtio422016 "io"
qt422016 "github.com/valyala/quicktemplate" qt422016 "github.com/valyala/quicktemplate"
) )
//line web/home.qtpl:3 //line web/home.qtpl:5
var ( var (
_ = qtio422016.Copy _ = qtio422016.Copy
_ = qt422016.AcquireByteBuffer _ = qt422016.AcquireByteBuffer
) )
//line web/home.qtpl:3 //line web/home.qtpl:5
type HomePage struct { type HomePage struct {
BaseOf BaseOf
Client *domain.Client Client *domain.Client
State string State string
} }
//line web/home.qtpl:10 //line web/home.qtpl:12
func (p *HomePage) StreamHead(qw422016 *qt422016.Writer) { func (p *HomePage) StreamHead(qw422016 *qt422016.Writer) {
//line web/home.qtpl:10 //line web/home.qtpl:12
qw422016.N().S(` `) qw422016.N().S(` `)
//line web/home.qtpl:11 //line web/home.qtpl:13
p.BaseOf.StreamHead(qw422016) p.BaseOf.StreamHead(qw422016)
//line web/home.qtpl:11 //line web/home.qtpl:13
qw422016.N().S(` `) qw422016.N().S(` `)
//line web/home.qtpl:12 //line web/home.qtpl:14
for i := range p.Client.RedirectURI { for i := range p.Client.RedirectURI {
//line web/home.qtpl:12 //line web/home.qtpl:14
qw422016.N().S(` <link rel="redirect_uri" href="`) qw422016.N().S(` <link rel="redirect_uri" href="`)
//line web/home.qtpl:13 //line web/home.qtpl:15
qw422016.E().S(p.Client.RedirectURI[i].String()) qw422016.E().S(p.Client.RedirectURI[i].String())
//line web/home.qtpl:13 //line web/home.qtpl:15
qw422016.N().S(`"> `) qw422016.N().S(`"> `)
//line web/home.qtpl:14 //line web/home.qtpl:16
} }
//line web/home.qtpl:14 //line web/home.qtpl:16
qw422016.N().S(` `) qw422016.N().S(` `)
//line web/home.qtpl:15 //line web/home.qtpl:17
} }
//line web/home.qtpl:15 //line web/home.qtpl:17
func (p *HomePage) WriteHead(qq422016 qtio422016.Writer) { func (p *HomePage) WriteHead(qq422016 qtio422016.Writer) {
//line web/home.qtpl:15 //line web/home.qtpl:17
qw422016 := qt422016.AcquireWriter(qq422016) qw422016 := qt422016.AcquireWriter(qq422016)
//line web/home.qtpl:15 //line web/home.qtpl:17
p.StreamHead(qw422016) p.StreamHead(qw422016)
//line web/home.qtpl:15 //line web/home.qtpl:17
qt422016.ReleaseWriter(qw422016) qt422016.ReleaseWriter(qw422016)
//line web/home.qtpl:15 //line web/home.qtpl:17
} }
//line web/home.qtpl:15 //line web/home.qtpl:17
func (p *HomePage) Head() string { func (p *HomePage) Head() string {
//line web/home.qtpl:15 //line web/home.qtpl:17
qb422016 := qt422016.AcquireByteBuffer() qb422016 := qt422016.AcquireByteBuffer()
//line web/home.qtpl:15 //line web/home.qtpl:17
p.WriteHead(qb422016) p.WriteHead(qb422016)
//line web/home.qtpl:15 //line web/home.qtpl:17
qs422016 := string(qb422016.B) qs422016 := string(qb422016.B)
//line web/home.qtpl:15 //line web/home.qtpl:17
qt422016.ReleaseByteBuffer(qb422016) qt422016.ReleaseByteBuffer(qb422016)
//line web/home.qtpl:15 //line web/home.qtpl:17
return qs422016 return qs422016
//line web/home.qtpl:15 //line web/home.qtpl:17
} }
//line web/home.qtpl:17 //line web/home.qtpl:19
func (p *HomePage) StreamBody(qw422016 *qt422016.Writer) { func (p *HomePage) StreamBody(qw422016 *qt422016.Writer) {
//line web/home.qtpl:17 //line web/home.qtpl:19
qw422016.N().S(` <header class="h-app h-x-app"> <img class="u-logo" src="`) qw422016.N().S(` <header class="h-app h-x-app"> <img class="u-logo" src="`)
//line web/home.qtpl:21 //line web/home.qtpl:22
qw422016.E().S(p.Client.GetLogo().String()) qw422016.E().S(p.Client.GetLogo().String())
//line web/home.qtpl:21 //line web/home.qtpl:22
qw422016.N().S(`" alt="`) qw422016.N().S(`" alt="`)
//line web/home.qtpl:22 //line web/home.qtpl:23
qw422016.E().S(p.Client.GetName()) qw422016.E().S(p.Client.GetName())
//line web/home.qtpl:22 //line web/home.qtpl:23
qw422016.N().S(`" crossorigin="anonymous" decoding="async" height="140" importance="high" referrerpolicy="no-referrer-when-downgrade" width="140"> <h1> <a class="p-name u-url" href="`) qw422016.N().S(`" crossorigin="anonymous" decoding="async" height="140" importance="high" referrerpolicy="no-referrer-when-downgrade" width="140"> <h1> <a class="p-name u-url" href="`)
//line web/home.qtpl:33 //line web/home.qtpl:33
qw422016.E().S(p.Client.GetURL().String()) qw422016.E().S(p.Client.GetURL().String())
@ -95,58 +97,72 @@ func (p *HomePage) StreamBody(qw422016 *qt422016.Writer) {
//line web/home.qtpl:35 //line web/home.qtpl:35
qw422016.E().S(p.Client.GetName()) qw422016.E().S(p.Client.GetName())
//line web/home.qtpl:35 //line web/home.qtpl:35
qw422016.N().S(` </a> </h1> </header> <main> <form method="get" action="/authorize" enctype="application/x-www-form-urlencoded" accept-charset="utf-8" target="_self"> `) 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"> `)
//line web/home.qtpl:48 //line web/home.qtpl:48
for name, value := range map[string]string{ for name, value := range map[string]string{
"client_id": p.Client.ID.String(), "client_id": p.Client.ID.String(),
"redirect_uri": p.Client.RedirectURI[0].String(), "redirect_uri": p.Client.RedirectURI[0].String(),
"response_type": domain.ResponseTypeCode.String(), "response_type": domain.ResponseTypeCode.String(),
"state": p.State, "state": p.State,
"scope": domain.Scopes{domain.ScopeProfile, domain.ScopeEmail}.String(),
} { } {
//line web/home.qtpl:54 //line web/home.qtpl:53
qw422016.N().S(` <input type="hidden" name="`) qw422016.N().S(` <input type="hidden" name="`)
//line web/home.qtpl:57 //line web/home.qtpl:55
qw422016.E().S(name) qw422016.E().S(name)
//line web/home.qtpl:57 //line web/home.qtpl:55
qw422016.N().S(`" value="`) qw422016.N().S(`" value="`)
//line web/home.qtpl:58 //line web/home.qtpl:56
qw422016.E().S(value) qw422016.E().S(value)
//line web/home.qtpl:58 //line web/home.qtpl:56
qw422016.N().S(`"> `) qw422016.N().S(`"> `)
//line web/home.qtpl:59 //line web/home.qtpl:57
} }
//line web/home.qtpl:57
qw422016.N().S(` `)
//line web/home.qtpl:59 //line web/home.qtpl:59
for _, scope := range []domain.Scope{
domain.ScopeEmail,
domain.ScopeProfile,
} {
//line web/home.qtpl:62
qw422016.N().S(` <input type="hidden" name="scope[]" value="`)
//line web/home.qtpl:65
qw422016.E().S(scope.String())
//line web/home.qtpl:65
qw422016.N().S(`"> `)
//line web/home.qtpl:66
}
//line web/home.qtpl:66
qw422016.N().S(` <input type="url" name="me" placeholder="https://example.com/" inputmode="url" autocomplete="url" required> <button type="submit">`) qw422016.N().S(` <input type="url" name="me" placeholder="https://example.com/" inputmode="url" autocomplete="url" required> <button type="submit">`)
//line web/home.qtpl:69 //line web/home.qtpl:75
p.StreamT(qw422016, "Sign In") p.StreamT(qw422016, "Sign In")
//line web/home.qtpl:69 //line web/home.qtpl:75
qw422016.N().S(`</button> </form> </main> `) qw422016.N().S(`</button> </form> </main> `)
//line web/home.qtpl:72 //line web/home.qtpl:78
} }
//line web/home.qtpl:72 //line web/home.qtpl:78
func (p *HomePage) WriteBody(qq422016 qtio422016.Writer) { func (p *HomePage) WriteBody(qq422016 qtio422016.Writer) {
//line web/home.qtpl:72 //line web/home.qtpl:78
qw422016 := qt422016.AcquireWriter(qq422016) qw422016 := qt422016.AcquireWriter(qq422016)
//line web/home.qtpl:72 //line web/home.qtpl:78
p.StreamBody(qw422016) p.StreamBody(qw422016)
//line web/home.qtpl:72 //line web/home.qtpl:78
qt422016.ReleaseWriter(qw422016) qt422016.ReleaseWriter(qw422016)
//line web/home.qtpl:72 //line web/home.qtpl:78
} }
//line web/home.qtpl:72 //line web/home.qtpl:78
func (p *HomePage) Body() string { func (p *HomePage) Body() string {
//line web/home.qtpl:72 //line web/home.qtpl:78
qb422016 := qt422016.AcquireByteBuffer() qb422016 := qt422016.AcquireByteBuffer()
//line web/home.qtpl:72 //line web/home.qtpl:78
p.WriteBody(qb422016) p.WriteBody(qb422016)
//line web/home.qtpl:72 //line web/home.qtpl:78
qs422016 := string(qb422016.B) qs422016 := string(qb422016.B)
//line web/home.qtpl:72 //line web/home.qtpl:78
qt422016.ReleaseByteBuffer(qb422016) qt422016.ReleaseByteBuffer(qb422016)
//line web/home.qtpl:72 //line web/home.qtpl:78
return qs422016 return qs422016
//line web/home.qtpl:72 //line web/home.qtpl:78
} }

View File

@ -10,7 +10,7 @@
</header> </header>
<main> <main>
<form <form class=""
accept-charset="utf-8" accept-charset="utf-8"
action="/api/ticket" action="/api/ticket"
autocomplete="off" autocomplete="off"
@ -19,16 +19,14 @@
target="_self"> target="_self">
{% if p.CSRF != nil %} {% if p.CSRF != nil %}
<input <input type="hidden"
type="hidden"
name="_csrf" name="_csrf"
value="{%z p.CSRF %}"> value="{%z p.CSRF %}">
{% endif %} {% endif %}
<div> <div>
<label for="subject">{%= p.T("Recipient") %}</label> <label for="subject">{%= p.T("Recipient") %}</label>
<input <input id="subject"
id="subject"
type="url" type="url"
name="subject" name="subject"
inputmode="url" inputmode="url"
@ -38,8 +36,7 @@
<div> <div>
<label for="resource">{%= p.T("Resource") %}</label> <label for="resource">{%= p.T("Resource") %}</label>
<input <input id="resource"
id="resource"
type="url" type="url"
name="resource" name="resource"
inputmode="url" inputmode="url"

View File

@ -30,56 +30,56 @@ func (p *TicketPage) StreamBody(qw422016 *qt422016.Writer) {
//line web/ticket.qtpl:9 //line web/ticket.qtpl:9
p.StreamT(qw422016, "TicketAuth") p.StreamT(qw422016, "TicketAuth")
//line web/ticket.qtpl:9 //line web/ticket.qtpl:9
qw422016.N().S(`</h1> </header> <main> <form accept-charset="utf-8" action="/api/ticket" autocomplete="off" enctype="application/x-www-form-urlencoded" method="post" target="_self"> `) qw422016.N().S(`</h1> </header> <main> <form class="" accept-charset="utf-8" action="/api/ticket" autocomplete="off" enctype="application/x-www-form-urlencoded" method="post" target="_self"> `)
//line web/ticket.qtpl:21 //line web/ticket.qtpl:21
if p.CSRF != nil { if p.CSRF != nil {
//line web/ticket.qtpl:21 //line web/ticket.qtpl:21
qw422016.N().S(` <input type="hidden" name="_csrf" value="`) qw422016.N().S(` <input type="hidden" name="_csrf" value="`)
//line web/ticket.qtpl:25 //line web/ticket.qtpl:24
qw422016.E().Z(p.CSRF) qw422016.E().Z(p.CSRF)
//line web/ticket.qtpl:25 //line web/ticket.qtpl:24
qw422016.N().S(`"> `) qw422016.N().S(`"> `)
//line web/ticket.qtpl:26 //line web/ticket.qtpl:25
} }
//line web/ticket.qtpl:26 //line web/ticket.qtpl:25
qw422016.N().S(` <div> <label for="subject">`) qw422016.N().S(` <div> <label for="subject">`)
//line web/ticket.qtpl:29 //line web/ticket.qtpl:28
p.StreamT(qw422016, "Recipient") p.StreamT(qw422016, "Recipient")
//line web/ticket.qtpl:29 //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">`) 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:40 //line web/ticket.qtpl:38
p.StreamT(qw422016, "Resource") p.StreamT(qw422016, "Resource")
//line web/ticket.qtpl:40 //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">`) 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:50 //line web/ticket.qtpl:47
p.StreamT(qw422016, "Send") p.StreamT(qw422016, "Send")
//line web/ticket.qtpl:50 //line web/ticket.qtpl:47
qw422016.N().S(`</button> </form> </main> `) qw422016.N().S(`</button> </form> </main> `)
//line web/ticket.qtpl:53 //line web/ticket.qtpl:50
} }
//line web/ticket.qtpl:53 //line web/ticket.qtpl:50
func (p *TicketPage) WriteBody(qq422016 qtio422016.Writer) { func (p *TicketPage) WriteBody(qq422016 qtio422016.Writer) {
//line web/ticket.qtpl:53 //line web/ticket.qtpl:50
qw422016 := qt422016.AcquireWriter(qq422016) qw422016 := qt422016.AcquireWriter(qq422016)
//line web/ticket.qtpl:53 //line web/ticket.qtpl:50
p.StreamBody(qw422016) p.StreamBody(qw422016)
//line web/ticket.qtpl:53 //line web/ticket.qtpl:50
qt422016.ReleaseWriter(qw422016) qt422016.ReleaseWriter(qw422016)
//line web/ticket.qtpl:53 //line web/ticket.qtpl:50
} }
//line web/ticket.qtpl:53 //line web/ticket.qtpl:50
func (p *TicketPage) Body() string { func (p *TicketPage) Body() string {
//line web/ticket.qtpl:53 //line web/ticket.qtpl:50
qb422016 := qt422016.AcquireByteBuffer() qb422016 := qt422016.AcquireByteBuffer()
//line web/ticket.qtpl:53 //line web/ticket.qtpl:50
p.WriteBody(qb422016) p.WriteBody(qb422016)
//line web/ticket.qtpl:53 //line web/ticket.qtpl:50
qs422016 := string(qb422016.B) qs422016 := string(qb422016.B)
//line web/ticket.qtpl:53 //line web/ticket.qtpl:50
qt422016.ReleaseByteBuffer(qb422016) qt422016.ReleaseByteBuffer(qb422016)
//line web/ticket.qtpl:53 //line web/ticket.qtpl:50
return qs422016 return qs422016
//line web/ticket.qtpl:53 //line web/ticket.qtpl:50
} }