initial work on account deletion

This commit is contained in:
Lynne Megido 2019-12-19 19:00:54 +10:00
parent 1d559d7118
commit 0f717a82bb
3 changed files with 49 additions and 5 deletions

View File

@ -0,0 +1,36 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>FediBooks</title>
{% include 'imports.html' %}
</head>
<body>
<div class="container centred">
<h1 class="thin centred">Close your FediBooks account</h1>
</div>
{% include 'error.html' %}
<div class="container centred">
<form method='POST'>
<h2>
<i class="fas fa-user-slash" style="font-size:3em;"></i>
</h2>
<div class="container centred">
<p>Are you sure you want to <strong>permanently</strong> delete your account?</p>
<p>All of your FediBooks bots will stop working, but their accounts will remain open. You can delete them manually or repurpose them for something else.</p>
<p>If you're sure you want to delete your account, enter your password below and click "Close my account".</p>
<p>
<input type="password" placeholder="Password">
</p>
<a class="button btn-secondary" href="/"><i class="fas fa-times"></i> Cancel</a>
<button class="button btn-dangerous"><i class="fas fa-trash"></i> Close my account</button>
</div>
</form>
</div>
{% include 'footer.html' %}
</body>
</html>

View File

@ -18,7 +18,7 @@
<form method="POST" class="full-width">
<div class="container light">
<h2 class="thin centred">Login settings</h2>
<p class="centred">Update your email and password here.</p>
<p class="centred">Update your email and password here, or close your account.</p>
</div>
<div class="row">
@ -29,6 +29,10 @@
<label for="password" class="large">Password</label>
<input type="password" name="password"pattern=".{8,}" placeholder="Unchanged">
</div>
<div class="row">
<label for="delete" class="large">Delete account</label>
<a name="delete" class="button btn-dangerous" href="/delete"><i class="fas fa-trash"></i> Close account</a>
</div>
<div class="container light">
<h2 class="thin centred">Contact settings</h2>
@ -73,10 +77,10 @@
</div>
<div class="container centred">
<button class="button btn-primary"><i class="fas fa-save"></i> Save</button>
<a href="/" class="button btn-secondary"><i class="fas fa-times"></i> Cancel</a>
<a href="/help/settings" target="_blank" class="button btn-secondary"><i class="fas fa-question"></i> Help</a>
</div>
<button class="button btn-primary"><i class="fas fa-save"></i> Save</button>
<a href="/" class="button btn-secondary"><i class="fas fa-times"></i> Cancel</a>
<a href="/help/settings" target="_blank" class="button btn-secondary"><i class="fas fa-question"></i> Help</a>
</div>
</form>
</div>

View File

@ -61,6 +61,10 @@ def show_signup_page():
def render_settings():
return settings(mysql)
@app.route("/delete")
def render_delete():
return render_template("close_account.html", error = session.pop('error', None))
@app.route("/bot/edit/<id>", methods = ['GET', 'POST'])
def render_bot_edit(id):
return bot_edit(id, mysql)