From 976f1808c375dd61d28a0f7630e1b33de01fa3e1 Mon Sep 17 00:00:00 2001 From: justcool393 Date: Wed, 5 Oct 2022 21:03:24 -0700 Subject: [PATCH] templates for admins... we REALLY should do something about that gigantic code duplication --- files/templates/userpage.html | 36 ++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/files/templates/userpage.html b/files/templates/userpage.html index 37a621afe..c97a5cb2f 100644 --- a/files/templates/userpage.html +++ b/files/templates/userpage.html @@ -218,16 +218,14 @@ Block - {% if v.admin_level > 2 %} - {% if SITE != 'rdrama.net' %} + {% if v.admin_level >= PERMS['ADMIN_ADD'] and SITE != 'rdrama.net' and not u.admin_level %} Make admin - {% endif %} - + {% endif %} + {% if v.admin_level >= PERMS['ADMIN_REMOVE'] and u.admin_level %} Remove admin - {% if u.admin_level > 1 %} - Revert admin actions - {% endif %} + {% if u.admin_level >= PERMS['ADMIN_ACTIONS_REVERT'] %} + Revert admin actions {% endif %} @@ -340,7 +338,7 @@

 						

-
+					{% if v and v.admin_level >= PERMS['USER_AGENDAPOSTER'] %}
 						
@@ -349,7 +347,7 @@

 
 						Disable Chud Theme
-
+					{% endif %}
 						

 
 						Mute
@@ -358,6 +356,7 @@
 
 
 						

+					{% if v and v.admin_level >= PERMS['POST_COMMENT_MODERATION'] %}
 						
 							
 							
@@ -369,6 +368,8 @@
 							
 							
 						
+ {% endif %} + {% if v and v.admin_level >= PERMS['USER_CLUB_ALLOW_BAN'] %}

 						{% if FEATURES['COUNTRY_CLUB'] -%}
 						
@@ -376,6 +377,7 @@
 						{%- endif %}
 
 						{% endif %}
+					{% endif %}
 					

 					

User ID: {{u.id}}

@@ -591,16 +593,16 @@ Block - {% if v.admin_level > 2 %} - {% if SITE != 'rdrama.net' %} - Make admin - {% endif %} + {% if v.admin_level >= PERMS['ADMIN_ADD'] and SITE != 'rdrama.net' and not u.admin_level %} + Make admin + {% endif %} + {% if v.admin_level >= PERMS['ADMIN_REMOVE'] and u.admin_level %} Remove admin + {% endif %} - {% if u.admin_level > 1 %} - Revert admin actions - {% endif %} + {% if u.admin_level >= PERMS['ADMIN_ACTIONS_REVERT'] %} + Revert admin actions {% endif %}
@@ -637,7 +639,7 @@ {% if v.admin_level > 1 %} - {% if FEATURES['COUNTRY_CLUB'] -%} + {% if FEATURES['COUNTRY_CLUB'] and v.admin_level >= PERMS['USER_CLUB_ALLOW_BAN'] -%} {%- endif %}