mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2025-02-01 11:59:08 +00:00
Implement the lock page
It is unused now, you can take a look at it on /lock
This commit is contained in:
parent
7c610d0a90
commit
d8f4f40f52
@ -553,6 +553,35 @@ kbd {
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The lock page
|
||||||
|
*/
|
||||||
|
.locked-notice {
|
||||||
|
background-color: transparent;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.locked-notice__message {
|
||||||
|
max-width: 30rem;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.locked-notice__lock {
|
||||||
|
font-size: 8rem;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.locked-notice__title {
|
||||||
|
margin: 0 0 1rem 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.locked-notice__login-form input {
|
||||||
|
margin-bottom: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* To-do lists
|
* To-do lists
|
||||||
*/
|
*/
|
||||||
|
@ -57,7 +57,7 @@
|
|||||||
</form>
|
</form>
|
||||||
{% else %}
|
{% else %}
|
||||||
<p>Authentication is disabled. You can make edits anonymously.</p>
|
<p>Authentication is disabled. You can make edits anonymously.</p>
|
||||||
<p><a class="modal__cancel" href="/">← Go home</a></p>
|
<p><a class="btn btn_weak" href="/">← Go home</a></p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</section>
|
</section>
|
||||||
</main>
|
</main>
|
||||||
@ -99,3 +99,35 @@
|
|||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
{% endfunc %}
|
{% endfunc %}
|
||||||
|
|
||||||
|
{% func LockHTML() %}
|
||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<title>🔒 Locked</title>
|
||||||
|
<link rel="shortcut icon" href="/static/favicon.ico">
|
||||||
|
<link rel="stylesheet" href="/static/style.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<main class="locked-notice">
|
||||||
|
<section class="locked-notice__message">
|
||||||
|
<p class="locked-notice__lock">🔒</p>
|
||||||
|
<h1 class="locked-notice__title">Locked</h1>
|
||||||
|
<form class="locked-notice__login-form" method="post" action="/login-data" id="login-form" enctype="multipart/form-data" autocomplete="on">
|
||||||
|
<label for="login-form__username">Username</label>
|
||||||
|
<br>
|
||||||
|
<input type="text" required autofocus id="login-form__username" name="username" autocomplete="username">
|
||||||
|
<br>
|
||||||
|
<label for="login-form__password">Password</label>
|
||||||
|
<br>
|
||||||
|
<input type="password" required name="password" autocomplete="current-password">
|
||||||
|
<br>
|
||||||
|
<input class="btn" type="submit" value="Log in">
|
||||||
|
</form>
|
||||||
|
</section>
|
||||||
|
</main>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
{% endfunc %}
|
@ -161,7 +161,7 @@ func StreamLoginHTML(qw422016 *qt422016.Writer) {
|
|||||||
//line views/auth.qtpl:58
|
//line views/auth.qtpl:58
|
||||||
qw422016.N().S(`
|
qw422016.N().S(`
|
||||||
<p>Authentication is disabled. You can make edits anonymously.</p>
|
<p>Authentication is disabled. You can make edits anonymously.</p>
|
||||||
<p><a class="modal__cancel" href="/">← Go home</a></p>
|
<p><a class="btn btn_weak" href="/">← Go home</a></p>
|
||||||
`)
|
`)
|
||||||
//line views/auth.qtpl:61
|
//line views/auth.qtpl:61
|
||||||
}
|
}
|
||||||
@ -330,3 +330,66 @@ func LogoutHTML(can bool) string {
|
|||||||
return qs422016
|
return qs422016
|
||||||
//line views/auth.qtpl:101
|
//line views/auth.qtpl:101
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//line views/auth.qtpl:103
|
||||||
|
func StreamLockHTML(qw422016 *qt422016.Writer) {
|
||||||
|
//line views/auth.qtpl:103
|
||||||
|
qw422016.N().S(`
|
||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<title>🔒 Locked</title>
|
||||||
|
<link rel="shortcut icon" href="/static/favicon.ico">
|
||||||
|
<link rel="stylesheet" href="/static/style.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<main class="locked-notice">
|
||||||
|
<section class="locked-notice__message">
|
||||||
|
<p class="locked-notice__lock">🔒</p>
|
||||||
|
<h1 class="locked-notice__title">Locked</h1>
|
||||||
|
<form class="locked-notice__login-form" method="post" action="/login-data" id="login-form" enctype="multipart/form-data" autocomplete="on">
|
||||||
|
<label for="login-form__username">Username</label>
|
||||||
|
<br>
|
||||||
|
<input type="text" required autofocus id="login-form__username" name="username" autocomplete="username">
|
||||||
|
<br>
|
||||||
|
<label for="login-form__password">Password</label>
|
||||||
|
<br>
|
||||||
|
<input type="password" required name="password" autocomplete="current-password">
|
||||||
|
<br>
|
||||||
|
<input class="btn" type="submit" value="Log in">
|
||||||
|
</form>
|
||||||
|
</section>
|
||||||
|
</main>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
`)
|
||||||
|
//line views/auth.qtpl:133
|
||||||
|
}
|
||||||
|
|
||||||
|
//line views/auth.qtpl:133
|
||||||
|
func WriteLockHTML(qq422016 qtio422016.Writer) {
|
||||||
|
//line views/auth.qtpl:133
|
||||||
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
||||||
|
//line views/auth.qtpl:133
|
||||||
|
StreamLockHTML(qw422016)
|
||||||
|
//line views/auth.qtpl:133
|
||||||
|
qt422016.ReleaseWriter(qw422016)
|
||||||
|
//line views/auth.qtpl:133
|
||||||
|
}
|
||||||
|
|
||||||
|
//line views/auth.qtpl:133
|
||||||
|
func LockHTML() string {
|
||||||
|
//line views/auth.qtpl:133
|
||||||
|
qb422016 := qt422016.AcquireByteBuffer()
|
||||||
|
//line views/auth.qtpl:133
|
||||||
|
WriteLockHTML(qb422016)
|
||||||
|
//line views/auth.qtpl:133
|
||||||
|
qs422016 := string(qb422016.B)
|
||||||
|
//line views/auth.qtpl:133
|
||||||
|
qt422016.ReleaseByteBuffer(qb422016)
|
||||||
|
//line views/auth.qtpl:133
|
||||||
|
return qs422016
|
||||||
|
//line views/auth.qtpl:133
|
||||||
|
}
|
||||||
|
@ -14,6 +14,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func initAuth() {
|
func initAuth() {
|
||||||
|
http.HandleFunc("/lock", handlerLock)
|
||||||
if !cfg.UseAuth {
|
if !cfg.UseAuth {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -26,6 +27,10 @@ func initAuth() {
|
|||||||
http.HandleFunc("/logout-confirm", handlerLogoutConfirm)
|
http.HandleFunc("/logout-confirm", handlerLogoutConfirm)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func handlerLock(w http.ResponseWriter, rq *http.Request) {
|
||||||
|
io.WriteString(w, views.LockHTML())
|
||||||
|
}
|
||||||
|
|
||||||
// handlerRegister both displays the register form (GET) and registers users (POST).
|
// handlerRegister both displays the register form (GET) and registers users (POST).
|
||||||
func handlerRegister(w http.ResponseWriter, rq *http.Request) {
|
func handlerRegister(w http.ResponseWriter, rq *http.Request) {
|
||||||
util.PrepareRq(rq)
|
util.PrepareRq(rq)
|
||||||
|
Loading…
Reference in New Issue
Block a user