templates/login.html: allow adding extra HTML Input Attributes for Username and Password field

With this change, if we set

```
{% block username_input_attribs %}pattern="[a-z0-9]+"
      placeholder="do not use email address, use your username"{% endblock username_input_attribs %}
```

We will get the following generated code

```
    <input
      id="username_input"
      type="text"
      autocapitalize="off"
      autocorrect="off"
      autocomplete="username"
      class="form-control"
      name="username"
      val=""
      tabindex="1"
      autofocus="autofocus"

      pattern="[a-z0-9]+"
      placeholder="do not use email address, use your username"
    />
This commit is contained in:
Long Vu
2025-02-06 13:51:17 -05:00
parent 7c71e517ef
commit bf28242d9d

View File

@@ -43,13 +43,19 @@
class="form-control"
name="username"
val="{{ username }}"
autofocus="autofocus" />
autofocus="autofocus"
{# allow adding extra HTML Input Attributes (pattern, placeholder, title, minlenght, maxlenght, ...) #}
{% block username_input_attribs %}{% endblock username_input_attribs %}
/>
<label for='password_input'>Password:</label>
<input type="password"
class="form-control"
autocomplete="current-password"
name="password"
id="password_input" />
id="password_input"
{# allow adding extra HTML Input Attributes (pattern, placeholder, title, minlenght, maxlenght, ...) #}
{% block password_input_attribs %}{% endblock password_input_attribs %}
/>
{% if authenticator.request_otp %}
<label for='otp_input'>{{ authenticator.otp_prompt }}</label>
<input class="form-control"