forked from MarseyWorld/MarseyWorld
132 lines
9.2 KiB
HTML
132 lines
9.2 KiB
HTML
{% macro userBanBlock(deviceType) %}
|
|
{% if u.chud %}
|
|
<h5 class="text-primary" id="profile-{{deviceType}}--chudded">CHUDDED USER:
|
|
(by {{u.chudder | safe}})
|
|
|
|
{% if u.chud > 1 %}
|
|
- {{u.unchud_string}}
|
|
{% endif %}
|
|
</h5>
|
|
{% endif %}
|
|
{% if u.is_suspended %}
|
|
<h5 class="text-primary" id="profile-{{deviceType}}--banned">BANNED USER:
|
|
{{u.ban_reason | safe}}
|
|
|
|
{% if not u.ban_reason.startswith('1-Day ban award used by') %}
|
|
(by {{u.banned_by | safe}})
|
|
{% endif %}
|
|
|
|
{% if u.unban_utc %}
|
|
- {{u.unban_string}}
|
|
{% endif %}
|
|
</h5>
|
|
{% endif %}
|
|
{% if v and v.admin_level >= PERMS['USER_SHADOWBAN'] and u.shadowbanned %}
|
|
<h5 class="text-primary" id="profile-{{deviceType}}--shadowbanned">SHADOWBANNED USER:
|
|
{{u.ban_reason | safe}}
|
|
|
|
(by <a href="/@{{u.shadowbanner}}">@{{u.shadowbanner}}</a>)
|
|
</h5>
|
|
{% endif %}
|
|
{% endmacro %}
|
|
|
|
{% macro userAdminTools(deviceType) %}
|
|
{% if v and v.id != u.id and v.admin_level >= PERMS['USER_MODERATION_TOOLS_VISIBLE'] %}
|
|
<div class="admintools-user-lower-{{deviceType}}">
|
|
{% if v.admin_level >= PERMS['USER_TITLE_CHANGE'] %}
|
|
<div class="body d-lg-flex border-bottom mt-4 mb-2">
|
|
<div class="w-lg-100">
|
|
<form action="/admin/title_change/{{u.id}}" method="post" data-nonce="{{g.nonce}}" data-onsubmit="sendFormXHR(this)">
|
|
<input hidden name="formkey" value="{{v|formkey}}">
|
|
<input maxlength=100 autocomplete="off" id="customtitlebody-{{deviceType}}" type="text" name="title" class="form-control" placeholder='Enter a flair here' value="{% if u.customtitleplain %}{{u.customtitleplain}}{% endif %}">
|
|
<div class="d-flex">
|
|
<div class="format pl-0"><i class="btn btn-secondary format d-inline-block m-0 fas fa-smile-beam" data-nonce="{{g.nonce}}" data-onclick="loadEmojis('customtitlebody-{{deviceType}}')" data-bs-toggle="modal" data-bs-target="#emojiModal" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Add Emoji"></i></div>
|
|
<div class="custom-control custom-checkbox ml-2 mt-1">
|
|
<input autocomplete="off" type="checkbox" class="custom-control-input" id="locked-{{deviceType}}" name="locked" {% if u.flairchanged %}checked{% endif %}>
|
|
<label class="custom-control-label" for="locked-{{deviceType}}">locked</label>
|
|
</div>
|
|
<input autocomplete="off" class="btn btn-primary ml-auto" type="submit" value="Change Flair">
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
{% if v.admin_level >= PERMS['USER_BAN'] %}
|
|
<form class="my-3 {% if u.is_permabanned %}d-none{% endif %}" action="/ban_user/{{u.id}}" method="post" data-nonce="{{g.nonce}}" data-onsubmit="sendFormXHRSwitch(this)">
|
|
<input hidden name="formkey" value="{{v|formkey}}">
|
|
<input autocomplete="off" style="font-size:11px" type="text" class="form-control" maxlength="256" name="reason" placeholder="Ban Reason" data-nonce="{{g.nonce}}" data-undisable_element="user-ban-submit-{{deviceType}}" required>
|
|
<input autocomplete="off" style="font-size:11px" type="number" step="any" class="form-control" name="days" max="{{max_days()}}" placeholder="Days (blank = permanent)">
|
|
<div class="custom-control custom-checkbox mb-1">
|
|
<input autocomplete="off" type="checkbox" id="alts-2-{{deviceType}}" class="custom-control-input" name="alts" value="1">
|
|
<label class="custom-control-label" for="alts-2-{{deviceType}}">Include alts</label>
|
|
</div>
|
|
<input autocomplete="off" id="user-ban-submit-{{deviceType}}" type="submit" class="btn btn-danger" value="Ban user" disabled>
|
|
</form>
|
|
|
|
<button type="button" id="unban-{{deviceType}}" class="mt-1 {% if not u.is_suspended %}d-none{% endif %} btn btn-success" data-nonce="{{g.nonce}}" data-onclick="unchud_or_unban(this,'/unban_user/{{u.id}}')">Unban user</button>
|
|
{% endif %}
|
|
{% if v.admin_level >= PERMS['USER_SHADOWBAN'] %}
|
|
<form id="shadowban-{{deviceType}}" class="my-3 {% if u.shadowbanned %}d-none{% endif %}" action="/shadowban/{{u.id}}" method="post" data-nonce="{{g.nonce}}" data-onsubmit="sendFormXHRSwitch(this)">
|
|
<input hidden name="formkey" value="{{v|formkey}}">
|
|
<input autocomplete="off" style="font-size:11px" type="text" class="form-control" maxlength="256" name="reason" placeholder="Shadowban Reason" data-nonce="{{g.nonce}}" data-undisable_element="user-shadowban-submit-{{deviceType}}" required>
|
|
<input autocomplete="off" id="user-shadowban-submit-{{deviceType}}" type="submit" class="btn btn-danger" value="Shadowban user" disabled>
|
|
</form>
|
|
|
|
<button type="button" id="unshadowban-{{deviceType}}" class="mt-1 {% if not u.shadowbanned %}d-none{% endif %} btn btn-success" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/unshadowban/{{u.id}}','shadowban-{{deviceType}}','unshadowban-{{deviceType}}','d-none')">Unshadowban user</button>
|
|
{% endif %}
|
|
{% if v.admin_level >= PERMS['USER_CHUD'] %}
|
|
<form class="my-3 {% if u.chud == 1 %}d-none{% endif %}" action="/chud_user/{{u.id}}" method="post" data-nonce="{{g.nonce}}" data-onsubmit="sendFormXHRSwitch(this)">
|
|
<input hidden name="formkey" value="{{v|formkey}}">
|
|
<input autocomplete="off" type="number" step="any" name="days" max="{{max_days()}}" class="form-control" placeholder="Days (0 or blank = permanent)">
|
|
<input type="submit" class="btn btn-danger" value="Chud">
|
|
</form>
|
|
|
|
<button type="button" id="unchud-{{deviceType}}" class="mt-1 {% if not u.chud %}d-none{% endif %} btn btn-success" data-nonce="{{g.nonce}}" data-onclick="unchud_or_unban(this,'/unchud_user/{{u.id}}')">Unchud</button>
|
|
{% endif %}
|
|
|
|
<div class="actionbtns my-3">
|
|
{% if FEATURES['BADGES'] and v.admin_level >= PERMS['USER_BADGES'] %}
|
|
<a id="give-badge-{{deviceType}}" class="btn btn-primary" style="display:inline-block!important" href="/admin/badge_grant?usernames={{u.username}}">Give Badge</a>
|
|
{% endif %}
|
|
|
|
{% if v.admin_level >= PERMS['ADMIN_ADD'] and not u.admin_level %}
|
|
<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 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>
|
|
{% endif %}
|
|
|
|
{% if v.admin_level >= PERMS['USER_BAN'] %}
|
|
<button type="button" id="mute-user-{{deviceType}}" class="{% if u.is_muted %}d-none{% endif %} btn btn-danger" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/mute_user/{{u.id}}','mute-user-{{deviceType}}','unmute-user-{{deviceType}}','d-none')">Mute</button>
|
|
<button type="button" id="unmute-user-{{deviceType}}" class="mb-1 {% if not u.is_muted %}d-none{% endif %} btn btn-success" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/unmute_user/{{u.id}}','mute-user-{{deviceType}}','unmute-user-{{deviceType}}','d-none')">Unmute</button>
|
|
{% endif %}
|
|
{% if v and v.admin_level >= PERMS['POST_COMMENT_MODERATION'] %}
|
|
<form action="/admin/unnuke_user" method="post" data-nonce="{{g.nonce}}" data-onsubmit="sendFormXHR(this)">
|
|
<input hidden name="formkey", value="{{v|formkey}}">
|
|
<input hidden name="user" value="{{u.username}}">
|
|
<input type="submit" class="btn btn-success" value="Approve User's Content">
|
|
</form>
|
|
<form class="mt-1" action="/admin/nuke_user" method="post" data-nonce="{{g.nonce}}" data-onsubmit="sendFormXHR(this)">
|
|
<input hidden name="formkey", value="{{v|formkey}}">
|
|
<input hidden name="user" value="{{u.username}}">
|
|
<input type="submit" class="btn btn-danger" value="Remove User's Content">
|
|
</form>
|
|
{% endif %}
|
|
|
|
{% if v.admin_level >= PERMS['USER_BLACKLIST'] %}
|
|
<button type="button" id="blacklist-{{deviceType}}" class="mt-1 {% if u.blacklisted_by %}d-none{% endif %} btn btn-danger" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/blacklist/{{u.id}}','blacklist-{{deviceType}}','unblacklist-{{deviceType}}','d-none')">Blacklist From Restricted Holes</button>
|
|
|
|
<button type="button" id="unblacklist-{{deviceType}}" class="mt-1 {% if not u.blacklisted_by %}d-none{% endif %} btn btn-success" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/unblacklist/{{u.id}}','blacklist-{{deviceType}}','unblacklist-{{deviceType}}','d-none')">Unblacklist From Restricted Holes</button>
|
|
{% endif %}
|
|
|
|
{% if v.admin_level >= PERMS['USER_RESET_PASSWORD'] %}
|
|
<button type="button" id="reset-password-{{deviceType}}" class="mt-1 btn btn-danger" data-nonce="{{g.nonce}}" data-onclick="areyousure(this)" data-areyousure="postToast(this,'/admin/reset_password/{{u.id}}')">Reset Password</button>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
{%- endmacro %}
|