Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-22 09:20:29 +01:00
FIX: lookup for assets in the wizard specified theme (#79)
Dieser Commit ist enthalten in:
Ursprung
fa73a18363
Commit
04b2b87ea2
2 geänderte Dateien mit 9 neuen und 3 gelöschten Zeilen
|
@ -1,11 +1,13 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
class CustomWizard::WizardController < ::ApplicationController
|
class CustomWizard::WizardController < ::ApplicationController
|
||||||
|
include ApplicationHelper
|
||||||
prepend_view_path(Rails.root.join('plugins', 'discourse-custom-wizard', 'views'))
|
prepend_view_path(Rails.root.join('plugins', 'discourse-custom-wizard', 'views'))
|
||||||
layout 'wizard'
|
layout 'wizard'
|
||||||
|
|
||||||
before_action :ensure_plugin_enabled
|
before_action :ensure_plugin_enabled
|
||||||
helper_method :wizard_page_title
|
helper_method :wizard_page_title
|
||||||
helper_method :wizard_theme_ids
|
helper_method :wizard_theme_ids
|
||||||
|
helper_method :wizard_theme_lookup
|
||||||
|
|
||||||
def wizard
|
def wizard
|
||||||
CustomWizard::Wizard.create(params[:wizard_id].underscore, current_user)
|
CustomWizard::Wizard.create(params[:wizard_id].underscore, current_user)
|
||||||
|
@ -19,6 +21,10 @@ class CustomWizard::WizardController < ::ApplicationController
|
||||||
wizard ? [wizard.theme_id] : nil
|
wizard ? [wizard.theme_id] : nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def wizard_theme_lookup(name)
|
||||||
|
Theme.lookup_field(wizard_theme_ids, mobile_view? ? :mobile : :desktop, name)
|
||||||
|
end
|
||||||
|
|
||||||
def index
|
def index
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.json do
|
format.json do
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
<%- unless customization_disabled? %>
|
<%- unless customization_disabled? %>
|
||||||
<%= theme_translations_lookup %>
|
<%= theme_translations_lookup %>
|
||||||
<%= raw theme_lookup("head_tag") %>
|
<%= raw wizard_theme_lookup("head_tag") %>
|
||||||
<%- end %>
|
<%- end %>
|
||||||
|
|
||||||
<%= server_plugin_outlet "custom_wizard" %>
|
<%= server_plugin_outlet "custom_wizard" %>
|
||||||
|
@ -38,13 +38,13 @@
|
||||||
|
|
||||||
<body class='custom-wizard'>
|
<body class='custom-wizard'>
|
||||||
<%- unless customization_disabled? %>
|
<%- unless customization_disabled? %>
|
||||||
<%= raw theme_lookup("header") %>
|
<%= raw wizard_theme_lookup("header") %>
|
||||||
<%- end %>
|
<%- end %>
|
||||||
|
|
||||||
<div id='custom-wizard-main'></div>
|
<div id='custom-wizard-main'></div>
|
||||||
|
|
||||||
<%- unless customization_disabled? %>
|
<%- unless customization_disabled? %>
|
||||||
<%= raw theme_lookup("body_tag") %>
|
<%= raw wizard_theme_lookup("body_tag") %>
|
||||||
<%- end %>
|
<%- end %>
|
||||||
|
|
||||||
<%- if current_user %>
|
<%- if current_user %>
|
||||||
|
|
Laden …
In neuem Issue referenzieren