mirror of
https://github.com/Lynnesbian/FediBooks/
synced 2024-12-27 14:58:59 +00:00
make the delete page look and work better
This commit is contained in:
parent
8f72d14243
commit
887aab6a71
3 changed files with 15 additions and 4 deletions
|
@ -47,6 +47,10 @@ body {
|
|||
height: 100px;
|
||||
background: center/contain url("https://cloud.lynnesbian.space/s/JZCPTs3DzMLAspC/preview");
|
||||
}
|
||||
.panel-icon.large {
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
}
|
||||
.panel-icon.online, .panel-icon.offline {
|
||||
width: 105px;
|
||||
}
|
||||
|
|
|
@ -9,14 +9,14 @@
|
|||
<body>
|
||||
<div class="container centred">
|
||||
<h1 class="thin centred">Delete bot</h1>
|
||||
<div class="panel-icon"></div>
|
||||
</div>
|
||||
|
||||
<div class="container centred">
|
||||
<form>
|
||||
<div class="panel-icon large"></div>
|
||||
<div class="container centred">
|
||||
<p>Are you sure you want to <strong>permanently</strong> delete bot name?</p>
|
||||
<p>The account on instan.ce will remain open, but your bot will stop posting from it.</p>
|
||||
<p>Are you sure you want to <strong>permanently</strong> delete this bot?</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>
|
||||
<button class="button btn-dangerous"><i class="fas fa-trash"></i> Delete bot</button>
|
||||
</div>
|
||||
|
|
9
webui.py
9
webui.py
|
@ -77,7 +77,9 @@ def bot_edit(id):
|
|||
|
||||
@app.route("/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>")
|
||||
def bot_accounts(id):
|
||||
|
@ -240,3 +242,8 @@ def do_login():
|
|||
|
||||
else:
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue