mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
FEATURE: Add site setting and wizard step to set base font (#10250)
Co-authored-by: Neil Lalonde <neillalonde@gmail.com>
This commit is contained in:
@ -209,6 +209,22 @@ class Wizard
|
||||
step.add_field(id: 'popular-themes', type: 'component')
|
||||
end
|
||||
|
||||
@wizard.append_step('fonts') do |step|
|
||||
field = step.add_field(
|
||||
id: 'font_previews',
|
||||
type: 'component',
|
||||
value: SiteSetting.base_font
|
||||
)
|
||||
|
||||
DiscourseFonts.fonts.each do |font|
|
||||
field.add_choice(font[:key], data: { class: font[:key].tr("_", "-"), font_stack: font[:stack] })
|
||||
end
|
||||
|
||||
step.on_update do |updater|
|
||||
updater.update_setting(:base_font, updater.fields[:font_previews])
|
||||
end
|
||||
end
|
||||
|
||||
@wizard.append_step('logos') do |step|
|
||||
step.add_field(id: 'logo', type: 'image', value: SiteSetting.site_logo_url)
|
||||
step.add_field(id: 'logo_small', type: 'image', value: SiteSetting.site_logo_small_url)
|
||||
|
Reference in New Issue
Block a user