Support for non-binary gender options

This commit is contained in:
Socks 2018-03-28 13:03:08 +01:00
parent c949e1db95
commit fed88af6d6
2 changed files with 6 additions and 1 deletions

View file

@ -149,6 +149,11 @@ def user_settings():
profile_pic = accounts.account_details(session['username'].lower())['profile']['profile_pic']
updated_profile['profile_pic'] = profile_pic
accounts.set_theme(session['username'].lower(), request.form['theme'])
if request.form['gender'] == "Non-Binary":
updated_profile['gender'] = request.form['gender-custom']
print(updated_profile)
username = session['username']
accounts.update_profile(username, updated_profile)
account = accounts.account_details(session['username'])

View file

@ -49,7 +49,7 @@
<input type="radio" id="genderInline3" name="gender" value="Non-Binary" class="custom-control-input" {% if account.profile.gender!="Female" and account.profile.gender!="Male" %}checked{% endif %}>
<label class="custom-control-label" for="genderInline3" onclick={document.getElementById("john").style="display:block;"}>Other</label>
</div>
<input type="text" id="john" style="display:none;" name="location" class="form-control mt-2" placeholder="Gender" aria-describedby="basic-addon1" value="{{ account.profile.gender }}">
<input type="text" id="john" name="gender-custom" style="display:none;" name="location" class="form-control mt-2" placeholder="Gender" aria-describedby="basic-addon1" value="{{ account.profile.gender }}">
</div>