mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 17:27:16 +08:00
UX: Various improvements to welcome topic CTA (#21010)
- Update welcome topic copy - Edit the welcome topic automatically when the title or description changes - Remove “Create your Welcome Topic” banner/CTA - Add "edit welcome topic" user tip
This commit is contained in:
@ -65,4 +65,22 @@ DiscourseEvent.on(:site_setting_changed) do |name, old_value, new_value|
|
||||
end
|
||||
|
||||
Emoji.clear_cache && Discourse.request_refresh! if name == :emoji_deny_list
|
||||
|
||||
if (name == :title || name == :site_description) &&
|
||||
topic = Topic.find_by(id: SiteSetting.welcome_topic_id)
|
||||
PostRevisor.new(topic.first_post, topic).revise!(
|
||||
Discourse.system_user,
|
||||
{
|
||||
title: I18n.t("discourse_welcome_topic.title", site_title: SiteSetting.title),
|
||||
raw:
|
||||
I18n.t(
|
||||
"discourse_welcome_topic.body",
|
||||
base_path: Discourse.base_path,
|
||||
site_title: SiteSetting.title,
|
||||
site_description: SiteSetting.site_description,
|
||||
),
|
||||
},
|
||||
skip_revision: true,
|
||||
)
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user