FIX: 1000 was a crazy threshold for showing categories at the bottom of

digests
This commit is contained in:
Robin Ward 2014-11-07 17:16:52 -05:00
parent bfe2021859
commit 0777efe74d
2 changed files with 4 additions and 2 deletions

View File

@ -54,7 +54,7 @@ class UserNotifications < ActionMailer::Base
featured_topic_ids = @featured_topics.map(&:id)
@new_topics_since_seen = Topic.new_since_last_seen(user, min_date, featured_topic_ids).count
if @new_topics_since_seen > 1000
if @new_topics_since_seen > SiteSetting.digest_topics
category_counts = Topic.new_since_last_seen(user, min_date, featured_topic_ids).group(:category_id).count
@new_by_category = []

View File

@ -56,7 +56,9 @@
<p><%= t('user_notifications.digest.more_topics_category', last_seen_at: @last_seen_at, new_topics_since_seen: @new_topics_since_seen) %></p>
<div>
<%- @new_by_category.each do |c| %>
<span style="margin-bottom: 8px; margin-right: 10px; display: inline-block;"><%= email_category(c[0], show_uncategorized: true) %> x <%= c[1] %></span>
<span style='white-space: nowrap'>
<b><%= c[0].name %></b> <span style='color: #777; margin: 0 10px 0 5px; font-size: 0.9em;'> <%= c[1] %></span>
</span>
<%- end %>
</div>
<%- else %>