sneed
This commit is contained in:
parent
9723b364bd
commit
54c686456b
10 changed files with 258 additions and 84 deletions
|
@ -25,7 +25,7 @@ beams_client = PushNotifications(
|
||||||
@auth_required
|
@auth_required
|
||||||
def banawardcomment(comment_id, v):
|
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()
|
comment = g.db.query(Comment).filter_by(id=comment_id).first()
|
||||||
if not comment: abort(400)
|
if not comment: abort(400)
|
||||||
|
|
|
@ -49,7 +49,7 @@ def resize():
|
||||||
@auth_required
|
@auth_required
|
||||||
def postbanaward(post_id, v):
|
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()
|
post = g.db.query(Submission).filter_by(id=post_id).first()
|
||||||
if not post: abort(400)
|
if not post: abort(400)
|
||||||
|
|
|
@ -215,7 +215,7 @@ def followers(username, v):
|
||||||
@app.get("/views")
|
@app.get("/views")
|
||||||
@auth_required
|
@auth_required
|
||||||
def visitors(v):
|
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)
|
viewers=sorted(v.viewers, key = lambda x: x.last_view_utc)
|
||||||
return render_template("viewers.html", v=v, viewers=viewers)
|
return render_template("viewers.html", v=v, viewers=viewers)
|
||||||
|
|
||||||
|
|
|
@ -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>
|
<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 %}
|
{% if v and v.id!=c.author_id and v.admin_level == 0 %}
|
||||||
|
{% 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>
|
<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 %}
|
{% endif %}
|
||||||
|
|
||||||
{% if v and c.id in v.saved_comment_idlist() %}
|
{% 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>
|
<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 %}
|
{% if v and v.id!=c.author_id and v.admin_level == 0 %}
|
||||||
|
{% 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>
|
<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 %}
|
{% endif %}
|
||||||
|
|
||||||
{% if v and c.id in v.saved_comment_idlist() %}
|
{% if v and c.id in v.saved_comment_idlist() %}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<meta name="thumbnail" content="/assets/images/preview.png">
|
<meta name="thumbnail" content="/assets/images/preview.png">
|
||||||
<link rel="icon" type="image/png" href="/assets/favicon.png">
|
<link rel="icon" type="image/png" href="/assets/favicon.png">
|
||||||
<title>403 Unauthorized</title>
|
<title>502 Bad Gateway</title>
|
||||||
|
|
||||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
|
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
|
||||||
|
|
||||||
|
@ -52,10 +52,10 @@
|
||||||
<div class="col-10 col-md-5">
|
<div class="col-10 col-md-5">
|
||||||
<div class="text-center px-3 my-8">
|
<div class="text-center px-3 my-8">
|
||||||
<i class="fad fa-helmet-battle text-muted mb-5" style="font-size: 5rem;"></i>
|
<i class="fad fa-helmet-battle text-muted mb-5" style="font-size: 5rem;"></i>
|
||||||
<h1 class="h5">403 Unauthorized</h1>
|
<h1 class="h5">502 Bad Gateway</h1>
|
||||||
<p class="text-muted">This page is only available to patrons:</p>
|
<p class="text-muted">Don't go this way, stranger. The gate is closed, and the guards are saying:</p>
|
||||||
<p class="text-muted mb-5">https://rdrama.gumroad.com/l/tfcvri</p>
|
<p class="text-muted mb-5">"We're restarting the server right now, try again in a few moments."</p>
|
||||||
<p class="text-muted mb-5">https://patreon.com/Aevann</p>
|
<p><a href="javascript:void(0)" onclick="window.location.reload(true)" class="btn btn-primary">Reload</a></p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
74
drama/templates/errors/banaward.html
Normal file
74
drama/templates/errors/banaward.html
Normal file
File diff suppressed because one or more lines are too long
74
drama/templates/errors/patron.html
Normal file
74
drama/templates/errors/patron.html
Normal file
File diff suppressed because one or more lines are too long
|
@ -133,7 +133,11 @@
|
||||||
<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="/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 %}
|
{% 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>
|
<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 %}
|
{% endif %}
|
||||||
|
|
||||||
{% if v and p.id in v.subscribed_idlist() %}
|
{% if v and p.id in v.subscribed_idlist() %}
|
||||||
|
@ -325,7 +329,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>
|
<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 %}
|
{% if v and v.id!=p.author_id and v.admin_level == 0 %}
|
||||||
|
{% 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>
|
<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 %}
|
{% 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>
|
<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>
|
||||||
|
|
|
@ -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>
|
<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 %}
|
{% if v and v.id!=p.author_id and v.admin_level == 0 %}
|
||||||
|
{% 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>
|
<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 %}
|
{% 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>
|
<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>
|
<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 %}
|
{% 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>
|
<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 %}
|
{% endif %}
|
||||||
|
|
||||||
{% if v and p.id in v.subscribed_idlist() %}
|
{% if v and p.id in v.subscribed_idlist() %}
|
||||||
|
|
|
@ -155,6 +155,7 @@
|
||||||
|
|
||||||
{% elif v and v.id == u.id %}
|
{% elif v and v.id == u.id %}
|
||||||
<a href="/settings/profile" class="btn btn-secondary">Edit profile</a>
|
<a href="/settings/profile" class="btn btn-secondary">Edit profile</a>
|
||||||
|
<a href="/views" class="btn btn-secondary">Profile views</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if v and v.id != u.id and v.admin_level > 0 and u.admin_level == 0 %}
|
{% if v and v.id != u.id and v.admin_level > 0 and u.admin_level == 0 %}
|
||||||
<br><br>
|
<br><br>
|
||||||
|
@ -306,6 +307,7 @@
|
||||||
</div>
|
</div>
|
||||||
{% if v and v.id == u.id %}
|
{% if v and v.id == u.id %}
|
||||||
<a href="/settings/profile" class="btn btn-secondary btn-sm">Edit profile</a>
|
<a href="/settings/profile" class="btn btn-secondary btn-sm">Edit profile</a>
|
||||||
|
<a href="/views" class="btn btn-secondary">Profile views</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if v and v.id != u.id %}
|
{% 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>
|
<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>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue