changeset 27:e019ca8e14f6

Clean up templates
author Jordi Gutiérrez Hermoso <jordigh@gmail.com>
date Mon, 28 Jun 2010 22:36:53 -0500
parents d534172de5d5
children 9f17312f3914
files templates/404.html templates/500.html templates/bundle/index.djhtml templates/controls.djhtml templates/index.djhtml templates/registration/activate.html templates/registration/login.html templates/registration/registration_complete.html templates/registration/registration_form.html templates/whitebox.djhtml
diffstat 10 files changed, 134 insertions(+), 128 deletions(-) [+]
line wrap: on
line diff
--- a/templates/404.html	Mon Jun 28 22:02:07 2010 -0500
+++ b/templates/404.html	Mon Jun 28 22:36:53 2010 -0500
@@ -1,12 +1,16 @@
-{% extends "controls.djhtml" %}
+{% extends "whitebox.djhtml" %}
+
 {% block title %}
 Object not found
 {% endblock %}
-{% block content %}
-<div class="whitebox">
+
+{% block boxtitle %}
+Object not found
+{% endblock %}
+
+{% block boxcontents %}
 <p>
   The resource you were looking for is unavailable. If you think this
   is our fault, please let us know.
 </p>
-</div>
 {% endblock %}
--- a/templates/500.html	Mon Jun 28 22:02:07 2010 -0500
+++ b/templates/500.html	Mon Jun 28 22:36:53 2010 -0500
@@ -1,12 +1,15 @@
-{% extends "controls.djhtml" %}
+{% extends "whitebox.djhtml" %}
 {% block title %}
 Server error
 {% endblock %}
-{% block content %}
-<div class="whitebox">
+
+{% block boxtitle %}
+Oops...
+{% endblock %}
+
+{% block boxcontents %}
 <p>
   The server encountered an internal error. If the problem persists,
   please let us know.
 </p>
-</div>
 {% endblock %}
--- a/templates/bundle/index.djhtml	Mon Jun 28 22:02:07 2010 -0500
+++ b/templates/bundle/index.djhtml	Mon Jun 28 22:36:53 2010 -0500
@@ -1,4 +1,4 @@
-{% extends "controls.djhtml" %}
+{% extends "whitebox.djhtml" %}
 
 {% block content %}
 <div class="info">
--- a/templates/controls.djhtml	Mon Jun 28 22:02:07 2010 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-{% extends "base.djhtml" %}
-
-{% block content-related %}
-<div id="info">
-  <h3>
-    Controls
-  </h3>
-  <div class="whitebox">
-    {% if user.is_authenticated %}
-    <p>
-      You are logged in
-      as <a href="/{{user.username}}">{{user.username}}</a>.
-    </p>
-    <p>
-      (<a href="{% url auth_logout %}">logout</a>)
-    </p>
-    {% else %}
-    <p>
-      <a href="{% url auth_login%}?next={{ request.path }}">Log in</a>
-    </p>
-    {% endif %}
-    <form method="get" action="." >
-      <br/>
-      <input id="search" type="text" name="search" maxlength="200" size="10"/>
-      <input type="submit" value="Search" />
-    </form>
-    
-  </div>
-</div>
-{% endblock %}
--- a/templates/index.djhtml	Mon Jun 28 22:02:07 2010 -0500
+++ b/templates/index.djhtml	Mon Jun 28 22:36:53 2010 -0500
@@ -1,4 +1,4 @@
-{% extends "controls.djhtml" %}
+{% extends "whitebox.djhtml" %}
 
 {% block content %}
 <div class="info">
--- a/templates/registration/activate.html	Mon Jun 28 22:02:07 2010 -0500
+++ b/templates/registration/activate.html	Mon Jun 28 22:36:53 2010 -0500
@@ -1,25 +1,23 @@
-{% extends "controls.djhtml" %}
+{% extends "whitebox.djhtml" %}
+
+{% block boxtitle %}
+Account activation
+{% endblock %}
+
+{% block boxcontents %}
 
-{% block content %}
-<div id="info">
-  <h3>
-    Account activation
-  </h3>
-  <div class="whitebox">
-    {% if account %}
-    <p>
-      Account successfully activated. 
-      <a href="{% url auth_login %}">Click here</a> to log in.
-    </p>
+{% if account %}
+<p>
+  Account successfully activated. 
+  <a href="{% url auth_login %}">Click here</a> to log in.
+</p>
+
+{% else %}
 
-    {% else %}
-
-    <p>
-      Account activation failed.
-    </p>
+<p>
+  Account activation failed.
+</p>
 
-    {% endif %}
+{% endif %}
 
-  </div>
-</div>
 {% endblock %}
--- a/templates/registration/login.html	Mon Jun 28 22:02:07 2010 -0500
+++ b/templates/registration/login.html	Mon Jun 28 22:36:53 2010 -0500
@@ -1,41 +1,35 @@
-{% extends "controls.djhtml" %}
+{% extends "whitebox.djhtml" %}
 
-{% block content %}
-<div id="info">
+{% block boxtitle %}
+Login
+{% endblock %}
 
-  <h3>
-    Login
-  </h3>
-  <div class="whitebox">
-    {% if user.is_authenticated %}
-    <p>
-      You're already logged in as 
-      <a href="{{ user.username }}">{{user.username}}</a>.
-    </p>
-    <p>
-      (<a href="{% url auth_logout %}">logout</a>)
-    </p>
+{% block boxcontents %}
+{% if user.is_authenticated %}
+<p>
+  You're already logged in as 
+  <a href="{{ user.username }}">{{user.username}}</a>.
+</p>
+<p>
+  (<a href="{% url auth_logout %}">logout</a>)
+</p>
 
-    {% else %}
+{% else %}
 
-    <form method="post" action=".">
-      {% csrf_token %}
-      <table>
-      {{form.as_table}}
-      </table>
-      <input type="submit" value="Log in" />
-      <input type="hidden" name="next" value="{{ next }}" />
-    </form>
+<form method="post" action=".">
+  {% csrf_token %}
+  <table>
+    {{form.as_table}}
+  </table>
+  <input type="submit" value="Log in" />
+  <input type="hidden" name="next" value="{{ next }}" />
+</form>
 
-    <p>
-      Forgot password? <a href="{% url auth_password_reset %}">Reset it</a>!
-    </p>
-    <p>
-      No login name? <a href="{% url registration_register %}">Register</a>!
-    </p>
-    {% endif %}
-
-
-  </div>
-</div>
+<p>
+  Forgot password? <a href="{% url auth_password_reset %}">Reset it</a>!
+</p>
+<p>
+  No login name? <a href="{% url registration_register %}">Register</a>!
+</p>
+{% endif %}
 {% endblock %}
--- a/templates/registration/registration_complete.html	Mon Jun 28 22:02:07 2010 -0500
+++ b/templates/registration/registration_complete.html	Mon Jun 28 22:36:53 2010 -0500
@@ -1,9 +1,7 @@
-{% extends "controls.djhtml" %}
-{% block content %}
-<div class="whitebox">
-  <p>
-    Activation email sent. Please check your inbox to complete your
-    registration.
-  </p>
-</div>
+{% extends "whitebox.djhtml" %}
+{% block boxcontents %}
+<p>
+  Activation email sent. Please check your inbox to complete your
+  registration.
+</p>
 {% endblock %}
--- a/templates/registration/registration_form.html	Mon Jun 28 22:02:07 2010 -0500
+++ b/templates/registration/registration_form.html	Mon Jun 28 22:36:53 2010 -0500
@@ -1,29 +1,27 @@
-{% extends "controls.djhtml" %}
+{% extends "whitebox.djhtml" %}
+
+{% block boxtitle %}
+Registration details
+{% endblock %}
 
-{% block content %}
+
+{% block boxcontents %}
+<p>
+  Please give us some basic information to set up your account.
+  Valid usernames consist of letters, numbers, and underscores.
+</p>
 
-<div class="info">
-  <h3>
-    Registration details
-  </h3>
-  <div class="whitebox">
-    <p>
-      Please give us some basic information to set up your account.
-      Valid usernames consist of letters, numbers, and underscores.
-    </p>
-    {% if form.errors %}
-    <p class="error">
-      Please correct the errors below.
-    </p>
-    {% endif %}
-    <form action="." method="post">
-      {% csrf_token %}
-      <table>
-      {{form.as_table}}
-      </table>
-      <input class="button" type="submit" value="Submit" />
-    </form>
-  </div>
-</div>
+{% if form.errors %}
+<p class="error">
+  Please correct the errors below.
+</p>
+{% endif %}
 
+<form action="." method="post">
+  {% csrf_token %}
+  <table>
+    {{form.as_table}}
+  </table>
+  <input class="button" type="submit" value="Submit" />
+</form>
 {% endblock %}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/whitebox.djhtml	Mon Jun 28 22:36:53 2010 -0500
@@ -0,0 +1,41 @@
+{% extends "base.djhtml" %}
+
+{% block content %}
+<div id="info">
+  <h3>
+    {% block boxtitle  %}{% endblock %}
+  </h3>
+  <div class="whitebox">
+    {% block boxcontents %}{% endblock %}
+  </div>
+</div>
+{% endblock %}
+
+{% block content-related %}
+<div id="info">
+  <h3>
+    Controls
+  </h3>
+  <div class="whitebox">
+    {% if user.is_authenticated %}
+    <p>
+      You are logged in
+      as <a href="/{{user.username}}">{{user.username}}</a>.
+    </p>
+    <p>
+      (<a href="{% url auth_logout %}">logout</a>)
+    </p>
+    {% else %}
+    <p>
+      <a href="{% url auth_login%}?next={{ request.path }}">Log in</a>
+    </p>
+    {% endif %}
+    <form method="get" action="." >
+      <br/>
+      <input id="search" type="text" name="search" maxlength="200" size="10"/>
+      <input type="submit" value="Search" />
+    </form>
+    
+  </div>
+</div>
+{% endblock %}