From 8f2d656bb31833f584d61f8ebf58339886db490d Mon Sep 17 00:00:00 2001 From: justcool393 Date: Fri, 7 Oct 2022 22:29:20 -0700 Subject: [PATCH] rename page and also add macro for ban area --- files/templates/userpage.html | 37 +++---------------- ...ls_lower.html => userpage_admintools.html} | 22 +++++++++++ 2 files changed, 28 insertions(+), 31 deletions(-) rename files/templates/{userpage_admintools_lower.html => userpage_admintools.html} (90%) 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'] %}