master
Aevann1 2021-08-31 22:05:06 +02:00
parent ddc8738bd7
commit 0015b395f3
2 changed files with 12 additions and 1 deletions

View File

@ -20,6 +20,15 @@ from files.__main__ import app, cache, limiter
from .front import frontlist
from files.helpers.discord import add_role
@app.post("/@<username>/make_admin")
@admin_level_required(6)
def make_admin(v, username):
user = get_user(username)
if not user: abort(404)
user.admin_level = 6
g.db.add(user)
return "", 204
@app.get("/admin/shadowbanned")
@auth_required
def shadowbanned(v):

View File

@ -410,7 +410,9 @@
<a class="btn btn-primary" href="javascript:void(0)" onclick="toggleElement('profile-toggleable-mobile', 'message-mobile')">Message</a>
<a class="btn btn-primary" href="javascript:void(0)" onclick="post_toast('/@{{u.username}}/suicide')">Get them help</a>
<a class="btn btn-primary" href="javascript:void(0)" onclick="toggleElement('profile-toggleable-mobile', 'coin-transfer-mobile')">Gift {{"COINS_NAME" | app_config}}</a>
{% if v.admin_level == 6 and 'rdrama' not in request.host %}
<a class="btn btn-primary" href="javascript:void(0)" onclick="post_toast('/@{{u.username}}/make_admin')">Make admin</a>
{% endif %}
<form class="d-none profile-toggleable-mobile" id='message-mobile' action="/@{{u.username}}/message" method="post">
<pre></pre>
<textarea id="input-message-mobile" form="message-mobile" name="message" rows="3" maxlength="1000" class="form-control" required></textarea>