forum: fix topics being incorrectly marked as unread (again).

Second attempt at 71690cacc. Fix topics on page 2+ being still marked as
unread after the user has marked all topics as read.
This commit is contained in:
evazion
2020-01-22 18:33:03 -06:00
parent 22cb0ea322
commit cc96f30e47
6 changed files with 69 additions and 90 deletions

View File

@@ -4,7 +4,7 @@
<span class="sticky">Sticky:</span>
<% end %>
<% if CurrentUser.is_member? && new_forum_topic?(topic, read_forum_topics) %>
<% if !topic.is_read? %>
<span class="new">NEW</span>
<% end %>

View File

@@ -11,7 +11,7 @@
<%= ForumTopic::CATEGORIES.map {|id, name| link_to_unless_current(name, forum_topics_path(:search => {:category_id => id}))}.join(", ").html_safe %>
</p>
<%= render "listing", forum_topics: @forum_topics, read_forum_topics: @read_forum_topics %>
<%= render "listing", forum_topics: @forum_topics %>
<%= numbered_paginator(@forum_topics) %>
</div>