diff options
author | Mike Crute <mcrute@gmail.com> | 2012-12-04 16:21:32 -0500 |
---|---|---|
committer | Mike Crute <mcrute@gmail.com> | 2012-12-11 15:27:46 -0500 |
commit | bd95993653a1b94d07316e24a0f519d00f9359d6 (patch) | |
tree | 45f44092fde26ad38db1aaaf123d7e2173fa973e /templates | |
parent | ab626f31a0645d87560d242a20dd60e01b3d3b46 (diff) | |
download | django-precompiler-bd95993653a1b94d07316e24a0f519d00f9359d6.tar.bz2 django-precompiler-bd95993653a1b94d07316e24a0f519d00f9359d6.tar.xz django-precompiler-bd95993653a1b94d07316e24a0f519d00f9359d6.zip |
User can login and logout
Diffstat (limited to 'templates')
-rw-r--r-- | templates/accounts/profile.html | 9 | ||||
-rw-r--r-- | templates/index.html | 5 | ||||
-rw-r--r-- | templates/registration/logged_out.html | 6 | ||||
-rw-r--r-- | templates/registration/login.html | 27 |
4 files changed, 47 insertions, 0 deletions
diff --git a/templates/accounts/profile.html b/templates/accounts/profile.html new file mode 100644 index 0000000..aa6f3ad --- /dev/null +++ b/templates/accounts/profile.html | |||
@@ -0,0 +1,9 @@ | |||
1 | {% extends "base.html" %} | ||
2 | |||
3 | {% block content %} | ||
4 | <h1>Your Account</h1> | ||
5 | <p>Hello <b>{{ user.email }}</b></p> | ||
6 | <ul> | ||
7 | <li><a href="{% url 'auth:logout' %}">Logout</a></li> | ||
8 | </ul> | ||
9 | {% endblock %} | ||
diff --git a/templates/index.html b/templates/index.html index ff76c3e..1e497a5 100644 --- a/templates/index.html +++ b/templates/index.html | |||
@@ -6,6 +6,11 @@ | |||
6 | <h1>Hello Codemash</h1> | 6 | <h1>Hello Codemash</h1> |
7 | <ul> | 7 | <ul> |
8 | <li><a href="{% url 'contact:form' %}">Contact Us</a></li> | 8 | <li><a href="{% url 'contact:form' %}">Contact Us</a></li> |
9 | {% if user.is_authenticated %} | ||
10 | <li><a href="{% url 'auth:logout' %}">Logout ({{ user.username }})</a></li> | ||
11 | {% else %} | ||
12 | <li><a href="{% url 'auth:login' %}">Login</a></li> | ||
13 | {% endif %} | ||
9 | </ul> | 14 | </ul> |
10 | <p>You've just created your first Django page. Pretty cool, eh?</p> | 15 | <p>You've just created your first Django page. Pretty cool, eh?</p> |
11 | {% endblock %} | 16 | {% endblock %} |
diff --git a/templates/registration/logged_out.html b/templates/registration/logged_out.html new file mode 100644 index 0000000..b6908d4 --- /dev/null +++ b/templates/registration/logged_out.html | |||
@@ -0,0 +1,6 @@ | |||
1 | {% extends "base.html" %} | ||
2 | |||
3 | {% block content %} | ||
4 | <h1>You are logged out</h1> | ||
5 | <p>You can go <a href="{% url 'home' %}">home</a>.</p> | ||
6 | {% endblock %} | ||
diff --git a/templates/registration/login.html b/templates/registration/login.html new file mode 100644 index 0000000..37893a9 --- /dev/null +++ b/templates/registration/login.html | |||
@@ -0,0 +1,27 @@ | |||
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 | <h1>Login</h1> | ||
10 | <form method="post" action="{% url 'auth:login' %}"> | ||
11 | {% csrf_token %} | ||
12 | <table> | ||
13 | <tr> | ||
14 | <td>{{ form.username.label_tag }}</td> | ||
15 | <td>{{ form.username }}</td> | ||
16 | </tr> | ||
17 | <tr> | ||
18 | <td>{{ form.password.label_tag }}</td> | ||
19 | <td>{{ form.password }}</td> | ||
20 | </tr> | ||
21 | </table> | ||
22 | |||
23 | <input type="submit" value="login" /> | ||
24 | <input type="hidden" name="next" value="{{ next }}" /> | ||
25 | </form> | ||
26 | |||
27 | {% endblock %} | ||