Small fixes for the blog handling code
[sommitrealweird.git] / sommitrealweird / blog / templates / blog / blog_index.html
1 {% extends "base.html" %}
2 {% load markup %}
3
4 {% block content %}
5     {% if entries %}
6         {% for entry in entries %}
7             <h1>{{ entry.title|escape }}</h1>
8             {{ entry.content|restructuredtext }}
9             <p>Posted: {{ entry.publish_date|date:"Y-m-d H:i" }} in 
10                 {% for section in entry.sections.all %}
11                     {% if forloop.first %}
12                         <a href="{{ section.get_absolute_url }}">{{ section.title }}</a>{% if not forloop.last %}, {% endif %}
13                     {% else %}
14                         {% if forloop.last %}
15                             and <a href="{{ section.get_absolute_url }}">{{ section.title }}</a>
16                         {% else %}
17                             <a href="{{ section.get_abolute_url }}">{{ section.title }}</a>
18                         {% endif %}
19                     {% endif %}
20                 {% endfor %}
21                 <a href="{{ entry.get_absolute_url }}">permalink</a></p>
22         {% endfor %}
23         {% if paginated %}
24             <p class="paginator">Pages: 
25             {% if has_prev %}
26                 <a href="?page={{ prev }}">Previous</a> |
27             {% endif %}
28             {% for paginator_page in pages %}
29                 {% if forloop.first %}
30                 {% else %}
31                     |
32                 {% endif %}
33                 {% ifequal paginator_page page %}
34                     {{ page }}
35                 {% else %}
36                     <a href="?page={{ paginator_page }}">{{ paginator_page }}</a>
37                 {% endifequal %}
38             {% endfor %}
39             {% if has_next %}
40                 | <a href="?page={{ next }}">Next</a>
41             {% endif %}
42             </p>
43         {% endif %}
44     {% else %}
45         <p>We have no blog entries - that sucks!</p>
46     {% endif %}
47 {% endblock %}