diff --git a/boards/templates/boards/thread.html b/boards/templates/boards/thread.html --- a/boards/templates/boards/thread.html +++ b/boards/templates/boards/thread.html @@ -33,7 +33,7 @@ {% endif %}
- {% for post in thread.get_replies %} + {% for post in posts %} {% if bumpable %}
{% else %} diff --git a/boards/templates/boards/thread_gallery.html b/boards/templates/boards/thread_gallery.html --- a/boards/templates/boards/thread_gallery.html +++ b/boards/templates/boards/thread_gallery.html @@ -22,27 +22,25 @@
- {% for post in thread.get_replies %} - {% if post.image %} - {% endcache %} diff --git a/boards/views/__init__.py b/boards/views/__init__.py --- a/boards/views/__init__.py +++ b/boards/views/__init__.py @@ -203,19 +203,24 @@ def thread(request, post_id, mode=MODE_N posts = thread_to_show.get_replies() context['form'] = form - context['bumpable'] = thread_to_show.can_bump() - if context['bumpable']: - context['posts_left'] = neboard.settings.MAX_POSTS_PER_THREAD - posts \ - .count() - context['bumplimit_progress'] = str( - float(context['posts_left']) / - neboard.settings.MAX_POSTS_PER_THREAD * 100) context["last_update"] = _datetime_to_epoch(thread_to_show.last_edit_time) context["thread"] = thread_to_show if MODE_NORMAL == mode: + context['bumpable'] = thread_to_show.can_bump() + if context['bumpable']: + context['posts_left'] = neboard.settings.MAX_POSTS_PER_THREAD - posts \ + .count() + context['bumplimit_progress'] = str( + float(context['posts_left']) / + neboard.settings.MAX_POSTS_PER_THREAD * 100) + + context['posts'] = posts + document = 'boards/thread.html' elif MODE_GALLERY == mode: + context['posts'] = posts.filter(image_width__gt=0) + document = 'boards/thread_gallery.html' else: raise Http404