remotes/1693045480750635534/spooky-22
Aevann1 2021-07-23 21:28:25 +02:00
parent 86c5e7916f
commit b5f7bd78da
10 changed files with 258 additions and 84 deletions

View File

@ -25,7 +25,7 @@ beams_client = PushNotifications(
@auth_required
def banawardcomment(comment_id, v):
if v.banawards != 1 and v.banawards != 2: return jsonify({"error": "You must have a ban award to ban this user."}), 403
if not v.banawards > 0: return render_template("errors/banaward.html", v=v)
comment = g.db.query(Comment).filter_by(id=comment_id).first()
if not comment: abort(400)

View File

@ -49,7 +49,7 @@ def resize():
@auth_required
def postbanaward(post_id, v):
if v.banawards != 1 and v.banawards != 2: return jsonify({"error": "You must have a ban award to ban this user."}), 403
if not v.banawards > 0: return render_template("errors/banaward.html", v=v)
post = g.db.query(Submission).filter_by(id=post_id).first()
if not post: abort(400)

View File

@ -215,7 +215,7 @@ def followers(username, v):
@app.get("/views")
@auth_required
def visitors(v):
if v.admin_level < 1 and not v.patron: abort(502)
if v.admin_level < 1 and not v.patron: return render_template("errors/patron.html", v=v)
viewers=sorted(v.viewers, key = lambda x: x.last_view_utc)
return render_template("viewers.html", v=v, viewers=viewers)

View File

@ -243,7 +243,11 @@
<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>
{% if v and v.id!=c.author_id and v.admin_level == 0 %}
<li class="list-inline-item text-muted d-none d-md-inline-block"><a href="javascript:void(0)" onclick="post_toast('/banaward/comment/{{c.id}}')"><i class="fas fa-user-slash text-danger"></i>Ban user</a></li>
{% if v.banawards > 0 %}
<li class="list-inline-item text-muted d-none d-md-inline-block"><a href="javascript:void(0)" onclick="post_toast('/banaward/comment/{{c.id}}')"><i class="fas fa-user-slash text-danger"></i>Ban user</a></li>
{% else %}
<li class="list-inline-item text-muted d-none d-md-inline-block"><a href="/banaward/comment/{{c.id}}"><i class="fas fa-user-slash text-danger"></i>Ban user</a></li>
{% endif %}
{% endif %}
{% if v and c.id in v.saved_comment_idlist() %}
@ -452,7 +456,11 @@
<li class="list-group-item"><a href="/votes?link=https://rdrama.net{{c.permalink}}"><i class="fas fa-arrows-v"></i>Votes</a></li>
{% if v and v.id!=c.author_id and v.admin_level == 0 %}
<li class="list-group-item"><a href="javascript:void(0)" onclick="post_toast('/banaward/comment/{{c.id}}')"><i class="fas fa-user-slash text-danger"></i>Ban user</a></li>
{% if v.banawards > 0 %}
<li class="list-group-item"><a href="javascript:void(0)" onclick="post_toast('/banaward/comment/{{c.id}}')"><i class="fas fa-user-slash text-danger"></i>Ban user</a></li>
{% else %}
<li class="list-group-item"><a href="/banaward/comment/{{c.id}}"><i class="fas fa-user-slash text-danger"></i>Ban user</a></li>
{% endif %}
{% endif %}
{% if v and c.id in v.saved_comment_idlist() %}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -132,8 +132,12 @@
<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>
{% if v and v.id!=p.author_id and v.admin_level == 0 %}
<button class="btn btn-link btn-block btn-lg text-left text-muted"><a href="javascript:void(0)" onclick="post_toast('/banaward/post/{{p.id}}')"><i class="fas fa-user-slash text-danger mr-3"></i>Ban user</a></button>
{% if v and v.id!=p.author_id and v.admin_level == 0 %}
{% if v.banawards > 0 %}
<button class="btn btn-link btn-block btn-lg text-left text-muted"><a href="javascript:void(0)" onclick="post_toast('/banaward/post/{{p.id}}')"><i class="fas fa-user-slash text-danger mr-3"></i>Ban user</a></button>
{% else %}
<button class="btn btn-link btn-block btn-lg text-left text-muted"><a href="/banaward/post/{{p.id}}"><i class="fas fa-user-slash text-danger mr-3"></i>Ban user</a></button>
{% endif %}
{% endif %}
{% if v and p.id in v.subscribed_idlist() %}
@ -323,9 +327,13 @@
{% endif %}
<li class="list-inline-item"><a href="/votes?link=https://rdrama.net{{p.permalink}}"><i class="fas fa-arrows-v"></i>Votes</a></li>
{% if v and v.id!=p.author_id and v.admin_level == 0 %}
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post_toast('/banaward/post/{{p.id}}')"><i class="fas fa-user-slash text-danger"></i>Ban user</a></li>
{% if v.banawards > 0 %}
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post_toast('/banaward/post/{{p.id}}')"><i class="fas fa-user-slash text-danger"></i>Ban user</a></li>
{% else %}
<li class="list-inline-item"><a href="/banaward/post/{{p.id}}"><i class="fas fa-user-slash text-danger"></i>Ban user</a></li>
{% endif %}
{% endif %}
<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>

View File

@ -195,7 +195,11 @@
<li class="list-inline-item"><a href="/votes?link=https://rdrama.net{{p.permalink}}"><i class="fas fa-arrows-v"></i>Votes</a></li>
{% if v and v.id!=p.author_id and v.admin_level == 0 %}
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post_toast('/banaward/post/{{p.id}}')"><i class="fas fa-user-slash text-danger"></i>Ban user</a></li>
{% if v.banawards > 0 %}
<li class="list-inline-item"><a href="javascript:void(0)" onclick="post_toast('/banaward/post/{{p.id}}')"><i class="fas fa-user-slash text-danger"></i>Ban user</a></li>
{% else %}
<li class="list-inline-item"><a href="/banaward/post/{{p.id}}"><i class="fas fa-user-slash text-danger"></i>Ban user</a></li>
{% endif %}
{% endif %}
<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>
@ -379,7 +383,11 @@
<li id="block-user-{{p.base36id}}" class="list-inline-item {% if p.is_blocking %} d-none{% endif %}"><a href="javascript:void(0)" onclick="post_toast('/settings/block?username={{p.author.username}}', callback=function(){window.location.reload(true);})"><i class="fas fa-user-slash"></i>Block user</a></li>
{% if v and v.id!=p.author_id and v.admin_level == 0 %}
<button class="btn btn-link btn-block btn-lg text-left text-muted"><a href="javascript:void(0)" onclick="post_toast('/banaward/post/{{p.id}}')"><i class="fas fa-user-slash text-danger mr-3"></i>Ban user</a></button>
{% if v.banawards > 0 %}
<button class="btn btn-link btn-block btn-lg text-left text-muted"><a href="javascript:void(0)" onclick="post_toast('/banaward/post/{{p.id}}')"><i class="fas fa-user-slash text-danger mr-3"></i>Ban user</a></button>
{% else %}
<button class="btn btn-link btn-block btn-lg text-left text-muted"><a href="/banaward/post/{{p.id}}"><i class="fas fa-user-slash text-danger mr-3"></i>Ban user</a></button>
{% endif %}
{% endif %}
{% if v and p.id in v.subscribed_idlist() %}

View File

@ -155,6 +155,7 @@
{% elif v and v.id == u.id %}
<a href="/settings/profile" class="btn btn-secondary">Edit profile</a>
<a href="/views" class="btn btn-secondary">Profile views</a>
{% endif %}
{% if v and v.id != u.id and v.admin_level > 0 and u.admin_level == 0 %}
<br><br>
@ -306,6 +307,7 @@
</div>
{% if v and v.id == u.id %}
<a href="/settings/profile" class="btn btn-secondary btn-sm">Edit profile</a>
<a href="/views" class="btn btn-secondary">Profile views</a>
{% endif %}
{% if v and v.id != u.id %}
<a id="button-unsub2" class="btn btn-secondary {% if not is_following %}d-none{% endif %}" href="javascript:void(0)" onclick="post('/api/unfollow/{{u.username}}', callback=function(){document.getElementById('button-unsub2').classList.toggle('d-none');document.getElementById('button-sub2').classList.toggle('d-none');})">Unfollow</a>