From: Brett Parker <iDunno@sommitrealweird.co.uk>
Date: Mon, 11 Feb 2008 10:44:22 +0000 (+0000)
Subject: Small fixes for the blog handling code
X-Git-Url: https://git.sommitrealweird.co.uk/sommitrealweird.git/commitdiff_plain/704ace48dfd3f1dd64271d1916c7defb4806e86c?ds=inline;hp=-c

Small fixes for the blog handling code
---

704ace48dfd3f1dd64271d1916c7defb4806e86c
diff --git a/sommitrealweird/blog/templates/blog/blog_index.html b/sommitrealweird/blog/templates/blog/blog_index.html
index 8e94748..e43cc64 100644
--- a/sommitrealweird/blog/templates/blog/blog_index.html
+++ b/sommitrealweird/blog/templates/blog/blog_index.html
@@ -39,6 +39,7 @@
             {% if has_next %}
                 | <a href="?page={{ next }}">Next</a>
             {% endif %}
+            </p>
         {% endif %}
     {% else %}
         <p>We have no blog entries - that sucks!</p>
diff --git a/sommitrealweird/blog/templates/blog/single_entry_rst.html b/sommitrealweird/blog/templates/blog/single_entry_rst.html
index 5681e14..e2bd8c7 100644
--- a/sommitrealweird/blog/templates/blog/single_entry_rst.html
+++ b/sommitrealweird/blog/templates/blog/single_entry_rst.html
@@ -3,6 +3,23 @@
 {% load markup %}
 
 {% block content %}
-<h1>{{ title }}</h1>
-{{ content|restructuredtext }}
+<h1>{{ entry.title }}</h1>
+{{ entry.content|restructuredtext }}
+<p>Posted: {{ entry.publish_date|date:"Y-m-d H:i" }} 
+    {% if entry.sections.count %}
+    in 
+    {% for section in entry.sections.all %}
+        {% if forloop.first %}
+            <a href="{{ section.get_absolute_url }}">{{ section.title }}</a>{% if not forloop.last %}, {% endif %}
+        {% else %}
+            {% if forloop.last %}
+                and <a href="{{ section.get_absolute_url }}">{{ section.title }}</a>
+            {% else %}
+                <a href="{{ section.get_abolute_url }}">{{ section.title }}</a>
+            {% endif %}
+        {% endif %}
+    {% endfor %}
+    {% endif %}
+    <a href="{{ entry.get_absolute_url }}">permalink</a>
+</p>
 {% endblock %}
diff --git a/sommitrealweird/blog/views.py b/sommitrealweird/blog/views.py
index a801cd4..d5da81b 100644
--- a/sommitrealweird/blog/views.py
+++ b/sommitrealweird/blog/views.py
@@ -46,8 +46,7 @@ def blog_view(request, year=None, month=None, day=None, hour=None, minutes=None,
             t = loader.get_template(template_name)
             c = RequestContext(request,
                 {
-                    "content": blog_entry.content,
-                    "title": blog_entry.title,
+                    "entry": blog_entry,
                     "publish_date": blog_entry.publish_date
                 }
             )