Reformat blog links a bit
[sommitrealweird.git] / sommitrealweird / blog / templates / blog / blog_index.html
1 {% extends "base.html" %}
2 {% load xhtml11rst %}
3 {% load comments %}
4
5 {% block extrahead %}
6 <link rel="alternate" type="application/atom+xml" title="iDunno's Blog - Atom Feed" href="{{ BLOG_FEED_ROOT }}/blog/" />
7 <link rel="alternate" type="application/rss+xml" title="iDunno's Blog - RSS Feed" href="{{ BLOG_FEED_ROOT }}/blog/rss/" />
8 {% endblock %}
9
10 {% block content %}
11     {% if entries %}
12         {% for entry in entries %}
13             <h1>{{ entry.title|escape }}</h1>
14             <div class="blogentry">
15             {{ entry.content|restructuredtext }}
16             </div>
17             <p>Posted: {{ entry.publish_date|date:"Y-m-d H:i" }} in 
18                 {% for section in entry.sections.all %}
19                     {% if forloop.first %}
20                         <a href="{{ section.get_absolute_url }}">{{ section.title }}</a>{% if not forloop.last %}, {% endif %}
21                     {% else %}
22                         {% if forloop.last %}
23                             and <a href="{{ section.get_absolute_url }}">{{ section.title }}</a>
24                         {% else %}
25                             <a href="{{ section.get_abolute_url }}">{{ section.title }}</a>
26                         {% endif %}
27                     {% endif %}
28                 {% endfor %}
29                 {% get_comment_count for entry as comment_count %}
30                 | <a href="{{ entry.get_absolute_url }}">permalink</a> | <a href="{{ entry.get_absolute_url }}#comments">Comments</a>: {{ comment_count }}</p>
31         {% endfor %}
32         {% if paginated and has_more_than_one_page %}
33             <p class="paginator">Pages: 
34             {% if has_prev %}
35                 <a href="?page={{ prev }}">Previous</a> |
36             {% endif %}
37             {% for paginator_page in pages %}
38                 {% if forloop.first %}
39                 {% else %}
40                     |
41                 {% endif %}
42                 {% ifequal paginator_page page %}
43                     {{ page }}
44                 {% else %}
45                     <a href="?page={{ paginator_page }}">{{ paginator_page }}</a>
46                 {% endifequal %}
47             {% endfor %}
48             {% if has_next %}
49                 | <a href="?page={{ next }}">Next</a>
50             {% endif %}
51             </p>
52         {% endif %}
53     {% else %}
54         <p>We have no blog entries - that sucks!</p>
55     {% endif %}
56 {% endblock %}