stop using numbers for admin_level comparison

pull/143/head
Aevann 2023-04-25 07:53:20 +02:00
parent f73f69fdea
commit 117532c4f9
3 changed files with 3 additions and 3 deletions

View File

@ -59,7 +59,7 @@
</span>
<span class="text d-none">{% if m %}{{m['text']}}{% endif %}</span>
<i class="quote btn fas fa-reply ml-auto" data-nonce="{{g.nonce}}" data-onclick="quote(this)"></i>
{% if v.admin_level > 1 %}
{% if v.admin_level >= PERMS['POST_COMMENT_MODERATION'] %}
<i class="btn del delconfirm fas fa-trash-alt"></i>
<i class="btn d-none del delmsg fas fa-trash-alt text-danger" data-nonce="{{g.nonce}}" data-onclick="del(this)"></i>
{% endif %}

View File

@ -4,7 +4,7 @@
{% include "modals/award.html" %}
{% endif %}
{% if v and v.admin_level > 1 %}
{% if v and v.admin_level >= PERMS['POST_COMMENT_MODERATION'] %}
<script defer src="{{'js/admin/pinpost.js' | asset}}"></script>
{% endif %}

View File

@ -79,7 +79,7 @@
<button type="button" id="add-admin-{{deviceType}}" class="btn btn-primary" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/@{{u.username}}/make_admin','add-admin-{{deviceType}}','remove-admin-{{deviceType}}','d-none')">Make Admin</button>
{% endif %}
{% if v.admin_level >= PERMS['ADMIN_REMOVE'] %}
<button type="button" id="remove-admin-{{deviceType}}" class="{% if u.admin_level < 1 %}d-none{% endif %} btn btn-danger" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/@{{u.username}}/remove_admin','add-admin-{{deviceType}}','remove-admin-{{deviceType}}','d-none')">Remove Admin</button>
<button type="button" id="remove-admin-{{deviceType}}" class="{% if not u.admin_level %}d-none{% endif %} btn btn-danger" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/@{{u.username}}/remove_admin','add-admin-{{deviceType}}','remove-admin-{{deviceType}}','d-none')">Remove Admin</button>
{% endif %}
{% if v.admin_level >= PERMS['ADMIN_ACTIONS_REVERT'] and u.admin_level %}
<button type="button" class="btn btn-danger" data-areyousure="postToastSwitch(this,'/@{{u.username}}/revert_actions')" data-nonce="{{g.nonce}}" data-onclick="areyousure(this)">Revert Admin Actions</button>