diff --git a/app/controllers/admin/page_parts_controller.rb b/app/controllers/admin/page_parts_controller.rb index f77a77829..71e39ae19 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 7c964ff58..0227c2524 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 000000000..d5bfaac68 --- /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 000000000..fb42ac781 --- /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 000000000..e0a9746d9 --- /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 f21f2eb22..3513cabf8 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 b2b97924f..206b04c55 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 03508f90e..af5aa326b 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 09dfa10e9..34e5a7d76 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 0ea7639f9..41c8ccf83 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) %> |