|
@@ -5,6 +5,9 @@
|
|
|
|
|
|
register_asset 'stylesheets/custom-wizard.scss'
|
|
|
|
|
|
+config = Rails.application.config
|
|
|
+config.assets.paths << Rails.root.join("plugins", "discourse-custom-wizard", "assets", "javascripts")
|
|
|
+
|
|
|
after_initialize do
|
|
|
require_dependency "application_controller"
|
|
|
module ::CustomWizard
|
|
@@ -14,25 +17,32 @@ after_initialize do
|
|
|
end
|
|
|
end
|
|
|
|
|
|
+ load File.expand_path('../lib/builder.rb', __FILE__)
|
|
|
+ load File.expand_path('../lib/wizard.rb', __FILE__)
|
|
|
+ load File.expand_path('../app/controllers/wizard.rb', __FILE__)
|
|
|
+ load File.expand_path('../app/controllers/steps.rb', __FILE__)
|
|
|
+ load File.expand_path('../app/controllers/admin.rb', __FILE__)
|
|
|
+
|
|
|
CustomWizard::Engine.routes.draw do
|
|
|
- get 'custom' => 'admin#index'
|
|
|
- get 'custom/new' => 'admin#index'
|
|
|
- get 'custom/all' => "admin#all"
|
|
|
- get 'custom/:id' => "admin#find"
|
|
|
- put 'custom/save' => "admin#save"
|
|
|
- delete 'custom/remove' => "admin#remove"
|
|
|
+ get ':name' => 'wizard#index'
|
|
|
+ get ':name/steps' => 'steps#index'
|
|
|
+ get ':name/steps/:id' => 'wizard#index'
|
|
|
+ put ':name/steps/:id' => 'steps#update'
|
|
|
end
|
|
|
|
|
|
require_dependency 'admin_constraint'
|
|
|
Discourse::Application.routes.append do
|
|
|
+ namespace :wizard do
|
|
|
+ mount ::CustomWizard::Engine, at: 'custom'
|
|
|
+ end
|
|
|
|
|
|
- namespace :admin, constraints: AdminConstraint.new do
|
|
|
- mount ::CustomWizard::Engine, at: 'wizards'
|
|
|
+ scope module: 'custom_wizard', constraints: AdminConstraint.new do
|
|
|
+ get 'admin/wizards/custom' => 'admin#index'
|
|
|
+ get 'admin/wizards/custom/new' => 'admin#index'
|
|
|
+ get 'admin/wizards/custom/all' => 'admin#all'
|
|
|
+ get 'admin/wizards/custom/:id' => 'admin#find'
|
|
|
+ put 'admin/wizards/custom/save' => 'admin#save'
|
|
|
+ delete 'admin/wizards/custom/remove' => 'admin#remove'
|
|
|
end
|
|
|
end
|
|
|
-
|
|
|
- load File.expand_path('../lib/builder.rb', __FILE__)
|
|
|
- load File.expand_path('../lib/wizard.rb', __FILE__)
|
|
|
- load File.expand_path('../controllers/steps.rb', __FILE__)
|
|
|
- load File.expand_path('../controllers/admin.rb', __FILE__)
|
|
|
end
|