0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-15 14:22:53 +01:00

FIX: lookup for assets in the wizard specified theme

Dieser Commit ist enthalten in:
Faizaan Gagan 2021-03-18 11:41:20 +05:30
Ursprung fa73a18363
Commit 31b3319c95
2 geänderte Dateien mit 9 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -1,11 +1,13 @@
# frozen_string_literal: true
class CustomWizard::WizardController < ::ApplicationController
include ApplicationHelper
prepend_view_path(Rails.root.join('plugins', 'discourse-custom-wizard', 'views'))
layout 'wizard'
before_action :ensure_plugin_enabled
helper_method :wizard_page_title
helper_method :wizard_theme_ids
helper_method :wizard_theme_lookup
def wizard
CustomWizard::Wizard.create(params[:wizard_id].underscore, current_user)
@ -19,6 +21,10 @@ class CustomWizard::WizardController < ::ApplicationController
wizard ? [wizard.theme_id] : nil
end
def wizard_theme_lookup(name)
Theme.lookup_field(wizard_theme_ids, mobile_view? ? :mobile : :desktop, name)
end
def index
respond_to do |format|
format.json do

Datei anzeigen

@ -22,7 +22,7 @@
<%- unless customization_disabled? %>
<%= theme_translations_lookup %>
<%= raw theme_lookup("head_tag") %>
<%= raw wizard_theme_lookup("head_tag") %>
<%- end %>
<%= server_plugin_outlet "custom_wizard" %>
@ -38,13 +38,13 @@
<body class='custom-wizard'>
<%- unless customization_disabled? %>
<%= raw theme_lookup("header") %>
<%= raw wizard_theme_lookup("header") %>
<%- end %>
<div id='custom-wizard-main'></div>
<%- unless customization_disabled? %>
<%= raw theme_lookup("body_tag") %>
<%= raw wizard_theme_lookup("body_tag") %>
<%- end %>
<%- if current_user %>