diff --git a/app/controllers/admin/module_apps_controller.rb b/app/controllers/admin/module_apps_controller.rb index 55be4135..98683345 100644 --- a/app/controllers/admin/module_apps_controller.rb +++ b/app/controllers/admin/module_apps_controller.rb @@ -1,9 +1,15 @@ class Admin::ModuleAppsController < ApplicationController + layout "admin" -def reload_frontend_pages - @module_app = ModuleApp.find(params[:id]) - respond_to do |format| - format.js {} + def index + @module_apps = ModuleApp.all.entries + end + + + def reload_frontend_pages + @module_app = ModuleApp.find(params[:id]) + respond_to do |format| + format.js {} + end end -end end \ No newline at end of file diff --git a/app/views/admin/module_apps/index.html.erb b/app/views/admin/module_apps/index.html.erb new file mode 100644 index 00000000..e69de29b diff --git a/lib/obit_widget_controller.rb b/lib/obit_widget_controller.rb new file mode 100644 index 00000000..c9789775 --- /dev/null +++ b/lib/obit_widget_controller.rb @@ -0,0 +1,6 @@ +class ObitWidgetController< ApplicationController + before_filter {|c| c.front_end_available(@app_title)} + layout 'production' + + +end \ No newline at end of file diff --git a/vendor/built_in_modules/NewBlog/app/controllers/panel/blog/front_end/posts_controller.rb b/vendor/built_in_modules/NewBlog/app/controllers/panel/blog/front_end/posts_controller.rb index df089756..fd83cc34 100644 --- a/vendor/built_in_modules/NewBlog/app/controllers/panel/blog/front_end/posts_controller.rb +++ b/vendor/built_in_modules/NewBlog/app/controllers/panel/blog/front_end/posts_controller.rb @@ -1,6 +1,10 @@ -class Panel::Blog::FrontEnd::PostsController < ApplicationController +class Panel::Blog::FrontEnd::PostsController < ObitWidgetController - layout 'production' + + def initialize + super + @app_title = NewBlog::MOUDLEAPP_TITLE + end # GET /posts # GET /posts.xml diff --git a/vendor/built_in_modules/NewBlog/app/controllers/panel/blog/widget/posts_controller.rb b/vendor/built_in_modules/NewBlog/app/controllers/panel/blog/widget/posts_controller.rb index 20e14616..5c165b49 100644 --- a/vendor/built_in_modules/NewBlog/app/controllers/panel/blog/widget/posts_controller.rb +++ b/vendor/built_in_modules/NewBlog/app/controllers/panel/blog/widget/posts_controller.rb @@ -1,7 +1,12 @@ -class Panel::Blog::Widget::PostsController < ApplicationController +class Panel::Blog::Widget::PostsController < ObitWidgetController layout 'production' + def initialize + super + @app_title = NewBlog::MOUDLEAPP_TITLE + end + # GET /posts # GET /posts.xml def index diff --git a/vendor/built_in_modules/NewBlog/app/helpers/application_helper.rb b/vendor/built_in_modules/NewBlog/app/helpers/application_helper.rb index de6be794..0d18e034 100644 --- a/vendor/built_in_modules/NewBlog/app/helpers/application_helper.rb +++ b/vendor/built_in_modules/NewBlog/app/helpers/application_helper.rb @@ -1,2 +1,6 @@ module ApplicationHelper + + def check_show_frontend + front_end_available(NewBlog::MOUDLEAPP_TITLE) + end end diff --git a/vendor/built_in_modules/NewBlog/app/helpers/new_blog_helper.rb b/vendor/built_in_modules/NewBlog/app/helpers/new_blog_helper.rb new file mode 100644 index 00000000..d8ad507e --- /dev/null +++ b/vendor/built_in_modules/NewBlog/app/helpers/new_blog_helper.rb @@ -0,0 +1,5 @@ +module NewBlogHelper + def self.check_show_frontend + ApplicationController.front_end_available(NewBlog::MOUDLEAPP_TITLE) + end +end \ No newline at end of file diff --git a/vendor/built_in_modules/NewBlog/config/initializers/app_config.rb b/vendor/built_in_modules/NewBlog/config/initializers/app_config.rb new file mode 100644 index 00000000..b218d15d --- /dev/null +++ b/vendor/built_in_modules/NewBlog/config/initializers/app_config.rb @@ -0,0 +1,18 @@ +# module NewBlog +# class MyEngine < Rails::Engine +# # Add a load path for this specific Engine +# # config.autoload_paths << File.expand_path("../lib/some/path", __FILE__) +# put "ABC" +# PrototypeR4::Application::Orbit_Apps << "NewBlog" +# +# # initializer "my_engine.add_middleware" do |app| +# # app.middleware.use MyEngine::Middleware +# # end +# end +# +# end +module NewBlog + VERSION = "0.0.1" + MOUDLEAPP_TITLE = "NewBlog" +end +PrototypeR4::Application::Orbit_Apps << "NewBlog" \ No newline at end of file diff --git a/vendor/built_in_modules/NewBlog/lib/NewBlog/engine.rb b/vendor/built_in_modules/NewBlog/lib/NewBlog/engine.rb index 90afca77..e0f0221c 100644 --- a/vendor/built_in_modules/NewBlog/lib/NewBlog/engine.rb +++ b/vendor/built_in_modules/NewBlog/lib/NewBlog/engine.rb @@ -1,6 +1,5 @@ module NewBlog class Engine < Rails::Engine isolate_namespace NewBlog - PrototypeR4::Application::Orbit_Apps << "NewBlog" end end