🎨 Format template files
This commit is contained in:
parent
43af05a02b
commit
834d27d939
10 changed files with 301 additions and 287 deletions
|
@ -71,11 +71,11 @@
|
|||
{% endif %}
|
||||
|
||||
{% for key, val := range map[string]string{
|
||||
"client_id": p.Client.ID.String(),
|
||||
"redirect_uri": p.RedirectURI.String(),
|
||||
"response_type": p.ResponseType.String(),
|
||||
"state": p.State,
|
||||
} %}
|
||||
"client_id": p.Client.ID.String(),
|
||||
"redirect_uri": p.RedirectURI.String(),
|
||||
"response_type": p.ResponseType.String(),
|
||||
"state": p.State,
|
||||
} %}
|
||||
<input type="hidden"
|
||||
name="{%s key %}"
|
||||
value="{%s val %}">
|
||||
|
@ -101,13 +101,14 @@
|
|||
{% endif %}
|
||||
|
||||
{% if p.CodeChallenge != "" %}
|
||||
{% for key, val := range map[string]string{
|
||||
"code_challenge": p.CodeChallenge,
|
||||
"code_challenge_method": p.CodeChallengeMethod.String(),
|
||||
} %}
|
||||
<input type="hidden"
|
||||
name="code_challenge"
|
||||
value="{%s p.CodeChallenge %}">
|
||||
|
||||
<input type="hidden"
|
||||
name="code_challenge_method"
|
||||
value="{%s p.CodeChallengeMethod.String() %}">
|
||||
name="{%s key %}"
|
||||
value="{%s val %}">
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% if p.Me != nil %}
|
||||
|
|
|
@ -292,98 +292,107 @@ func (p *AuthorizePage) StreamBody(qw422016 *qt422016.Writer) {
|
|||
if p.CodeChallenge != "" {
|
||||
//line web/authorize.qtpl:103
|
||||
qw422016.N().S(`
|
||||
`)
|
||||
//line web/authorize.qtpl:104
|
||||
for key, val := range map[string]string{
|
||||
"code_challenge": p.CodeChallenge,
|
||||
"code_challenge_method": p.CodeChallengeMethod.String(),
|
||||
} {
|
||||
//line web/authorize.qtpl:107
|
||||
qw422016.N().S(`
|
||||
<input type="hidden"
|
||||
name="code_challenge"
|
||||
value="`)
|
||||
//line web/authorize.qtpl:106
|
||||
qw422016.E().S(p.CodeChallenge)
|
||||
//line web/authorize.qtpl:106
|
||||
qw422016.N().S(`">
|
||||
|
||||
<input type="hidden"
|
||||
name="code_challenge_method"
|
||||
name="`)
|
||||
//line web/authorize.qtpl:109
|
||||
qw422016.E().S(key)
|
||||
//line web/authorize.qtpl:109
|
||||
qw422016.N().S(`"
|
||||
value="`)
|
||||
//line web/authorize.qtpl:110
|
||||
qw422016.E().S(p.CodeChallengeMethod.String())
|
||||
qw422016.E().S(val)
|
||||
//line web/authorize.qtpl:110
|
||||
qw422016.N().S(`">
|
||||
qw422016.N().S(`">
|
||||
`)
|
||||
//line web/authorize.qtpl:111
|
||||
}
|
||||
}
|
||||
//line web/authorize.qtpl:111
|
||||
qw422016.N().S(`
|
||||
`)
|
||||
//line web/authorize.qtpl:112
|
||||
}
|
||||
//line web/authorize.qtpl:112
|
||||
qw422016.N().S(`
|
||||
|
||||
`)
|
||||
//line web/authorize.qtpl:113
|
||||
//line web/authorize.qtpl:114
|
||||
if p.Me != nil {
|
||||
//line web/authorize.qtpl:113
|
||||
//line web/authorize.qtpl:114
|
||||
qw422016.N().S(`
|
||||
<input type="hidden"
|
||||
name="me"
|
||||
value="`)
|
||||
//line web/authorize.qtpl:116
|
||||
//line web/authorize.qtpl:117
|
||||
qw422016.E().S(p.Me.String())
|
||||
//line web/authorize.qtpl:116
|
||||
//line web/authorize.qtpl:117
|
||||
qw422016.N().S(`">
|
||||
`)
|
||||
//line web/authorize.qtpl:117
|
||||
//line web/authorize.qtpl:118
|
||||
}
|
||||
//line web/authorize.qtpl:117
|
||||
//line web/authorize.qtpl:118
|
||||
qw422016.N().S(`
|
||||
|
||||
`)
|
||||
//line web/authorize.qtpl:119
|
||||
//line web/authorize.qtpl:120
|
||||
if len(p.Providers) > 0 {
|
||||
//line web/authorize.qtpl:119
|
||||
//line web/authorize.qtpl:120
|
||||
qw422016.N().S(`
|
||||
<select name="provider"
|
||||
autocomplete
|
||||
required>
|
||||
|
||||
`)
|
||||
//line web/authorize.qtpl:124
|
||||
//line web/authorize.qtpl:125
|
||||
for _, provider := range p.Providers {
|
||||
//line web/authorize.qtpl:124
|
||||
//line web/authorize.qtpl:125
|
||||
qw422016.N().S(`
|
||||
<option value="`)
|
||||
//line web/authorize.qtpl:125
|
||||
//line web/authorize.qtpl:126
|
||||
qw422016.E().S(provider.UID)
|
||||
//line web/authorize.qtpl:125
|
||||
//line web/authorize.qtpl:126
|
||||
qw422016.N().S(`"
|
||||
`)
|
||||
//line web/authorize.qtpl:126
|
||||
//line web/authorize.qtpl:127
|
||||
if provider.UID == "mastodon" {
|
||||
//line web/authorize.qtpl:126
|
||||
//line web/authorize.qtpl:127
|
||||
qw422016.N().S(`selected`)
|
||||
//line web/authorize.qtpl:126
|
||||
//line web/authorize.qtpl:127
|
||||
}
|
||||
//line web/authorize.qtpl:126
|
||||
//line web/authorize.qtpl:127
|
||||
qw422016.N().S(`>
|
||||
|
||||
`)
|
||||
//line web/authorize.qtpl:128
|
||||
//line web/authorize.qtpl:129
|
||||
qw422016.E().S(provider.Name)
|
||||
//line web/authorize.qtpl:128
|
||||
//line web/authorize.qtpl:129
|
||||
qw422016.N().S(`
|
||||
</option>
|
||||
`)
|
||||
//line web/authorize.qtpl:130
|
||||
//line web/authorize.qtpl:131
|
||||
}
|
||||
//line web/authorize.qtpl:130
|
||||
//line web/authorize.qtpl:131
|
||||
qw422016.N().S(`
|
||||
</select>
|
||||
`)
|
||||
//line web/authorize.qtpl:132
|
||||
//line web/authorize.qtpl:133
|
||||
} else {
|
||||
//line web/authorize.qtpl:132
|
||||
//line web/authorize.qtpl:133
|
||||
qw422016.N().S(`
|
||||
<input type="hidden"
|
||||
name="provider"
|
||||
value="direct">
|
||||
`)
|
||||
//line web/authorize.qtpl:136
|
||||
//line web/authorize.qtpl:137
|
||||
}
|
||||
//line web/authorize.qtpl:136
|
||||
//line web/authorize.qtpl:137
|
||||
qw422016.N().S(`
|
||||
|
||||
<button type="submit"
|
||||
|
@ -391,9 +400,9 @@ func (p *AuthorizePage) StreamBody(qw422016 *qt422016.Writer) {
|
|||
value="deny">
|
||||
|
||||
`)
|
||||
//line web/authorize.qtpl:142
|
||||
//line web/authorize.qtpl:143
|
||||
p.StreamT(qw422016, "Deny")
|
||||
//line web/authorize.qtpl:142
|
||||
//line web/authorize.qtpl:143
|
||||
qw422016.N().S(`
|
||||
</button>
|
||||
|
||||
|
@ -402,39 +411,39 @@ func (p *AuthorizePage) StreamBody(qw422016 *qt422016.Writer) {
|
|||
value="allow">
|
||||
|
||||
`)
|
||||
//line web/authorize.qtpl:149
|
||||
//line web/authorize.qtpl:150
|
||||
p.StreamT(qw422016, "Allow")
|
||||
//line web/authorize.qtpl:149
|
||||
//line web/authorize.qtpl:150
|
||||
qw422016.N().S(`
|
||||
</button>
|
||||
</form>
|
||||
</main>
|
||||
`)
|
||||
//line web/authorize.qtpl:153
|
||||
//line web/authorize.qtpl:154
|
||||
}
|
||||
|
||||
//line web/authorize.qtpl:153
|
||||
//line web/authorize.qtpl:154
|
||||
func (p *AuthorizePage) WriteBody(qq422016 qtio422016.Writer) {
|
||||
//line web/authorize.qtpl:153
|
||||
//line web/authorize.qtpl:154
|
||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||
//line web/authorize.qtpl:153
|
||||
//line web/authorize.qtpl:154
|
||||
p.StreamBody(qw422016)
|
||||
//line web/authorize.qtpl:153
|
||||
//line web/authorize.qtpl:154
|
||||
qt422016.ReleaseWriter(qw422016)
|
||||
//line web/authorize.qtpl:153
|
||||
//line web/authorize.qtpl:154
|
||||
}
|
||||
|
||||
//line web/authorize.qtpl:153
|
||||
//line web/authorize.qtpl:154
|
||||
func (p *AuthorizePage) Body() string {
|
||||
//line web/authorize.qtpl:153
|
||||
//line web/authorize.qtpl:154
|
||||
qb422016 := qt422016.AcquireByteBuffer()
|
||||
//line web/authorize.qtpl:153
|
||||
//line web/authorize.qtpl:154
|
||||
p.WriteBody(qb422016)
|
||||
//line web/authorize.qtpl:153
|
||||
//line web/authorize.qtpl:154
|
||||
qs422016 := string(qb422016.B)
|
||||
//line web/authorize.qtpl:153
|
||||
//line web/authorize.qtpl:154
|
||||
qt422016.ReleaseByteBuffer(qb422016)
|
||||
//line web/authorize.qtpl:153
|
||||
//line web/authorize.qtpl:154
|
||||
return qs422016
|
||||
//line web/authorize.qtpl:153
|
||||
//line web/authorize.qtpl:154
|
||||
}
|
||||
|
|
|
@ -23,55 +23,57 @@
|
|||
|
||||
{% stripspace %}
|
||||
{% func (p *BaseOf) Lang() %}
|
||||
{% if p.Language != language.Und %}
|
||||
{%s p.Language.String() %}
|
||||
{% else %}
|
||||
en
|
||||
{% endif %}
|
||||
{% if p.Language != language.Und %}
|
||||
{%s p.Language.String() %}
|
||||
{% else %}
|
||||
en
|
||||
{% endif %}
|
||||
{% endfunc %}
|
||||
{% endstripspace %}
|
||||
|
||||
{% collapsespace %}
|
||||
{% func (p *BaseOf) Title() %}
|
||||
{%s p.Config.Name %}
|
||||
{%s p.Config.Name %}
|
||||
{% endfunc %}
|
||||
|
||||
{% 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="{%s p.Config.Server.StaticURLPrefix %}/favicon.ico"
|
||||
sizes="any">
|
||||
{% comment %}https://evilmartians.com/chronicles/how-to-favicon-in-2021-six-files-that-fit-most-needs{% endcomment %}
|
||||
<link rel="icon"
|
||||
href="{%s p.Config.Server.StaticURLPrefix %}/favicon.ico"
|
||||
sizes="any">
|
||||
|
||||
<link rel="icon"
|
||||
href="{%s p.Config.Server.StaticURLPrefix %}/icon.svg"
|
||||
type="image/svg+xml">
|
||||
<link rel="icon"
|
||||
href="{%s p.Config.Server.StaticURLPrefix %}/icon.svg"
|
||||
type="image/svg+xml">
|
||||
|
||||
<link rel="apple-touch-icon"
|
||||
href="{%s p.Config.Server.StaticURLPrefix %}/apple-touch-icon.png">
|
||||
<link rel="apple-touch-icon"
|
||||
href="{%s p.Config.Server.StaticURLPrefix %}/apple-touch-icon.png">
|
||||
|
||||
<link rel="manifest"
|
||||
href="{%s p.Config.Server.StaticURLPrefix %}/manifest.webmanifest">
|
||||
<link rel="manifest"
|
||||
href="{%s p.Config.Server.StaticURLPrefix %}/manifest.webmanifest">
|
||||
{% endfunc %}
|
||||
|
||||
{% func (p *BaseOf) Body() %}{% endfunc %}
|
||||
|
||||
{% func Template(p Page) %}
|
||||
<!DOCTYPE html>
|
||||
<html class="page"
|
||||
lang="{%= p.Lang() %}">
|
||||
<!DOCTYPE html>
|
||||
<html class="page"
|
||||
lang="{%= p.Lang() %}">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport"
|
||||
content="width=device-width, initial-scale=1.0">
|
||||
|
||||
{%= p.Head() %}
|
||||
|
||||
<title>{%= p.Title() %}</title>
|
||||
</head>
|
||||
<body class="page__body body">
|
||||
{%= p.Body() %}
|
||||
{%= p.Head() %}
|
||||
|
||||
{% code
|
||||
<title>{%= p.Title() %}</title>
|
||||
</head>
|
||||
|
||||
<body class="page__body body">
|
||||
{%= p.Body() %}
|
||||
|
||||
{% code
|
||||
var path, vcsRevision string
|
||||
|
||||
if bi, ok := debug.ReadBuildInfo(); ok {
|
||||
|
@ -87,21 +89,22 @@
|
|||
}
|
||||
%}
|
||||
|
||||
{% if vcsRevision != "" %}
|
||||
<footer>
|
||||
<small>
|
||||
{%= p.T("version") %}
|
||||
<a href="https://{%s path %}/commit/{%s vcsRevision %}" target="_blank">
|
||||
{%s vcsRevision[:7] -%}
|
||||
</a>
|
||||
</small>
|
||||
</footer>
|
||||
{% endif %}
|
||||
</body>
|
||||
</html>
|
||||
{% if vcsRevision != "" %}
|
||||
<footer>
|
||||
<small>
|
||||
{%= p.T("version") %}
|
||||
<a href="https://{%s path %}/commit/{%s vcsRevision %}"
|
||||
target="_blank">
|
||||
{%s vcsRevision[:7] -%}
|
||||
</a>
|
||||
</small>
|
||||
</footer>
|
||||
{% endif %}
|
||||
</body>
|
||||
</html>
|
||||
{% endfunc %}
|
||||
|
||||
{% func (p *BaseOf) T(format string, args ...interface{}) %}
|
||||
{%s p.Printer.Sprintf(format, args...) %}
|
||||
{%s p.Printer.Sprintf(format, args...) %}
|
||||
{% endfunc %}
|
||||
{% endcollapsespace %}
|
||||
|
|
|
@ -237,19 +237,19 @@ func StreamTemplate(qw422016 *qt422016.Writer, p Page) {
|
|||
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:67
|
||||
//line web/baseof.qtpl:68
|
||||
p.StreamHead(qw422016)
|
||||
//line web/baseof.qtpl:67
|
||||
//line web/baseof.qtpl:68
|
||||
qw422016.N().S(` <title>`)
|
||||
//line web/baseof.qtpl:69
|
||||
//line web/baseof.qtpl:70
|
||||
p.StreamTitle(qw422016)
|
||||
//line web/baseof.qtpl:69
|
||||
//line web/baseof.qtpl:70
|
||||
qw422016.N().S(`</title> </head> <body class="page__body body"> `)
|
||||
//line web/baseof.qtpl:72
|
||||
//line web/baseof.qtpl:74
|
||||
p.StreamBody(qw422016)
|
||||
//line web/baseof.qtpl:72
|
||||
//line web/baseof.qtpl:74
|
||||
qw422016.N().S(` `)
|
||||
//line web/baseof.qtpl:75
|
||||
//line web/baseof.qtpl:77
|
||||
var path, vcsRevision string
|
||||
|
||||
if bi, ok := debug.ReadBuildInfo(); ok {
|
||||
|
@ -264,94 +264,94 @@ func StreamTemplate(qw422016 *qt422016.Writer, p Page) {
|
|||
}
|
||||
}
|
||||
|
||||
//line web/baseof.qtpl:88
|
||||
qw422016.N().S(` `)
|
||||
//line web/baseof.qtpl:90
|
||||
qw422016.N().S(` `)
|
||||
//line web/baseof.qtpl:92
|
||||
if vcsRevision != "" {
|
||||
//line web/baseof.qtpl:90
|
||||
//line web/baseof.qtpl:92
|
||||
qw422016.N().S(` <footer> <small> `)
|
||||
//line web/baseof.qtpl:93
|
||||
//line web/baseof.qtpl:95
|
||||
p.StreamT(qw422016, "version")
|
||||
//line web/baseof.qtpl:93
|
||||
//line web/baseof.qtpl:95
|
||||
qw422016.N().S(` <a href="https://`)
|
||||
//line web/baseof.qtpl:94
|
||||
//line web/baseof.qtpl:96
|
||||
qw422016.E().S(path)
|
||||
//line web/baseof.qtpl:94
|
||||
//line web/baseof.qtpl:96
|
||||
qw422016.N().S(`/commit/`)
|
||||
//line web/baseof.qtpl:94
|
||||
//line web/baseof.qtpl:96
|
||||
qw422016.E().S(vcsRevision)
|
||||
//line web/baseof.qtpl:94
|
||||
//line web/baseof.qtpl:96
|
||||
qw422016.N().S(`" target="_blank"> `)
|
||||
//line web/baseof.qtpl:95
|
||||
//line web/baseof.qtpl:98
|
||||
qw422016.E().S(vcsRevision[:7])
|
||||
//line web/baseof.qtpl:95
|
||||
//line web/baseof.qtpl:98
|
||||
qw422016.N().S(`</a> </small> </footer> `)
|
||||
//line web/baseof.qtpl:99
|
||||
//line web/baseof.qtpl:102
|
||||
}
|
||||
//line web/baseof.qtpl:99
|
||||
//line web/baseof.qtpl:102
|
||||
qw422016.N().S(` </body> </html> `)
|
||||
//line web/baseof.qtpl:102
|
||||
//line web/baseof.qtpl:105
|
||||
}
|
||||
|
||||
//line web/baseof.qtpl:102
|
||||
//line web/baseof.qtpl:105
|
||||
func WriteTemplate(qq422016 qtio422016.Writer, p Page) {
|
||||
//line web/baseof.qtpl:102
|
||||
//line web/baseof.qtpl:105
|
||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||
//line web/baseof.qtpl:102
|
||||
//line web/baseof.qtpl:105
|
||||
StreamTemplate(qw422016, p)
|
||||
//line web/baseof.qtpl:102
|
||||
//line web/baseof.qtpl:105
|
||||
qt422016.ReleaseWriter(qw422016)
|
||||
//line web/baseof.qtpl:102
|
||||
//line web/baseof.qtpl:105
|
||||
}
|
||||
|
||||
//line web/baseof.qtpl:102
|
||||
//line web/baseof.qtpl:105
|
||||
func Template(p Page) string {
|
||||
//line web/baseof.qtpl:102
|
||||
//line web/baseof.qtpl:105
|
||||
qb422016 := qt422016.AcquireByteBuffer()
|
||||
//line web/baseof.qtpl:102
|
||||
//line web/baseof.qtpl:105
|
||||
WriteTemplate(qb422016, p)
|
||||
//line web/baseof.qtpl:102
|
||||
//line web/baseof.qtpl:105
|
||||
qs422016 := string(qb422016.B)
|
||||
//line web/baseof.qtpl:102
|
||||
//line web/baseof.qtpl:105
|
||||
qt422016.ReleaseByteBuffer(qb422016)
|
||||
//line web/baseof.qtpl:102
|
||||
//line web/baseof.qtpl:105
|
||||
return qs422016
|
||||
//line web/baseof.qtpl:102
|
||||
//line web/baseof.qtpl:105
|
||||
}
|
||||
|
||||
//line web/baseof.qtpl:104
|
||||
//line web/baseof.qtpl:107
|
||||
func (p *BaseOf) StreamT(qw422016 *qt422016.Writer, format string, args ...interface{}) {
|
||||
//line web/baseof.qtpl:104
|
||||
//line web/baseof.qtpl:107
|
||||
qw422016.N().S(` `)
|
||||
//line web/baseof.qtpl:105
|
||||
//line web/baseof.qtpl:108
|
||||
qw422016.E().S(p.Printer.Sprintf(format, args...))
|
||||
//line web/baseof.qtpl:105
|
||||
//line web/baseof.qtpl:108
|
||||
qw422016.N().S(` `)
|
||||
//line web/baseof.qtpl:106
|
||||
//line web/baseof.qtpl:109
|
||||
}
|
||||
|
||||
//line web/baseof.qtpl:106
|
||||
//line web/baseof.qtpl:109
|
||||
func (p *BaseOf) WriteT(qq422016 qtio422016.Writer, format string, args ...interface{}) {
|
||||
//line web/baseof.qtpl:106
|
||||
//line web/baseof.qtpl:109
|
||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||
//line web/baseof.qtpl:106
|
||||
//line web/baseof.qtpl:109
|
||||
p.StreamT(qw422016, format, args...)
|
||||
//line web/baseof.qtpl:106
|
||||
//line web/baseof.qtpl:109
|
||||
qt422016.ReleaseWriter(qw422016)
|
||||
//line web/baseof.qtpl:106
|
||||
//line web/baseof.qtpl:109
|
||||
}
|
||||
|
||||
//line web/baseof.qtpl:106
|
||||
//line web/baseof.qtpl:109
|
||||
func (p *BaseOf) T(format string, args ...interface{}) string {
|
||||
//line web/baseof.qtpl:106
|
||||
//line web/baseof.qtpl:109
|
||||
qb422016 := qt422016.AcquireByteBuffer()
|
||||
//line web/baseof.qtpl:106
|
||||
//line web/baseof.qtpl:109
|
||||
p.WriteT(qb422016, format, args...)
|
||||
//line web/baseof.qtpl:106
|
||||
//line web/baseof.qtpl:109
|
||||
qs422016 := string(qb422016.B)
|
||||
//line web/baseof.qtpl:106
|
||||
//line web/baseof.qtpl:109
|
||||
qt422016.ReleaseByteBuffer(qb422016)
|
||||
//line web/baseof.qtpl:106
|
||||
//line web/baseof.qtpl:109
|
||||
return qs422016
|
||||
//line web/baseof.qtpl:106
|
||||
//line web/baseof.qtpl:109
|
||||
}
|
||||
|
|
|
@ -9,9 +9,9 @@
|
|||
|
||||
{% collapsespace %}
|
||||
{% func (p *CallbackPage) Body() %}
|
||||
{% if p.Token != nil %}
|
||||
<h1>{%s p.Token.Me.String() %}</h1>
|
||||
<small>{%s p.Token.AccessToken %}</small>
|
||||
{% endif %}
|
||||
{% if p.Token != nil %}
|
||||
<h1>{%s p.Token.Me.String() %}</h1>
|
||||
<small>{%s p.Token.AccessToken %}</small>
|
||||
{% endif %}
|
||||
{% endfunc %}
|
||||
{% endcollapsespace %}
|
||||
|
|
|
@ -11,31 +11,31 @@
|
|||
|
||||
{% collapsespace %}
|
||||
{% func (p *ErrorPage) Title() %}
|
||||
{%s p.T("Error") %}
|
||||
{%s p.T("Error") %}
|
||||
{% endfunc %}
|
||||
|
||||
{% func (p *ErrorPage) Body() %}
|
||||
<main>
|
||||
{% code err := new(domain.Error) %}
|
||||
{% if errors.As(p.Error, err) %}
|
||||
<h1>{%s err.Code.String() %}</h1>
|
||||
<main>
|
||||
{% code err := new(domain.Error) %}
|
||||
{% if errors.As(p.Error, err) %}
|
||||
<h1>{%s err.Code.String() %}</h1>
|
||||
|
||||
{% if err.Description != "" %}
|
||||
<p>{%s err.Description %}</p>
|
||||
{% endif %}
|
||||
{% if err.Description != "" %}
|
||||
<p>{%s err.Description %}</p>
|
||||
{% endif %}
|
||||
|
||||
{% if err.URI != "" %}
|
||||
<a rel="noreferrer noopener"
|
||||
href="{%s err.URI %}"
|
||||
target="_blank">
|
||||
{% if err.URI != "" %}
|
||||
<a rel="noreferrer noopener"
|
||||
href="{%s err.URI %}"
|
||||
target="_blank">
|
||||
|
||||
{%s p.T("How do I fix it?") %}
|
||||
</a>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<h1>{%s p.T("Error") %}</h1>
|
||||
<p>{%s p.Error.Error() %}</p>
|
||||
{% endif %}
|
||||
</main>
|
||||
{%s p.T("How do I fix it?") %}
|
||||
</a>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<h1>{%s p.T("Error") %}</h1>
|
||||
<p>{%s p.Error.Error() %}</p>
|
||||
{% endif %}
|
||||
</main>
|
||||
{% endfunc %}
|
||||
{% endcollapsespace %}
|
||||
|
|
|
@ -10,70 +10,71 @@
|
|||
|
||||
{% collapsespace %}
|
||||
{% 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 %}
|
||||
{%= 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() %}
|
||||
<header class="h-app h-x-app">
|
||||
<img class="u-logo"
|
||||
src="{%s p.Client.GetLogo().String() %}"
|
||||
alt="{%s p.Client.GetName() %}"
|
||||
crossorigin="anonymous"
|
||||
decoding="async"
|
||||
height="140"
|
||||
importance="high"
|
||||
referrerpolicy="no-referrer-when-downgrade"
|
||||
width="140">
|
||||
<header class="h-app h-x-app">
|
||||
<img class="u-logo"
|
||||
src="{%s p.Client.GetLogo().String() %}"
|
||||
alt="{%s p.Client.GetName() %}"
|
||||
crossorigin="anonymous"
|
||||
decoding="async"
|
||||
height="140"
|
||||
importance="high"
|
||||
referrerpolicy="no-referrer-when-downgrade"
|
||||
width="140">
|
||||
|
||||
<h1>
|
||||
<a class="p-name u-url"
|
||||
href="{%s p.Client.GetURL().String() %}">
|
||||
<h1>
|
||||
<a class="p-name u-url"
|
||||
href="{%s p.Client.GetURL().String() %}">
|
||||
|
||||
{%s p.Client.GetName() %}
|
||||
</a>
|
||||
</h1>
|
||||
</header>
|
||||
{%s p.Client.GetName() %}
|
||||
</a>
|
||||
</h1>
|
||||
</header>
|
||||
|
||||
<main>
|
||||
<form class=""
|
||||
method="get"
|
||||
action="/authorize"
|
||||
enctype="application/x-www-form-urlencoded"
|
||||
accept-charset="utf-8"
|
||||
target="_self">
|
||||
<main>
|
||||
<form class=""
|
||||
method="get"
|
||||
action="/authorize"
|
||||
enctype="application/x-www-form-urlencoded"
|
||||
accept-charset="utf-8"
|
||||
target="_self">
|
||||
|
||||
{% for name, value := range map[string]string{
|
||||
{% for name, value := range map[string]string{
|
||||
"client_id": p.Client.ID.String(),
|
||||
"redirect_uri": p.Client.RedirectURI[0].String(),
|
||||
"response_type": domain.ResponseTypeCode.String(),
|
||||
"state": p.State,
|
||||
} %}
|
||||
<input type="hidden"
|
||||
name="{%s name %}"
|
||||
value="{%s value %}">
|
||||
{% endfor %}
|
||||
|
||||
{% for _, scope := range []domain.Scope{
|
||||
<input type="hidden"
|
||||
name="{%s name %}"
|
||||
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="hidden"
|
||||
name="scope[]"
|
||||
value="{%s scope.String() %}">
|
||||
{% endfor %}
|
||||
|
||||
<input type="url"
|
||||
name="me"
|
||||
placeholder="https://example.com/"
|
||||
inputmode="url"
|
||||
autocomplete="url"
|
||||
required>
|
||||
<input type="url"
|
||||
name="me"
|
||||
placeholder="https://example.com/"
|
||||
inputmode="url"
|
||||
autocomplete="url"
|
||||
required>
|
||||
|
||||
<button type="submit">{%= p.T("Sign In") %}</button>
|
||||
</form>
|
||||
</main>
|
||||
<button type="submit">{%= p.T("Sign In") %}</button>
|
||||
</form>
|
||||
</main>
|
||||
{% endfunc %}
|
||||
{% endcollapsespace %}
|
||||
|
|
112
web/home.qtpl.go
112
web/home.qtpl.go
|
@ -41,128 +41,128 @@ func (p *HomePage) StreamHead(qw422016 *qt422016.Writer) {
|
|||
for i := range p.Client.RedirectURI {
|
||||
//line web/home.qtpl:14
|
||||
qw422016.N().S(` <link rel="redirect_uri" href="`)
|
||||
//line web/home.qtpl:15
|
||||
//line web/home.qtpl:16
|
||||
qw422016.E().S(p.Client.RedirectURI[i].String())
|
||||
//line web/home.qtpl:15
|
||||
//line web/home.qtpl:16
|
||||
qw422016.N().S(`"> `)
|
||||
//line web/home.qtpl:16
|
||||
//line web/home.qtpl:17
|
||||
}
|
||||
//line web/home.qtpl:16
|
||||
//line web/home.qtpl:17
|
||||
qw422016.N().S(` `)
|
||||
//line web/home.qtpl:17
|
||||
//line web/home.qtpl:18
|
||||
}
|
||||
|
||||
//line web/home.qtpl:17
|
||||
//line web/home.qtpl:18
|
||||
func (p *HomePage) WriteHead(qq422016 qtio422016.Writer) {
|
||||
//line web/home.qtpl:17
|
||||
//line web/home.qtpl:18
|
||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||
//line web/home.qtpl:17
|
||||
//line web/home.qtpl:18
|
||||
p.StreamHead(qw422016)
|
||||
//line web/home.qtpl:17
|
||||
//line web/home.qtpl:18
|
||||
qt422016.ReleaseWriter(qw422016)
|
||||
//line web/home.qtpl:17
|
||||
//line web/home.qtpl:18
|
||||
}
|
||||
|
||||
//line web/home.qtpl:17
|
||||
//line web/home.qtpl:18
|
||||
func (p *HomePage) Head() string {
|
||||
//line web/home.qtpl:17
|
||||
//line web/home.qtpl:18
|
||||
qb422016 := qt422016.AcquireByteBuffer()
|
||||
//line web/home.qtpl:17
|
||||
//line web/home.qtpl:18
|
||||
p.WriteHead(qb422016)
|
||||
//line web/home.qtpl:17
|
||||
//line web/home.qtpl:18
|
||||
qs422016 := string(qb422016.B)
|
||||
//line web/home.qtpl:17
|
||||
//line web/home.qtpl:18
|
||||
qt422016.ReleaseByteBuffer(qb422016)
|
||||
//line web/home.qtpl:17
|
||||
//line web/home.qtpl:18
|
||||
return qs422016
|
||||
//line web/home.qtpl:17
|
||||
//line web/home.qtpl:18
|
||||
}
|
||||
|
||||
//line web/home.qtpl:19
|
||||
//line web/home.qtpl:20
|
||||
func (p *HomePage) StreamBody(qw422016 *qt422016.Writer) {
|
||||
//line web/home.qtpl:19
|
||||
//line web/home.qtpl:20
|
||||
qw422016.N().S(` <header class="h-app h-x-app"> <img class="u-logo" src="`)
|
||||
//line web/home.qtpl:22
|
||||
//line web/home.qtpl:23
|
||||
qw422016.E().S(p.Client.GetLogo().String())
|
||||
//line web/home.qtpl:22
|
||||
//line web/home.qtpl:23
|
||||
qw422016.N().S(`" alt="`)
|
||||
//line web/home.qtpl:23
|
||||
//line web/home.qtpl:24
|
||||
qw422016.E().S(p.Client.GetName())
|
||||
//line web/home.qtpl:23
|
||||
//line web/home.qtpl:24
|
||||
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:34
|
||||
qw422016.E().S(p.Client.GetURL().String())
|
||||
//line web/home.qtpl:33
|
||||
//line web/home.qtpl:34
|
||||
qw422016.N().S(`"> `)
|
||||
//line web/home.qtpl:35
|
||||
//line web/home.qtpl:36
|
||||
qw422016.E().S(p.Client.GetName())
|
||||
//line web/home.qtpl:35
|
||||
//line web/home.qtpl:36
|
||||
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:49
|
||||
for name, value := range map[string]string{
|
||||
"client_id": p.Client.ID.String(),
|
||||
"redirect_uri": p.Client.RedirectURI[0].String(),
|
||||
"response_type": domain.ResponseTypeCode.String(),
|
||||
"state": p.State,
|
||||
} {
|
||||
//line web/home.qtpl:53
|
||||
//line web/home.qtpl:54
|
||||
qw422016.N().S(` <input type="hidden" name="`)
|
||||
//line web/home.qtpl:55
|
||||
//line web/home.qtpl:56
|
||||
qw422016.E().S(name)
|
||||
//line web/home.qtpl:55
|
||||
//line web/home.qtpl:56
|
||||
qw422016.N().S(`" value="`)
|
||||
//line web/home.qtpl:56
|
||||
//line web/home.qtpl:57
|
||||
qw422016.E().S(value)
|
||||
//line web/home.qtpl:56
|
||||
//line web/home.qtpl:57
|
||||
qw422016.N().S(`"> `)
|
||||
//line web/home.qtpl:57
|
||||
//line web/home.qtpl:58
|
||||
}
|
||||
//line web/home.qtpl:57
|
||||
//line web/home.qtpl:58
|
||||
qw422016.N().S(` `)
|
||||
//line web/home.qtpl:59
|
||||
//line web/home.qtpl:60
|
||||
for _, scope := range []domain.Scope{
|
||||
domain.ScopeEmail,
|
||||
domain.ScopeProfile,
|
||||
} {
|
||||
//line web/home.qtpl:62
|
||||
//line web/home.qtpl:63
|
||||
qw422016.N().S(` <input type="hidden" name="scope[]" value="`)
|
||||
//line web/home.qtpl:65
|
||||
//line web/home.qtpl:66
|
||||
qw422016.E().S(scope.String())
|
||||
//line web/home.qtpl:65
|
||||
//line web/home.qtpl:66
|
||||
qw422016.N().S(`"> `)
|
||||
//line web/home.qtpl:66
|
||||
//line web/home.qtpl:67
|
||||
}
|
||||
//line web/home.qtpl:66
|
||||
//line web/home.qtpl:67
|
||||
qw422016.N().S(` <input type="url" name="me" placeholder="https://example.com/" inputmode="url" autocomplete="url" required> <button type="submit">`)
|
||||
//line web/home.qtpl:75
|
||||
//line web/home.qtpl:76
|
||||
p.StreamT(qw422016, "Sign In")
|
||||
//line web/home.qtpl:75
|
||||
//line web/home.qtpl:76
|
||||
qw422016.N().S(`</button> </form> </main> `)
|
||||
//line web/home.qtpl:78
|
||||
//line web/home.qtpl:79
|
||||
}
|
||||
|
||||
//line web/home.qtpl:78
|
||||
//line web/home.qtpl:79
|
||||
func (p *HomePage) WriteBody(qq422016 qtio422016.Writer) {
|
||||
//line web/home.qtpl:78
|
||||
//line web/home.qtpl:79
|
||||
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||
//line web/home.qtpl:78
|
||||
//line web/home.qtpl:79
|
||||
p.StreamBody(qw422016)
|
||||
//line web/home.qtpl:78
|
||||
//line web/home.qtpl:79
|
||||
qt422016.ReleaseWriter(qw422016)
|
||||
//line web/home.qtpl:78
|
||||
//line web/home.qtpl:79
|
||||
}
|
||||
|
||||
//line web/home.qtpl:78
|
||||
//line web/home.qtpl:79
|
||||
func (p *HomePage) Body() string {
|
||||
//line web/home.qtpl:78
|
||||
//line web/home.qtpl:79
|
||||
qb422016 := qt422016.AcquireByteBuffer()
|
||||
//line web/home.qtpl:78
|
||||
//line web/home.qtpl:79
|
||||
p.WriteBody(qb422016)
|
||||
//line web/home.qtpl:78
|
||||
//line web/home.qtpl:79
|
||||
qs422016 := string(qb422016.B)
|
||||
//line web/home.qtpl:78
|
||||
//line web/home.qtpl:79
|
||||
qt422016.ReleaseByteBuffer(qb422016)
|
||||
//line web/home.qtpl:78
|
||||
//line web/home.qtpl:79
|
||||
return qs422016
|
||||
//line web/home.qtpl:78
|
||||
//line web/home.qtpl:79
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
type="url"
|
||||
name="subject"
|
||||
inputmode="url"
|
||||
placeholder="https://bob.example.org"
|
||||
placeholder="https://bob.example.org/"
|
||||
required>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ func (p *TicketPage) StreamBody(qw422016 *qt422016.Writer) {
|
|||
//line web/ticket.qtpl:28
|
||||
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">`)
|
||||
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")
|
||||
//line web/ticket.qtpl:38
|
||||
|
|
Loading…
Reference in a new issue