1
0
Fork 0
mirror of https://github.com/Lynnesbian/FediBooks/ synced 2024-11-25 08:38:59 +00:00

make the delete page look and work better

This commit is contained in:
Lynne Megido 2019-09-02 16:59:49 +10:00
parent 8f72d14243
commit 887aab6a71
3 changed files with 15 additions and 4 deletions

View file

@ -47,6 +47,10 @@ body {
height: 100px; height: 100px;
background: center/contain url("https://cloud.lynnesbian.space/s/JZCPTs3DzMLAspC/preview"); background: center/contain url("https://cloud.lynnesbian.space/s/JZCPTs3DzMLAspC/preview");
} }
.panel-icon.large {
width: 150px;
height: 150px;
}
.panel-icon.online, .panel-icon.offline { .panel-icon.online, .panel-icon.offline {
width: 105px; width: 105px;
} }

View file

@ -9,14 +9,14 @@
<body> <body>
<div class="container centred"> <div class="container centred">
<h1 class="thin centred">Delete bot</h1> <h1 class="thin centred">Delete bot</h1>
<div class="panel-icon"></div>
</div> </div>
<div class="container centred"> <div class="container centred">
<form> <form>
<div class="panel-icon large"></div>
<div class="container centred"> <div class="container centred">
<p>Are you sure you want to <strong>permanently</strong> delete bot name?</p> <p>Are you sure you want to <strong>permanently</strong> delete this bot?</p>
<p>The account on instan.ce will remain open, but your bot will stop posting from it.</p> <p>The account on {{ instance }} will remain open, but your bot will stop posting from it.</p>
<a class="button btn-secondary" href="/"><i class="fas fa-times"></i> Cancel</a> <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> Delete bot</button> <button class="button btn-dangerous"><i class="fas fa-trash"></i> Delete bot</button>
</div> </div>

View file

@ -77,7 +77,9 @@ def bot_edit(id):
@app.route("/bot/delete/<id>") @app.route("/bot/delete/<id>")
def bot_delete(id): def bot_delete(id):
return render_template("bot_delete.html") if bot_check(id):
instance = id.split("@")[2]
return render_template("bot_delete.html", instance = instance)
@app.route("/bot/accounts/<id>") @app.route("/bot/accounts/<id>")
def bot_accounts(id): def bot_accounts(id):
@ -240,3 +242,8 @@ def do_login():
else: else:
return "invalid login" return "invalid login"
def bot_check(bot):
c = mysql.connection.cursor()
c.execute("SELECT COUNT(*) FROM `bots` WHERE `handle` = %s AND `user_id` = %s", (bot, session['user_id']))
return c.fetchone()[0] == 1