Change NewBlog to new_blog

This commit is contained in:
Matthew Fu committed 2012-01-10 18:29:11 +08:00
1 parent 79f778ad8c
commit cae3daa9c4
96 files changed
+133 -65

No files matched your search

@@ -1,8 +0,0 @@
<h1><%= t('blog.editing_post') %></h1>
<%= form_for @post, :url => panel_blog_back_end_post_path(@post) do |f| %>
<%= render :partial => 'form', :locals => {:f => f} %>
<% end %>
<%= link_to t('blog.show'), panel_blog_back_end_post_path(@post) %> |
<%= link_back %>
-5
View File
@@ -1,5 +0,0 @@
require "NewBlog/engine"
module NewBlog
end
@@ -1,25 +0,0 @@
<h1><%= t('blog.list_post') %></h1>
<table>
<tr>
<th><%= t('blog.title') %></th>
<th><%= t('blog.body') %></th>
<th></th>
<th></th>
<th></th>
</tr>
<% @posts.each do |post| %>
<tr>
<td><%= post.title %></td>
<td><%= post.body %></td>
<td><%= link_to t('blog.show'), panel_blog_post_path(post) %></td>
<td><%= link_to t('blog.edit'), edit_panel_blog_post_path(post) %></td>
<td><%= link_to t('blog.delete'), panel_blog_post_path(post), :confirm => t('blog.sure?'), :method => :delete %></td>
</tr>
<% end %>
</table>
<br />
<%= link_to t('blog.new_post'), new_panel_blog_back_end_post_path %>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,4 +1,4 @@
class Panel::Blog::BackEnd::PostsController < ApplicationController
class Panel::NewBlog::BackEnd::PostsController < ApplicationController
layout 'admin'
@@ -45,7 +45,7 @@ class Panel::Blog::BackEnd::PostsController < ApplicationController
respond_to do |format|
if @post.save
format.html { redirect_to(panel_blog_post_url(@post), :notice => t('blog.create_post_success')) }
format.html { redirect_to(panel_new_blog_post_url(@post), :notice => t('blog.create_post_success')) }
format.xml { render :xml => @post, :status => :created, :location => @post }
else
format.html { render :action => "new" }
@@ -61,7 +61,7 @@ class Panel::Blog::BackEnd::PostsController < ApplicationController
respond_to do |format|
if @post.update_attributes(params[:post])
format.html { redirect_to(panel_blog_post_url(@post), :notice => t('blog.update_post_success')) }
format.html { redirect_to(panel_new_blog_post_url(@post), :notice => t('blog.update_post_success')) }
format.xml { head :ok }
else
format.html { render :action => "edit" }
@@ -77,7 +77,7 @@ class Panel::Blog::BackEnd::PostsController < ApplicationController
@post.destroy
respond_to do |format|
format.html { redirect_to(panel_blog_posts_url) }
format.html { redirect_to(panel_new_blog_posts_url) }
format.xml { head :ok }
end
end
@@ -0,0 +1,7 @@
class Panel::NewBlog::FrontEnd::CommentsController < ObitFrontendController
def create
@post = Post.find(params[:post_id])
@comment = @post.comments.create!(params[:comment])
redirect_to panel_new_blog_front_end_post_url(@post)
end
end
@@ -0,0 +1,21 @@
class Panel::NewBlog::FrontEnd::PostsController < ObitFrontendController
def initialize
super
@app_title = NewBlog::MOUDLEAPP_TITLE
end
# GET /posts
# GET /posts.xml
def index
@posts = Post.all
end
def show
@post = Post.find(params[:id])
end
end
@@ -1,4 +1,4 @@
class Panel::Blog::Widget::PostsController < ObitWidgetController
class Panel::NewBlog::Widget::PostsController < ObitWidgetController
layout 'production'
@@ -0,0 +1,8 @@
<h1><%= t('blog.editing_post') %></h1>
<%= form_for @post, :url => panel_new_blog_back_end_post_path(@post) do |f| %>
<%= render :partial => 'form', :locals => {:f => f} %>
<% end %>
<%= link_to t('blog.show'), panel_new_blog_back_end_post_path(@post) %> |
<%= link_back %>
@@ -1,6 +1,6 @@
<% content_for :secondary do %>
<ul class="list">
<li><%= link_to t('blog.new_post'), new_panel_blog_back_end_post_path, :class => 'seclink1' %></li>
<li><%= link_to t('blog.new_post'), new_panel_new_blog_back_end_post_path, :class => 'seclink1' %></li>
</ul>
<% end -%>
@@ -21,9 +21,9 @@
<tr>
<td><%= post.title %></td>
<td><%= truncate(post.body,:length=>15) %></td>
<td><%= link_to t('blog.show'), panel_blog_back_end_post_path(post) %></td>
<td><%= link_to t('blog.edit'), edit_panel_blog_back_end_post_path(post) %></td>
<td><%= link_to t('blog.delete'), panel_blog_back_end_post_path(post), :confirm => t('blog.sure?'), :method => :delete %></td>
<td><%= link_to t('blog.show'), panel_new_blog_back_end_post_path(post) %></td>
<td><%= link_to t('blog.edit'), edit_panel_new_blog_back_end_post_path(post) %></td>
<td><%= link_to t('blog.delete'), panel_new_blog_back_end_post_path(post), :confirm => t('blog.sure?'), :method => :delete %></td>
</tr>
<% end %>
</table>
@@ -1,4 +1,4 @@
<%=stylesheet_link_tag "NewBlog/application"%>
<%=stylesheet_link_tag "new_blog/application"%>
<h2><%=@post.title%></h2>
<p>
<%= @post.body%>
@@ -1,12 +1,12 @@
<% content_for :secondary do %>
<ul class="list">
<li><%= link_to t('blog.index'), panel_blog_back_end_posts_path, :class => 'seclink2' %></li>
<li><%= link_to t('blog.index'), panel_new_blog_back_end_posts_path, :class => 'seclink2' %></li>
</ul>
<% end -%>
<%= flash_messages %>
<h1><%= t('blog.new_post') %></h1>
<%= form_for @post, :url => panel_blog_back_end_posts_path do |f| %>
<%= form_for @post, :url => panel_new_blog_back_end_posts_path do |f| %>
<%= render :partial => 'form', :locals => {:f => f} %>
<% end %>
@@ -18,7 +18,7 @@
</p>
<% end %>
<%= form_for Comment.new, :url => panel_blog_front_end_comments_path do |f| %>
<%= form_for Comment.new, :url => panel_new_blog_front_end_comments_path do |f| %>
<p>
<%= f.label :name, "Author" %><br />
@@ -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 %>
@@ -2,6 +2,6 @@
<%= post_frontend.title %><br />
<p>
<%= 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) %>
</p>
</div>
@@ -1,6 +1,6 @@
<% content_for :secondary do %>
<ul class="list">
<li><%= link_to t('blog.new_post'), new_panel_blog_back_end_post_path, :class => 'seclink1' %></li>
<li><%= link_to t('blog.new_post'), new_panel_new_blog_back_end_post_path, :class => 'seclink1' %></li>
</ul>
<% end -%>
@@ -18,7 +18,7 @@
</p>
<% end %>
<%= form_for Comment.new, :url => panel_blog_front_end_comments_path do |f| %>
<%= form_for Comment.new, :url => panel_new_blog_front_end_comments_path do |f| %>
<p>
<%= f.label :name, "Author" %><br />
@@ -1,4 +1,4 @@
<%=stylesheet_link_tag "NewBlog/application"%>
<%=stylesheet_link_tag "new_blog/application"%>
<div class="widget_index">
<table>
<tr>
@@ -8,7 +8,7 @@
<% @posts.each do |post| %>
<tr>
<td><%= link_to post.title,panel_blog_front_end_post_path(post) %></td>
<td><%= link_to post.title,panel_new_blog_front_end_post_path(post) %></td>
<td><%= post.body.truncate(14) %></td>
</tr>
<% end %>
@@ -1,4 +1,4 @@
<%=stylesheet_link_tag "NewBlog/application"%>
<%=stylesheet_link_tag "new_blog/application"%>
<div class="widget_latest_post">
<h2><%= @post.title %> </h2>
<p>
@@ -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"
+25
View File
@@ -0,0 +1,25 @@
Rails.application.routes.draw do
namespace :panel do
namespace :new_blog do
namespace :back_end do
root :to => "posts#index"
resources :posts
resources :comments
end
namespace :front_end do
root :to => "posts#index"
match "show/:id" => "posts#show" ,:as => :post
match "comments" => "comments#create",:as => :comments
end
namespace :widget do
root :to => "posts#index"
match "latest_post" => "posts#latest_post"
end
end
end
# match "appfront/blog/front_end/show/:id" => "posts#frontend_show" ,:as => :appfront_blog_show
match "/appfront/*path" => redirect("/panel/*path")
end
+5
View File
@@ -0,0 +1,5 @@
require "new_blog/engine"
module NewBlog
end
@@ -1,5 +1,5 @@
module NewBlog
class Engine < Rails::Engine
isolate_namespace NewBlog
isolate_namespace new_blog
end
end
+12
View File
@@ -0,0 +1,12 @@
{
"title": "NewBlog",
"version": "0.1",
"organization": "Rulingcom",
"author": "RD dep",
"intro": "A simple blog……",
"update_info": "Some info",
"create_date": "11-11-2011",
"app_pages": ["/panel/new_blog/front_end/"],
"widgets": ["/panel/new_blog/widget/latest_post","/panel/new_blog/widget/"],
"enable_frontend": false
}
File renamed without changes.