UX: In digest email lists of topics, show striped version of category
badge
This commit is contained in:
parent
872cfff49b
commit
bfe2021859
|
@ -68,10 +68,17 @@ module UserNotificationsHelper
|
|||
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; white-space:nowrap;'> </span>"
|
||||
|
||||
if opts[:only_stripe]
|
||||
result << "<span style='background-color: ##{category.color}; font-size: 12px; padding: 4px 2px; font-weight: bold; margin: 0; width: 2px; white-space:nowrap;'> </span>"
|
||||
result << "<span style='font-size: 12px; font-weight: bold; margin-left: 3px;'>#{category.name}</span>"
|
||||
else
|
||||
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; white-space:nowrap;'> </span>"
|
||||
end
|
||||
result << "<span style='background-color: ##{category.color}; color: ##{category.text_color}; font-size: 12px; padding: 4px 6px; font-weight: bold; margin: 0; white-space:nowrap;'>#{category.name}</span>"
|
||||
end
|
||||
result << "<span style='background-color: ##{category.color}; color: ##{category.text_color}; font-size: 12px; padding: 4px 6px; font-weight: bold; margin: 0; white-space:nowrap;'>#{category.name}</span>"
|
||||
|
||||
result.html_safe
|
||||
end
|
||||
end
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
<li>
|
||||
<%= link_to t.title, "#{Discourse.base_url}#{t.relative_url}" %>
|
||||
<span class='post-count'><%= t('user_notifications.digest.posts', count: t.posts_count) %></span>
|
||||
<%= email_category(t.category) %>
|
||||
<%= email_category(t.category, only_stripe: true) %>
|
||||
</li>
|
||||
</ul>
|
||||
<%- end -%>
|
||||
|
|
Loading…
Reference in New Issue