2022-10-08 09:31:18 +00:00
{% macro userBanBlock(deviceType) %}
2023-07-02 17:40:39 +00:00
{% 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 %}
2022-10-08 05:29:20 +00:00
{% if u.is_suspended %}
2023-07-02 17:40:39 +00:00
< h5 class = "text-primary" id = "profile-{{deviceType}}--banned" > BANNED USER:
2022-10-08 05:30:57 +00:00
{{u.ban_reason | safe}}
2023-07-03 00:26:20 +00:00
2023-07-02 17:40:39 +00:00
{% 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 %}
2022-10-08 05:30:57 +00:00
< / h5 >
{% endif %}
2023-10-05 09:44:42 +00:00
{% if v and v.can_see_shadowbanned and u.shadowbanned %}
2023-07-02 17:40:39 +00:00
< h5 class = "text-primary" id = "profile-{{deviceType}}--shadowbanned" > SHADOWBANNED USER:
2022-10-08 05:30:57 +00:00
{{u.ban_reason | safe}}
2023-07-02 17:40:39 +00:00
(by < a href = "/@{{u.shadowbanner}}" > @{{u.shadowbanner}}< / a > )
2022-10-08 05:30:57 +00:00
< / h5 >
{% endif %}
2022-10-08 09:31:18 +00:00
{% endmacro %}
2022-10-08 05:29:20 +00:00
2022-10-31 22:43:18 +00:00
{% macro userAdminTools(deviceType) %}
2022-10-07 07:57:23 +00:00
{% if v and v.id != u.id and v.admin_level >= PERMS['USER_MODERATION_TOOLS_VISIBLE'] %}
< div class = "admintools-user-lower-{{deviceType}}" >
2023-10-04 12:29:41 +00:00
{% if v.admin_level >= PERMS['USER_CHANGE_FLAIR'] %}
2023-02-27 15:02:35 +00:00
< div class = "body d-lg-flex border-bottom mt-4 mb-2" >
2022-10-07 07:57:23 +00:00
< div class = "w-lg-100" >
2023-10-04 12:29:41 +00:00
< form action = "/admin/change_flair/{{u.id}}" method = "post" data-nonce = "{{g.nonce}}" data-onsubmit = "sendFormXHR(this)" >
2023-01-24 05:10:16 +00:00
< input hidden name = "formkey" value = "{{v|formkey}}" >
2023-10-05 10:39:12 +00:00
< input maxlength = 100 autocomplete = "off" id = "flair_htmlbody-{{deviceType}}" type = "text" name = "title" class = "form-control" placeholder = 'Enter a flair here' value = "{% if u.flair %}{{u.flair}}{% endif %}" >
2023-02-27 15:02:35 +00:00
< div class = "d-flex" >
2023-10-05 17:29:37 +00:00
{{macros.emoji_btn('flair_htmlbody-' ~ deviceType)}}
2023-10-05 11:11:03 +00:00
2023-02-27 15:02:35 +00:00
< div class = "custom-control custom-checkbox ml-2 mt-1" >
2023-02-22 16:58:47 +00:00
< input autocomplete = "off" type = "checkbox" class = "custom-control-input" id = "locked-{{deviceType}}" name = "locked" { % if u . flairchanged % } checked { % endif % } >
2023-02-07 01:24:50 +00:00
< label class = "custom-control-label" for = "locked-{{deviceType}}" > locked< / label >
2022-10-07 07:57:23 +00:00
< / div >
2023-03-07 00:21:08 +00:00
< input autocomplete = "off" class = "btn btn-primary ml-auto" type = "submit" value = "Change Flair" >
2022-10-07 07:57:23 +00:00
< / div >
< / form >
< / div >
< / div >
{% endif %}
{% if v.admin_level >= PERMS['USER_BAN'] %}
2023-06-29 19:51:32 +00:00
< 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)" >
2023-01-24 05:10:16 +00:00
< input hidden name = "formkey" value = "{{v|formkey}}" >
2023-01-01 02:17:46 +00:00
< 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 >
2023-03-12 14:48:19 +00:00
< input autocomplete = "off" style = "font-size:11px" type = "number" step = "any" class = "form-control" name = "days" max = "{{max_days()}}" placeholder = "Days (blank = permanent)" >
2022-11-05 02:07:29 +00:00
< 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 >
2023-03-07 00:21:08 +00:00
< input autocomplete = "off" id = "user-ban-submit-{{deviceType}}" type = "submit" class = "btn btn-danger" value = "Ban user" disabled >
2022-11-05 02:07:29 +00:00
< / form >
2023-09-07 08:41:39 +00:00
< 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 >
2022-10-07 07:41:59 +00:00
{% endif %}
2023-10-05 09:44:42 +00:00
{% if v.can_see_shadowbanned %}
2022-12-30 12:52:59 +00:00
< 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)" >
2023-01-24 05:10:16 +00:00
< input hidden name = "formkey" value = "{{v|formkey}}" >
2023-01-01 02:17:46 +00:00
< 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 >
2023-03-07 00:21:08 +00:00
< input autocomplete = "off" id = "user-shadowban-submit-{{deviceType}}" type = "submit" class = "btn btn-danger" value = "Shadowban user" disabled >
2022-11-05 02:16:39 +00:00
< / form >
2023-09-07 08:41:39 +00:00
< 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 >
2022-10-07 07:41:59 +00:00
{% endif %}
2023-06-23 11:07:47 +00:00
{% 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)" >
2023-01-24 05:10:16 +00:00
< input hidden name = "formkey" value = "{{v|formkey}}" >
2023-03-12 14:48:19 +00:00
< input autocomplete = "off" type = "number" step = "any" name = "days" max = "{{max_days()}}" class = "form-control" placeholder = "Days (0 or blank = permanent)" >
2023-03-07 00:21:08 +00:00
< input type = "submit" class = "btn btn-danger" value = "Chud" >
2022-10-07 07:41:59 +00:00
< / form >
2023-09-07 08:41:39 +00:00
< 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 >
2022-10-07 07:41:59 +00:00
{% endif %}
2023-01-01 11:36:20 +00:00
2023-05-04 16:36:41 +00:00
< div class = "actionbtns my-3" >
2023-08-05 10:24:37 +00:00
{% 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 %}
2023-03-15 01:54:55 +00:00
{% if v.admin_level >= PERMS['ADMIN_ADD'] and not u.admin_level %}
2023-01-29 08:28:29 +00:00
< 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 >
2022-10-31 22:43:18 +00:00
{% endif %}
{% if v.admin_level >= PERMS['ADMIN_REMOVE'] %}
2023-04-25 05:53:20 +00:00
< 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 >
2022-10-31 22:43:18 +00:00
{% endif %}
{% if v.admin_level >= PERMS['ADMIN_ACTIONS_REVERT'] and u.admin_level %}
2022-12-30 12:14:18 +00:00
< 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 >
2022-10-31 22:43:18 +00:00
{% endif %}
{% if v.admin_level >= PERMS['USER_BAN'] %}
2022-12-30 12:14:18 +00:00
< 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 >
2022-10-31 22:43:18 +00:00
{% endif %}
{% if v and v.admin_level >= PERMS['POST_COMMENT_MODERATION'] %}
2022-12-30 12:52:59 +00:00
< form action = "/admin/unnuke_user" method = "post" data-nonce = "{{g.nonce}}" data-onsubmit = "sendFormXHR(this)" >
2023-01-24 05:10:16 +00:00
< input hidden name = "formkey" , value = "{{v|formkey}}" >
< input hidden name = "user" value = "{{u.username}}" >
2023-03-07 00:21:08 +00:00
< input type = "submit" class = "btn btn-success" value = "Approve User's Content" >
2022-10-31 22:43:18 +00:00
< / form >
2022-12-30 12:52:59 +00:00
< form class = "mt-1" action = "/admin/nuke_user" method = "post" data-nonce = "{{g.nonce}}" data-onsubmit = "sendFormXHR(this)" >
2023-01-24 05:10:16 +00:00
< input hidden name = "formkey" , value = "{{v|formkey}}" >
< input hidden name = "user" value = "{{u.username}}" >
2023-03-07 00:21:08 +00:00
< input type = "submit" class = "btn btn-danger" value = "Remove User's Content" >
2022-10-31 22:43:18 +00:00
< / form >
{% endif %}
2023-01-25 15:41:46 +00:00
{% 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 >
2023-09-07 08:41:39 +00:00
< 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 >
2023-01-25 15:41:46 +00:00
{% endif %}
2023-06-30 16:39:24 +00:00
{% if v.admin_level >= PERMS['USER_RESET_PASSWORD'] %}
2023-08-05 21:31:27 +00:00
< 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 >
2023-06-30 16:39:24 +00:00
{% endif %}
2022-10-31 22:43:18 +00:00
< / div >
2022-10-07 07:57:23 +00:00
< / div >
{% endif %}
2022-10-08 06:08:35 +00:00
{%- endmacro %}