mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-05-03 09:25:18 -04:00
UX: In digest email lists of topics, show striped version of category
badge
This commit is contained in:
parent
872cfff49b
commit
bfe2021859
2 changed files with 11 additions and 4 deletions
app
|
@ -68,10 +68,17 @@ module UserNotificationsHelper
|
||||||
return "" if category.uncategorized? && !opts[:show_uncategorized]
|
return "" if category.uncategorized? && !opts[:show_uncategorized]
|
||||||
|
|
||||||
result = ""
|
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
|
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
|
result.html_safe
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
<li>
|
<li>
|
||||||
<%= link_to t.title, "#{Discourse.base_url}#{t.relative_url}" %>
|
<%= link_to t.title, "#{Discourse.base_url}#{t.relative_url}" %>
|
||||||
<span class='post-count'><%= t('user_notifications.digest.posts', count: t.posts_count) %></span>
|
<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>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<%- end -%>
|
<%- end -%>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue