mirror of
https://github.com/discourse/discourse.git
synced 2024-12-01 21:19:41 -06:00
UX: Link categories in digest emails
This commit is contained in:
parent
a85a3da167
commit
37a3e956b6
@ -69,14 +69,16 @@ module UserNotificationsHelper
|
||||
|
||||
result = ""
|
||||
|
||||
category_url = "#{Discourse.base_url}#{category.url}"
|
||||
|
||||
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>"
|
||||
result << "<a href='#{category_url}' style='background-color: ##{category.color}; font-size: 12px; padding: 4px 2px; font-weight: bold; margin: 0; width: 2px; white-space:nowrap;'> </a>"
|
||||
result << "<a href='#{category_url}' style='font-size: 12px; font-weight: bold; margin-left: 3px;'>#{category.name}</a>"
|
||||
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>"
|
||||
result << "<a href='#{category_url}' style='background-color: ##{category.parent_category.color}; font-size: 12px; padding: 4px 2px; font-weight: bold; margin: 0; width: 2px; white-space:nowrap;'> </a>"
|
||||
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 << "<a href='#{category_url}' 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}</a>"
|
||||
end
|
||||
|
||||
result.html_safe
|
||||
|
@ -58,7 +58,7 @@
|
||||
<div>
|
||||
<%- @new_by_category.each do |c| %>
|
||||
<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>
|
||||
<a href='<%= Discourse.base_url %><%= c[0].url %>' style='color: #333'><%= c[0].name %></b> <span style='color: #777; margin: 0 10px 0 5px; font-size: 0.9em;'> <%= c[1] %></span>
|
||||
</span>
|
||||
<%- end %>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user