0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-08 19:38:00 +01:00
discourse-custom-wizard/plugin.rb

39 Zeilen
1,1 KiB
Ruby

2017-09-23 04:34:07 +02:00
# name: discourse-custom-wizard
# about: Allows the admins to create custom user input forms
# version: 0.1
# authors: Angus McLeod
register_asset 'stylesheets/custom-wizard.scss'
after_initialize do
require_dependency "application_controller"
module ::CustomWizard
class Engine < ::Rails::Engine
engine_name "custom_wizard"
isolate_namespace CustomWizard
end
end
CustomWizard::Engine.routes.draw do
get 'custom' => 'admin#index'
get 'custom/new' => 'admin#index'
get 'custom/all' => "admin#all"
get 'custom/:name' => "admin#find"
put 'custom/:name' => "admin#save"
delete 'custom/:name' => "admin#remove"
end
require_dependency 'admin_constraint'
Discourse::Application.routes.append do
namespace :admin, constraints: AdminConstraint.new do
mount ::CustomWizard::Engine, at: 'wizards'
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