fsdfs
This commit is contained in:
parent
c68dd2e440
commit
b4ea3b202b
6 changed files with 33 additions and 32 deletions
|
@ -54,16 +54,6 @@ def remove_admin(v, username):
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
return {"message": "Admin removed!"}
|
return {"message": "Admin removed!"}
|
||||||
|
|
||||||
|
|
||||||
@app.get("/admin/grassed")
|
|
||||||
@admin_level_required(2)
|
|
||||||
def grassed(v):
|
|
||||||
users = g.db.query(User).filter(User.ban_reason.like('grass award used by @%')).all()
|
|
||||||
|
|
||||||
if not v or v.oldsite: template = ''
|
|
||||||
else: template = 'CHRISTMAS/'
|
|
||||||
return render_template(f"{template}grassed.html", v=v, users=users)
|
|
||||||
|
|
||||||
@app.post("/distribute/<comment>")
|
@app.post("/distribute/<comment>")
|
||||||
@limiter.limit("1/second")
|
@limiter.limit("1/second")
|
||||||
@admin_level_required(3)
|
@admin_level_required(3)
|
||||||
|
@ -287,14 +277,6 @@ def shadowbanned(v):
|
||||||
else: template = 'CHRISTMAS/'
|
else: template = 'CHRISTMAS/'
|
||||||
return render_template(f"{template}shadowbanned.html", v=v, users=users)
|
return render_template(f"{template}shadowbanned.html", v=v, users=users)
|
||||||
|
|
||||||
@app.get("/agendaposters")
|
|
||||||
@auth_desired
|
|
||||||
def agendaposters(v):
|
|
||||||
users = [x for x in g.db.query(User).filter_by(agendaposter = True).all()]
|
|
||||||
if not v or v.oldsite: template = ''
|
|
||||||
else: template = 'CHRISTMAS/'
|
|
||||||
return render_template(f"{template}agendaposters.html", v=v, users=users)
|
|
||||||
|
|
||||||
|
|
||||||
@app.get("/admin/image_posts")
|
@app.get("/admin/image_posts")
|
||||||
@admin_level_required(2)
|
@admin_level_required(2)
|
||||||
|
|
|
@ -186,9 +186,7 @@ def sign_up_get(v):
|
||||||
ref_user = None
|
ref_user = None
|
||||||
|
|
||||||
if ref_user and (ref_user.id in session.get("history", [])):
|
if ref_user and (ref_user.id in session.get("history", [])):
|
||||||
if not v or v.oldsite: template = ''
|
return render_template(f"sign_up_failed_ref.html")
|
||||||
else: template = 'CHRISTMAS/'
|
|
||||||
return render_template(f"{template}sign_up_failed_ref.html")
|
|
||||||
|
|
||||||
now = int(time.time())
|
now = int(time.time())
|
||||||
token = token_hex(16)
|
token = token_hex(16)
|
||||||
|
@ -203,9 +201,7 @@ def sign_up_get(v):
|
||||||
|
|
||||||
redir = request.values.get("redirect", "/").replace("/logged_out", "").strip()
|
redir = request.values.get("redirect", "/").replace("/logged_out", "").strip()
|
||||||
|
|
||||||
if not v or v.oldsite: template = ''
|
return render_template(f"sign_up.html",
|
||||||
else: template = 'CHRISTMAS/'
|
|
||||||
return render_template(f"{template}sign_up.html",
|
|
||||||
formkey=formkey,
|
formkey=formkey,
|
||||||
now=now,
|
now=now,
|
||||||
redirect=redir,
|
redirect=redir,
|
||||||
|
|
|
@ -18,6 +18,25 @@ site = environ.get("DOMAIN").strip()
|
||||||
beams_client = PushNotifications(instance_id=PUSHER_INSTANCE_ID, secret_key=PUSHER_KEY)
|
beams_client = PushNotifications(instance_id=PUSHER_INSTANCE_ID, secret_key=PUSHER_KEY)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@app.get("/grassed")
|
||||||
|
@auth_desired
|
||||||
|
def grassed(v):
|
||||||
|
users = g.db.query(User).filter(User.ban_reason.like('grass award used by @%')).all()
|
||||||
|
|
||||||
|
if not v or v.oldsite: template = ''
|
||||||
|
else: template = 'CHRISTMAS/'
|
||||||
|
return render_template(f"{template}grassed.html", v=v, users=users)
|
||||||
|
|
||||||
|
@app.get("/agendaposters")
|
||||||
|
@auth_desired
|
||||||
|
def agendaposters(v):
|
||||||
|
users = [x for x in g.db.query(User).filter_by(agendaposter = True).all()]
|
||||||
|
if not v or v.oldsite: template = ''
|
||||||
|
else: template = 'CHRISTMAS/'
|
||||||
|
return render_template(f"{template}agendaposters.html", v=v, users=users)
|
||||||
|
|
||||||
|
|
||||||
@app.get("/@<username>/upvoters")
|
@app.get("/@<username>/upvoters")
|
||||||
@auth_desired
|
@auth_desired
|
||||||
def upvoters(v, username):
|
def upvoters(v, username):
|
||||||
|
|
|
@ -23,8 +23,8 @@
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="/admin/users">Users Feed</a></li>
|
<li><a href="/admin/users">Users Feed</a></li>
|
||||||
<li><a href="/admin/shadowbanned">Shadowbanned Users</a></li>
|
<li><a href="/admin/shadowbanned">Shadowbanned Users</a></li>
|
||||||
<li><a href="/admin/agendaposters">Users with Agendaposter Theme</a></li>
|
<li><a href="/agendaposters">Users with Agendaposter Theme</a></li>
|
||||||
<li><a href="/admin/grassed">Currently Grassed Users</a></li>
|
<li><a href="/grassed">Currently Grassed Users</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h4>Safety</h4>
|
<h4>Safety</h4>
|
||||||
|
|
|
@ -1,12 +1,15 @@
|
||||||
{% extends "settings2.html" %}
|
{% extends "settings2.html" %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="overflow-x-auto"><table class="table table-striped mb-5 text-small-mobile">
|
<script src="/static/assets/js/sort_table.js?a=2"></script>
|
||||||
|
|
||||||
|
<div class="overflow-x-auto">
|
||||||
|
<table id="sortable_table" class="table table-striped mb-5 text-small-mobile">
|
||||||
<thead class="bg-primary text-white">
|
<thead class="bg-primary text-white">
|
||||||
<tr>
|
<tr>
|
||||||
<th style="font-weight:bold;">#</th>
|
<th style="font-weight:bold;">#</th>
|
||||||
<th style="font-weight:bold;">Name</th>
|
<th role="button" onclick="sort_table(1)" style="font-weight:bold;">Name</th>
|
||||||
<th style="font-weight:bold;">Grasser</th>
|
<th role="button" onclick="sort_table(2)" style="font-weight:bold;">Grasser</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
{% for user in users %}
|
{% for user in users %}
|
||||||
|
|
|
@ -3,12 +3,13 @@
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<script src="/static/assets/js/sort_table.js?a=2"></script>
|
<script src="/static/assets/js/sort_table.js?a=2"></script>
|
||||||
|
|
||||||
<div class="overflow-x-auto"><table class="table table-striped mb-5 text-small-mobile">
|
<div class="overflow-x-auto">
|
||||||
|
<table id="sortable_table" class="table table-striped mb-5 text-small-mobile">
|
||||||
<thead class="bg-primary text-white">
|
<thead class="bg-primary text-white">
|
||||||
<tr>
|
<tr>
|
||||||
<th style="font-weight:bold;">#</th>
|
<th style="font-weight:bold;">#</th>
|
||||||
<th onclick="sort_table(1)" style="font-weight:bold;">Name</th>
|
<th role="button" onclick="sort_table(1)" style="font-weight:bold;">Name</th>
|
||||||
<th onclick="sort_table(2)" style="font-weight:bold;">Shadowbanned by</th>
|
<th role="button" onclick="sort_table(2)" style="font-weight:bold;">Shadowbanned by</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
{% for user in users %}
|
{% for user in users %}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue