diff --git a/boards/context_processors.py b/boards/context_processors.py --- a/boards/context_processors.py +++ b/boards/context_processors.py @@ -73,7 +73,16 @@ def _get_fav_threads(context, settings_m fav_threads = Post.objects.filter( id__in=fav_threads_setting.keys()).only('url', 'id', 'thread')\ .select_related('thread') - context[CONTEXT_FAV_THREADS] = [ - (post, post.get_thread().get_replies_newer( - fav_threads_setting[str(post.id)]).count()) - for post in fav_threads] + + context_thread_list = [] + for post in fav_threads: + new_replies = post.get_thread().get_replies_newer(fav_threads_setting[str(post.id)]) + + element = dict() + element['post'] = post + element['count'] = new_replies.count() + if element['count'] > 0: + element['new_post'] = new_replies.first().get_absolute_url() + context_thread_list.append(element) + context[CONTEXT_FAV_THREADS] = context_thread_list + diff --git a/boards/templates/boards/base.html b/boards/templates/boards/base.html --- a/boards/templates/boards/base.html +++ b/boards/templates/boards/base.html @@ -60,7 +60,7 @@ {% comment %} If there are new posts in the thread, show their count. {% endcomment %} - {{ thread.0.get_link_view|safe }}{% if thread.1 %} (+{{ thread.1 }}){% endif %}{% if not forloop.last %}, {% endif %} + {{ thread.post.get_link_view|safe }}{% if thread.count %} (+{{ thread.count }}){% endif %}{% if not forloop.last %}, {% endif %} {% endfor %} {% endif %}