rename page and also add macro for ban area

master
justcool393 2022-10-07 22:29:20 -07:00
parent 3949670088
commit 8f2d656bb3
2 changed files with 28 additions and 31 deletions

View File

@ -29,7 +29,7 @@
<meta name="twitter:url" content="{{u.url}}"> <meta name="twitter:url" content="{{u.url}}">
{% endblock %} {% endblock %}
{% import 'userpage_admintools_lower.html' as userpage_admintools_lower with context %} {% import 'userpage_admintools.html' as userpage_admintools with context %}
{% block desktopUserBanner %} {% block desktopUserBanner %}
@ -49,25 +49,7 @@
</a> </a>
</div> </div>
<div id="profilestuff" class="ml-3 w-100"> <div id="profilestuff" class="ml-3 w-100">
{% if u.is_suspended %} {{ userpage_admintools.userBanBlock('desktop') }}
<h5 class="text-primary" id="profile--banned">BANNED USER
{% if u.ban_reason %}:
{{u.ban_reason | safe}}
{% endif %}
(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>
{% endif %}
{% endif %}
{% if v and v.admin_level >= PERMS['USER_SHADOWBAN'] and u.shadowbanned %}
<h5 class="text-primary" id="profile--shadowbanned">SHADOWBANNED USER
{% if u.ban_reason %}:
{{u.ban_reason | safe}}
{% endif %}
(by <a href="/@{{u.shadowbanned}}">@{{u.shadowbanned}}</a>)
</h5>
{% endif %}
<div class="d-flex align-items-center mt-1 mb-2"> <div class="d-flex align-items-center mt-1 mb-2">
<h1 class="font-weight-bolder h3 my-0 mr-2" id="profile--name" style="color: #{{u.name_color}}"><span {% if u.patron %}class="patron" style="background-color:#{{u.name_color}}"{% endif %}>{{u.user_name}}</span></h1> <h1 class="font-weight-bolder h3 my-0 mr-2" id="profile--name" style="color: #{{u.name_color}}"><span {% if u.patron %}class="patron" style="background-color:#{{u.name_color}}"{% endif %}>{{u.user_name}}</span></h1>
@ -271,7 +253,7 @@
<a class="btn btn-secondary" role="button" onclick="toggle()">Toggle anthem</a> <a class="btn btn-secondary" role="button" onclick="toggle()">Toggle anthem</a>
{% endif %} {% endif %}
{{ userpage_admintools_lower.userAdminToolsLower('desktop') }} {{ userpage_admintools.userAdminToolsLower('desktop') }}
<pre></pre> <pre></pre>
<div id="profile--info"> <div id="profile--info">
@ -336,14 +318,7 @@
</a> </a>
</div> </div>
<div class="mt-n3 py-3"> <div class="mt-n3 py-3">
{% if u.is_suspended %} {{ userpage_admintools.userBanBlock('desktop') }}
<h5 class="text-primary" id="profile-mobile--banned">BANNED USER{% if u.ban_reason %}: {{u.ban_reason | safe}}{% endif %} (by <a href="{{u.banned_by.url}}">@{{u.banned_by.username}}</a>)</h5>
{% if u.unban_utc %}<h5 class="text-primary" id="profile-mobile--unban">{{u.unban_string}}</h5>{% endif %}
{% endif %}
{% if v and v.admin_level >= PERMS['USER_SHADOWBAN'] and u.shadowbanned %}
<h5 class="text-primary" id="profile-mobile--banned">SHADOWBANNED USER{% if u.ban_reason %}: {{u.ban_reason | safe}}{% endif %} (by <a href="/@{{u.shadowbanned}}">@{{u.shadowbanned}}</a>)</h5>
{% endif %}
<h1 class="h5 d-inline-block" id="profile-mobile--name" style="color: #{{u.name_color}}"><span {% if u.patron %}class="patron" style="background-color:#{{u.name_color}}"{% endif %}>{{u.user_name}}</span></h1> <h1 class="h5 d-inline-block" id="profile-mobile--name" style="color: #{{u.name_color}}"><span {% if u.patron %}class="patron" style="background-color:#{{u.name_color}}"{% endif %}>{{u.user_name}}</span></h1>
@ -530,7 +505,7 @@
<button class="btn btn-primary mt-2 mb-3" onclick="transferBux(true)">Gift</button> <button class="btn btn-primary mt-2 mb-3" onclick="transferBux(true)">Gift</button>
</div> </div>
{{ userpage_admintools_lower.userAdminToolsLower('mobile') }} {{ userpage_admintools.userAdminToolsLower('mobile') }}
{% endif %} {% endif %}
<pre></pre> <pre></pre>

View File

@ -1,3 +1,25 @@
{% macro userBanBlock(deviceType) -%}
{% if u.is_suspended %}
<h5 class="text-primary" id="profile-{{deviceType}}--banned">BANNED USER
{% if u.ban_reason %}:
{{u.ban_reason | safe}}
{% endif %}
(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>
{% endif %}
{% 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 %}
{%- endmacro %}
{% macro userAdminToolsLower(deviceType) -%} {% macro userAdminToolsLower(deviceType) -%}
{% if v and v.id != u.id and v.admin_level >= PERMS['USER_MODERATION_TOOLS_VISIBLE'] %} {% if v and v.id != u.id and v.admin_level >= PERMS['USER_MODERATION_TOOLS_VISIBLE'] %}
<div class="admintools-user-lower-{{deviceType}}"> <div class="admintools-user-lower-{{deviceType}}">