flounder

A simple gemini site builder
Log | Files | Refs | README | LICENSE

commit ab26d8c93d3179ea216929903435124f5aa7ed7e
parent 7fb04c7da9d9f530d0f0bf2b51c39c0f03a070e8
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Sun,  6 Dec 2020 02:22:45 -0800

some form changes

Diffstat:
Mhttp.go | 11++++++++++-
Mtemplates/me.html | 11++++++++---
Mtemplates/reset_pass.html | 4++--
3 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/http.go b/http.go @@ -204,7 +204,6 @@ func uploadFilesHandler(w http.ResponseWriter, r *http.Request) { http.Redirect(w, r, "/my_site", http.StatusSeeOther) } -// TODO use this type AuthUser struct { LoggedIn bool Username string @@ -559,6 +558,16 @@ func deleteAccountHandler(w http.ResponseWriter, r *http.Request) { } func resetPasswordHandler(w http.ResponseWriter, r *http.Request) { + user := newGetAuthUser(r) + data := struct { + PageTitle string + AuthUser AuthUser + Error error + }{"Reset Password", user, nil} + err := t.ExecuteTemplate(w, "reset_pass.html", data) + if err != nil { + panic(err) + } } func adminUserHandler(w http.ResponseWriter, r *http.Request) { diff --git a/templates/me.html b/templates/me.html @@ -4,6 +4,7 @@ <form action="/me" method="post"> <div> <label for="username">Username</label><br> + <em>Note: renaming your account will cause links to your pages to break</em> <input id="username" name="username" @@ -29,13 +30,17 @@ </form> <a href="/reset-password">Reset password</a> <p><a href="/my_site/flounder-archive.zip">🗄️ Download my site archive (.zip)</a></p> -<form action="/delete-account" method="POST" class="inline"> +<details> + <summary>Delete Account</summary> + <form action="/delete-account" method="POST"> +<label for="validate-delete">Type in your username to delete your account:</label> +<input id="validate-delete" name="validate-delete" size="32" type="text" value="" /> <input class="button delete" type="submit" - onclick="return confirm('Are you SURE you want to delete your account and all your files?');" value="Delete account" + onclick="return confirm('Are you SURE you want to delete your account and all your files?');" /> - +</details> {{template "footer" .}} </form> diff --git a/templates/reset_pass.html b/templates/reset_pass.html @@ -1,6 +1,6 @@ {{template "header" .}} <h1>Reset Password</h1> -<form action="/reset_password" method="post"> +<form action="/reset-password" method="post"> <div> <label for="password">Current Password</label><br> <input @@ -8,7 +8,7 @@ name="password" size="32" type="text" - value="{{.AuthUser}}" + value="" /> </div> <div>