title -> flair

master
Aevann 2023-10-17 21:50:13 +03:00
parent d9f913a4af
commit 9df3fceef4
4 changed files with 4 additions and 4 deletions

View File

@ -917,7 +917,7 @@ def admin_change_flair(user_id, v):
user = get_account(user_id)
new_flair = request.values.get("title")[:256].strip()
new_flair = request.values.get("flair")[:256].strip()
user.flair = new_flair
new_flair = filter_emojis_only(new_flair)

View File

@ -922,7 +922,7 @@ def process_settings_plaintext(value, current, length, default_value):
def settings_change_flair(v):
if v.flairchanged: abort(403)
flair = process_settings_plaintext("title", v.flair, 100, None)
flair = process_settings_plaintext("flair", v.flair, 100, None)
if flair:
flair_html = filter_emojis_only(flair)

View File

@ -207,7 +207,7 @@
{{common.line_text_section('pronouns', '/settings/pronouns_change', 'pronouns', 'Pronouns', v.pronouns, 'Limit of 15 characters', 'Enter pronouns here', 'Change Pronouns', false, 3, 15, '([a-zA-Z]{1,7})/[a-zA-Z]{1,7}(/[a-zA-Z]{1,7})?', false)}}
{% endif %}
{{common.line_text_section('flair', '/settings/change_flair', 'title', 'Flair', v.flair, 'Limit of 100 characters', 'Enter a flair here', 'Change Flair', true, 0, 100, '.*', v.flairchanged)}}
{{common.line_text_section('flair', '/settings/change_flair', 'flair', 'Flair', v.flair, 'Limit of 100 characters', 'Enter a flair here', 'Change Flair', true, 0, 100, '.*', v.flairchanged)}}
{{common.color_section('flaircolor', '/settings/titlecolor', 'titlecolor', 'Flair Color', v.titlecolor)}}

View File

@ -38,7 +38,7 @@
<div class="w-lg-100">
<form action="/admin/change_flair/{{u.id}}" method="post" data-nonce="{{g.nonce}}" data-onsubmit="sendFormXHR(this)">
<input hidden name="formkey" value="{{v|formkey}}">
<input maxlength=100 autocomplete="off" id="flair_htmlbody-{{deviceType}}" type="text" name="title" class="form-control" placeholder='Enter a flair here' value="{% if u.flair %}{{u.flair}}{% endif %}">
<input maxlength=100 autocomplete="off" id="flair_htmlbody-{{deviceType}}" type="text" name="flair" class="form-control" placeholder='Enter a flair here' value="{% if u.flair %}{{u.flair}}{% endif %}">
<div class="d-flex">
{{macros.emoji_btn('flair_htmlbody-' ~ deviceType)}}