]> git.sommitrealweird.co.uk Git - sommitrealweird.git/commitdiff
Small fixes for the blog handling code
authorBrett Parker <iDunno@sommitrealweird.co.uk>
Mon, 11 Feb 2008 10:44:22 +0000 (10:44 +0000)
committerBrett Parker <iDunno@sommitrealweird.co.uk>
Mon, 11 Feb 2008 10:44:22 +0000 (10:44 +0000)
sommitrealweird/blog/templates/blog/blog_index.html
sommitrealweird/blog/templates/blog/single_entry_rst.html
sommitrealweird/blog/views.py

index 8e947484cce48345444dd20b4c9daf0e10e74535..e43cc647ac523eea114abaeacc4678e49c8b2159 100644 (file)
@@ -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>
index 5681e14e28a3475b1603ccc342b934220b3df269..e2bd8c7f5eb2d51ff2b90e862b911e0fa85cc0f8 100644 (file)
@@ -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 %}
index a801cd463081518c599cdf2c929e731f211cdd49..d5da81b09fac29b559b1a8044ac3bd2720682446 100644 (file)
@@ -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
                 }
             )