Skip to content

Commit c11030b

Browse files
committed
add templates for auth views
1 parent 0cb03fa commit c11030b

File tree

7 files changed

+158
-0
lines changed

7 files changed

+158
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{% extends "base.html" %}
2+
3+
{% block content %}
4+
5+
<div class="container">
6+
<p>Logged out!</p>
7+
<a href="{% url 'login' %}">Click here to login again.</a>
8+
</div>
9+
{% endblock %}

templates/registration/login.html

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
{% extends "base.html" %}
2+
3+
{% block content %}
4+
5+
{% if form.errors %}
6+
<p>Your username and password didn't match. Please try again.</p>
7+
{% endif %}
8+
9+
{% if next %}
10+
{% if user.is_authenticated %}
11+
<p>Your account doesn't have access to this page. To proceed,
12+
please login with an account that has access.</p>
13+
{% else %}
14+
<p>Please login to see this page.</p>
15+
{% endif %}
16+
{% endif %}
17+
18+
<div class="container">
19+
<div class="row">
20+
21+
<!-- <div class="col-md-4"></div> -->
22+
<!-- <div class="col-md-4"> -->
23+
<!-- Default form login -->
24+
<form class="text-center border border-light p-5" method="post" action="{% url 'login' %}">
25+
{% csrf_token %}
26+
27+
<p class="h4 mb-4">Sign in</p>
28+
29+
<!-- Email -->
30+
<!-- <input type="email" id="defaultLoginFormEmail" class="form-control mb-4" placeholder="E-mail"> -->
31+
<div class="text-left">{{ form.username.label_tag }}</div>
32+
{{ form.username }}
33+
<div class="mb-4"></div>
34+
35+
<!-- Password -->
36+
<div class="text-left">{{ form.password.label_tag }}</div>
37+
{{ form.password }}
38+
<div class="mb-4"></div>
39+
40+
<div class="d-flex justify-content-around">
41+
<div>
42+
<!-- Forgot password -->
43+
<a href="{% url 'password_reset' %}">Lost password?</a>
44+
</div>
45+
</div>
46+
47+
<!-- Sign in button -->
48+
<button class="btn btn-info btn-block my-4" type="submit">Sign in</button>
49+
<input type="hidden" name="next" value="{{ next }}" />
50+
51+
<!-- Register -->
52+
<p>Not a member?
53+
<a href="">Register</a>
54+
</p>
55+
56+
<!-- Social login -->
57+
<p>or sign in with:</p>
58+
59+
<a type="button" href="https://facebook.com" class="light-blue-text mx-2">
60+
<i class="fa fa-facebook"></i>
61+
</a>
62+
<a type="button" href="https://twitter.com" class="light-blue-text mx-2">
63+
<i class="fa fa-twitter"></i>
64+
</a>
65+
<a type="button" href="https://linkedin.com" class="light-blue-text mx-2">
66+
<i class="fa fa-linkedin"></i>
67+
</a>
68+
<a type="button" href="https://github.com" class="light-blue-text mx-2">
69+
<i class="fa fa-github"></i>
70+
</a>
71+
72+
</form>
73+
<!-- Default form login -->
74+
<!-- </div> -->
75+
<!-- <div class="col-md-4"></div> -->
76+
</div>
77+
</div>
78+
79+
{% endblock %}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{% extends "base.html" %}
2+
{% block content %}
3+
4+
<div class="container">
5+
<h1>The password has been changed!</h1>
6+
<p><a href="{% url 'login' %}">log in again?</a></p>
7+
</div>
8+
9+
{% endblock %}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{% extends "base.html" %}
2+
3+
{% block content %}
4+
5+
<div class="container">
6+
{% if validlink %}
7+
<p>Please enter (and confirm) your new password.</p>
8+
<form action="" method="post">
9+
<div style="display:none">
10+
<input type="hidden" value="{{ csrf_token }}" name="csrfmiddlewaretoken">
11+
</div>
12+
<table>
13+
<tr>
14+
<td>{{ form.new_password1.errors }}
15+
<label for="id_new_password1">New password:</label></td>
16+
<td>{{ form.new_password1 }}</td>
17+
</tr>
18+
<tr>
19+
<td>{{ form.new_password2.errors }}
20+
<label for="id_new_password2">Confirm password:</label></td>
21+
<td>{{ form.new_password2 }}</td>
22+
</tr>
23+
<tr>
24+
<td></td>
25+
<td><input type="submit" value="Change my password" /></td>
26+
</tr>
27+
</table>
28+
</form>
29+
{% else %}
30+
<h1>Password reset failed</h1>
31+
<p>The password reset link was invalid, possibly because it has already been used. Please request a new password reset.</p>
32+
{% endif %}
33+
</div>
34+
35+
{% endblock %}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{% extends "base.html" %}
2+
3+
{% block content %}
4+
5+
<div class="container">
6+
<p>We've emailed you instructions for setting your password. If they haven't arrived in a few minutes, check your spam folder.</p>
7+
</div>
8+
9+
{% endblock %}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Someone asked for password reset for email {{ email }}. Follow the link below:
2+
{{ protocol}}://{{ domain }}{% url 'password_reset_confirm' uidb64=uid token=token %}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{% extends "base.html" %}
2+
3+
{% block content %}
4+
5+
<form method='post' action=''>
6+
{% csrf_token %}
7+
8+
{% if form.email.errors %}
9+
{{ form.email.errors }}
10+
{% endif %}
11+
<p>{{ form.email }}</p>
12+
<input type='submit' class='btn btn-default btn-lg' value='Reset password'>
13+
</form>
14+
15+
{% endblock %}

0 commit comments

Comments
 (0)