Commits

David Chambers committed a4ab7d1

Improved readability of templates.

Comments (0)

Files changed (17)

 {% extends "base.dhtml" %}
+
 {% block title %}404: Page not found{% endblock %}
+
 {% block content %}
-                <h1>404: Page not found</h1>
-                <p>Oops! The requested page appears not to exist.</p>
+        <h1>404: Page not found</h1>
+        <p>Oops! The requested page appears not to exist.</p>
 {% endblock %}
 {% extends "base.dhtml" %}
+
 {% block title %}500: Server error{% endblock %}
+
 {% block content %}
-                <h1>500: Server error</h1>
-                <p>Sorry! Something went wrong on the server; the site admins have been alerted to the problem.</p>
+        <h1>500: Server error</h1>
+        <p>Sorry! Something went wrong on the server; the site admins have been alerted to the problem.</p>
 {% endblock %}

templates/_contact.dhtml

 {% extends "base.dhtml" %}
+
 {% load mango %}
+
 {% block title %}Contact{% endblock %}
+
 {% block content %}
-            {% block contact_heading %}<h1>Contact</h1>{% endblock %}{% if form %}
-            <form id="contact" method="post">{% csrf_token %}
-                <fieldset>
-                    {% field form.sender_name %}
-                    {% field form.sender_email %}
-                    {% field form.subject %}
-                </fieldset>
-                {% field form.message %}
-                {% field form.cc_sender %}
-                <div><input type="submit" value="Send message" /></div>
-            </form>
-            <script>
-                (function () {
-                    var element, i = arguments.length;
+      {% block contact_heading %}<h1>Contact</h1>{% endblock %}
+    {% if form %}
+      <form id="contact" method="post">{% csrf_token %}
+        <fieldset>
+          {% field form.sender_name %}
+          {% field form.sender_email %}
+          {% field form.subject %}
+        </fieldset>
+        {% field form.message %}
+        {% field form.cc_sender %}
+        <div><input type="submit" value="Send message" /></div>
+      </form>
+      <script>
+        (function () {
+          var element, i = arguments.length;
 
-                    function focus() {
-                        if (this.className == 'placeholder') {
-                            this.className = '';
-                            this.value = '';
-                        }
-                    }
+          function focus() {
+            if (this.className == 'placeholder') {
+              this.className = '';
+              this.value = '';
+            }
+          }
 
-                    function blur() {
-                        if (this.value === '') {
-                            this.value = this.getAttribute('placeholder');
-                            this.className = 'placeholder';
-                        }
-                    }
+          function blur() {
+            if (this.value === '') {
+              this.value = this.getAttribute('placeholder');
+              this.className = 'placeholder';
+            }
+          }
 
-                    while (i--) {
-                        element = document.getElementById(arguments[i]);
+          while (i--) {
+            element = document.getElementById(arguments[i]);
 
-                        // check for native support
-                        if ('placeholder' in element) return;
+            // check for native support
+            if ('placeholder' in element) return;
 
-                        // add event listeners (W3C/IE)
-                        if (element.addEventListener) {
-                            element.addEventListener('focus', focus, false);
-                            element.addEventListener('blur', blur, false);
-                        } else if (element.attachEvent) {
-                            element.attachEvent('onfocus', focus);
-                            element.attachEvent('onblur', blur);
-                        }
+            // add event listeners (W3C/IE)
+            if (element.addEventListener) {
+              element.addEventListener('focus', focus, false);
+              element.addEventListener('blur', blur, false);
+            } else if (element.attachEvent) {
+              element.attachEvent('onfocus', focus);
+              element.attachEvent('onblur', blur);
+            }
 
-                        // initialize
-                        blur.apply(element);
-                    }
-                }('sender_name', 'sender_email', 'subject'));
-            </script>{% else %}
-            <p>Thanks for your message. I'll do my best to respond in the not too distant future.</p>{% endif %}
+            // initialize
+            blur.apply(element);
+          }
+        }('sender_name', 'sender_email', 'subject'));
+      </script>
+    {% else %}
+      <p>Thanks for your message. I'll do my best to respond in the not too distant future.</p>
+    {% endif %}
 {% endblock %}

templates/_document.dhtml

 {% extends "base.dhtml" %}
+
 {% load mango %}
+
 {% block title %}{{ document.title_text }}{% endblock %}
+
 {% block head %}
-    {{ block.super }}{% for stylesheet in document.stylesheets %}
-    {{ stylesheet }}{% endfor %}{% endblock %}
+    {{ block.super }}
+  {% for stylesheet in document.stylesheets %}
+    {{ stylesheet }}
+  {% endfor %}
+{% endblock %}
+
 {% block content %}
-                <article>
-                    <header>
-                        <h1>{{ document.title }}</h1>{% if document.datetime %}
-                        <time datetime="{{ document.datetime|isoformat }}" pubdate="pubdate">{{ document|pubdate }}</time>{% endif %}
-                    </header>
-                    {{ document.html }}
-{% block metadata %}{% if document.author or document.tags or document.has_shorturl %}
-                    <footer class="metadata">{% if document.author or document.has_shorturl %}
-                        <ul>{% if document.author %}{% if document.author.url %}
-                            <li class="author"><a href="{{ document.author.url }}">{{ document.author.name }}</a></li>{% else %}
-                            <li class="author">{{ document.author.name }}</li>{% endif %}{% endif %}{% if document.has_shorturl %}
-                            <li class="shorturl"><a href="{{ document.shorturl }}">Short URL</a></li>{% endif %}
-                        </ul>{% endif %}{% if document.tags %}
-                        <h4>This {{ document.type }} has the following tags:</h4>
-                        <ol>{% for tag in document.tags %}
-                            <li><a href="{% url mango.views.tagged_as tag.slug %}">{{ tag }}</a></li>{% endfor %}
-                        </ol>{% endif %}
-                    </footer>{% endif %}{% endblock %}
-{% block comments %}{% if comments or new_comment %}
-                    {% block comments_heading %}<h2 id="comments">Comments</h2>{% endblock %}{% for comment in comments %}{% include "comment.dhtml" %}{% endfor %}{% if new_comment %}{{ new_comment }}{% if COMMENTS_REQUIRE_APPROVAL %}
-                    <p><strong>Your comment is awaiting moderation.</strong></p>{% endif %}{% endif %}{% endif %}{% if DISQUS and thread.allow_comments %}
-                    {% block respond_heading %}<h3 id="respond">Respond</h3>{% endblock %}
-                    {{ form.non_field_errors }}
-                    <form id="comment" method="post">{% csrf_token %}
-                        <fieldset>
-                            {% field form.author_name %}
-                            {% field form.author_email %}
-                            {% field form.author_url %}
-                        </fieldset>
-                        {% field form.message %}{% if SUBSCRIPTIONS %}
-                        {% field form.subscribe %}{% endif %}
-                        <div><input type="submit" value="Submit comment" /></div>
-                    </form>
-                    <script>
-                        (function () {
-                            var element, i = arguments.length;
+        <article>
+          <header>
+            <h1>{{ document.title }}</h1>
+          {% if document.datetime %}
+            <time datetime="{{ document.datetime|isoformat }}" pubdate="pubdate">{{ document|pubdate }}</time>
+          {% endif %}
+          </header>
+          {{ document.html }}
+  {% block metadata %}
+        {% if document.author or document.tags or document.has_shorturl %}
+          <footer class="metadata">
+          {% if document.author or document.has_shorturl %}
+            <ul>
+            {% if document.author %}
+              <li class="author">
+              {% if document.author.url %}
+                <a href="{{ document.author.url }}">{{ document.author.name }}</a>
+              {% else %}
+                {{ document.author.name }}
+              {% endif %}
+              </li>
+            {% endif %}
+            {% if document.has_shorturl %}
+              <li class="shorturl"><a href="{{ document.shorturl }}">Short URL</a></li>
+            {% endif %}
+            </ul>
+          {% endif %}
+          {% if document.tags %}
+            <h4>This {{ document.type }} has the following tags:</h4>
+            <ol>
+            {% for tag in document.tags %}
+              <li><a href="{% url mango.views.tagged_as tag.slug %}">{{ tag }}</a></li>
+            {% endfor %}
+            </ol>
+          {% endif %}
+          </footer>
+        {% endif %}
+  {% endblock %}
+  {% block comments %}
+      {% if comments or new_comment %}
+          {% block comments_heading %}<h2 id="comments">Comments</h2>{% endblock %}
+          {% for comment in comments %}{% include "comment.dhtml" %}{% endfor %}
+        {% if new_comment %}
+          {{ new_comment }}
+          {% if COMMENTS_REQUIRE_APPROVAL %}
+          <p><strong>Your comment is awaiting moderation.</strong></p>
+          {% endif %}
+        {% endif %}
+      {% endif %}
+      {% if DISQUS and thread.allow_comments %}
+          {% block respond_heading %}<h3 id="respond">Respond</h3>{% endblock %}
+          {{ form.non_field_errors }}
+          <form id="comment" method="post">{% csrf_token %}
+            <fieldset>
+              {% field form.author_name %}
+              {% field form.author_email %}
+              {% field form.author_url %}
+            </fieldset>
+            {% field form.message %}
+          {% if SUBSCRIPTIONS %}
+            {% field form.subscribe %}
+          {% endif %}
+            <div><input type="submit" value="Submit comment" /></div>
+          </form>
+          <script>
+            (function () {
+              var element, i = arguments.length;
 
-                            function focus() {
-                                if (this.className == 'placeholder') {
-                                    this.className = '';
-                                    this.value = '';
-                                }
-                            }
+              function focus() {
+                if (this.className == 'placeholder') {
+                  this.className = '';
+                  this.value = '';
+                }
+              }
 
-                            function blur() {
-                                if (this.value === '') {
-                                    this.value = this.getAttribute('placeholder');
-                                    this.className = 'placeholder';
-                                }
-                            }
+              function blur() {
+                if (this.value === '') {
+                  this.value = this.getAttribute('placeholder');
+                  this.className = 'placeholder';
+                }
+              }
 
-                            while (i--) {
-                                element = document.getElementById(arguments[i]);
+              while (i--) {
+                element = document.getElementById(arguments[i]);
 
-                                // check for native support
-                                if ('placeholder' in element) return;
+                // check for native support
+                if ('placeholder' in element) return;
 
-                                // add event listeners (W3C/IE)
-                                if (element.addEventListener) {
-                                    element.addEventListener('focus', focus, false);
-                                    element.addEventListener('blur', blur, false);
-                                } else if (element.attachEvent) {
-                                    element.attachEvent('onfocus', focus);
-                                    element.attachEvent('onblur', blur);
-                                }
+                // add event listeners (W3C/IE)
+                if (element.addEventListener) {
+                  element.addEventListener('focus', focus, false);
+                  element.addEventListener('blur', blur, false);
+                } else if (element.attachEvent) {
+                  element.attachEvent('onfocus', focus);
+                  element.attachEvent('onblur', blur);
+                }
 
-                                // initialize
-                                blur.apply(element);
-                            }
-                        }('author_name', 'author_email', 'author_url'));
-                    </script>{% endif %}
+                // initialize
+                blur.apply(element);
+              }
+            }('author_name', 'author_email', 'author_url'));
+          </script>
+      {% endif %}
+  {% endblock %}
+        </article>
 {% endblock %}
-                </article>
+
+{% block scripts %}
+    {{ block.super }}
+  {% for script in document.scripts %}
+    {{ script }}
+  {% endfor %}
 {% endblock %}
-{% block scripts %}
-    {{ block.super }}{% for script in document.scripts %}
-    {{ script }}{% endfor %}{% endblock %}

templates/archives.dhtml

 {% extends "base.dhtml" %}
+
 {% load mango %}
+
 {% block title %}Archives{% endblock %}
+
 {% block content %}
-            <h1>Archives</h1>{% if archives %}
-            <ol id="archives">{% for year, month, posts in archives %}
-                <li>
-                    <h2>{{ month|month }} {{ year }}</h2>
-                    <ol>{% for post in posts %}
-                        <li>
-                            <a href="{{ post.permalink }}">{{ post.title }}</a>
-                            <time datetime="{{ post.datetime|isoformat }}">{{ post|pubdate }}</time>
-                        </li>{% endfor %}
-                    </ol>
-                </li>{% endfor %}
-            </ol>{% else %}
-            <p>The archives are currently empty.</p>{% endif %}
+        <h1>Archives</h1>
+      {% if archives %}
+        <ol id="archives">
+        {% for year, month, posts in archives %}
+          <li>
+            <h2>{{ month|month }} {{ year }}</h2>
+            <ol>
+            {% for post in posts %}
+              <li>
+                <a href="{{ post.permalink }}">{{ post.title }}</a>
+                <time datetime="{{ post.datetime|isoformat }}">{{ post|pubdate }}</time>
+              </li>
+            {% endfor %}
+            </ol>
+          </li>
+        {% endfor %}
+        </ol>
+      {% else %}
+        <p>The archives are currently empty.</p>
+      {% endif %}
 {% endblock %}
 {% extends "_base.dhtml" %}
+
 {% block scripts %}
-{{ block.super }}
+    {{ block.super }}
     <script>
-        (function (undefined) {
-            var top, wrap = document.getElementById('wrap'), style = wrap.style;
+      (function (undefined) {
+        var top, wrap = document.getElementById('wrap'), style = wrap.style;
 
-            if (style.webkitBorderImage === undefined &&
-                style.MozBorderImage === undefined &&
-                style.borderImage === undefined) {
+        if (style.webkitBorderImage === undefined &&
+            style.MozBorderImage === undefined &&
+            style.borderImage === undefined) {
 
-                if (wrap.className) {
-                    wrap.className += ' noborderimage';
-                } else {
-                    wrap.className = 'noborderimage';
-                }
-                top = document.createElement('div');
-                top.id = 'topfix';
-                wrap.appendChild(top);
-            }
-        }());
-    </script>{% endblock %}
+          if (wrap.className) {
+            wrap.className += ' noborderimage';
+          } else {
+            wrap.className = 'noborderimage';
+          }
+          top = document.createElement('div');
+          top.id = 'topfix';
+          wrap.appendChild(top);
+        }
+      }());
+    </script>
+{% endblock %}

templates/category.dhtml

 {% extends "base.dhtml" %}
+
 {% load mango %}
+
 {% block title %}{{ category.name|smart_capfirst }}{% endblock %}
-{% block stylesheets %}{{ block.super }}{% for stylesheet in category.pages|combine:category.posts|required:"stylesheets" %}
-    {{ stylesheet }}{% endfor %}{% endblock %}
+
+{% block stylesheets %}
+    {{ block.super }}
+  {% for stylesheet in category.pages|combine:category.posts|required:"stylesheets" %}
+    {{ stylesheet }}
+  {% endfor %}
+{% endblock %}
+
 {% block content %}
-            <h1>{{ category.name|smart_capfirst }}</h1>{% if category.html %}
-            {{ category.html }}{% endif %}
-            {% if category.pages %}
-            <h2>Pages</h2>{% for document in category.pages %}{% include "excerpt.dhtml" %}{% endfor %}{% endif %}
-            {% if category.posts %}
-            <h2>Posts</h2>{% for document in category.posts %}{% include "excerpt.dhtml" %}{% endfor %}{% endif %}
-            {% if category.subcategories %}
-            <h2>Subcategor{{ category.subcategories|length|pluralize:"y,ies" }}</h2>
-            <ol id="subcategories">{% for subcategory in category.subcategories %}
-                <li><a href="{{ subcategory.urls.canon.rel }}">{{ subcategory.name|smart_capfirst }}</a></li>{% endfor %}
-            </ol>{% endif %}{% if not category.pages and not category.posts and not category.subcategories %}
-            <p>This category is currently empty.</p>{% endif %}
+        <h1>{{ category.name|smart_capfirst }}</h1>
+      {% if category.html %}
+        {{ category.html }}
+      {% endif %}
+      {% if category.pages %}
+        <h2>Pages</h2>
+        {% for document in category.pages %}{% include "excerpt.dhtml" %}{% endfor %}
+      {% endif %}
+      {% if category.posts %}
+        <h2>Posts</h2>
+        {% for document in category.posts %}{% include "excerpt.dhtml" %}{% endfor %}
+      {% endif %}
+      {% if category.subcategories %}
+        <h2>Subcategor{{ category.subcategories|length|pluralize:"y,ies" }}</h2>
+        <ol id="subcategories">
+        {% for subcategory in category.subcategories %}
+          <li><a href="{{ subcategory.urls.canon.rel }}">{{ subcategory.name|smart_capfirst }}</a></li>
+        {% endfor %}
+        </ol>
+      {% endif %}
+      {% if not category.pages and not category.posts and not category.subcategories %}
+        <p>This category is currently empty.</p>
+      {% endif %}
 {% endblock %}
-{% block scripts %}{{ block.super }}{% for script in category.pages|combine:category.posts|required:"scripts" %}
-    {{ script }}{% endfor %}{% endblock %}
+
+{% block scripts %}
+    {{ block.super }}
+  {% for script in category.pages|combine:category.posts|required:"scripts" %}
+    {{ script }}
+  {% endfor %}
+{% endblock %}

templates/comment.dhtml

 {% load mango %}
-                    <article class="{% if comment|is_author_comment %}author {% endif %}comment" id="{{ comment.id }}">
-                        <div>
-                            {{ comment.html }}
-                        </div>
-                        <footer>
-                            <img alt="" src="{{ comment|author_email_hash|gravatar }}" />{% if comment|author_url %}
-                            <strong><a href="{{ comment|author_url }}">{{ comment|author_name }}</a></strong>{% else %}
-                            <strong>{{ comment|author_name }}</strong>{% endif %}
-                            <time datetime="{{ comment.created_at|isoformat }}" pubdate="pubdate">
-                                <span>{{ comment.created_at|display_date }}</span>
-                                <span>{{ comment.created_at|display_time }}</span>
-                            </time>
-                        </footer>
-                    </article>
+
+          <article class="{% if comment|is_author_comment %}author {% endif %}comment" id="{{ comment.id }}">
+            <div>
+              {{ comment.html }}
+            </div>
+            <footer>
+              <img alt="" src="{{ comment|author_email_hash|gravatar }}" />
+            {% if comment|author_url %}
+              <strong><a href="{{ comment|author_url }}">{{ comment|author_name }}</a></strong>
+            {% else %}
+              <strong>{{ comment|author_name }}</strong>
+            {% endif %}
+              <time datetime="{{ comment.created_at|isoformat }}" pubdate="pubdate">
+                <span>{{ comment.created_at|display_date }}</span>
+                <span>{{ comment.created_at|display_time }}</span>
+              </time>
+            </footer>
+          </article>

templates/excerpt.dhtml

 {% load mango %}
-            <article>{% if document.title or document.datetime %}
-                <header>{% if document.title %}
-                    <h2><a href="{{ document.permalink }}">{{ document.title }}</a></h2>{% endif %}{% if document.datetime %}
-                    <time datetime="{{ document.datetime|isoformat }}" pubdate="pubdate">{{ document|pubdate }}</time>{% endif %}
-                </header>{% endif %}
-                {{ document.excerpt }}
-            </article>
+
+      <article>
+      {% if document.title or document.datetime %}
+        <header>
+        {% if document.title %}
+          <h2><a href="{{ document.permalink }}">{{ document.title }}</a></h2>
+        {% endif %}
+        {% if document.datetime %}
+          <time datetime="{{ document.datetime|isoformat }}" pubdate="pubdate">{{ document|pubdate }}</time>
+        {% endif %}
+        </header>
+      {% endif %}
+        {{ document.excerpt }}
+      </article>

templates/formfield.dhtml

-
-<div class="{{ type }}">{% if errors %}
-    {{ errors }}{% endif %}
-    <label for="{{ id }}"{% if required %} class="required"{% endif %}>{{ label }}</label>
-    {% if textarea %}<textarea{% else %}<input type="{{ type }}"{% endif %} id="{{ id }}" name="{{ name }}"{% if maxlength %} maxlength="{{ maxlength }}"{% endif %}{% if placeholder %} placeholder="{{ placeholder }}"{% endif %}{% if textarea %}>{% if value %}{{ value }}{% endif %}</textarea>{% else %}{% if value %} value="{{ value }}"{% endif %} />{% endif %}
+<div class="{{ type }}">
+{% if errors %}
+  {{ errors }}
+{% endif %}
+  <label for="{{ id }}"{% if required %} class="required"{% endif %}>{{ label }}</label>
+  {% if textarea %}<textarea{% else %}<input type="{{ type }}"{% endif %} id="{{ id }}" name="{{ name }}"{% if maxlength %} maxlength="{{ maxlength }}"{% endif %}{% if placeholder %} placeholder="{{ placeholder }}"{% endif %}{% if textarea %}>{% if value %}{{ value }}{% endif %}</textarea>{% else %}{% if value %} value="{{ value }}"{% endif %} />{% endif %}
 </div>

templates/index.dhtml

 {% extends "base.dhtml" %}
+
 {% load mango %}
-{% block stylesheets %}{{ block.super }}{% for stylesheet in posts|slice:":5"|required:"stylesheets" %}
-    {{ stylesheet }}{% endfor %}{% endblock %}
+
+{% block stylesheets %}
+    {{ block.super }}
+  {% for stylesheet in posts|slice:":5"|required:"stylesheets" %}
+    {{ stylesheet }}
+  {% endfor %}
+{% endblock %}
+
 {% block header_title %}<h1>{{ SITE_TITLE }}</h1>{% endblock %}
-{% block content %}{% for document in posts|slice:":5" %}{% include "excerpt.dhtml" %}{% empty %}
-            <h2>Welcome to your new blog</h2>
-            <p>It's lookin' a bit empty, though. Get to work!</p>{% endfor %}{% if posts|length > 5 %}
-            <h2>Want more?</h2>
-            <p>Check out the <a href="{% url mango.views.archives %}">archives</a>.</p>{% endif %}{% endblock %}
-{% block scripts %}{{ block.super }}{% for script in posts|slice:":5"|required:"scripts" %}
-    {{ script }}{% endfor %}{% endblock %}
+
+{% block content %}
+    {% for document in posts|slice:":5" %}
+      {% include "excerpt.dhtml" %}
+    {% empty %}
+      <h2>Welcome to your new blog</h2>
+      <p>It's lookin' a bit empty, though. Get to work!</p>
+    {% endfor %}
+    {% if posts|length > 5 %}
+      <h2>Want more?</h2>
+      <p>Check out the <a href="{% url mango.views.archives %}">archives</a>.</p>
+    {% endif %}
+{% endblock %}
+
+{% block scripts %}
+    {{ block.super }}
+  {% for script in posts|slice:":5"|required:"scripts" %}
+    {{ script }}
+  {% endfor %}
+{% endblock %}

templates/paged.dhtml

 {% extends "base.dhtml" %}
+
 {% load mango %}
-{% block stylesheets %}{{ block.super }}{% for stylesheet in documents|required:"stylesheets" %}
-    {{ stylesheet }}{% endfor %}{% endblock %}
-{% block content %}{% for document in documents %}{% include "excerpt.dhtml" %}{% endfor %}{% if prev_url or next_url %}
-            <ul id="page-navigation">{% if prev_url %}
-                <li><a rel="prev" href="{{ prev_url }}">Newer entries</a></li>{% endif %}{% if next_url %}
-                <li><a rel="next" href="{{ next_url }}">Older entries</a></li>{% endif %}
-            </ul>{% endif %}{% endblock %}
-{% block scripts %}{{ block.super }}{% for script in documents|required:"scripts" %}
-    {{ script }}{% endfor %}{% endblock %}
+
+{% block stylesheets %}
+    {{ block.super }}
+  {% for stylesheet in documents|required:"stylesheets" %}
+    {{ stylesheet }}
+  {% endfor %}
+{% endblock %}
+
+{% block content %}
+      {% for document in documents %}{% include "excerpt.dhtml" %}{% endfor %}
+    {% if prev_url or next_url %}
+      <ul id="page-navigation">
+      {% if prev_url %}
+        <li><a rel="prev" href="{{ prev_url }}">Newer entries</a></li>
+      {% endif %}
+      {% if next_url %}
+        <li><a rel="next" href="{{ next_url }}">Older entries</a></li>
+      {% endif %}
+      </ul>
+    {% endif %}
+{% endblock %}
+
+{% block scripts %}
+    {{ block.super }}
+  {% for script in documents|required:"scripts" %}
+    {{ script }}
+  {% endfor %}
+{% endblock %}

templates/searchresults.dhtml

 {% extends "base.dhtml" %}
+
 {% load mango %}
+
 {% block title %}Search results{% if terms %} for {{ terms|to_query_string }}{% endif %}{% endblock %}
+
 {% block content %}
-            <h1>Search results{% if terms %} for <code>{{ terms|to_query_string }}</code>{% endif %}</h1>{% if results.pages or results.posts %}{% if results.pages %}
-            <h2>Pages</h2>
-            <ol class="searchresults">{% for page in results.pages %}
-                <li><a href="{{ page.permalink }}">{{ page.title }}</a></li>{% endfor %}
-            </ol>{% endif %}{% if results.posts %}
-            <h2>Posts</h2>
-            <ol class="searchresults">{% for post in results.posts %}
-                <li><a href="{{ post.permalink }}">{{ post.title }}</a> (<time datetime="{{ post.datetime|isoformat }}">{{ post|pubdate }}</time>)</li>{% endfor %}
-            </ol>{% endif %}{% else %}
-            <p>There are currently no documents that match your search term{{ terms|pluralize }}.</p>{% endif %}
+      <h1>Search results{% if terms %} for <code>{{ terms|to_query_string }}</code>{% endif %}</h1>
+  {% if results.pages or results.posts %}
+    {% if results.pages %}
+      <h2>Pages</h2>
+      <ol class="searchresults">
+      {% for page in results.pages %}
+        <li><a href="{{ page.permalink }}">{{ page.title }}</a></li>
+      {% endfor %}
+      </ol>
+    {% endif %}
+    {% if results.posts %}
+      <h2>Posts</h2>
+      <ol class="searchresults">
+      {% for post in results.posts %}
+        <li><a href="{{ post.permalink }}">{{ post.title }}</a> (<time datetime="{{ post.datetime|isoformat }}">{{ post|pubdate }}</time>)</li>
+      {% endfor %}
+      </ol>
+    {% endif %}
+  {% else %}
+      <p>There are currently no documents that match your search term{{ terms|pluralize }}.</p>
+  {% endif %}
 {% endblock %}

templates/sitemap.xml

 <?xml version="1.0" encoding="UTF-8"?>
-<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">{% for url in urlset %}
-    <url>
-        <loc>{{ url.location }}</loc>{% if url.lastmod %}
-        <lastmod>{{ url.lastmod|date:"Y-m-d" }}</lastmod>{% endif %}{% if url.changefreq %}
-        <changefreq>{{ url.changefreq }}</changefreq>{% endif %}{% if url.priority %}
-        <priority>{{ url.priority }}</priority>{% endif %}
-    </url>{% endfor %}
+<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
+{% for url in urlset %}
+  <url>
+    <loc>{{ url.location }}</loc>
+  {% if url.lastmod %}
+    <lastmod>{{ url.lastmod|date:"Y-m-d" }}</lastmod>
+  {% endif %}
+  {% if url.changefreq %}
+    <changefreq>{{ url.changefreq }}</changefreq>
+  {% endif %}
+  {% if url.priority %}
+    <priority>{{ url.priority }}</priority>
+  {% endif %}
+  </url>
+{% endfor %}
 </urlset>
 {% extends "base.dhtml" %}
+
 {% load mango %}
-{% block title %}Posts tagged "{{ tag }}"{% endblock %}{% block feeds %}{{ block.super }}
-    <link rel="alternate" type="application/atom+xml" href="{% url mango.feeds.atom tag %}" />{% endblock %}
-{% block stylesheets %}{{ block.super }}{% for stylesheet in documents|required:"stylesheets" %}
-    {{ stylesheet }}{% endfor %}{% endblock %}
+
+{% block title %}Posts tagged "{{ tag }}"{% endblock %}
+
+{% block feeds %}
+    {{ block.super }}
+    <link rel="alternate" type="application/atom+xml" href="{% url mango.feeds.atom tag %}" />
+{% endblock %}
+
+{% block stylesheets %}
+    {{ block.super }}
+  {% for stylesheet in documents|required:"stylesheets" %}
+    {{ stylesheet }}
+  {% endfor %}
+{% endblock %}
+
 {% block content %}
-            <h1>Posts tagged "{{ tag }}"</h1>{% for document in documents %}{% include "excerpt.dhtml" %}{% empty %}
-            <p>There are currently no posts tagged "{{ tag }}".</p>{% endfor %}
+      <h1>Posts tagged "{{ tag }}"</h1>
+    {% for document in documents %}
+      {% include "excerpt.dhtml" %}
+    {% empty %}
+      <p>There are currently no posts tagged "{{ tag }}".</p>
+    {% endfor %}
 {% endblock %}
-{% block scripts %}{{ block.super }}{% for script in documents|required:"scripts" %}
-    {{ script }}{% endfor %}{% endblock %}
+
+{% block scripts %}
+    {{ block.super }}
+  {% for script in documents|required:"scripts" %}
+    {{ script }}
+  {% endfor %}
+{% endblock %}
 {% extends "base.dhtml" %}
+
 {% block title %}Tags{% endblock %}
+
 {% block content %}
-            <h1>Tags</h1>{% if tags %}
-            <dl id="tags">{% for tag, count in tags %}
-                <dt><a href="{% url mango.views.tagged_as tag.slug %}">{{ tag }}</a></dt>
-                <dd>{{ count }}</dd>{% endfor %}
-            </dl>{% else %}
-            <p>There are no tags to display.</p>{% endif %}
+      <h1>Tags</h1>
+    {% if tags %}
+      <dl id="tags">
+      {% for tag, count in tags %}
+        <dt><a href="{% url mango.views.tagged_as tag.slug %}">{{ tag }}</a></dt>
+        <dd>{{ count }}</dd>
+      {% endfor %}
+      </dl>
+    {% else %}
+      <p>There are no tags to display.</p>
+    {% endif %}
 {% endblock %}

templates/update.dhtml

-<div class="update"><div>{% load mango %}
-<h{% firstof update.headinglevel 4 %}>Update{% if update.datetime %} — <time datetime="{{ update.datetime|isoformat }}">{{ update|pubdate }}</time>{% endif %}</h{% firstof update.headinglevel 4 %}>
-{{ update.html }}
-</div></div>
+{% load mango %}
+
+<div class="update">
+  <div>
+    <h{% firstof update.headinglevel 4 %}>Update{% if update.datetime %} — <time datetime="{{ update.datetime|isoformat }}">{{ update|pubdate }}</time>{% endif %}</h{% firstof update.headinglevel 4 %}>
+    {{ update.html }}
+  </div>
+</div>