forked from MarseyWorld/MarseyWorld
fsdfds
parent
d686b53c4e
commit
119c547dc6
|
@ -330,7 +330,7 @@ class Comment(Base):
|
|||
body = body.replace(url, f"{url_noquery}?{urlencode(p, True)}")
|
||||
|
||||
if v and v.shadowbanned and v.id == self.author_id and 86400 > time.time() - self.created_utc > 60:
|
||||
ti = int(time.time() - self.created_utc)/60
|
||||
ti = int((time.time() - self.created_utc)/60)
|
||||
maxupvotes = min(ti, 31)
|
||||
rand = randint(1, maxupvotes)
|
||||
if self.upvotes < rand:
|
||||
|
|
|
@ -334,7 +334,7 @@ class Submission(Base):
|
|||
if v.nitter: body = body.replace("www.twitter.com", "nitter.net").replace("twitter.com", "nitter.net")
|
||||
|
||||
if v and v.shadowbanned and v.id == self.author_id and 86400 > time.time() - self.created_utc > 20:
|
||||
ti = int(time.time() - self.created_utc)/60
|
||||
ti = int((time.time() - self.created_utc)/60)
|
||||
maxupvotes = min(ti, 27)
|
||||
rand = random.randint(1, maxupvotes)
|
||||
if self.upvotes < rand:
|
||||
|
|
|
@ -7,6 +7,7 @@ from sqlalchemy import func
|
|||
from os import path
|
||||
import calendar
|
||||
import matplotlib.pyplot as plt
|
||||
from files.classes.mod_logs import ACTIONTYPES
|
||||
|
||||
site = environ.get("DOMAIN").strip()
|
||||
site_name = environ.get("SITE_NAME").strip()
|
||||
|
@ -177,7 +178,8 @@ def log(v):
|
|||
|
||||
page = int(request.args.get("page",1))
|
||||
admin = request.args.get("admin")
|
||||
if admin: admin = get_id(admin)
|
||||
if admin: admin_id = get_id(admin)
|
||||
else: admin_id = 0
|
||||
|
||||
kind = request.args.get("kind")
|
||||
|
||||
|
@ -185,14 +187,16 @@ def log(v):
|
|||
if not (v and v.admin_level > 1):
|
||||
actions = actions.filter(ModAction.kind!="shadowban", ModAction.kind!="unshadowban", ModAction.kind!="club", ModAction.kind!="unclub", ModAction.kind!="check")
|
||||
|
||||
if admin: actions = actions.filter_by(user_id=admin)
|
||||
if admin_id: actions = actions.filter_by(user_id=admin_id)
|
||||
if kind: actions = actions.filter_by(kind=kind)
|
||||
|
||||
actions = actions.order_by(ModAction.id.desc()).offset(25*(page-1)).limit(26).all()
|
||||
next_exists=len(actions)>25
|
||||
actions=actions[:25]
|
||||
|
||||
return render_template("log.html", v=v, actions=actions, next_exists=next_exists, page=page)
|
||||
admins = [x[0] for x in g.db.query(User.username).filter(User.admin_level > 1).all()]
|
||||
|
||||
return render_template("log.html", v=v, admins=admins, types=ACTIONTYPES, admin=admin, type=kind, actions=actions, next_exists=next_exists, page=page)
|
||||
|
||||
@app.get("/log/<id>")
|
||||
@auth_desired
|
||||
|
|
|
@ -782,6 +782,11 @@ def user_profile_uid(id):
|
|||
x=get_account(id)
|
||||
return redirect(x.profile_url)
|
||||
|
||||
@app.get("/@<username>/pic")
|
||||
@limiter.exempt
|
||||
def user_profile_name(username):
|
||||
x = get_user(username)
|
||||
return redirect(x.profile_url)
|
||||
|
||||
@app.get("/@<username>/saved/posts")
|
||||
@auth_required
|
||||
|
|
|
@ -36,6 +36,48 @@
|
|||
|
||||
</div>
|
||||
|
||||
<div class="row" style="overflow: visible;padding-top:5px;">
|
||||
<div class="col">
|
||||
<div class="d-flex justify-content-between align-items-center mr-2">
|
||||
|
||||
{% block navbar %}
|
||||
<div class="font-weight-bold py-3"></div>
|
||||
|
||||
<div class="d-flex align-items-center sortingbarmargin">
|
||||
<div class="text-small font-weight-bold mr-2"></div>
|
||||
<div class="dropdown dropdown-actions">
|
||||
|
||||
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
{% if admin %}<img loading="lazy" src="/@{{admin}}/pic" alt="avatar" width=20 height=20 class="rounded-circle mr-2">{{admin}}{% else %}<img loading="lazy" src="/assets/images/emojis/marseyjanny.webp" alt="avatar" width=20 height=20 class="rounded-circle mr-2">All{% endif %}
|
||||
</button>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton" x-placement="bottom-start" style="position: absolute; will-change: transform; top: 0px; left: 0px; transform: translate3d(0px, 31px, 0px);">
|
||||
<a class="dropdown-item" href="/log{% if type %}?kind={{type}}{% endif %}"><img loading="lazy" src="/assets/images/emojis/marseyjanny.webp" alt="avatar" width=20 height=20 class="rounded-circle mr-2">All</a>
|
||||
{% for a in admins %}
|
||||
<a class="dropdown-item" href="?admin={{a}}{% if type %}&kind={{type}}{% endif %}"><img loading="lazy" src="/@{{a}}/pic" alt="avatar" width=20 height=20 class="rounded-circle mr-2">{{a}}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="text-small font-weight-bold mr-2"></div>
|
||||
<div class="dropdown dropdown-actions">
|
||||
|
||||
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
{% if type %}<i class="fas {{types[type]['icon']}} mr-2"></i>{{type}}{% else %}<i class="fas fa-broom mr-2"></i>All{% endif %}
|
||||
</button>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton" x-placement="bottom-start" style="position: absolute; will-change: transform; top: 0px; left: 0px; transform: translate3d(0px, 31px, 0px);">
|
||||
<a class="dropdown-item" href="/log{% if admin %}?admin={{admin}}{% endif %}"><i class="fas fa-broom mr-2"></i>All</a>
|
||||
{% for t, v in types.items() %}
|
||||
<a class="dropdown-item" href="?{% if admin %}admin={{admin}}&{% endif %}kind={{t}}"><i class="fas {{v['icon']}} mr-2"></i>{{t}}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="rounded border bg-white mx-auto">
|
||||
{% for ma in actions %}
|
||||
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
{% extends "settings2.html" %}
|
||||
|
||||
{% block content %}
|
||||
<table class="table table-striped mb-5">
|
||||
<thead class="bg-primary text-white">
|
||||
<tr>
|
||||
<th style="font-weight:bold;">#</th>
|
||||
<th style="font-weight:bold;">Name</th>
|
||||
<th style="font-weight:bold;">Ban reason</th>
|
||||
<th style="font-weight:bold;">Banned by</th>
|
||||
</tr>
|
||||
</thead>
|
||||
{% for user in users %}
|
||||
<tr>
|
||||
<td style="font-weight:bold;">{{users.index(user)+1}}</td>
|
||||
<td><a style="color:#{{user.namecolor}}; font-weight:bold;" href="/@{{user.username}}"><img loading="lazy" src="/uid/{{user.id}}/pic" class="pp20"><span {% if user.patron %}class="patron" style="background-color:#{{user.namecolor}};"{% endif %}>{{user.username}}</span></a></td>
|
||||
<td style="font-weight:bold;">{% if user.ban_reason %}{{user.ban_reason}}{% endif %}</td>
|
||||
<td style="font-weight:bold;" href="/@{{user.banned_by.username}}"><img loading="lazy" src="/uid/{{user.banned_by.id}}/pic" class="pp20"><span {% if user.banned_by.patron %}class="patron" style="background-color:#{{user.banned_by.namecolor}};"{% endif %}>{{user.banned_by.username}}</span></a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
||||
{% endblock %}
|
Loading…
Reference in New Issue