1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2024-10-31 04:06:16 +00:00
mycorrhiza/templates/auth.qtpl.go

225 lines
5.6 KiB
Go
Raw Normal View History

2020-11-14 13:03:06 +00:00
// Code generated by qtc from "auth.qtpl". DO NOT EDIT.
// See https://github.com/valyala/quicktemplate for details.
//line templates/auth.qtpl:1
package templates
//line templates/auth.qtpl:1
import "github.com/bouncepaw/mycorrhiza/user"
//line templates/auth.qtpl:3
import (
qtio422016 "io"
qt422016 "github.com/valyala/quicktemplate"
)
//line templates/auth.qtpl:3
var (
_ = qtio422016.Copy
_ = qt422016.AcquireByteBuffer
)
//line templates/auth.qtpl:3
func StreamLoginHTML(qw422016 *qt422016.Writer) {
//line templates/auth.qtpl:3
qw422016.N().S(`
2021-01-26 05:41:57 +00:00
<div class="layout">
<main class="main-width">
2020-11-14 13:03:06 +00:00
<section>
`)
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:7
2020-11-14 13:03:06 +00:00
if user.AuthUsed {
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:7
2020-11-14 13:03:06 +00:00
qw422016.N().S(`
<h1>Login</h1>
<form method="post" action="/login-data" id="login-form" enctype="multipart/form-data">
<p>Use the data you were given by an administrator.</p>
2020-11-14 13:03:06 +00:00
<fieldset>
<legend>Username</legend>
<input type="text" required autofocus name="username" autocomplete="on">
</fieldset>
<fieldset>
<legend>Password</legend>
<input type="password" required name="password" autocomplete="on">
</fieldset>
<p>By submitting this form you give this wiki a permission to store cookies in your browser. It lets the engine associate your edits with you. You will stay logged in until you log out.</p>
2020-11-14 13:03:06 +00:00
<input type="submit">
<a href="/">Cancel</a>
</form>
`)
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:23
2020-11-14 13:03:06 +00:00
} else {
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:23
2020-11-14 13:03:06 +00:00
qw422016.N().S(`
<p>Administrator of this wiki have not configured any authorization method. You can make edits anonymously.</p>
<p><a href="/"> Go home</a></p>
`)
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:26
2020-11-14 13:03:06 +00:00
}
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:26
2020-11-14 13:03:06 +00:00
qw422016.N().S(`
</section>
</main>
2021-01-26 05:41:57 +00:00
</div>
2020-11-14 13:03:06 +00:00
`)
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:30
2020-11-14 13:03:06 +00:00
}
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:30
2020-11-14 13:03:06 +00:00
func WriteLoginHTML(qq422016 qtio422016.Writer) {
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:30
2020-11-14 13:03:06 +00:00
qw422016 := qt422016.AcquireWriter(qq422016)
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:30
2020-11-14 13:03:06 +00:00
StreamLoginHTML(qw422016)
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:30
2020-11-14 13:03:06 +00:00
qt422016.ReleaseWriter(qw422016)
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:30
2020-11-14 13:03:06 +00:00
}
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:30
2020-11-14 13:03:06 +00:00
func LoginHTML() string {
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:30
2020-11-14 13:03:06 +00:00
qb422016 := qt422016.AcquireByteBuffer()
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:30
2020-11-14 13:03:06 +00:00
WriteLoginHTML(qb422016)
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:30
2020-11-14 13:03:06 +00:00
qs422016 := string(qb422016.B)
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:30
2020-11-14 13:03:06 +00:00
qt422016.ReleaseByteBuffer(qb422016)
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:30
2020-11-14 13:03:06 +00:00
return qs422016
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:30
2020-11-14 13:03:06 +00:00
}
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:32
2020-11-14 13:03:06 +00:00
func StreamLoginErrorHTML(qw422016 *qt422016.Writer, err string) {
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:32
2020-11-14 13:03:06 +00:00
qw422016.N().S(`
2021-01-26 05:41:57 +00:00
<div class="layout">
<main class="main-width">
2020-11-14 13:03:06 +00:00
<section>
`)
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:36
2020-11-14 13:03:06 +00:00
switch err {
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:37
2020-11-14 13:03:06 +00:00
case "unknown username":
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:37
2020-11-14 13:03:06 +00:00
qw422016.N().S(`
<p class="error">Unknown username.</p>
`)
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:39
2020-11-14 13:03:06 +00:00
case "wrong password":
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:39
2020-11-14 13:03:06 +00:00
qw422016.N().S(`
<p class="error">Wrong password.</p>
`)
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:41
2020-11-14 13:03:06 +00:00
default:
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:41
2020-11-14 13:03:06 +00:00
qw422016.N().S(`
<p class="error">`)
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:42
2020-11-14 13:03:06 +00:00
qw422016.E().S(err)
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:42
2020-11-14 13:03:06 +00:00
qw422016.N().S(`</p>
`)
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:43
2020-11-14 13:03:06 +00:00
}
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:43
2020-11-14 13:03:06 +00:00
qw422016.N().S(`
<p><a href="/login"> Try again</a></p>
</section>
</main>
2021-01-26 05:41:57 +00:00
</div>
2020-11-14 13:03:06 +00:00
`)
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:48
2020-11-14 13:03:06 +00:00
}
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:48
2020-11-14 13:03:06 +00:00
func WriteLoginErrorHTML(qq422016 qtio422016.Writer, err string) {
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:48
2020-11-14 13:03:06 +00:00
qw422016 := qt422016.AcquireWriter(qq422016)
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:48
2020-11-14 13:03:06 +00:00
StreamLoginErrorHTML(qw422016, err)
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:48
2020-11-14 13:03:06 +00:00
qt422016.ReleaseWriter(qw422016)
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:48
2020-11-14 13:03:06 +00:00
}
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:48
2020-11-14 13:03:06 +00:00
func LoginErrorHTML(err string) string {
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:48
2020-11-14 13:03:06 +00:00
qb422016 := qt422016.AcquireByteBuffer()
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:48
2020-11-14 13:03:06 +00:00
WriteLoginErrorHTML(qb422016, err)
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:48
2020-11-14 13:03:06 +00:00
qs422016 := string(qb422016.B)
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:48
2020-11-14 13:03:06 +00:00
qt422016.ReleaseByteBuffer(qb422016)
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:48
2020-11-14 13:03:06 +00:00
return qs422016
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:48
2020-11-14 13:03:06 +00:00
}
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:50
2020-11-14 13:03:06 +00:00
func StreamLogoutHTML(qw422016 *qt422016.Writer, can bool) {
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:50
2020-11-14 13:03:06 +00:00
qw422016.N().S(`
2021-01-26 05:41:57 +00:00
<div class="layout">
<main class="main-width">
2020-11-14 13:03:06 +00:00
<section>
`)
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:54
2020-11-14 13:03:06 +00:00
if can {
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:54
2020-11-14 13:03:06 +00:00
qw422016.N().S(`
<h1>Log out?</h1>
<p><a href="/logout-confirm"><strong>Confirm</strong></a></p>
<p><a href="/">Cancel</a></p>
`)
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:58
2020-11-14 13:03:06 +00:00
} else {
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:58
2020-11-14 13:03:06 +00:00
qw422016.N().S(`
<p>You cannot log out because you are not logged in.</p>
<p><a href="/login">Login</a></p>
<p><a href="/login"> Home</a></p>
`)
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:62
2020-11-14 13:03:06 +00:00
}
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:62
2020-11-14 13:03:06 +00:00
qw422016.N().S(`
</section>
</main>
2021-01-26 05:41:57 +00:00
</div>
2020-11-14 13:03:06 +00:00
`)
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:66
2020-11-14 13:03:06 +00:00
}
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:66
2020-11-14 13:03:06 +00:00
func WriteLogoutHTML(qq422016 qtio422016.Writer, can bool) {
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:66
2020-11-14 13:03:06 +00:00
qw422016 := qt422016.AcquireWriter(qq422016)
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:66
2020-11-14 13:03:06 +00:00
StreamLogoutHTML(qw422016, can)
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:66
2020-11-14 13:03:06 +00:00
qt422016.ReleaseWriter(qw422016)
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:66
2020-11-14 13:03:06 +00:00
}
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:66
2020-11-14 13:03:06 +00:00
func LogoutHTML(can bool) string {
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:66
2020-11-14 13:03:06 +00:00
qb422016 := qt422016.AcquireByteBuffer()
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:66
2020-11-14 13:03:06 +00:00
WriteLogoutHTML(qb422016, can)
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:66
2020-11-14 13:03:06 +00:00
qs422016 := string(qb422016.B)
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:66
2020-11-14 13:03:06 +00:00
qt422016.ReleaseByteBuffer(qb422016)
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:66
2020-11-14 13:03:06 +00:00
return qs422016
2021-01-26 05:41:57 +00:00
//line templates/auth.qtpl:66
2020-11-14 13:03:06 +00:00
}