mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Upload Logos Step
This commit is contained in:
@@ -59,7 +59,6 @@ class Wizard
|
||||
end
|
||||
|
||||
wizard.append_step('colors') do |step|
|
||||
|
||||
theme_id = ColorScheme.where(via_wizard: true).pluck(:theme_id)
|
||||
theme_id = theme_id.present? ? theme_id[0] : 'default'
|
||||
|
||||
@@ -68,6 +67,13 @@ class Wizard
|
||||
step.add_field(id: 'theme_preview', type: 'component')
|
||||
end
|
||||
|
||||
wizard.append_step('logos') do |step|
|
||||
step.add_field(id: 'logo_url', type: 'image', value: SiteSetting.logo_url)
|
||||
step.add_field(id: 'logo_small_url', type: 'image', value: SiteSetting.logo_small_url)
|
||||
step.add_field(id: 'favicon_url', type: 'image', value: SiteSetting.favicon_url)
|
||||
step.add_field(id: 'apple_touch_icon_url', type: 'image', value: SiteSetting.apple_touch_icon_url)
|
||||
end
|
||||
|
||||
wizard.append_step('finished')
|
||||
|
||||
wizard
|
||||
|
||||
@@ -59,6 +59,13 @@ class Wizard
|
||||
end
|
||||
end
|
||||
|
||||
def update_logos(fields)
|
||||
update_setting(:logo_url, fields, :logo_url)
|
||||
update_setting(:logo_small_url, fields, :logo_small_url)
|
||||
update_setting(:favicon_url, fields, :favicon_url)
|
||||
update_setting(:apple_touch_icon_url, fields, :apple_touch_icon_url)
|
||||
end
|
||||
|
||||
def success?
|
||||
@errors.blank?
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user