Add BUR counters to forum topics index

This commit is contained in:
BrokenEagle
2020-02-15 22:04:47 +00:00
parent 9c6ef424ef
commit 24ae35aa96
4 changed files with 28 additions and 4 deletions

View File

@@ -10,4 +10,12 @@ module ForumTopicsHelper
def new_forum_topic?(topic, read_forum_topics)
!read_forum_topics.map(&:id).include?(topic.id)
end
def bulk_update_request_counts(topic)
requests = []
requests << %(<span class="topic-pending-burs">Pending: #{topic.pending_bur_count}</span>) if topic.pending_bur_count.positive?
requests << %(<span class="topic-approved-burs">Approved: #{topic.approved_bur_count}</span>) if topic.approved_bur_count.positive?
requests << %(<span class="topic-rejected-burs">Rejected: #{topic.rejected_bur_count}</span>) if topic.rejected_bur_count.positive?
requests.join(" | ").html_safe
end
end