29 lines
1.1 KiB
HTML
29 lines
1.1 KiB
HTML
<!-- Компонент для поля ввода пароля с возможностью показать/скрыть -->
|
||
{% comment %}
|
||
Использование:
|
||
{% include 'accounts/password_input.html' with field_name='password1' field_label='Пароль' required=True %}
|
||
{% endcomment %}
|
||
|
||
<div class="mb-3">
|
||
<label for="{{ field_name }}" class="form-label">{{ field_label|default:"Пароль" }}</label>
|
||
<div class="input-group">
|
||
<input
|
||
type="password"
|
||
class="form-control"
|
||
id="{{ field_name }}"
|
||
name="{{ field_name }}"
|
||
{% if required %}required{% endif %}
|
||
{% if placeholder %}placeholder="{{ placeholder }}"{% endif %}
|
||
>
|
||
<button
|
||
type="button"
|
||
class="btn btn-outline-secondary show-password-btn"
|
||
data-target="{{ field_name }}"
|
||
>
|
||
<i class="bi bi-eye"></i>
|
||
</button>
|
||
</div>
|
||
{% if field_errors %}
|
||
<div class="text-danger">{{ field_errors }}</div>
|
||
{% endif %}
|
||
</div> |