Upload Logos Step

This commit is contained in:
Robin Ward
2016-09-08 16:58:07 -04:00
parent c94e6f1b96
commit af83c8dc14
18 changed files with 223 additions and 43 deletions

View File

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

View File

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