add spider toggle

remotes/1693176582716663532/tmp_refs/heads/watchparty
Aevann1 2022-09-25 04:44:19 +02:00
parent a3a7ec6296
commit dd7145410f
2 changed files with 23 additions and 0 deletions

View File

@ -108,6 +108,14 @@ def settings_profile_post(v):
badge = v.has_badge(170)
if badge: g.db.delete(badge)
elif request.values.get("spider", v.spider) != v.spider and v.spider <= 1:
updated = True
v.spider = int(request.values.get("spider") == 'true')
if v.spider: badge_grant(user=v, badge_id=179)
else:
badge = v.has_badge(170)
if badge: g.db.delete(badge)
elif request.values.get("bio") == "":
v.bio = None
v.bio_html = None

View File

@ -761,6 +761,21 @@
</div>
</div>
<div class="d-lg-flex border-bottom">
<div class="title w-lg-25">
<label for="spiderswitch">Spider</label>
</div>
<div class="body w-lg-100">
<div class="custom-control custom-switch">
<input autocomplete="off" type="checkbox" class="custom-control-input" id="spiderswitch" name="spider" {% if v.spider%}checked{% endif %} {% if v.spider > 1 %}disabled{% endif %} onchange="post_toast(this,'/settings/profile?spider='+document.getElementById('spiderswitch').checked)">
<label class="custom-control-label" for="spiderswitch"></label>
</div>
<span class="text-small text-muted">Have a spider friend accompany you during your journey in the site.</span>
</div>
</div>
</div>
</div>