mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 06:41:25 +08:00
FIX: Wizard tries harder to find existing Welcome Topic
The wizard searches for: * a topic that with the "is_welcome_topic" custom field * a topic with the correct slug for the current default locale * a topic with the correct slug for the English locale * the oldest globally pinned topic It gives up if it didn't find any of the above.
This commit is contained in:
@ -48,6 +48,7 @@ class Wizard
|
||||
|
||||
if @wizard.completed_steps?('introduction') && !introduction.get_summary
|
||||
step.disabled = true
|
||||
step.description_vars = { topic_title: I18n.t("discourse_welcome_topic.title") }
|
||||
else
|
||||
step.add_field(id: 'welcome', type: 'textarea', required: true, value: introduction.get_summary)
|
||||
|
||||
@ -102,6 +103,7 @@ class Wizard
|
||||
end
|
||||
|
||||
@wizard.append_step('corporate') do |step|
|
||||
step.description_vars = { base_path: Discourse.base_path }
|
||||
step.add_field(id: 'company_name', type: 'text', value: SiteSetting.company_name)
|
||||
step.add_field(id: 'governing_law', type: 'text', value: SiteSetting.governing_law)
|
||||
step.add_field(id: 'city_for_disputes', type: 'text', value: SiteSetting.city_for_disputes)
|
||||
@ -263,6 +265,7 @@ class Wizard
|
||||
|
||||
@wizard.append_step('finished') do |step|
|
||||
step.banner = "finished.png"
|
||||
step.description_vars = { base_path: Discourse.base_path }
|
||||
end
|
||||
@wizard
|
||||
end
|
||||
|
Reference in New Issue
Block a user