Skip to content

Commit

Permalink
[admin] Add a link to password reset in login form openwisp#19
Browse files Browse the repository at this point in the history
Implements and closes openwisp#19
  • Loading branch information
R9295 committed Nov 30, 2017
1 parent a4add44 commit 891f538
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions openwisp_controller/config/templates/admin/login.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{% extends "admin/login.html" %}
{% block content %}
{% if form.errors and not form.non_field_errors %}
<p class="errornote">
{% if form.errors.items|length == 1 %}Please correct the error below{% else %}Please correct the errors below{% endif %}
</p>
{% endif %}

{% if form.non_field_errors %}
{% for error in form.non_field_errors %}
<p class="errornote">
{{ error }}
</p>
{% endfor %}
{% endif %}

<div id="content-main">

{% if user.is_authenticated %}
<p class="errornote">
{% block trimmed %}
You are authenticated as {{ username }}, but are not authorized to
access this page. Would you like to login to a different account?
{% endblock %}
</p>
{% endif %}

<form action="{{ app_path }}" method="post" id="login-form">{% csrf_token %}
<div class="form-row">
{{ form.username.errors }}
{{ form.username.label_tag }} {{ form.username }}
</div>
<div class="form-row">
{{ form.password.errors }}
{{ form.password.label_tag }} {{ form.password }}
<input type="hidden" name="next" value="{{ next }}" />
</div>
<a href="{% url 'account_reset_password' %}">Forgot Password?</a>

<div class="submit-row">
<input type="submit" value="Log in" />
</div>
</form>

</div>
{% endblock %}

0 comments on commit 891f538

Please sign in to comment.