2022-10-08 09:31:18 +00:00
{% macro userBanBlock(deviceType) %}
2022-10-08 05:29:20 +00:00
{% if u.is_suspended %}
2022-10-08 05:30:57 +00:00
< h5 class = "text-primary" id = "profile-{{deviceType}}--banned" > BANNED USER
{% if u.ban_reason %}:
{{u.ban_reason | safe}}
2022-10-08 05:29:20 +00:00
{% endif %}
2022-10-08 05:30:57 +00:00
(by < a href = "{{u.banned_by.url}}" > @{{u.banned_by.username}}< / a > )
< / h5 >
{% if u.unban_utc %}
< h5 class = "text-primary" id = "profile--unban" > {{u.unban_string}}< / h5 >
2022-10-08 05:29:20 +00:00
{% endif %}
2022-10-08 05:30:57 +00:00
{% endif %}
{% if v and v.admin_level >= PERMS['USER_SHADOWBAN'] and u.shadowbanned %}
< h5 class = "text-primary" id = "profile-{{deviceType}}--shadowbanned" > SHADOWBANNED USER
{% if u.ban_reason %}:
{{u.ban_reason | safe}}
{% endif %}
(by < a href = "/@{{u.shadowbanned}}" > @{{u.shadowbanned}}< / a > )
< / 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}}" >
{% if v.admin_level >= PERMS['USER_TITLE_CHANGE'] %}
2022-10-29 00:38:39 +00:00
< div class = "body d-lg-flex border-bottom mb-2" >
2022-10-07 07:57:23 +00:00
< div class = "w-lg-100" >
< form action = "/admin/title_change/{{u.id}}" method = "post" >
< input type = "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 mt-2" >
2022-10-28 23:09:06 +00:00
< div class = "format" role = "button" > < i class = "btn btn-secondary format d-inline-block m-0 fas fa-smile-beam" onclick = "loadEmojis('customtitlebody-{{deviceType}}')" aria-hidden = "true" data-bs-toggle = "modal" data-bs-target = "#emojiModal" data-bs-toggle = "tooltip" data-bs-placement = "bottom" title = "Add Emoji" > < / i > < / div >
2022-10-29 02:21:06 +00:00
< div class = "custom-control custom-checkbox ml-3" >
2022-10-07 07:57:23 +00:00
< input autocomplete = "off" type = "checkbox" class = "custom-control-input" id = "locked" name = "locked" { % if u . flairchanged % } checked { % endif % } >
< label class = "custom-control-label" for = "locked" > locked< / label >
< / div >
< input autocomplete = "off" class = "btn btn-primary ml-auto" type = "submit" onclick = "disable(this)" value = "Change Flair" >
< / div >
< / form >
< / div >
< / div >
{% endif %}
{% if v.admin_level >= PERMS['USER_BAN'] %}
2022-10-07 07:41:59 +00:00
{% if u.is_suspended %}
2022-10-29 00:38:39 +00:00
< form class = "mb-2" action = "/unban_user/{{u.id}}" method = "post" >
2022-10-07 07:41:59 +00:00
< input type = "hidden" name = "formkey" value = "{{v.formkey}}" >
< input type = "hidden" name = "redir" value = "true" >
< input type = "submit" onclick = "disable(this)" class = "btn btn-success" value = "Unban user" >
2022-10-07 08:08:47 +00:00
< / form >
2022-10-07 07:41:59 +00:00
{% else %}
2022-10-29 00:38:39 +00:00
< form class = "mb-2" action = "/ban_user/{{u.id}}" method = "post" >
2022-10-07 07:41:59 +00:00
< input type = "hidden" name = "formkey" value = "{{v.formkey}}" >
< input type = "hidden" name = "redir" value = "true" >
2022-10-07 07:54:25 +00:00
< input autocomplete = "off" style = "font-size:11px" type = "text" class = "form-control" maxlength = "256" name = "reason" placeholder = "Ban Reason" oninput = "document.getElementById('user-ban-submit-{{deviceType}}').disabled=false" required >
2022-10-07 07:41:59 +00:00
< input autocomplete = "off" style = "font-size:11px" type = "number" step = "any" class = "form-control" name = "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 >
2022-10-07 07:58:10 +00:00
< input autocomplete = "off" id = "user-ban-submit-{{deviceType}}" type = "submit" onclick = "disable(this)" class = "btn btn-danger" value = "Ban user" disabled >
2022-10-07 07:41:59 +00:00
< / form >
{% endif %}
{% endif %}
2022-10-07 07:57:23 +00:00
{% if v.admin_level >= PERMS['USER_SHADOWBAN'] %}
2022-10-07 07:41:59 +00:00
{% if u.shadowbanned %}
2022-10-29 00:38:39 +00:00
< form class = "mb-2" action = "/unshadowban/{{u.id}}" method = "post" >
2022-10-07 07:41:59 +00:00
< input type = "hidden" name = "formkey" value = "{{v.formkey}}" >
< input type = "submit" onclick = "disable(this)" class = "btn btn-success" value = "Unshadowban user" >
< / form >
{% else %}
2022-10-29 00:38:39 +00:00
< form class = "mb-2" action = "/shadowban/{{u.id}}" method = "post" >
2022-10-07 07:41:59 +00:00
< input type = "hidden" name = "formkey" value = "{{v.formkey}}" >
2022-10-07 07:54:25 +00:00
< input autocomplete = "off" style = "font-size:11px" type = "text" class = "form-control" maxlength = "256" name = "reason" placeholder = "Shadowban Reason" oninput = "document.getElementById('user-shadowban-submit-{{deviceType}}').disabled=false" required >
2022-10-07 07:41:59 +00:00
< div class = "custom-control custom-checkbox mb-1" >
2022-10-07 07:57:23 +00:00
< input autocomplete = "off" type = "checkbox" id = "shadowban-alts-{{deviceType}}" class = "custom-control-input" name = "alts" value = "1" >
2022-10-07 07:54:25 +00:00
< label class = "custom-control-label" for = "shadowban-alts-{{deviceType}}" > Include alts< / label >
2022-10-07 07:41:59 +00:00
< / div >
2022-10-07 07:58:10 +00:00
< input autocomplete = "off" id = "user-shadowban-submit-{{deviceType}}" type = "submit" onclick = "disable(this)" class = "btn btn-danger" value = "Shadowban user" disabled >
2022-10-07 07:41:59 +00:00
< / form >
{% endif %}
{% endif %}
2022-10-07 07:57:23 +00:00
{% if v.admin_level >= PERMS['USER_AGENDAPOSTER'] %}
2022-10-07 07:41:59 +00:00
< form id = "agendaposter-{{deviceType}}" class = "{% if u.agendaposter %}d-none{% endif %}" action = "/agendaposter/{{u.id}}" method = "post" >
2022-10-07 07:57:23 +00:00
< 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 type = "submit" onclick = "disable(this)" class = "btn btn-danger" value = "Lock Chud Theme" >
2022-10-07 07:41:59 +00:00
< / form >
2022-10-30 15:10:07 +00:00
< button type = "button" id = "unagendaposter-{{deviceType}}" class = "mt-1 {% if not u.agendaposter %}d-none{% endif %} btn btn-success" onclick = "postToast(this,'/unagendaposter/{{u.id}}','agendaposter-{{deviceType}}','unagendaposter-{{deviceType}}','d-none')" > Disable Chud Theme< / button >
2022-10-07 07:41:59 +00:00
{% endif %}
2022-10-31 22:43:18 +00:00
< div class = "actionbtns mt-3" >
{% if v.admin_level >= PERMS['ADMIN_ADD'] %}
< button type = "button" id = "add-admin-{{deviceType}}" class = "{% if u.admin_level >= PERMS['ADMIN_ADD_PERM_LEVEL'] %}d-none{% endif %} btn btn-primary" onclick = "postToast(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" onclick = "postToast(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-click = "postToast(this,'/@{{u.username}}/revert_actions')" 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" onclick = "postToast(this,'/mute_user/{{u.id}}/1','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" onclick = "postToast(this,'/mute_user/{{u.id}}/0','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" >
< input type = "hidden" name = "formkey" , value = "{{v.formkey}}" >
< input type = "hidden" name = "user" value = "{{u.username}}" >
< input type = "submit" onclick = "disable(this)" class = "btn btn-success" value = "Approve User's Content" >
< / form >
< form class = "mt-1" action = "/admin/nuke_user" method = "post" >
< input type = "hidden" name = "formkey" , value = "{{v.formkey}}" >
< input type = "hidden" name = "user" value = "{{u.username}}" >
< input type = "submit" onclick = "disable(this)" class = "btn btn-danger" value = "Remove User's Content" >
< / form >
{% endif %}
{% if FEATURES['COUNTRY_CLUB'] and v and v.admin_level >= PERMS['USER_CLUB_ALLOW_BAN'] %}
< button type = "button" id = "grant-{{device}}" class = "mt-1 {% if u.paid_dues %}d-none{% endif %} btn btn-success" onclick = "postToast(this,'/@{{u.username}}/club_allow','grant-{{device}}','bar-{{device}}','d-none')" > Grant club access< / button >
< button type = "button" id = "bar-{{device}}" class = "{% if u.club_allowed == False %}d-none{% endif %} btn btn-danger" onclick = "postToast(this,'/@{{u.username}}/club_ban','grant-{{device}}','bar-{{device}}','d-none')" > Bar from club< / button >
{% endif %}
< / div >
2022-10-07 07:57:23 +00:00
< / div >
{% endif %}
2022-10-08 06:08:35 +00:00
{%- endmacro %}