feat: created a base form with some validators

This commit is contained in:
2021-11-29 00:10:59 +01:00
parent 3bc5f0e6f5
commit ec451d82c0
10 changed files with 248 additions and 2 deletions

View File

@@ -0,0 +1,42 @@
{% extends 'base.html' %}
{% block main_block %}
<div class="row col" id="reset-form">
{% for field, errors in form.errors.items() %}
{{ ', '.join(errors) }}
{% endfor %}
<form method="post">
{{ form.csrf_token() }}
<div class="form-group">
{{ form.username.label }}
{{ form.username(class="form-control") }}
</div>
<div class="form-group">
{{ form.currentpassword.label }}
{{ form.currentpassword(class="form-control") }}
</div>
<div class="form-group">
{{ form.newpassword.label }}
<span id="password-msg">
The new password should contain at least : 8 characters, one numeric digit, one lowercase and one uppercase characters.
</span>
{{ form.newpassword(class="form-control") }}
</div>
<div class="form-group">
{{ form.confirm_password.label }}
<span id="confirm-msg">
Passwords should match
</span>
{{ form.confirm_password(class="form-control") }}
</div>
<br>
<div class="form-group" style="text-align: center; margin-bottom: 0.40 em">
{{ form.submit(class="btn btn-primary")}}
</div>
</form>
</div>
{% endblock main_block %}
{% block script_block %}
<script defer src="/static/js/validate.js"></script>
{% endblock script_block %}