diff --git a/assets/javascripts/wizard/lib/wizard-i18n.js.es6 b/assets/javascripts/wizard/lib/wizard-i18n.js.es6 index 17242e58..fdefab77 100644 --- a/assets/javascripts/wizard/lib/wizard-i18n.js.es6 +++ b/assets/javascripts/wizard/lib/wizard-i18n.js.es6 @@ -1,7 +1,10 @@ import I18n from "I18n"; const getThemeId = () => { - let themeId = parseInt($("meta[name=discourse_theme_ids]")[0].content, 10); + let themeId = parseInt( + document.querySelector("meta[name=discourse_theme_id]").content, + 10 + ); if (!isNaN(themeId)) { return themeId.toString(); diff --git a/controllers/custom_wizard/wizard.rb b/controllers/custom_wizard/wizard.rb index 9670fd62..bac15fa9 100644 --- a/controllers/custom_wizard/wizard.rb +++ b/controllers/custom_wizard/wizard.rb @@ -6,7 +6,7 @@ class CustomWizard::WizardController < ::ApplicationController before_action :ensure_plugin_enabled helper_method :wizard_page_title - helper_method :wizard_theme_ids + helper_method :wizard_theme_id helper_method :wizard_theme_lookup helper_method :wizard_theme_translations_lookup @@ -20,16 +20,16 @@ class CustomWizard::WizardController < ::ApplicationController wizard ? (wizard.name || wizard.id) : I18n.t('wizard.custom_title') end - def wizard_theme_ids - wizard ? [wizard.theme_id] : nil + def wizard_theme_id + wizard ? wizard.theme_id : nil end def wizard_theme_lookup(name) - Theme.lookup_field(wizard_theme_ids, mobile_view? ? :mobile : :desktop, name) + Theme.lookup_field(wizard_theme_id, mobile_view? ? :mobile : :desktop, name) end def wizard_theme_translations_lookup - Theme.lookup_field(wizard_theme_ids, :translations, I18n.locale) + Theme.lookup_field(wizard_theme_id, :translations, I18n.locale) end def index diff --git a/views/layouts/wizard.html.erb b/views/layouts/wizard.html.erb index efa09734..16d119b7 100644 --- a/views/layouts/wizard.html.erb +++ b/views/layouts/wizard.html.erb @@ -4,8 +4,8 @@ <%= discourse_stylesheet_link_tag :wizard, theme_id: nil %> <%= discourse_stylesheet_link_tag :wizard_custom %> - <%- if wizard_theme_ids.present? %> - <%= discourse_stylesheet_link_tag (mobile_view? ? :mobile_theme : :desktop_theme), theme_ids: wizard_theme_ids %> + <%- if wizard_theme_id.present? %> + <%= discourse_stylesheet_link_tag (mobile_view? ? :mobile_theme : :desktop_theme), theme_id: wizard_theme_id %> <%- end %> <%= preload_script "locales/#{I18n.locale}" %> @@ -29,7 +29,7 @@ <%= tag.meta id: 'data-discourse-setup', data: client_side_setup_data %> - "> + <%= render partial: "layouts/head" %>