Wizard: Server Side Validation + Finished Step

This commit is contained in:
Robin Ward
2016-08-31 13:35:49 -04:00
parent be1d74d207
commit 9f12b571ef
35 changed files with 260 additions and 62 deletions

View File

@ -27,7 +27,6 @@ class Wizard
step.previous = last_step
step.index = last_step.index + 1
end
end
def self.build
@ -38,9 +37,20 @@ class Wizard
wizard.append_step(title)
contact = wizard.create_step('contact')
contact.add_field(id: 'contact_email', type: 'text', required: true)
contact.add_field(id: 'contact_email', type: 'text', required: true, value: SiteSetting.contact_email)
contact.add_field(id: 'contact_url', type: 'text', value: SiteSetting.contact_url)
contact.add_field(id: 'site_contact_username', type: 'text', value: SiteSetting.site_contact_username)
wizard.append_step(contact)
theme = wizard.create_step('colors')
scheme = theme.add_field(id: 'color_scheme', type: 'dropdown', required: true)
scheme.add_option('default')
scheme.add_option('dark')
wizard.append_step(theme)
finished = wizard.create_step('finished')
wizard.append_step(finished);
wizard
end
end