remotes/1693045480750635534/spooky-22
Aevann1 2021-09-12 08:41:19 +02:00
parent 0bf0729ccf
commit aa917df15b
9 changed files with 21 additions and 21 deletions

View File

@ -2,7 +2,7 @@ from .admin import *
from .comments import *
from .discord import *
from .errors import *
from .flagging import *
from .reporting import *
from .front import *
from .login import *
from .oauth import *

View File

@ -205,9 +205,9 @@ def image_posts_listing(v):
return render_template("admin/image_posts.html", v=v, listing=posts, next_exists=next_exists, page=page, sort="new")
@app.get("/admin/flagged/posts")
@app.get("/admin/reported/posts")
@admin_level_required(3)
def flagged_posts(v):
def reported_posts(v):
page = max(1, int(request.args.get("page", 1)))
@ -222,13 +222,13 @@ def flagged_posts(v):
listing = get_posts(listing, v=v)
return render_template("admin/flagged_posts.html",
return render_template("admin/reported_posts.html",
next_exists=next_exists, listing=listing, page=page, v=v)
@app.get("/admin/flagged/comments")
@app.get("/admin/reported/comments")
@admin_level_required(3)
def flagged_comments(v):
def reported_comments(v):
page = max(1, int(request.args.get("page", 1)))
@ -244,7 +244,7 @@ def flagged_comments(v):
listing = get_comments(listing, v=v)
return render_template("admin/flagged_comments.html",
return render_template("admin/reported_comments.html",
next_exists=next_exists,
listing=listing,
page=page,

View File

@ -31,7 +31,7 @@ def api_flag_post(pid, v):
g.db.add(flag)
return {"message": "Post flagged!"}
return {"message": "Post reported!"}
@app.post("/flag/comment/<cid>")
@ -59,7 +59,7 @@ def api_flag_comment(cid, v):
g.db.add(flag)
return {"message": "Comment flagged!"}
return {"message": "Comment reported!"}
@app.post('/del_report/<report_fn>')

View File

@ -11,8 +11,8 @@
<h3>&nbsp;Admin Tools</h3>
{% filter markdown %}
#### Content
* [Flagged Posts](/admin/flagged/posts)
* [Flagged Comments](/admin/flagged/comments)
* [Reported Posts](/admin/reported/posts)
* [Reported Comments](/admin/reported/comments)
* [Image Posts](/admin/image_posts)
* [Removed Posts](/admin/removed)

View File

@ -1,4 +1,4 @@
{% extends "admin/flagged_posts.html" %}
{% extends "admin/reported_posts.html" %}

View File

@ -18,12 +18,12 @@
<div class="d-flex">
<ul class="nav post-nav mr-auto">
<li class="nav-item">
<a class="nav-link {% if request.path=="/admin/flagged/posts" %} active{% endif %}" href="/admin/flagged/posts">
<a class="nav-link {% if request.path=="/admin/reported/posts" %} active{% endif %}" href="/admin/reported/posts">
<div>Posts</div>
</a>
</li>
<li class="nav-item">
<a class="nav-link {% if request.path=="/admin/flagged/comments" %} active{% endif %}" href="/admin/flagged/comments">
<a class="nav-link {% if request.path=="/admin/reported/comments" %} active{% endif %}" href="/admin/reported/comments">
<div>Comments</div>
</a>
</li>
@ -63,7 +63,7 @@
{% endblock %}
{% block title %}
<title>Flagged Posts</title>
<title>Reported Posts</title>
<meta name="description" content="on {{'SITE_NAME' | app_config}}">
{% endblock %}

View File

@ -317,7 +317,7 @@
{% if v and v.admin_level>=3 %}
{% if "/flagged/" in request.path %}
{% if "/reported/" in request.path %}
<li class="list-inline-item text-muted d-none d-md-inline-block"><a class="text-success" href="javascript:void(0)" onclick="approveComment('{{c.id}}')"><i class="fas fa-check text-success fa-fw"></i>Approve</a></li>
<li class="list-inline-item text-muted d-none d-md-inline-block"><a class="text-danger" href="javascript:void(0)" onclick="removeComment('{{c.id}}')"><i class="fas fa-ban text-danger fa-fw"></i>Remove</a></li>
{% else %}
@ -465,7 +465,7 @@
<li id="undistinguish2-{{c.id}}" class="{% if not c.distinguish_level %}d-none{% endif %} list-group-item"><a class="text-info d-block" href="javascript:void(0)" onclick="admin_comment2('{{c.id}}','distinguish2-{{c.id}}','undistinguish2-{{c.id}}')" data-dismiss="modal"><i class="fas fa-id-badge text-info"></i>Undistinguish</a></li>
{% endif %}
{% if v.admin_level>=3 %}
{% if "/flagged/" in request.path %}
{% if "/reported/" in request.path %}
<li class="list-group-item"><a class="text-danger d-block" href="javascript:void(0)" onclick="removeComment2('{{c.id}}')" data-dismiss="modal"><i class="fas fa-ban text-danger"></i>Remove</a></li>
<li class="list-group-item"><a class="text-success d-block" href="javascript:void(0)" onclick="approveComment2('{{c.id}}')" data-dismiss="modal"><i class="fas fa-check text-success"></i>Approve</a></li>
{% else %}

View File

@ -145,7 +145,7 @@
<button id="undistinguish2-{{p.id}}" class="{% if not p.distinguish_level %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-left" href="javascript:void(0)" onclick="post_toast2('/distinguish/{{p.id}}','distinguish2-{{p.id}}','undistinguish2-{{p.id}}')" data-dismiss="modal"><i class="fas fa-crown text-center mr-3"></i>Undistinguish</button>
{% endif %}
{% if "/flagged/" in request.path %}
{% if "/reported/" in request.path %}
<button class="nobackground btn btn-link btn-block btn-lg text-danger text-left" href="javascript:void(0)" onclick="post_toast('/ban_post/{{p.id}}')" data-dismiss="modal"><i class="far fa-ban text-center mr-3"></i>Remove</button>
<button class="nobackground btn btn-link btn-block btn-lg text-success text-left" href="javascript:void(0)" onclick="post_toast('/unban_post/{{p.id}}')" data-dismiss="modal"><i class="far fa-check text-center mr-3"></i>Approve</button>
{% else %}
@ -454,7 +454,7 @@
{% endif %}
{% if v.admin_level >=3 %}
{% if "/flagged/" in request.path %}
{% if "/reported/" in request.path %}
{% if v.id != p.author.id %}<li class="list-inline-item"><a class="text-danger" href="javascript:void(0)" onclick="post_toast('/ban_post/{{p.id}}')"><i class="fas fa-ban"></i>Remove</a></li>{% endif %}
<li class="list-inline-item"><a class="text-success" href="javascript:void(0)" onclick="post_toast('/unban_post/{{p.id}}')"><i class="fas fa-check"></i>Approve</a></li>
{% else %}

View File

@ -180,7 +180,7 @@
{% endif %}
{% if v.admin_level >=3 %}
{% if "/flagged/" in request.path %}
{% if "/reported/" in request.path %}
{% if v.id != p.author.id %}<li class="list-inline-item"><a class="text-danger" href="javascript:void(0)" onclick="post_toast('/ban_post/{{p.id}}')"><i class="fas fa-ban"></i>Remove</a></li>{% endif %}
<li class="list-inline-item"><a class="text-success" href="javascript:void(0)" onclick="post_toast('/unban_post/{{p.id}}')"><i class="fas fa-check"></i>Approve</a></li>
{% else %}
@ -333,7 +333,7 @@
<button id="undistinguish2-{{p.id}}" class="{% if not p.distinguish_level %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-left" href="javascript:void(0)" onclick="post_toast2('/distinguish/{{p.id}}','distinguish2-{{p.id}}','undistinguish2-{{p.id}}')" data-dismiss="modal"><i class="fas fa-crown text-center mr-3"></i>Undistinguish</button>
{% endif %}
{% if "/flagged/" in request.path %}
{% if "/reported/" in request.path %}
<button class="nobackground btn btn-link btn-block btn-lg text-danger text-left" href="javascript:void(0)" onclick="post_toast('/ban_post/{{p.id}}')" data-dismiss="modal"><i class="far fa-ban text-center mr-3"></i>Remove</button>
<button class="nobackground btn btn-link btn-block btn-lg text-success text-left" href="javascript:void(0)" onclick="post_toast('/unban_post/{{p.id}}')" data-dismiss="modal"><i class="far fa-check text-center mr-3"></i>Approve</button>
{% else %}