add reset password link in login page

This commit is contained in:
Cayo Puigdefabregas 2022-11-11 17:42:29 +01:00
parent cf5a7651a0
commit 79dff1d361
2 changed files with 13 additions and 2 deletions

View File

@ -21,7 +21,7 @@
<div class="card-body">
<div class="pt-4 pb-2">
<div class="pt-2 pb-3">
<h5 class="card-title text-center pb-0 fs-4 help">Sign in</h5>
{% if form.form_errors %}
<p class="text-danger">
@ -62,6 +62,7 @@
</div>
<div class="col-12">
<p class="small mb-0">Don't have account? <a href="{{ url_register }}">Create an account</a></p>
<p class="small mb-0">Forgot password? <a href="{{ url_reset_password }}">Reset your password</a></p>
</div>
</form>

View File

@ -43,10 +43,20 @@ class LoginView(View):
return flask.redirect(next_url or flask.url_for('inventory.devicelist'))
url_register = "#"
url_reset_password = "#"
if 'register' in app.blueprints.keys():
url_register = flask.url_for('register.user-registration')
context = {'form': form, 'version': __version__, 'url_register': url_register}
if 'reset_password' in app.blueprints.keys():
url_reset_password = flask.url_for('reset_password.reset-password')
context = {
'form': form,
'version': __version__,
'url_register': url_register,
'url_reset_password': url_reset_password,
}
return flask.render_template(self.template_name, **context)