{% else %}
-
+
{% endif %}
- {% if thread.image %}
+ {% if thread.thread.image %}
{% endif %}
- {% if thread.get_last_replies %}
+ {% if thread.thread.get_last_replies %}
- {% for post in thread.get_last_replies %}
- {% if thread.can_bump %}
+ {% for post in thread.thread.get_last_replies %}
+ {% if thread.bumpable %}
{% else %}
-
+
{% endif %}
{% if post.image %}
@@ -98,7 +98,7 @@
{{ post.title }}
+ {% url 'thread' thread.thread.id %}#{{ post.id }}">
(#{{ post.id }})
[{{ post.pub_time }}]
diff --git a/boards/views.py b/boards/views.py
--- a/boards/views.py
+++ b/boards/views.py
@@ -36,7 +36,10 @@ def index(request, page=0):
else:
form = threadFormClass(error_class=PlainErrorList, **kwargs)
- threads = Post.objects.get_threads(page=int(page))
+ threads = []
+ for thread in Post.objects.get_threads(page=int(page)):
+ threads.append({'thread': thread,
+ 'bumpable': thread.can_bump()})
context['threads'] = None if len(threads) == 0 else threads
context['form'] = form