add marsify toggle in settings

master
Aevann1 2022-09-05 06:50:27 +02:00
parent e6d5839e4d
commit 225e64b91e
3 changed files with 23 additions and 1 deletions

View File

@ -87,7 +87,7 @@ def award_timers(v, bot=False):
notify_if_not_bot("Your owoify status has expired!")
dirty = True
if v.marsify and v.marsify != 1 and v.marsify < now:
v.marsify = None
v.marsify = 0
if SITE_NAME != 'rDrama': notify_if_not_bot("Your marsify status has expired!")
dirty = True

View File

@ -100,6 +100,10 @@ def settings_profile_post(v):
updated = True
v.is_nofollow = request.values.get("nofollow") == 'true'
elif request.values.get("marsify", v.marsify) != v.marsify and v.marsify <= 1:
updated = True
v.marsify = int(request.values.get("marsify") == 'true')
elif request.values.get("bio") == "":
v.bio = None
v.bio_html = None

View File

@ -743,6 +743,24 @@
</div>
</div>
<div class="d-lg-flex border-bottom">
<div class="title w-lg-25">
<label for="marsifyswitch">Marsify</label>
</div>
<div class="body w-lg-100">
<div class="custom-control custom-switch">
<input autocomplete="off" type="checkbox" class="custom-control-input" id="marsifyswitch" name="marsify" {% if v.marsify%}checked{% endif %} {% if v.marsify > 1 %}disabled{% endif %} onchange="post_toast(this,'/settings/profile?marsify='+document.getElementById('marsifyswitch').checked)">
<label class="custom-control-label" for="marsifyswitch"></label>
</div>
<span class="text-small text-muted">Automatically insert relevant marseys into your future comments.</span>
</div>
</div>
</div>
</div>