Commit 5432c185 authored by Adryan Reis's avatar Adryan Reis
Browse files

input password

parent 1b787acb
......@@ -105,6 +105,37 @@ def br_input(input_type="", placeholder="", label="", input_id="", help_text=""
classes, label_html=label_html, input_html=input_html, help_text_html=help_text_html
)
@register.simple_tag
def br_password_input(input_id="input-password", label="Senha", placeholder="Digite sua senha", value="", extra_classes="", col_classes="col-sm-5 col-lg-3 mb-3", disabled=False):
"""
Renderiza um campo de input de senha DSGov com botão para mostrar/ocultar senha.
Inclui funcionalidade de toggle para visualização da senha.
Os valores default garantem visual e acessibilidade padrão, mas podem ser sobrescritos no template.
"""
disabled_attr = 'disabled' if disabled else ''
input_classes = f'br-input input-button {extra_classes}'.strip()
return format_html(
"""
<div class="{}">
<div class="{}">
<label for="{}">{}</label>
<input id="{}" type="password" placeholder="{}" value="{}" {}/>
<button class="br-button" type="button" aria-label="Exibir senha" role="switch" aria-checked="false">
<i class="fas fa-eye" aria-hidden="true"></i>
</button>
</div>
</div>
""",
col_classes,
input_classes,
input_id,
label,
input_id,
placeholder,
value,
disabled_attr
)
@register.simple_tag
def br_list(title, items):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment