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:
Bianca Nenciu
2020-08-31 13:14:09 +03:00
committed by GitHub
parent 7290ca1f4a
commit f2e14a3946
29 changed files with 404 additions and 60 deletions

View File

@ -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)