forked from rDrama/rDrama
1
0
Fork 0

mods -> mods_hole

master
Aevann 2024-01-12 09:18:04 +02:00
parent 660e90fc89
commit 51c06b6a51
11 changed files with 48 additions and 48 deletions

View File

@ -407,7 +407,7 @@ class User(Base):
return True
@lazy
def mods(self, hole):
def mods_hole(self, hole):
if self.is_permabanned or self.shadowbanned: return False
if hole == 'test'and self.truescore >= TRUESCORE_MINIMUM: return True
if self.admin_level >= PERMS['MODS_EVERY_HOLE']: return True

View File

@ -614,7 +614,7 @@ def diff_words(answer, guess):
def toggle_comment_nsfw(cid, v):
comment = get_comment(cid)
if comment.author_id != v.id and v.admin_level < PERMS['POST_COMMENT_MODERATION'] and not (comment.post and comment.post.hole and v.mods(comment.post.hole)) and comment.wall_user_id != v.id:
if comment.author_id != v.id and v.admin_level < PERMS['POST_COMMENT_MODERATION'] and not (comment.post and comment.post.hole and v.mods_hole(comment.post.hole)) and comment.wall_user_id != v.id:
abort(403)
comment.nsfw = not comment.nsfw
@ -628,7 +628,7 @@ def toggle_comment_nsfw(cid, v):
target_comment_id = comment.id,
)
g.db.add(ma)
elif comment.post and comment.post.hole and v.mods(comment.post.hole):
elif comment.post and comment.post.hole and v.mods_hole(comment.post.hole):
ma = HoleAction(
hole = comment.post.hole,
kind = "set_nsfw_comment" if comment.nsfw else "unset_nsfw_comment",

View File

@ -19,11 +19,11 @@ def exile_post(v, pid):
hole = p.hole
if not hole: abort(400)
if not v.mods(hole): abort(403)
if not v.mods_hole(hole): abort(403)
u = p.author
if u.mods(hole): abort(403)
if u.mods_hole(hole): abort(403)
if not u.exiler_username(hole):
exile = Exile(user_id=u.id, hole=hole, exiler_id=v.id)
@ -53,11 +53,11 @@ def exile_comment(v, cid):
hole = c.post.hole
if not hole: abort(400)
if not v.mods(hole): abort(403)
if not v.mods_hole(hole): abort(403)
u = c.author
if u.mods(hole): abort(403)
if u.mods_hole(hole): abort(403)
if not u.exiler_username(hole):
exile = Exile(user_id=u.id, hole=hole, exiler_id=v.id)
@ -85,7 +85,7 @@ def exile_comment(v, cid):
def unexile(v, hole, uid):
u = get_account(uid)
if not v.mods(hole): abort(403)
if not v.mods_hole(hole): abort(403)
if u.exiler_username(hole):
exile = g.db.query(Exile).filter_by(user_id=u.id, hole=hole).one_or_none()
@ -201,7 +201,7 @@ def unfollow_sub(v, hole):
@limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400)
@limiter.limit(DEFAULT_RATELIMIT, deduct_when=lambda response: response.status_code < 400, key_func=get_ID)
@auth_required
def mods(v, hole):
def mods_hole(v, hole):
if hole == 'test':
return redirect('/users')
@ -273,7 +273,7 @@ def add_mod(v, hole):
abort(403, "Everyone is already a mod of this hole!")
hole = get_hole(hole).name
if not v.mods(hole): abort(403)
if not v.mods_hole(hole): abort(403)
user = request.values.get('user')
@ -312,7 +312,7 @@ def add_mod(v, hole):
def remove_mod(v, hole):
hole = get_hole(hole).name
if not v.mods(hole): abort(403)
if not v.mods_hole(hole): abort(403)
uid = request.values.get('uid')
@ -405,7 +405,7 @@ def kick(v, pid):
post = get_post(pid)
if not post.hole: abort(403)
if not v.mods(post.hole): abort(403)
if not v.mods_hole(post.hole): abort(403)
old = post.hole
post.hole = None
@ -435,7 +435,7 @@ def kick(v, pid):
@auth_required
def hole_settings(v, hole):
hole = get_hole(hole)
if not v.mods(hole.name): abort(403)
if not v.mods_hole(hole.name): abort(403)
return render_template('hole/settings.html', v=v, sidebar=hole.sidebar, hole=hole, css=hole.css)
@ -447,7 +447,7 @@ def hole_settings(v, hole):
@auth_required
def post_hole_sidebar(v, hole):
hole = get_hole(hole)
if not v.mods(hole.name): abort(403)
if not v.mods_hole(hole.name): abort(403)
if v.shadowbanned: abort(400)
sidebar = request.values.get('sidebar', '').strip()
@ -485,7 +485,7 @@ def post_hole_css(v, hole):
css = request.values.get('css', '').strip()
if not hole: abort(404)
if not v.mods(hole.name): abort(403)
if not v.mods_hole(hole.name): abort(403)
if v.shadowbanned: abort(400)
if len(css) > CSS_LENGTH_LIMIT:
@ -526,7 +526,7 @@ def upload_hole_sidebar(v, hole):
if g.is_tor: abort(403, "Image uploads are not allowed through Tor")
hole = get_hole(hole)
if not v.mods(hole.name): abort(403)
if not v.mods_hole(hole.name): abort(403)
if v.shadowbanned: abort(500)
file = request.files["sidebar"]
@ -554,7 +554,7 @@ def upload_hole_sidebar(v, hole):
@auth_required
def delete_hole_sidebar(v, hole, index):
hole = get_hole(hole)
if not v.mods(hole.name): abort(403)
if not v.mods_hole(hole.name): abort(403)
if not hole.sidebarurls:
abort(404, f"Sidebar image not found (/h/{hole.name} has no sidebar images)")
@ -584,7 +584,7 @@ def delete_hole_sidebar(v, hole, index):
@auth_required
def delete_all_hole_sidebars(v, hole):
hole = get_hole(hole)
if not v.mods(hole.name): abort(403)
if not v.mods_hole(hole.name): abort(403)
for sidebar in hole.sidebarurls:
try:
@ -614,7 +614,7 @@ def upload_hole_banner(v, hole):
if g.is_tor: abort(403, "Image uploads are not allowed through Tor")
hole = get_hole(hole)
if not v.mods(hole.name): abort(403)
if not v.mods_hole(hole.name): abort(403)
if v.shadowbanned: abort(500)
file = request.files["banner"]
@ -642,7 +642,7 @@ def upload_hole_banner(v, hole):
@auth_required
def delete_hole_banner(v, hole, index):
hole = get_hole(hole)
if not v.mods(hole.name): abort(403)
if not v.mods_hole(hole.name): abort(403)
if not hole.bannerurls:
abort(404, f"Banner not found (/h/{hole.name} has no banners)")
@ -672,7 +672,7 @@ def delete_hole_banner(v, hole, index):
@auth_required
def delete_all_hole_banners(v, hole):
hole = get_hole(hole)
if not v.mods(hole.name): abort(403)
if not v.mods_hole(hole.name): abort(403)
for banner in hole.bannerurls:
try:
@ -702,7 +702,7 @@ def hole_marsey(v, hole):
if g.is_tor: abort(403, "Image uploads are not allowed through TOR!")
hole = get_hole(hole)
if not v.mods(hole.name): abort(403)
if not v.mods_hole(hole.name): abort(403)
if v.shadowbanned: abort(500)
file = request.files["marsey"]
@ -746,7 +746,7 @@ def hole_pin(v, pid):
if not p.hole: abort(403)
if not v.mods(p.hole): abort(403)
if not v.mods_hole(p.hole): abort(403)
num = g.db.query(Post).filter(Post.hole == p.hole, Post.hole_pinned != None).count()
if num >= 2:
@ -782,7 +782,7 @@ def hole_unpin(v, pid):
if not p.hole: abort(403)
if not v.mods(p.hole): abort(403)
if not v.mods_hole(p.hole): abort(403)
p.hole_pinned = None
g.db.add(p)
@ -814,7 +814,7 @@ def hole_stealth(v, hole):
hole = get_hole(hole)
if hole.name in {'braincels','smuggies','mnn','glory'} and v.admin_level < PERMS["MODS_EVERY_HOLE"]:
abort(403)
if not v.mods(hole.name): abort(403)
if not v.mods_hole(hole.name): abort(403)
hole.stealth = not hole.stealth
g.db.add(hole)
@ -851,7 +851,7 @@ def pin_comment_mod(cid, v):
comment = get_comment(cid, v=v)
if not comment.stickied:
if not (comment.post.hole and v.mods(comment.post.hole)): abort(403)
if not (comment.post.hole and v.mods_hole(comment.post.hole)): abort(403)
comment.stickied = v.username + " (Mod)"
@ -884,7 +884,7 @@ def unpin_comment_mod(cid, v):
comment = get_comment(cid, v=v)
if comment.stickied:
if not (comment.post.hole and v.mods(comment.post.hole)): abort(403)
if not (comment.post.hole and v.mods_hole(comment.post.hole)): abort(403)
comment.stickied = None
comment.stickied_utc = None

View File

@ -767,7 +767,7 @@ def undelete_post_pid(pid, v):
def mark_post_nsfw(pid, v):
p = get_post(pid)
if p.author_id != v.id and v.admin_level < PERMS['POST_COMMENT_MODERATION'] and not (p.hole and v.mods(p.hole)):
if p.author_id != v.id and v.admin_level < PERMS['POST_COMMENT_MODERATION'] and not (p.hole and v.mods_hole(p.hole)):
abort(403)
if p.nsfw and v.is_permabanned:
@ -806,7 +806,7 @@ def mark_post_nsfw(pid, v):
def unmark_post_nsfw(pid, v):
p = get_post(pid)
if p.author_id != v.id and v.admin_level < PERMS['POST_COMMENT_MODERATION'] and not (p.hole and v.mods(p.hole)):
if p.author_id != v.id and v.admin_level < PERMS['POST_COMMENT_MODERATION'] and not (p.hole and v.mods_hole(p.hole)):
abort(403)
if p.nsfw and v.is_permabanned:

View File

@ -31,7 +31,7 @@ def report_post(pid, v):
if len(reason_html) > 350:
abort(400, "Report reason too long!")
if reason.startswith('!') and (v.admin_level >= PERMS['POST_COMMENT_MODERATION'] or post.hole and v.mods(post.hole)):
if reason.startswith('!') and (v.admin_level >= PERMS['POST_COMMENT_MODERATION'] or post.hole and v.mods_hole(post.hole)):
post.flair = reason_html[1:]
g.db.add(post)
if v.admin_level >= PERMS['POST_COMMENT_MODERATION']:
@ -166,7 +166,7 @@ def move_post(post, v, reason):
hole_to = get_hole(reason, graceful=True)
hole_to = hole_to.name if hole_to else None
can_move_post = v.admin_level >= PERMS['POST_COMMENT_MODERATION'] or (post.hole and v.mods(hole_from))
can_move_post = v.admin_level >= PERMS['POST_COMMENT_MODERATION'] or (post.hole and v.mods_hole(hole_from))
if hole_from != 'chudrama': # posts can only be moved out of /h/chudrama by admins
can_move_post = can_move_post or post.author_id == v.id
if not can_move_post: return False

View File

@ -433,7 +433,7 @@
{% set url = "sticky_comment" %}
{% elif v.id == c.post.author_id %}
{% set url = "pin_comment" %}
{% elif c.post.hole and v.mods(c.post.hole) %}
{% elif c.post.hole and v.mods_hole(c.post.hole) %}
{% set url = "pin_comment_mod" %}
{% endif %}
@ -464,7 +464,7 @@
{% if c.parent_post %}
{% set hole = c.post.hole %}
{% if hole and v.mods(hole) and not c.author.mods(hole) %}
{% if hole and v.mods_hole(hole) and not c.author.mods_hole(hole) %}
<button type="button" id="exile-{{c.id}}" class="d-none {% if not c.author.exiler_username(hole) %}d-md-block{% endif %} dropdown-item list-inline-item text-danger" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/exile/comment/{{c.id}}','exile-{{c.id}}','unexile-{{c.id}}','d-none')"><i class="fas fa-campfire text-danger fa-fw"></i>Exile user</button>
<button type="button" id="unexile-{{c.id}}" class="d-none {% if c.author.exiler_username(hole) %}d-md-block{% endif %} dropdown-item list-inline-item text-success" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/h/{{hole}}/unexile/{{c.author_id}}','exile-{{c.id}}','unexile-{{c.id}}','d-none')"><i class="fas fa-campfire text-success fa-fw"></i>Unexile user</button>
{% endif %}
@ -475,7 +475,7 @@
<button type="button" id="unprogstack-{{c.id}}" class="dropdown-item list-inline-item d-none {% if c.is_approved == PROGSTACK_ID %}d-md-block{% endif %} text-danger" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/admin/unprogstack/comment/{{c.id}}','progstack-{{c.id}}','unprogstack-{{c.id}}','d-md-block')"><i class="fas fa-bullhorn text-danger fa-fw"></i>Remove Progressive Stack</button>
{% endif %}
{% if FEATURES['NSFW_MARKING'] and (c.parent_post or c.wall_user_id) and (c.author_id == v.id or v.admin_level >= PERMS['POST_COMMENT_MODERATION'] or (c.post.hole and v.mods(c.post.hole))) or c.wall_user_id == v.id %}
{% if FEATURES['NSFW_MARKING'] and (c.parent_post or c.wall_user_id) and (c.author_id == v.id or v.admin_level >= PERMS['POST_COMMENT_MODERATION'] or (c.post.hole and v.mods_hole(c.post.hole))) or c.wall_user_id == v.id %}
<button type="button" id="mark-{{c.id}}" class="dropdown-item list-inline-item d-none {% if not c.nsfw %}d-md-block{% endif %} text-danger" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/toggle_comment_nsfw/{{c.id}}','mark-{{c.id}}','unmark-{{c.id}}','d-md-block')"><i class="fas fa-eye-evil text-danger fa-fw"></i>Mark NSFW</button>
<button type="button" id="unmark-{{c.id}}" class="dropdown-item list-inline-item d-none {% if c.nsfw %}d-md-block{% endif %} text-success" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/toggle_comment_nsfw/{{c.id}}','mark-{{c.id}}','unmark-{{c.id}}','d-md-block')"><i class="fas fa-eye-evil text-success fa-fw"></i>Unmark NSFW</button>
{% endif %}
@ -633,7 +633,7 @@
{% endif %}
{% endif %}
{% if FEATURES['NSFW_MARKING'] and v.admin_level < PERMS['POST_COMMENT_MODERATION'] and (c.author_id == v.id or (c.post.hole and v.mods(c.post.hole))) or c.wall_user_id == v.id %}
{% if FEATURES['NSFW_MARKING'] and v.admin_level < PERMS['POST_COMMENT_MODERATION'] and (c.author_id == v.id or (c.post.hole and v.mods_hole(c.post.hole))) or c.wall_user_id == v.id %}
<button type="button" id="mark2-{{c.id}}" class="{% if c.nsfw %}d-none{% endif %} list-group-item text-danger" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/toggle_comment_nsfw/{{c.id}}','mark2-{{c.id}}','unmark2-{{c.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-eye-evil text-danger mr-2"></i>Mark NSFW</button>
<button type="button" id="unmark2-{{c.id}}" class="{% if not c.nsfw %}d-none{% endif %} list-group-item text-success" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/toggle_comment_nsfw/{{c.id}}','mark2-{{c.id}}','unmark2-{{c.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-eye-evil text-success mr-2"></i>Unmark NSFW</button>
@ -643,7 +643,7 @@
{% if c.parent_post and v.id == c.post.author_id %}
<button type="button" id="pin2-{{c.id}}" class="list-group-item {% if c.stickied %}d-none{% endif %} text-info" data-bs-target="#actionsModal-{{c.id}}" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/pin_comment/{{c.id}}','pin2-{{c.id}}','unpin2-{{c.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-thumbtack fa-rotate--45 text-info mr-2"></i>Pin</button>
<button type="button" id="unpin2-{{c.id}}" class="list-group-item {% if not c.stickied %}d-none{% endif %} text-info" data-bs-target="#actionsModal-{{c.id}}" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/unpin_comment/{{c.id}}','pin2-{{c.id}}','unpin2-{{c.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-thumbtack fa-rotate--45 text-info mr-2"></i>Unpin</button>
{% elif c.post.hole and v.mods(c.post.hole) %}
{% elif c.post.hole and v.mods_hole(c.post.hole) %}
<button type="button" id="pin2-{{c.id}}" class="list-group-item {% if c.stickied %}d-none{% endif %} text-info" data-bs-target="#actionsModal-{{c.id}}" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/pin_comment_mod/{{c.id}}','pin2-{{c.id}}','unpin2-{{c.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-thumbtack fa-rotate--45 text-info mr-2"></i>Pin</button>
<button type="button" id="unpin2-{{c.id}}" class="list-group-item {% if not c.stickied %}d-none{% endif %} text-info" data-bs-target="#actionsModal-{{c.id}}" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/unpin_comment_mod/{{c.id}}','pin2-{{c.id}}','unpin2-{{c.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-thumbtack fa-rotate--45 text-info mr-2"></i>Unpin</button>
{% endif %}
@ -651,7 +651,7 @@
{% if c.parent_post %}
{% set hole = c.post.hole %}
{% if hole and v.mods(hole) and not c.author.mods(hole) %}
{% if hole and v.mods_hole(hole) and not c.author.mods_hole(hole) %}
<button type="button" data-bs-dismiss="modal" id="exile2-{{c.id}}" class="{% if c.author.exiler_username(hole) %}d-none{% endif %} list-group-item text-danger" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/exile/comment/{{c.id}}','exile2-{{c.id}}','unexile2-{{c.id}}','d-none')"><i class="fas fa-campfire text-danger mr-2"></i>Exile user</button>
<button type="button" data-bs-dismiss="modal" id="unexile2-{{c.id}}" class="{% if not c.author.exiler_username(hole) %}d-none{% endif %} list-group-item text-success" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/h/{{hole}}/unexile/{{c.author_id}}','exile2-{{c.id}}','unexile2-{{c.id}}','d-none')"><i class="fas fa-campfire text-success mr-2"></i>Unexile user</button>
{% endif %}

View File

@ -24,7 +24,7 @@
</td>
<td {% if exile.created_utc %}data-time="{{exile.created_utc}}"{% endif %}></td>
<td>
{% if v.mods(hole.name) %}
{% if v.mods_hole(hole.name) %}
<form action="/h/{{hole}}/unexile/{{user.id}}" method="post" data-nonce="{{g.nonce}}" data-onsubmit="sendFormXHRReload(this)">
<input hidden name="formkey" value="{{v|formkey}}">
<input autocomplete="off" class="btn btn-primary ml-auto" type="submit" value="Unexile">

View File

@ -34,7 +34,7 @@
</table>
</div>
{% if v.mods(hole.name) %}
{% if v.mods_hole(hole.name) %}
<form action="/h/{{hole}}/add_mod" method="post" data-nonce="{{g.nonce}}" data-onsubmit="sendFormXHRReload(this)">
<input hidden name="formkey" value="{{v|formkey}}">
<input class="form-control" style="display:inline;width:250px" autocomplete="off" type="text" name="user" class="form-control" placeholder="Enter username..">

View File

@ -60,7 +60,7 @@
<button type="button" id="pin-{{p.id}}" class="dropdown-item {% if p.stickied and not p.stickied_utc %}d-none{% endif %} list-inline-item text-info" data-nonce="{{g.nonce}}" data-onclick="pinPost(this, '{{p.id}}')"><i class="fas fa-thumbtack fa-rotate--45"></i>Pin {% if p.stickied_utc %}permanently{% else %}for 1 hour{% endif %}</button>
<button type="button" id="unpin-{{p.id}}" class="dropdown-item {% if not p.stickied %}d-none{% endif %} list-inline-item text-info" data-nonce="{{g.nonce}}" data-onclick="unpinPost(this, '{{p.id}}')"><i class="fas fa-thumbtack fa-rotate--45"></i>Unpin</button>
{% endif %}
{% if p.hole and v.mods(p.hole) %}
{% if p.hole and v.mods_hole(p.hole) %}
<button type="button" id="hole-pin-{{p.id}}" class="dropdown-item {% if p.hole_pinned %}d-none{% endif %} list-inline-item text-info" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/hole_pin/{{p.id}}','hole-pin-{{p.id}}','hole-unpin-{{p.id}}','d-none')"><i class="fas fa-thumbtack fa-rotate--45"></i>Pin to /h/{{p.hole}}</button>
<button type="button" id="hole-unpin-{{p.id}}" class="dropdown-item {% if not p.hole_pinned %}d-none{% endif %} list-inline-item text-info" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/hole_unpin/{{p.id}}','hole-pin-{{p.id}}','hole-unpin-{{p.id}}','d-none')"><i class="fas fa-thumbtack fa-rotate--45"></i>Unpin from /h/{{p.hole}}</button>
{% endif %}
@ -72,14 +72,14 @@
<button type="button" id="block-{{p.id}}" class="dropdown-item list-inline-item text-danger {% if p.is_blocking %}d-none{% endif %}" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/block_user?username={{p.author_name}}','block-{{p.id}}','unblock-{{p.id}}','d-none')"><i class="fas fa-eye-slash text-danger"></i>Block user</button>
<button type="button" id="unblock-{{p.id}}" class="dropdown-item text-success list-inline-item {% if not p.is_blocking %}d-none{% endif %}" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/unblock_user?username={{p.author_name}}','block-{{p.id}}','unblock-{{p.id}}','d-none')"><i class="fas fa-eye text-success"></i>Unblock user</button>
{% endif %}
{% if p.hole and v.mods(p.hole) %}
{% if p.hole and v.mods_hole(p.hole) %}
<button type="button" class="dropdown-item list-inline-item text-danger" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/kick/{{p.id}}')"><i class="fas fa-sign-out text-danger"></i>Kick</button>
{% if not p.author.mods(p.hole) %}
{% if not p.author.mods_hole(p.hole) %}
<button type="button" id="exile-{{p.id}}" class="{% if p.author.exiler_username(p.hole) %}d-none{% endif %} dropdown-item list-inline-item text-danger" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/exile/post/{{p.id}}','exile-{{p.id}}','unexile-{{p.id}}','d-none')"><i class="fas fa-campfire text-danger"></i>Exile user</button>
<button type="button" id="unexile-{{p.id}}" class="{% if not p.author.exiler_username(p.hole) %}d-none{% endif %} dropdown-item list-inline-item text-success" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/h/{{hole}}/unexile/{{p.author_id}}','exile-{{p.id}}','unexile-{{p.id}}','d-none')"><i class="fas fa-campfire text-success"></i>Unexile user</button>
{% endif %}
{% endif %}
{% if FEATURES['NSFW_MARKING'] and (v.id == p.author_id or v.admin_level >= PERMS['POST_COMMENT_MODERATION'] or (p.hole and v.mods(p.hole))) %}
{% if FEATURES['NSFW_MARKING'] and (v.id == p.author_id or v.admin_level >= PERMS['POST_COMMENT_MODERATION'] or (p.hole and v.mods_hole(p.hole))) %}
<button type="button" id="mark-{{p.id}}" class="dropdown-item {% if p.nsfw %}d-none{% endif %} list-inline-item text-danger" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/mark_post_nsfw/{{p.id}}','mark-{{p.id}}','unmark-{{p.id}}','d-none')"><i class="fas fa-eye-evil"></i>Mark NSFW</button>
<button type="button" id="unmark-{{p.id}}" class="dropdown-item {% if not p.nsfw %}d-none{% endif %} list-inline-item text-success" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/unmark_post_nsfw/{{p.id}}','mark-{{p.id}}','unmark-{{p.id}}','d-none')"><i class="fas fa-eye-evil"></i>Unmark NSFW</button>
{% endif %}

View File

@ -31,7 +31,7 @@
<button type="button" id="unpin-profile2-{{p.id}}" class="{% if not p.is_pinned %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-muted text-left" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/pin/{{p.id}}','pin-profile2-{{p.id}}','unpin-profile2-{{p.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-thumbtack fa-rotate--45 text-center mr-2"></i>Unpin from profile</button>
{% endif %}
{% if p.hole and v.mods(p.hole) %}
{% if p.hole and v.mods_hole(p.hole) %}
<button type="button" id="hole-pin2-{{p.id}}" class="{% if p.hole_pinned %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-left text-info" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/hole_pin/{{p.id}}','hole-pin2-{{p.id}}','hole-unpin2-{{p.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-thumbtack fa-rotate--45 text-center text-info mr-2"></i>Pin to /h/{{p.hole}}</button>
<button type="button" id="hole-unpin2-{{p.id}}" class="{% if not p.hole_pinned %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-left text-info" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/hole_unpin/{{p.id}}','hole-pin2-{{p.id}}','hole-unpin2-{{p.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-thumbtack fa-rotate--45 text-center text-info mr-2"></i>Unpin from /h/{{p.hole}}</button>
{% endif %}
@ -50,15 +50,15 @@
{% endif %}
{% endif %}
{% if FEATURES['NSFW_MARKING'] and (v.id == p.author_id or (p.hole and v.mods(p.hole))) %}
{% if FEATURES['NSFW_MARKING'] and (v.id == p.author_id or (p.hole and v.mods_hole(p.hole))) %}
<button type="button" id="mark3-{{p.id}}" class="{% if p.nsfw %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-left text-danger" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/mark_post_nsfw/{{p.id}}','mark3-{{p.id}}','unmark3-{{p.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-eye-evil text-center mr-2"></i>Mark NSFW</button>
<button type="button" id="unmark3-{{p.id}}" class="{% if not p.nsfw %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-left text-success" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/unmark_post_nsfw/{{p.id}}','mark3-{{p.id}}','unmark3-{{p.id}}','d-none')" data-bs-dismiss="modal"><i class="fas fa-eye-evil text-center mr-2"></i>Unmark NSFW</button>
{% endif %}
{% if p.hole and v.mods(p.hole) %}
{% if p.hole and v.mods_hole(p.hole) %}
<button type="button" data-bs-dismiss="modal" class="nobackground btn btn-link btn-block btn-lg text-left text-danger" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/kick/{{p.id}}')"><i class="fas fa-sign-out text-danger text-center mr-2"></i>Kick</button>
{% if not p.author.mods(p.hole) %}
{% if not p.author.mods_hole(p.hole) %}
<button type="button" data-bs-dismiss="modal" id="exile2" class="{% if p.author.exiler_username(p.hole) %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-left text-danger" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/exile/post/{{p.id}}','exile2','unexile2','d-none')"><i class="fas fa-campfire mr-2 text-danger"></i>Exile user</button>
<button type="button" data-bs-dismiss="modal" id="unexile2" class="{% if not p.author.exiler_username(p.hole) %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-left text-success" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/h/{{hole}}/unexile/{{p.author_id}}','exile2','unexile2','d-none')"><i class="fas fa-campfire mr-2 text-success"></i>Unexile user</button>
{% endif %}

View File

@ -65,7 +65,7 @@
{% if hole %}
<br>
{% if v and v.mods(hole.name) %}
{% if v and v.mods_hole(hole.name) %}
<a class="btn btn-primary btn-block mb-3 text-uppercase" style="font-size: 0.87rem" href="/h/{{hole}}/settings">/h/{{hole}} SETTINGS</a>
{% endif %}