diff --git a/files/templates/userpage.html b/files/templates/userpage.html index 4849f8ed4..342302e0b 100644 --- a/files/templates/userpage.html +++ b/files/templates/userpage.html @@ -29,7 +29,7 @@ {% endblock %} -{% import 'userpage_admintools_lower.html' as userpage_admintools_lower with context %} +{% import 'userpage_admintools.html' as userpage_admintools with context %} {% block desktopUserBanner %} @@ -49,25 +49,7 @@
- {% if u.is_suspended %} -
BANNED USER - {% if u.ban_reason %}: - {{u.ban_reason | safe}} - {% endif %} - (by @{{u.banned_by.username}}) -
- {% if u.unban_utc %} -
{{u.unban_string}}
- {% endif %} - {% endif %} - {% if v and v.admin_level >= PERMS['USER_SHADOWBAN'] and u.shadowbanned %} -
SHADOWBANNED USER - {% if u.ban_reason %}: - {{u.ban_reason | safe}} - {% endif %} - (by @{{u.shadowbanned}}) -
- {% endif %} + {{ userpage_admintools.userBanBlock('desktop') }}

{{u.user_name}}

@@ -271,7 +253,7 @@ Toggle anthem {% endif %} - {{ userpage_admintools_lower.userAdminToolsLower('desktop') }} + {{ userpage_admintools.userAdminToolsLower('desktop') }}

 					
@@ -336,15 +318,8 @@
- {% if u.is_suspended %} -
BANNED USER{% if u.ban_reason %}: {{u.ban_reason | safe}}{% endif %} (by @{{u.banned_by.username}})
- {% if u.unban_utc %}
{{u.unban_string}}
{% endif %} - {% endif %} - - {% if v and v.admin_level >= PERMS['USER_SHADOWBAN'] and u.shadowbanned %} -
SHADOWBANNED USER{% if u.ban_reason %}: {{u.ban_reason | safe}}{% endif %} (by @{{u.shadowbanned}})
- {% endif %} - + {{ userpage_admintools.userBanBlock('desktop') }} +

{{u.user_name}}

{% if u.username != u.original_username %} @@ -530,7 +505,7 @@
- {{ userpage_admintools_lower.userAdminToolsLower('mobile') }} + {{ userpage_admintools.userAdminToolsLower('mobile') }} {% endif %}

diff --git a/files/templates/userpage_admintools_lower.html b/files/templates/userpage_admintools.html
similarity index 90%
rename from files/templates/userpage_admintools_lower.html
rename to files/templates/userpage_admintools.html
index c3112e0ec..5724aec0b 100644
--- a/files/templates/userpage_admintools_lower.html
+++ b/files/templates/userpage_admintools.html
@@ -1,3 +1,25 @@
+{% macro userBanBlock(deviceType) -%}
+	{% if u.is_suspended %}
+			
BANNED USER + {% if u.ban_reason %}: + {{u.ban_reason | safe}} + {% endif %} + (by @{{u.banned_by.username}}) +
+ {% if u.unban_utc %} +
{{u.unban_string}}
+ {% endif %} + {% endif %} + {% if v and v.admin_level >= PERMS['USER_SHADOWBAN'] and u.shadowbanned %} +
SHADOWBANNED USER + {% if u.ban_reason %}: + {{u.ban_reason | safe}} + {% endif %} + (by @{{u.shadowbanned}}) +
+ {% endif %} +{%- endmacro %} + {% macro userAdminToolsLower(deviceType) -%} {% if v and v.id != u.id and v.admin_level >= PERMS['USER_MODERATION_TOOLS_VISIBLE'] %}