forked from expo/troggle
[svn] Add user registration and user profiles.
Used modified versions of django-registration and django-profiles , both on bitbucket. The Person model is now set up as the profile for auth.User s. I set up a requestcontext so that settings is automatically passed to every template, no need to repeat ourselves in views. However, this needs to be refined: I will soon change it to only pass a subset of settings. E.G. we do not need to be passing the DB login and password! Copied from http://cucc@cucc.survex.com/svn/trunk/expoweb/troggle/, rev. 8231 by aaron @ 1/29/2009 11:02 PM
This commit is contained in:
13
templates/registration/activate.html
Normal file
13
templates/registration/activate.html
Normal file
@@ -0,0 +1,13 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}
|
||||
registration_form.html | {{ block.super }}
|
||||
{% endblock %}
|
||||
|
||||
{% block header %}
|
||||
<h1>activate.html</h1>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
You are now activated.
|
||||
{% endblock %}
|
||||
3
templates/registration/activation_email.txt
Normal file
3
templates/registration/activation_email.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
Activate your account in {{ expiration_days }} days...
|
||||
{{ URL_ROOT }}{% url registration_activate activation_key %}
|
||||
|
||||
1
templates/registration/activation_email_subject.txt
Normal file
1
templates/registration/activation_email_subject.txt
Normal file
@@ -0,0 +1 @@
|
||||
[CUCC Expo] Activation email
|
||||
19
templates/registration/login.html
Normal file
19
templates/registration/login.html
Normal file
@@ -0,0 +1,19 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% if form.errors %}
|
||||
<p>Your username and password didn't match. Please try again.</p>
|
||||
{% endif %}
|
||||
|
||||
<form method="post" action=".">
|
||||
<table>
|
||||
<tr><td>{{ form.username.label_tag }}</td><td>{{ form.username }}</td></tr>
|
||||
<tr><td>{{ form.password.label_tag }}</td><td>{{ form.password }}</td></tr>
|
||||
</table>
|
||||
|
||||
<input type="submit" value="login" />
|
||||
<input type="hidden" name="next" value="{{ next }}" />
|
||||
</form>
|
||||
|
||||
{% endblock %}
|
||||
4
templates/registration/logout.html
Normal file
4
templates/registration/logout.html
Normal file
@@ -0,0 +1,4 @@
|
||||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
You have been logged out.
|
||||
{% endblock %}
|
||||
6
templates/registration/registration_activate.html
Normal file
6
templates/registration/registration_activate.html
Normal file
@@ -0,0 +1,6 @@
|
||||
{% extends “base.html” %}
|
||||
{% block body %}
|
||||
Hello {{ account }}!
|
||||
|
||||
Check your email to confirm the activation. There are {{ expiration_days }} days left to do it.
|
||||
{% endblock %}
|
||||
13
templates/registration/registration_complete.html
Normal file
13
templates/registration/registration_complete.html
Normal file
@@ -0,0 +1,13 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}
|
||||
registration_complete.html | {{ block.super }}
|
||||
{% endblock %}
|
||||
|
||||
{% block header %}
|
||||
<h1>registration_complete.html</h1>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
Thank you for signing up. An email with the activation code has been sent to your inbox.
|
||||
{% endblock %}
|
||||
56
templates/registration/registration_form.html
Normal file
56
templates/registration/registration_form.html
Normal file
@@ -0,0 +1,56 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}
|
||||
registration_form.html | {{ block.super }}
|
||||
{% endblock %}
|
||||
|
||||
{% block header %}
|
||||
<h1>registration_form.html</h1>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<form action="{% url registration_register %}" method="POST">
|
||||
<table>
|
||||
<tr>
|
||||
<td align="right" valign="top">Username:</td>
|
||||
<td>
|
||||
{{ form.username }} <br/>
|
||||
{% for error in form.username.errors %}
|
||||
<span style="color:red">{{ error }}</span>
|
||||
{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right" valign="top">Email:</td>
|
||||
<td>
|
||||
{{ form.email }} <br/>
|
||||
{% for error in form.email.errors %}
|
||||
<span style="color:red">{{ error }}</span>
|
||||
{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right" valign="top">Password:</td>
|
||||
<td>
|
||||
{{ form.password1 }} <br/>
|
||||
{% for error in form.password1.errors %}
|
||||
<span style="color:red">{{ error }}</span>
|
||||
{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right" valign="top">Password (again):</td>
|
||||
<td>
|
||||
{{ form.password2 }} <br/>
|
||||
{% for error in form.password2.errors %}
|
||||
<span style="color:red">{{ error }}</span>
|
||||
{% endfor %}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td><input type="submit" value="Register" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user