diff --git a/app/controllers/admin/page_parts_controller.rb b/app/controllers/admin/page_parts_controller.rb index f77a7782..71e39ae1 100644 --- a/app/controllers/admin/page_parts_controller.rb +++ b/app/controllers/admin/page_parts_controller.rb @@ -28,7 +28,7 @@ class Admin::PagePartsController < ApplicationController @partial = 'edit_text' @part_locale = params[:part_locale] || I18n.locale.to_s when 'module' - @plugins=[{:module=>"Blog",:widgets=>[{:name=>"Blog",:path=>"panel/blog/widget_latest_post"},{:name=>"Blog",:path=>"panel/blog/widget_index"}]}] + @plugins=[{:module=>"Blog",:widgets=>[{:name=>"Blog",:path=>"panel/new_blog/widget_latest_post"},{:name=>"Blog",:path=>"panel/new_blog/widget_index"}]}] when 'snippet' end end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 7c964ff5..0227c252 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -9,12 +9,12 @@ class ApplicationController < ActionController::Base def front_end_available(module_app_title='') app_controller = ModuleApp.first(conditions: {:title => module_app_title} ) unless app_controller.enable_frontend? - render :text => 'View not available' + render :nothing end end def get_all_app_engines - ary = ["vender/plugins/NewBlog"] + ary = ["vender/plugins/new_blog"] app_engines = ary.collect{|t| Rails::Engine.find t } diff --git a/app/controllers/obit_frontend_component_controller.rb b/app/controllers/obit_frontend_component_controller.rb new file mode 100644 index 00000000..d5bfaac6 --- /dev/null +++ b/app/controllers/obit_frontend_component_controller.rb @@ -0,0 +1,4 @@ +class ObitFrontendComponentController< ApplicationController + before_filter {|c| c.front_end_available(@app_title)} + layout 'production' +end \ No newline at end of file diff --git a/app/controllers/obit_frontend_controller.rb b/app/controllers/obit_frontend_controller.rb new file mode 100644 index 00000000..fb42ac78 --- /dev/null +++ b/app/controllers/obit_frontend_controller.rb @@ -0,0 +1,3 @@ +class ObitFrontendController< ObitFrontendComponentController + +end \ No newline at end of file diff --git a/app/controllers/obit_widget_controller.rb b/app/controllers/obit_widget_controller.rb new file mode 100644 index 00000000..e0a9746d --- /dev/null +++ b/app/controllers/obit_widget_controller.rb @@ -0,0 +1,3 @@ +class ObitWidgetController< ObitFrontendComponentController + +end \ No newline at end of file diff --git a/lib/NewBlog.zip b/lib/NewBlog.zip index f21f2eb2..3513cabf 100644 Binary files a/lib/NewBlog.zip and b/lib/NewBlog.zip differ diff --git a/lib/fraisier/layout.html b/lib/fraisier/layout.html index b2b97924..206b04c5 100644 --- a/lib/fraisier/layout.html +++ b/lib/fraisier/layout.html @@ -26,8 +26,8 @@
<%= t('blog.title') %> | -<%= t('blog.body') %> | -- | - | - |
---|---|---|---|---|
<%= post.title %> | -<%= post.body %> | -<%= link_to t('blog.show'), panel_blog_post_path(post) %> | -<%= link_to t('blog.edit'), edit_panel_blog_post_path(post) %> | -<%= link_to t('blog.delete'), panel_blog_post_path(post), :confirm => t('blog.sure?'), :method => :delete %> | -
<%= @post.body%> diff --git a/vendor/built_in_modules/NewBlog/app/views/panel/blog/back_end/posts/new.html.erb b/vendor/built_in_modules/new_blog/app/views/panel/new_blog/back_end/posts/new.html.erb similarity index 55% rename from vendor/built_in_modules/NewBlog/app/views/panel/blog/back_end/posts/new.html.erb rename to vendor/built_in_modules/new_blog/app/views/panel/new_blog/back_end/posts/new.html.erb index 03508f90..af5aa326 100644 --- a/vendor/built_in_modules/NewBlog/app/views/panel/blog/back_end/posts/new.html.erb +++ b/vendor/built_in_modules/new_blog/app/views/panel/new_blog/back_end/posts/new.html.erb @@ -1,12 +1,12 @@ <% content_for :secondary do %>
<%= f.label :name, "Author" %>
@@ -34,5 +34,5 @@
<% end %>
-<%= link_to t('blog.edit'), edit_panel_blog_back_end_post_path(@post) %> |
+<%= link_to t('blog.edit'), edit_panel_new_blog_back_end_post_path(@post) %> |
<%= link_back %>
\ No newline at end of file
diff --git a/vendor/built_in_modules/NewBlog/app/views/panel/blog/front_end/posts/_post_frontend.html.erb b/vendor/built_in_modules/new_blog/app/views/panel/new_blog/front_end/posts/_post_frontend.html.erb
similarity index 56%
rename from vendor/built_in_modules/NewBlog/app/views/panel/blog/front_end/posts/_post_frontend.html.erb
rename to vendor/built_in_modules/new_blog/app/views/panel/new_blog/front_end/posts/_post_frontend.html.erb
index 09dfa10e..34e5a7d7 100644
--- a/vendor/built_in_modules/NewBlog/app/views/panel/blog/front_end/posts/_post_frontend.html.erb
+++ b/vendor/built_in_modules/new_blog/app/views/panel/new_blog/front_end/posts/_post_frontend.html.erb
@@ -2,6 +2,6 @@
<%= post_frontend.title %>
<%= truncate(post_frontend.body,:length=>25) %> - <%= link_to 'Read more...',panel_blog_front_end_post_path(post_frontend) %> + <%= link_to 'Read more...',panel_new_blog_front_end_post_path(post_frontend) %>
<%= f.label :name, "Author" %>
diff --git a/vendor/built_in_modules/NewBlog/app/views/panel/blog/widget/posts/index.html.erb b/vendor/built_in_modules/new_blog/app/views/panel/new_blog/widget/posts/index.html.erb
similarity index 64%
rename from vendor/built_in_modules/NewBlog/app/views/panel/blog/widget/posts/index.html.erb
rename to vendor/built_in_modules/new_blog/app/views/panel/new_blog/widget/posts/index.html.erb
index 0ea7639f..41c8ccf8 100644
--- a/vendor/built_in_modules/NewBlog/app/views/panel/blog/widget/posts/index.html.erb
+++ b/vendor/built_in_modules/new_blog/app/views/panel/new_blog/widget/posts/index.html.erb
@@ -1,4 +1,4 @@
-<%=stylesheet_link_tag "NewBlog/application"%>
+<%=stylesheet_link_tag "new_blog/application"%>
<%= link_to post.title,panel_blog_front_end_post_path(post) %> | +<%= link_to post.title,panel_new_blog_front_end_post_path(post) %> | <%= post.body.truncate(14) %> |