Merge pull request #4301 from BrokenEagle/forum-topic-bur-indicators

Add BUR counters to forum topics index
This commit is contained in:
evazion
2020-03-07 23:04:19 -06:00
committed by GitHub
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