forked from rDrama/rDrama
1
0
Fork 0

submission: change ADMIN_HOME_VISIBLE permissions to can view post mod tools perm

user: make so user can't moderate themselves at least in the UI
master
justcool393 2022-10-06 18:44:33 -07:00
parent 9b705fc23e
commit 35162a4899
2 changed files with 35 additions and 36 deletions

View File

@ -590,7 +590,7 @@
</div> </div>
{% endif %} {% endif %}
{% if v and v.admin_level >= PERMS['POST_COMMENT_MODERATION'] %} {% if v and v.admin_level >= PERMS['POST_COMMENT_MODERATION_TOOLS_VISIBLE'] %}
{% include "post_admin_actions_mobile.html" %} {% include "post_admin_actions_mobile.html" %}
{% endif %} {% endif %}
@ -902,7 +902,7 @@
<span class="text-info d-none {{p.id}}-new-comments"></span> <span class="text-info d-none {{p.id}}-new-comments"></span>
</a> </a>
{% if v and v.admin_level >= PERMS['ADMIN_HOME_VISIBLE'] %} {% if v and v.admin_level >= PERMS['POST_COMMENT_MODERATION_TOOLS_VISIBLE'] %}
<a class="ml-2" role="button" data-bs-toggle="modal" data-bs-target="#adminModal-{{p.id}}"> <a class="ml-2" role="button" data-bs-toggle="modal" data-bs-target="#adminModal-{{p.id}}">
<i class="fas fa-broom"></i> <i class="fas fa-broom"></i>
</a> </a>

View File

@ -222,7 +222,7 @@
<a id="admin" class="{% if u.admin_level >= PERMS['ADMIN_ADD_PERM_LEVEL'] %}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast(this,'/@{{u.username}}/make_admin','admin','unadmin','d-none')">Make admin</a> <a id="admin" class="{% if u.admin_level >= PERMS['ADMIN_ADD_PERM_LEVEL'] %}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast(this,'/@{{u.username}}/make_admin','admin','unadmin','d-none')">Make admin</a>
{% endif %} {% endif %}
{% if v.admin_level >= PERMS['ADMIN_REMOVE'] %} {% if v.admin_level >= PERMS['ADMIN_REMOVE'] %}
<a id="unadmin" class="{% if u.admin_level < PERMS['ADMIN_ADD_PERM_LEVEL'] %}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast(this,'/@{{u.username}}/remove_admin','admin','unadmin','d-none')">Remove admin</a> <a id="unadmin" class="{% if u.admin_level < 1 %}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast(this,'/@{{u.username}}/remove_admin','admin','unadmin','d-none')">Remove admin</a>
{% endif %} {% endif %}
{% if v.admin_level >= PERMS['ADMIN_ACTIONS_REVERT'] %} {% if v.admin_level >= PERMS['ADMIN_ACTIONS_REVERT'] %}
<a class="btn btn-primary" role="button" onclick="post_toast(this,'/@{{u.username}}/revert_actions')">Revert admin actions</a> <a class="btn btn-primary" role="button" onclick="post_toast(this,'/@{{u.username}}/revert_actions')">Revert admin actions</a>
@ -336,43 +336,42 @@
</form> </form>
{% endif %} {% endif %}
{% endif %} {% endif %}
{% endif %}
<pre></pre> <pre></pre>
<pre></pre> <pre></pre>
{% if v and v.admin_level >= PERMS['USER_AGENDAPOSTER'] %} {% if v and v.admin_level >= PERMS['USER_AGENDAPOSTER'] %}
<form id="agendaposter1" class="{% if u.agendaposter %}d-none{% endif %}" action="/agendaposter/{{u.id}}" method="post"> <form id="agendaposter1" class="{% if u.agendaposter %}d-none{% endif %}" action="/agendaposter/{{u.id}}" method="post">
<input type="hidden" name="formkey", value="{{v.formkey}}"> <input type="hidden" name="formkey", value="{{v.formkey}}">
<input autocomplete="off" type="number" step="any" name="days" class="form-control" placeholder="Days (0 or blank = permanent)"> <input autocomplete="off" type="number" step="any" name="days" class="form-control" placeholder="Days (0 or blank = permanent)">
<input type="submit" onclick="disable(this)" class="btn btn-danger" value="Lock Chud Theme"> <input type="submit" onclick="disable(this)" class="btn btn-danger" value="Lock Chud Theme">
</form> </form>
<pre></pre>
<a id="unagendaposter" class="{% if not u.agendaposter %}d-none{% endif %} btn btn-success" role="button" onclick="post_toast(this,'/unagendaposter/{{u.id}}','agendaposter1','unagendaposter','d-none')">Disable Chud Theme</a>
{% endif %}
<pre></pre> <pre></pre>
{% if v and v.admin_level >= PERMS['USER_BAN']}
<a id="unagendaposter" class="{% if not u.agendaposter %}d-none{% endif %} btn btn-success" role="button" onclick="post_toast(this,'/unagendaposter/{{u.id}}','agendaposter1','unagendaposter','d-none')">Disable Chud Theme</a> <a id="mute-user" class="{% if u.is_muted %}d-none{% endif %} btn btn-danger" role="button" onclick="post_toast(this,'/mute_user/{{u.id}}/1','mute-user','unmute-user','d-none')">Mute</a>
{% endif %} <a id="unmute-user" class="{% if not u.is_muted %}d-none{% endif %} btn btn-success" role="button" onclick="post_toast(this,'/mute_user/{{u.id}}/0','mute-user','unmute-user','d-none')">Unmute</a>
{% endif %}
<pre></pre> <pre></pre>
{% if v and v.admin_level >= PERMS['USER_BAN']} {% if v and v.admin_level >= PERMS['POST_COMMENT_MODERATION'] %}
<a id="mute-user" class="{% if u.is_muted %}d-none{% endif %} btn btn-danger" role="button" onclick="post_toast(this,'/mute_user/{{u.id}}/1','mute-user','unmute-user','d-none')">Mute</a> <form action="/admin/unnuke_user" method="post">
<a id="unmute-user" class="{% if not u.is_muted %}d-none{% endif %} btn btn-success" role="button" onclick="post_toast(this,'/mute_user/{{u.id}}/0','mute-user','unmute-user','d-none')">Unmute</a> <input type="hidden" name="formkey", value="{{v.formkey}}">
<pre></pre> <input type="hidden" name="user" value="{{u.username}}">
{% endif %} <input type="submit" onclick="disable(this)" class="btn btn-success" value="Approve User's Content">
{% if v and v.admin_level >= PERMS['POST_COMMENT_MODERATION'] %} </form>
<form action="/admin/unnuke_user" method="post"> <pre></pre>
<input type="hidden" name="formkey", value="{{v.formkey}}"> <form action="/admin/nuke_user" method="post">
<input type="hidden" name="user" value="{{u.username}}"> <input type="hidden" name="formkey", value="{{v.formkey}}">
<input type="submit" onclick="disable(this)" class="btn btn-success" value="Approve User's Content"> <input type="hidden" name="user" value="{{u.username}}">
</form> <input type="submit" onclick="disable(this)" class="btn btn-danger" value="Remove User's Content">
<pre></pre> </form>
<form action="/admin/nuke_user" method="post"> {% endif %}
<input type="hidden" name="formkey", value="{{v.formkey}}"> {% if FEATURES['COUNTRY_CLUB'] and v and v.admin_level >= PERMS['USER_CLUB_ALLOW_BAN'] %}
<input type="hidden" name="user" value="{{u.username}}"> <pre></pre>
<input type="submit" onclick="disable(this)" class="btn btn-danger" value="Remove User's Content"> <button id="grant2" class="{% if u.paid_dues %}d-none{% endif %} btn btn-success" onclick="post_toast(this,'/@{{u.username}}/club_allow','grant2','bar2','d-none')">Grant club access</button>
</form> <button id="bar2" class="{% if u.club_allowed == False %}d-none{% endif %} btn btn-danger" onclick="post_toast(this,'/@{{u.username}}/club_ban','grant2','bar2','d-none')">Bar from club</button>
{% endif %} {% endif %}
{% if FEATURES['COUNTRY_CLUB'] and v and v.admin_level >= PERMS['USER_CLUB_ALLOW_BAN'] %}
<pre></pre>
<button id="grant2" class="{% if u.paid_dues %}d-none{% endif %} btn btn-success" onclick="post_toast(this,'/@{{u.username}}/club_allow','grant2','bar2','d-none')">Grant club access</button>
<button id="bar2" class="{% if u.club_allowed == False %}d-none{% endif %} btn btn-danger" onclick="post_toast(this,'/@{{u.username}}/club_ban','grant2','bar2','d-none')">Bar from club</button>
{% endif %} {% endif %}
<pre></pre> <pre></pre>
<div id="profile--info"> <div id="profile--info">
@ -594,7 +593,7 @@
{% endif %} {% endif %}
{% if v.admin_level >= PERMS['ADMIN_REMOVE'] %} {% if v.admin_level >= PERMS['ADMIN_REMOVE'] %}
<a id="unadmin2" class="{% if u.admin_level < PERMS['ADMIN_ADD_PERM_LEVEL'] %}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast(this,'/@{{u.username}}/remove_admin','admin2','unadmin2','d-none')">Remove admin</a> <a id="unadmin2" class="{% if u.admin_level < 1 %}d-none{% endif %} btn btn-primary" href="javascript:void(0)" onclick="post_toast(this,'/@{{u.username}}/remove_admin','admin2','unadmin2','d-none')">Remove admin</a>
{% endif %} {% endif %}
{% if v.admin_level >= PERMS['ADMIN_ACTIONS_REVERT'] %} {% if v.admin_level >= PERMS['ADMIN_ACTIONS_REVERT'] %}