remotes/1693045480750635534/spooky-22
Aevann1 2021-07-22 20:52:13 +02:00
parent ef9d5a150c
commit 6be7c326b6
5 changed files with 19 additions and 6 deletions

View File

@ -21,11 +21,12 @@ beams_client = PushNotifications(
secret_key=PUSHER_KEY,
)
@app.route("/banaward/<comment_id>", methods=["POST"])
@app.route("/banaward/comment/<comment_id>", methods=["POST"])
@auth_required
def banaward(comment_id, v):
def banawardcomment(comment_id, v):
if v.banawards != 1 and v.banawards != 2: abort(403)
if v.banawards != 1 and v.banawards != 2: return "You must have a ban award to ban this user. You can obtain it here:\nhttps://rdrama.gumroad.com/l/tfcvri\nhttps://www.patreon.com/Aevann"
comment = g.db.query(Comment).filter_by(id=comment_id).first()
if not comment: abort(400)

View File

@ -32,11 +32,11 @@ with open("snappy.txt", "r") as f:
snappyquotes = f.read().split("{[para]}")
@app.route("/banaward/<post_id>", methods=["POST"])
@app.route("/banaward/post/<post_id>", methods=["POST"])
@auth_required
def banaward(post_id, v):
def postbanaward(post_id, v):
if v.banawards != 1 and v.banawards != 2: abort(403)
if v.banawards != 1 and v.banawards != 2: return "You must have a ban award to ban this user. You can obtain it here:\nhttps://rdrama.gumroad.com/l/tfcvri\nhttps://www.patreon.com/Aevann"
post = g.db.query(Submission).filter_by(id=post_id).first()
if not post: abort(400)

View File

@ -242,6 +242,8 @@
<li class="list-inline-item text-muted d-none d-md-inline-block"><a href="/votes?link=https://rdrama.net{{c.permalink}}"><i class="fas fa-arrows-v"></i>Votes</a></li>
<li class="list-inline-item text-muted d-none d-md-inline-block"><a href="javascript:void(0)" onclick="post('/banaward/comment/{{c.id}}', function(){window.location.reload(true);})"><i class="fas fa-user-slash text-danger"></i>Ban user</a></li>
{% if v and c.id in v.saved_comment_idlist() %}
<li class="list-inline-item text-muted d-none d-md-inline-block"><a href="javascript:void(0)" onclick="post('/unsave_comment/{{c.base36id}}', function(){window.location.reload(true);})"><i class="fas fa-save"></i>Unsave</a></li>
{% else %}
@ -447,6 +449,8 @@
<li class="list-group-item"><a href="/votes?link=https://rdrama.net{{c.permalink}}"><i class="fas fa-arrows-v"></i>Votes</a></li>
<li class="list-group-item"><a href="javascript:void(0)" onclick="post('/banaward/comment/{{c.id}}', function(){window.location.reload(true);})"><i class="fas fa-user-slash text-danger"></i>Ban user</a></li>
{% if v and c.id in v.saved_comment_idlist() %}
<li class="list-group-item"><a href="javascript:void(0)" onclick="post('/unsave_comment/{{c.base36id}}', function(){window.location.reload(true);})"><i class="fas fa-save"></i>Unsave</a></li>
{% else %}

View File

@ -132,6 +132,8 @@
<button class="btn btn-link btn-block btn-lg text-left text-muted"><a href="/votes?link=https://rdrama.net{{p.permalink}}"><i class="fas fa-arrows-v text-center text-muted mr-3"></i>Votes</a></button>
<button class="btn btn-link btn-block btn-lg text-left text-muted"><a href="javascript:void(0)" onclick="post('/banaward/post/{{p.id}}', function(){window.location.reload(true);})"><i class="fas fa-user-slash text-danger mr-3"></i>Ban user</a></button>
{% if v and p.id in v.subscribed_idlist() %}
<button class="btn btn-link btn-block btn-lg text-left text-muted"><a href="javascript:void(0)" onclick="post('/unsubscribe/{{p.id}}', function(){window.location.reload(true);})"><i class="fas fa-eye-slash text-center text-muted mr-3"></i>Unsubscribe</a></button>
{% elif v %}
@ -320,6 +322,8 @@
<li class="list-inline-item"><a href="/votes?link=https://rdrama.net{{p.permalink}}"><i class="fas fa-arrows-v"></i>Votes</a></li>
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post('/banaward/post/{{p.id}}', function(){window.location.reload(true);})"><i class="fas fa-user-slash text-danger"></i>Ban user</a></li>
<li class="list-inline-item"><a href="javascript:void(0);" role="button" class="copy-link" data-clipboard-text="{{p.permalink | full_link}}"><i class="fas fa-copy"></i>Copy link</a></li>
{% if v and p.id in v.subscribed_idlist() %}

View File

@ -168,6 +168,8 @@
<li class="list-inline-item"><a href="/votes?link=https://rdrama.net{{p.permalink}}"><i class="fas fa-arrows-v"></i>Votes</a></li>
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post('/banaward/post/{{p.id}}', function(){window.location.reload(true);})"><i class="fas fa-user-slash text-danger"></i>Ban user</a></li>
<li class="list-inline-item"><a href="javascript:void(0);" role="button" class="copy-link" data-clipboard-text="{{p.permalink | full_link}}"><i class="fas fa-copy"></i>Copy link</a></li>
{% if v and p.id in v.subscribed_idlist() %}
@ -346,6 +348,8 @@
<ul class="list-group post-actions">
<button class="btn btn-link btn-block btn-lg text-left text-muted"><a href="/votes?link=https://rdrama.net{{p.permalink}}"><i class="fas fa-arrows-v text-center text-muted mr-3"></i>Votes</a></button>
<button class="btn btn-link btn-block btn-lg text-left text-muted"><a href="javascript:void(0)" onclick="post('/banaward/post/{{p.id}}', function(){window.location.reload(true);})"><i class="fas fa-user-slash text-danger mr-3"></i>Ban user</a></button>
{% if v and p.id in v.subscribed_idlist() %}
<button class="btn btn-link btn-block btn-lg text-left text-muted"><a href="javascript:void(0)" onclick="post('/unsubscribe/{{p.id}}', function(){window.location.reload(true);})"><i class="fas fa-eye-slash text-center text-muted mr-3"></i>Unsubscribe</a></button>
{% elif v %}