forked from rDrama/rDrama
1
0
Fork 0

add minlength and maxlength to name change field

master
Aevann 2023-10-17 12:20:14 +03:00
parent 851242a721
commit 266b927488
1 changed files with 7 additions and 2 deletions

View File

@ -188,8 +188,13 @@
<p>Your original username will always stay reserved for you: <code>{{v.original_username}}</code></p>
<form action="/settings/name_change" method="post" data-nonce="{{g.nonce}}" data-onsubmit="sendFormXHR(this)">
<input hidden name="formkey" value="{{v|formkey}}">
<input id="name-body" autocomplete="off" type="text" name="name" class="form-control" value="{{v.username}}" {% if v.namechanged %}disabled{% endif %}>
<small>{% if v.patron %}1{% else %}3{% endif %}-25 characters, including letters, numbers, _ , and -</small>
{% if v.patron %}
{% set minlength = 1 %}
{% else %}
{% set minlength = 3 %}
{% endif %}
<input id="name-body" autocomplete="off" type="text" name="name" class="form-control" value="{{v.username}}" minlength="{{minlength}}" maxlength="25" {% if v.namechanged %}disabled{% endif %}>
<small>{{minlength}}-25 characters, including letters, numbers, _ , and -</small>
<div class="d-flex mt-2">
<input autocomplete="off" class="btn btn-primary ml-auto" type="submit" value="Change Display Name" {% if v.namechanged %}disabled{% endif %}>
</div>