[snowy] Add in all required templates for django-registration
- From: Brad Taylor <btaylor src gnome org>
- To: svn-commits-list gnome org
- Subject: [snowy] Add in all required templates for django-registration
- Date: Mon, 25 May 2009 12:05:04 -0400 (EDT)
commit cb1d9378a347aedff254068bee7b4f969857938c
Author: Brad Taylor <brad getcoded net>
Date: Mon May 25 11:35:14 2009 -0400
Add in all required templates for django-registration
---
site_media/css/screen.css | 4 +++
templates/base.html | 13 ++++++----
templates/registration/login.html | 31 +++++++++++++++++++++++++
templates/registration/logout.html | 12 +++++++++
templates/registration/registration_form.html | 21 +++++++++++++---
5 files changed, 72 insertions(+), 9 deletions(-)
diff --git a/site_media/css/screen.css b/site_media/css/screen.css
index e92d4e9..d5f025a 100644
--- a/site_media/css/screen.css
+++ b/site_media/css/screen.css
@@ -252,6 +252,10 @@ table#content-layout {
background-color: #4e6960;
}
+.form-field th {
+ text-align: left;
+}
+
/* Note-specific styles */
#note h1 {
text-decoration: underline;
diff --git a/templates/base.html b/templates/base.html
index b31aeb3..9521907 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -1,4 +1,5 @@
{% load gravatar %}
+{% load i18n %}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
@@ -20,20 +21,22 @@
<body>
<div id="header-container">
<div id="header-logo">
- <img src="{{ MEDIA_URL }}img/tomboy-logo.png" alt="tomboy: simple note-taking."/>
+ <a href="/">
+ <img src="{{ MEDIA_URL }}img/tomboy-logo.png" alt="{% trans "tomboy: simple note-taking." %}"/>
+ </a>
</div>
<div id="header-avatar">
{% if user.is_authenticated %}
- {% gravatar_img_for_user user 64 %}
+ <a href="{% url notes.views.note_index user.username %}">{% gravatar_img_for_user user 64 %}</a>
{% endif %}
</div>
<div id="header-auth">
{% if user.is_authenticated %}
- <!-- registration login form -->
<h3>{{ user }}</h3>
- <p><a href="">preferences</a> / <a href="{% url django.contrib.auth.views.logout %}">log out</a></p>
+ <p><a href="">{% trans "preferences" %}</a> / <a href="{% url django.contrib.auth.views.logout %}">{% trans "log out" %}</a></p>
{% else %}
- <p>care to <a href="{% url django.contrib.auth.views.login %}">log in</a>?</p>
+ <p>{% trans "hello stranger! care to " %}<a href="{% url django.contrib.auth.views.login %}">{% trans "log in" %}</a>{% trans "?" %}</p>
+ <p><small>{% trans "not a member yet?" %} <a href="{% url registration.views.register %}">{% trans "Sign up." %}</a></small></p>
{% endif %}
</div>
<div class="clear"></div>
diff --git a/templates/registration/login.html b/templates/registration/login.html
new file mode 100644
index 0000000..6945741
--- /dev/null
+++ b/templates/registration/login.html
@@ -0,0 +1,31 @@
+{% extends "site_base.html" %}
+
+{% load i18n %}
+
+{% block content %}
+{% if form.errors %}
+<p>{% trans "Your username and password didn't match. Please try again." %}</p>
+{% endif %}
+<h3>{% trans "Log in" %}</h3>
+
+<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" />
+{% if next %}
+<input type="hidden" name="next" value="{{ next }}" />
+{% else %}
+<input type="hidden" name="next" value="/" />
+{% endif %}
+</form>
+{% endblock %}
+
diff --git a/templates/registration/logout.html b/templates/registration/logout.html
new file mode 100644
index 0000000..500bcae
--- /dev/null
+++ b/templates/registration/logout.html
@@ -0,0 +1,12 @@
+{% extends "site_base.html" %}
+
+{% load i18n %}
+
+{% block content %}
+<h3>{{ title }}</h3>
+<p>{% blocktrans %}You have been successfully logged out. You're coming back, right?{% endblocktrans %}</p>
+<p>
+<a href="{% url django.contrib.auth.views.login %}">{% trans "Log in again" %}</a>
+</p>
+{% endblock %}
+
diff --git a/templates/registration/registration_form.html b/templates/registration/registration_form.html
index a13beaf..b49195c 100644
--- a/templates/registration/registration_form.html
+++ b/templates/registration/registration_form.html
@@ -1,9 +1,22 @@
{% extends 'site_base.html' %}
-{% block body %}
-<form method='POST'>
-{{ form.as_p }}
+{% load i18n %}
-<input method="submit" type="submit">
+{% block content %}
+<h1>{% trans "Create an account" %}</h1>
+<form method='POST'>
+ <table class="form-field">
+ <tbody>
+ {{ form.as_table }}
+ </tbody>
+ <tfoot>
+ <tr>
+ <th></th>
+ <td>
+ <input method="submit" type="submit" value="Create Account"/>
+ </td>
+ </tr>
+ </tfoot>
+ </table>
</form>
{% endblock %}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]