diff --git a/controllers/wizard.rb b/controllers/wizard.rb index eb5edabd..40c76807 100644 --- a/controllers/wizard.rb +++ b/controllers/wizard.rb @@ -7,15 +7,15 @@ class CustomWizard::WizardController < ::ApplicationController helper_method :theme_key def wizard - PluginStore.get('custom_wizard', params[:wizard_id].underscore) + CustomWizard::Template.new(PluginStore.get('custom_wizard', params[:wizard_id].underscore)) end def wizard_page_title - wizard ? (wizard['name'] || wizard['id']) : I18n.t('wizard.custom_title') + wizard ? (wizard.name || wizard.id) : I18n.t('wizard.custom_title') end def theme_key - wizard ? wizard['theme_key'] : nil + wizard ? wizard.theme_key : nil end def index diff --git a/lib/template.rb b/lib/template.rb index c9308dab..9b6fd5a3 100644 --- a/lib/template.rb +++ b/lib/template.rb @@ -29,5 +29,10 @@ class CustomWizard::Template @after_time_scheduled = data['after_time_scheduled'] @required = data['required'] || false @theme_key = data['theme_key'] + + if data['theme'] + theme = Theme.find_by(name: data['theme']) + @theme_key = theme.key if theme + end end end