Permalink
Browse files

Indentation on base template. Put sidebar in its own partial.

  • Loading branch information...
1 parent 36a2aa8 commit 7e15f653a0e40f9b58bcbcaa62357e8574cdb681 @ktonon ktonon committed Aug 26, 2011
Showing with 117 additions and 124 deletions.
  1. +33 −124 mingus/templates/base.html
  2. +84 −0 mingus/templates/sections/sidebar.html
@@ -1,8 +1,5 @@
-{% load disqus_tags flatblock_tags cache navbar generic_content blog compress analytics elsewhere feeds i18n archive %}
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd">
-
+{% load analytics cache compress disqus_tags flatblock_tags generic_content i18n navbar %}
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
@@ -49,136 +46,48 @@
{% disqus_dev %}
{% block extra_head %}{% endblock %}
</head>
-
-<body id="{% block body_id %}{% endblock %}" class="{% block body_class %}blog{% endblock %}">
-<div id="bleeder"></div>
-
- <div id="body-container" class="clearfix">
+ <body id="{% block body_id %}{% endblock %}" class="{% block body_class %}blog{% endblock %}">
+ <div id="bleeder"></div>
+
+ <div id="body-container" class="clearfix">
{% block body %}
- <div id="header" class="clearfix">
- <div id="logo">
- <h1><a href="/" title="{{ BLOG_SETTINGS.site_name }}">&nbsp;</a></h1>
- </div>
- <!-- /logo -->
-
- <div id="nav">
- <form action="/search/" method="GET">
- <span class="left-search"><input type="text" name="q" value="{{ search_term }}"></span>
- <span class="right-search"><input type="submit" class="button" value="{% trans "Search" %}"></span>
- </form>
- {% cache 3600 "base.navbars" %}
- {% navbars %}
- {% endcache %}
- </div>
- <!-- /nav -->
+ <div id="header" class="clearfix">
+ <div id="logo">
+ <h1><a href="/" title="{{ BLOG_SETTINGS.site_name }}">&nbsp;</a></h1>
+ </div>
+ <!-- /logo -->
+
+ <div id="nav">
+ <form action="/search/" method="GET">
+ <span class="left-search"><input type="text" name="q" value="{{ search_term }}"></span>
+ <span class="right-search"><input type="submit" class="button" value="{% trans "Search" %}"></span>
+ </form>
+ {% navbars %}
+ </div>
+ <!-- /nav -->
- </div>
- <!-- /header -->
+ </div>
+ <!-- /header -->
<div class="container_16">
+
<div class="grid_9 suffix_1">
<div class="content">
{% block content %}{% endblock %}
</div>
- <!-- /content -->
-
</div>
- <!-- /grid_9 -->
-
+
<div id="right-rail" class="grid_6">
-
- <h4>{% trans "About" %}</h4>
- <p>{{ BLOG_SETTINGS.about|safe }}</p>
-
- {% flatblock "twitter_feed" 3600 "flatblocks/bare.html" %}
-
- <h4>Subscribe</h4>
- <ul>
- {% if BLOG_SETTINGS.twitter_url %}<li><a href="{{ BLOG_SETTINGS.twitter_url }}" title="{% trans "Follow me on Twitter" %}">{% trans "Twitter" %}</a></li>{% endif %}
- {% if BLOG_SETTINGS.rss_url %}<li><a href="{{ BLOG_SETTINGS.rss_url }}" title"{% trans "Subscribe via RSS" %}">RSS</a></li>{% endif %}
- {% if BLOG_SETTINGS.email_subscribe_url %}<li><a href="{{ BLOG_SETTINGS.email_subscribe_url }}" title="{% trans "Subscribe via Email" %}">Email</a></li>{% endif %}
-
- {% if category %}<li><a href="/feeds/categories/{{ category.title|lower }}" title"{% trans "Subscribe via RSS" %}">RSS - {{ category }}</a></li>{% endif %}
- {% if BLOG_SETTINGS_email_subscribe_url %}<li><a href="{{ BLOG_SETTINGS.email_subscribe_url }}" title="{% trans "Subscribe via Email" %}">{% trans "Email" %}</a></li>{% endif %}
- </ul>
-
- {% cache 3600 "base.profiles" %}
- {% get_elsewhere_profiles as profiles %}
- {% if profiles %}
- <h4>{% trans "Elsewhere" %}</h4>
- <ul>
- {% for item in profiles %}
- <li><a href="{{ item.url }}" rel="me" title="{{ item.name }}">{{ item.name }}</a></li>
- {% endfor %}
- </ul>
- {% endif %}
- {% endcache %}
-
- {% cache 3600 "base.category_list" %}
- {% get_blog_categories as category_list %}
- {% if category_list %}
- <h4>{% trans "Categories" %}</h4>
- <ul>
- {% for category in category_list %}
- <li><a href="{% url basic.blog.views.category_detail category.slug %}" title="{{ category.title }}">{{ category.title }}</a></li>
- {% endfor %}
- </ul>
- {% endif %}
- {% endcache %}
-
- {% cache 3600 "base.post_list" %}
- {% get_latest_posts 10 as post_list %}
- {% if post_list %}
- <h4>{% trans "Recent Posts" %}</h4>
- <ul class="recent-posts">
- {% for post in post_list %}
- <li><a href="{{ post.get_absolute_url }}" title="{{ post.title }}">{{ post.title }}</a></li>
- {% endfor %}
- </ul>
- {% endif %}
- {% endcache %}
-
- {% cache 7200 "base.archive" %}
- {% get_post_archive as dates %}
- <h4>{% trans "Archive" %}</h4>
- <ul class="archive">
- {% for date in dates %}
- <li><a href="{% url blog_archive_month date|date:"Y", date|date:"m" %}" title="{{ date|date:"F Y" }}">{{ date|date:"F Y" }}</a></li>
- {% endfor %}
- </ul>
- {% endcache %}
-
- {% cache 3600 "base.blogroll" %}
- {% get_blogroll 10 as blogroll %}
- {% if blogroll %}
- <h4>{% trans "BlogRoll" %}</h4>
- <ul class="recent-posts">
- {% for item in blogroll %}
- <li><a href="{{ item.get_absolute_url }}" title="{{ item.name }}">{{ item.name }}</a></li>
- {% endfor %}
- </ul>
- {% endif %}
- {% endcache %}
-
- {% cache 3600 "bas.popular-posts" %}
- {% get_popular_posts 10 as popular_post_list %}
- {% if popular_post_list %}
- <h4>{% trans "Popular Posts" %}</h4>
- <ul class="recent-posts">
- {% for item in popular_post_list %}
- <li><a href="{{ item.get_absolute_url }}" title="{{ item.title }}">{{ item.title }}</a></li>
- {% endfor %}
- </ul>
- {% endif %}
- {% endcache %}
-
+ {% block sidebar %}
+ {% include 'sections/sidebar.html' %}
+ {% endblock %}
</div>
- <!-- /grid_6 -->
+
</div>
<!-- /container_16 -->
- {% endblock %}
+ {% endblock %}
</div>
<!-- /body-container -->
@@ -198,11 +107,11 @@
{% block extra_body %}
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
- jQuery(function($) {
- $.getScript('{{ STATIC_URL }}js/prettify.js', function(){
- prettyPrint();
+ jQuery(function($) {
+ $.getScript('{{ STATIC_URL }}js/prettify.js', function(){
+ prettyPrint();
+ });
});
- });
</script>
{% endblock %}
</body>
@@ -0,0 +1,84 @@
+{% load archive blog flatblock_tags cache elsewhere i18n %}
+<h4>{% trans "About" %}</h4>
+<p>{{ BLOG_SETTINGS.about|safe }}</p>
+
+{% flatblock "twitter_feed" 3600 "flatblocks/bare.html" %}
+
+<h4>Subscribe</h4>
+<ul>
+ {% if BLOG_SETTINGS.twitter_url %}<li><a href="{{ BLOG_SETTINGS.twitter_url }}" title="{% trans "Follow me on Twitter" %}">{% trans "Twitter" %}</a></li>{% endif %}
+ {% if BLOG_SETTINGS.rss_url %}<li><a href="{{ BLOG_SETTINGS.rss_url }}" title"{% trans "Subscribe via RSS" %}">RSS</a></li>{% endif %}
+ {% if BLOG_SETTINGS.email_subscribe_url %}<li><a href="{{ BLOG_SETTINGS.email_subscribe_url }}" title="{% trans "Subscribe via Email" %}">Email</a></li>{% endif %}
+ {% if category %}<li><a href="/feeds/categories/{{ category.title|lower }}" title"{% trans "Subscribe via RSS" %}">RSS - {{ category }}</a></li>{% endif %}
+ {% if BLOG_SETTINGS_email_subscribe_url %}<li><a href="{{ BLOG_SETTINGS.email_subscribe_url }}" title="{% trans "Subscribe via Email" %}">{% trans "Email" %}</a></li>{% endif %}
+</ul>
+
+{% cache 3600 "base.profiles" %}
+{% get_elsewhere_profiles as profiles %}
+{% if profiles %}
+<h4>{% trans "Elsewhere" %}</h4>
+<ul>
+ {% for item in profiles %}
+ <li><a href="{{ item.url }}" rel="me" title="{{ item.name }}">{{ item.name }}</a></li>
+ {% endfor %}
+</ul>
+{% endif %}
+{% endcache %}
+
+{% cache 3600 "base.category_list" %}
+{% get_blog_categories as category_list %}
+{% if category_list %}
+<h4>{% trans "Categories" %}</h4>
+<ul>
+ {% for category in category_list %}
+ <li><a href="{% url basic.blog.views.category_detail category.slug %}" title="{{ category.title }}">{{ category.title }}</a></li>
+ {% endfor %}
+</ul>
+{% endif %}
+{% endcache %}
+
+{% cache 3600 "base.post_list" %}
+{% get_latest_posts 10 as post_list %}
+{% if post_list %}
+<h4>{% trans "Recent Posts" %}</h4>
+<ul class="recent-posts">
+ {% for post in post_list %}
+ <li><a href="{{ post.get_absolute_url }}" title="{{ post.title }}">{{ post.title }}</a></li>
+ {% endfor %}
+</ul>
+{% endif %}
+{% endcache %}
+
+{% cache 7200 "base.archive" %}
+{% get_post_archive as dates %}
+<h4>{% trans "Archive" %}</h4>
+<ul class="archive">
+ {% for date in dates %}
+ <li><a href="{% url blog_archive_month date|date:"Y", date|date:"m" %}" title="{{ date|date:"F Y" }}">{{ date|date:"F Y" }}</a></li>
+ {% endfor %}
+</ul>
+{% endcache %}
+
+{% cache 3600 "base.blogroll" %}
+{% get_blogroll 10 as blogroll %}
+{% if blogroll %}
+<h4>{% trans "BlogRoll" %}</h4>
+<ul class="recent-posts">
+ {% for item in blogroll %}
+ <li><a href="{{ item.get_absolute_url }}" title="{{ item.name }}">{{ item.name }}</a></li>
+ {% endfor %}
+</ul>
+{% endif %}
+{% endcache %}
+
+{% cache 3600 "bas.popular-posts" %}
+{% get_popular_posts 10 as popular_post_list %}
+{% if popular_post_list %}
+<h4>{% trans "Popular Posts" %}</h4>
+<ul class="recent-posts">
+ {% for item in popular_post_list %}
+ <li><a href="{{ item.get_absolute_url }}" title="{{ item.title }}">{{ item.title }}</a></li>
+ {% endfor %}
+</ul>
+{% endif %}
+{% endcache %}

0 comments on commit 7e15f65

Please sign in to comment.