mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FEATURE: Implement Onebox for posts including polls. (#7539)
This commit is contained in:

committed by
Régis Hanol

parent
c77bc525cb
commit
227c45107d
@ -435,6 +435,13 @@ after_initialize do
|
||||
end
|
||||
end
|
||||
|
||||
on(:reduce_excerpt) do |doc, options|
|
||||
post = options[:post]
|
||||
doc.css("div.poll").each do |poll|
|
||||
poll.replace "<a href='#{UrlHelper.escape_uri(post.url)}'>#{I18n.t("poll.poll")}</a>"
|
||||
end
|
||||
end
|
||||
|
||||
on(:post_created) do |post|
|
||||
DiscoursePoll::Poll.schedule_jobs(post)
|
||||
|
||||
|
Reference in New Issue
Block a user