remotes/1693045480750635534/spooky-22
Aevann1 2021-07-23 17:25:47 +02:00
parent 35e81adfaf
commit 3a7bddc9ed
2 changed files with 31 additions and 33 deletions

View File

@ -67,6 +67,7 @@ def settings_profile_post(v):
if request.values.get("animatedname", v.animatedname) != v.animatedname:
if v.animatedname == False:
users1, users2 = leaderboard()
print(users1)
if v not in users1 and v not in users2: return jsonify({"error": "You must be in the leaderboard to apply animated name!"}), 403
updated = True
v.animatedname = request.values.get("animatedname", None) == 'true'

View File

@ -314,53 +314,50 @@
<div class="body d-lg-flex border-bottom">
<label for="bio" class="text-black w-lg-25">Name Color</label>
<label for="bio" class="text-black w-lg-25">Name Color</label>
<div class="d-flex">
<div class="d-flex">
<form action="/settings/namecolor" id="color-form" method="post" class="color-picker" style="line-height: 0">
<input type="hidden" name="formkey" value="{{v.formkey}}">
<form action="/settings/namecolor" id="color-form" method="post" class="color-picker" style="line-height: 0">
<input type="hidden" name="formkey" value="{{v.formkey}}">
{% for color in ['ff66ac','805ad5','62ca56','38a169','80ffff','2a96f3','eb4963','ff0000','f39731','30409f','3e98a7','e4432d','7b9ae4','ec72de','7f8fa6', 'f8db58'] %}
<input type="radio" name="color" id="color-{{color}}" value="{{color}}" {% if v.namecolor == color %}checked{% endif %} onclick="document.getElementById('color-form').submit()"/>
<label class="color-radio" for="color-{{color}}">
<span style="background-color: #{{color}}">
{% if v.namecolor.lower() == color %}
<i class="fas fa-check text-white"></i>
{% else %}
&nbsp;
{% endif %}
</span>
</label>
{% endfor %}
{% for color in ['ff66ac','805ad5','62ca56','38a169','80ffff','2a96f3','eb4963','ff0000','f39731','30409f','3e98a7','e4432d','7b9ae4','ec72de','7f8fa6', 'f8db58'] %}
<input type="radio" name="color" id="color-{{color}}" value="{{color}}" {% if v.namecolor == color %}checked{% endif %} onclick="document.getElementById('color-form').submit()"/>
<label class="color-radio" for="color-{{color}}">
<span style="background-color: #{{color}}">
{% if v.namecolor.lower() == color %}
<i class="fas fa-check text-white"></i>
{% else %}
&nbsp;
{% endif %}
</span>
</label>
{% endfor %}
</form>
</form>
</div>
<div class="d-lg-flex border-bottom">
<div class="title w-lg-25">
<label for="animatedname">Animated Username</label>
</div>
<div class="body w-lg-100">
</div>
<div class="body d-lg-flex border-bottom">
<label for="bio" class="text-black w-lg-25">Animated Username</label>
<div class="w-lg-100">
<div class="custom-control custom-switch">
<input type="checkbox" class="custom-control-input" id="animatedname" name="animatedname"{% if v.animatedname%} checked{% endif %} onchange="post_toast('/settings/profile?animatedname='+document.getElementById('animatedname').checked)">
<label class="custom-control-label" for="animatedname"></label>
</div>
<span class="text-small-extra text-muted">Enable animated username (only available to users in the leaderboard and patrons)</span>
</div>
</div>
</div>
{% if not v.flairchanged %}
<div class="body d-lg-flex border-bottom">