1
0
Fork 0

Commits vergleichen

...

1 Commit

Autor SHA1 Nachricht Datum
Faizaan Gagan
31b3319c95 FIX: lookup for assets in the wizard specified theme 2021-03-18 11:41:20 +05:30
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 %>