mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Break down new topic counts by category if a digest contains many.
This commit is contained in:
@@ -70,8 +70,15 @@ module UserNotificationsHelper
|
||||
end
|
||||
|
||||
|
||||
def email_category(category)
|
||||
return "" if category.blank? || category.uncategorized?
|
||||
def email_category(category, opts=nil)
|
||||
opts = opts || {}
|
||||
|
||||
# If there is no category, bail
|
||||
return "" if category.blank?
|
||||
|
||||
# By default hide uncategorized
|
||||
return "" if category.uncategorized? && !opts[:show_uncategorized]
|
||||
|
||||
result = ""
|
||||
if category.parent_category.present?
|
||||
result << "<span style='background-color: ##{category.parent_category.color}; font-size: 12px; padding: 4px 2px; font-weight: bold; margin: 0; width: 2px;'> </span>"
|
||||
|
||||
Reference in New Issue
Block a user