This commit is contained in:
BoHung Chiu 2021-03-08 10:24:14 +08:00
parent 4671956309
commit 39992cd943
1 changed files with 36 additions and 15 deletions

View File

@ -1,21 +1,42 @@
require "yaml" require "yaml"
module PersonalPluginGenerator module PersonalPluginGenerator
class Engine < ::Rails::Engine class Engine < ::Rails::Engine
initializer "personal_plugin_generator" do begin
OrbitApp.registration "PersonalPluginGenerator", :type => "OrbitMemberModule" do initializer "personal_plugin_generator" do
base_url File.expand_path File.dirname(__FILE__) OrbitApp.registration "PersonalPluginGenerator", :type => "OrbitMemberModule" do
categorizable base_url File.expand_path File.dirname(__FILE__)
authorizable categorizable
side_bar do authorizable
head_label_i18n 'personal_plugin_generator.personal_plugin_generator', icon_class: "icons-graduation" side_bar do
available_for "users" head_label_i18n 'personal_plugin_generator.personal_plugin_generator', icon_class: "icons-graduation"
active_for_controllers (['admin/personal_plugin_fields']) available_for "users"
head_link_path "admin_personal_plugin_fields_path" active_for_controllers (['admin/personal_plugin_fields'])
context_link 'personal_plugin_generator.personal_plugin_generator', head_link_path "admin_personal_plugin_fields_path"
:link_path=>"admin_personal_plugin_fields_path" , context_link 'personal_plugin_generator.personal_plugin_generator',
:priority=>1, :link_path=>"admin_personal_plugin_fields_path" ,
:active_for_action=>{'admin/personal_plugin_fields'=>'index'}, :priority=>1,
:available_for => 'users' :active_for_action=>{'admin/personal_plugin_fields'=>'index'},
:available_for => 'users'
end
end
end
rescue
initializer "personal_plugin_generator" do
OrbitApp.registration "PersonalPluginGenerator", :type => "ModuleApp" do
base_url File.expand_path File.dirname(__FILE__)
categorizable
authorizable
side_bar do
head_label_i18n 'personal_plugin_generator.personal_plugin_generator', icon_class: "icons-graduation"
available_for "users"
active_for_controllers (['admin/personal_plugin_fields'])
head_link_path "admin_personal_plugin_fields_path"
context_link 'personal_plugin_generator.personal_plugin_generator',
:link_path=>"admin_personal_plugin_fields_path" ,
:priority=>1,
:active_for_action=>{'admin/personal_plugin_fields'=>'index'},
:available_for => 'users'
end
end end
end end
end end