UX: emphasizes on local-dates being UTC in excerpts (#8208)

This commit is contained in:
Joffrey JAFFEUX
2019-10-17 16:18:06 +02:00
committed by Robin Ward
parent ecfba0bb37
commit 54bc2bdba7
2 changed files with 15 additions and 0 deletions

View File

@ -53,6 +53,12 @@ after_initialize do
custom_fields[DiscourseLocalDates::POST_CUSTOM_FIELD] || []
end
on(:reduce_excerpt) do |fragment, post|
fragment.css('.discourse-local-date').each do |container|
container.content = "#{container.content} (UTC)"
end
end
on(:reduce_cooked) do |fragment|
fragment.css('.discourse-local-date').each do |container|
if container.attributes['data-email-preview']