Remove NewBlog from plugins

This commit is contained in:
chris2tof 2011-12-22 15:53:34 +08:00
parent d465febca7
commit 1f9197e438
17 changed files with 0 additions and 357 deletions

View File

@ -1,9 +0,0 @@
{
"title": "NewBlog",
"version": "0.1",
"organization": "Rulingcom",
"author": "RD dep",
"intro": "A simple blog……",
"update_info": "Some info",
"create_date": "11-11-2011"
}

View File

@ -1,84 +0,0 @@
class Panel::Blog::BackEnd::PostsController < ApplicationController
layout 'admin'
def index
@posts = Post.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @posts }
end
end
# GET /posts/1
# GET /posts/1.xml
def show
@post = Post.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @post }
end
end
# GET /posts/new
# GET /posts/new.xml
def new
@post = Post.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @post }
end
end
# GET /posts/1/edit
def edit
@post = Post.find(params[:id])
end
# POST /posts
# POST /posts.xml
def create
@post = Post.new(params[:post])
respond_to do |format|
if @post.save
format.html { redirect_to(panel_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" }
format.xml { render :xml => @post.errors, :status => :unprocessable_entity }
end
end
end
# PUT /posts/1
# PUT /posts/1.xml
def update
@post = Post.find(params[:id])
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.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @post.errors, :status => :unprocessable_entity }
end
end
end
# DELETE /posts/1
# DELETE /posts/1.xml
def destroy
@post = Post.find(params[:id])
@post.destroy
respond_to do |format|
format.html { redirect_to(panel_blog_posts_url) }
format.xml { head :ok }
end
end
end

View File

@ -1,13 +0,0 @@
<%= f.error_messages %>
<div class="field">
<%= f.label :title %><br />
<%= f.text_field :title %>
</div>
<div class="field">
<%= f.label :body %><br />
<%= f.text_area :body %>
</div>
<div class="actions">
<%= f.submit %>
</div>

View File

@ -1,32 +0,0 @@
<% content_for :secondary do %>
<ul class="list">
<li><%= link_to t('blog.new_post'), new_panel_blog_back_end_post_path, :class => 'seclink1' %></li>
</ul>
<% end -%>
<%= flash_messages %>
<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><%= 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>
</tr>
<% end %>
</table>
<br />

View File

@ -1,5 +0,0 @@
<%=stylesheet_link_tag "NewBlog/application"%>
<h2><%=@post.title%></h2>
<p>
<%= @post.body%>
</p>

View File

@ -1,13 +0,0 @@
<% content_for :secondary do %>
<ul class="list">
<li><%= link_to t('blog.index'), panel_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| %>
<%= render :partial => 'form', :locals => {:f => f} %>
<% end %>
<%= link_back %>

View File

@ -1,34 +0,0 @@
<p id="notice"><%= flash_messages %></p>
<p>
<b><%= t('blog.body') %></b>
<%=h @post.body %>
</p>
<h2><%= t('blog.comments') %></h2>
<% @post.comments.each do |c| %>
<p>
<b><%=h c.name %> said:</b><br />
<%= time_ago_in_words(c.created_at) %> ago
</p>
<p>
<%=h c.body %>
</p>
<% end %>
<%= form_for Comment.new, :url => panel_blog_front_end_comments_path do |f| %>
<p>
<%= f.label :name, "Author" %><br />
<%= f.text_field :name %><br />
<%= f.label :body, "Comment Description" %><br />
<%= f.text_area :body %>
<%= hidden_field_tag :post_id, @post.id %>
</p>
<p>
<%= f.submit "Add Comment" %>
</p>
<% end %>

View File

@ -1,32 +0,0 @@
<% content_for :secondary do %>
<ul class="list">
<li><%= link_to t('blog.new_post'), new_panel_blog_post_path, :class => 'seclink1' %></li>
</ul>
<% end -%>
<%= flash_messages %>
<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><%= truncate(post.body,:length=>15) %></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 />

View File

@ -1,5 +0,0 @@
<%=stylesheet_link_tag "NewBlog/application"%>
<h2><%=@post.title%></h2>
<p>
<%= @post.body%>
</p>

View File

@ -1,13 +0,0 @@
<% content_for :secondary do %>
<ul class="list">
<li><%= link_to t('blog.index'), panel_blog_posts_path, :class => 'seclink2' %></li>
</ul>
<% end -%>
<%= flash_messages %>
<h1><%= t('blog.new_post') %></h1>
<%= form_for @post, :url => panel_blog_posts_path do |f| %>
<%= render :partial => 'form', :locals => {:f => f} %>
<% end %>
<%= link_back %>

View File

@ -1,38 +0,0 @@
<p id="notice"><%= flash_messages %></p>
<p>
<b><%= t('blog.body') %></b>
<%=h @post.body %>
</p>
<h2><%= t('blog.comments') %></h2>
<% @post.comments.each do |c| %>
<p>
<b><%=h c.name %> said:</b><br />
<%= time_ago_in_words(c.created_at) %> ago
</p>
<p>
<%=h c.body %>
</p>
<% end %>
<%= form_for Comment.new, :url => panel_blog_comments_path do |f| %>
<p>
<%= f.label :name, "Author" %><br />
<%= f.text_field :name %><br />
<%= f.label :body, "Comment Description" %><br />
<%= f.text_area :body %>
<%= hidden_field_tag :post_id, @post.id %>
</p>
<p>
<%= f.submit "Add Comment" %>
</p>
<% end %>
<%= link_to t('blog.edit'), edit_panel_blog_post_path(@post) %> |
<%= link_back %>

View File

@ -1,16 +0,0 @@
<%=stylesheet_link_tag "NewBlog/application"%>
<div class="widget_index">
<table>
<tr>
<th><%= t('blog.title') %></th>
<th><%= t('blog.body') %></th>
</tr>
<% @posts.each do |post| %>
<tr>
<td><%= link_to post.title,panel_blog_post_path(post) %></td>
<td><%= post.body.truncate(14) %></td>
</tr>
<% end %>
</table>
</div>

View File

@ -1,7 +0,0 @@
<%=stylesheet_link_tag "NewBlog/application"%>
<div class="widget_latest_post">
<h2><%= @post.title %> </h2>
<p>
<%= @post.body %>
</p>
</div>

View File

@ -1,16 +0,0 @@
<%=stylesheet_link_tag "NewBlog/application"%>
<div class="widget_index">
<table>
<tr>
<th><%= t('blog.title') %></th>
<th><%= t('blog.body') %></th>
</tr>
<% @posts.each do |post| %>
<tr>
<td><%= link_to post.title,panel_blog_front_end_post_path(post) %></td>
<td><%= post.body.truncate(14) %></td>
</tr>
<% end %>
</table>
</div>

View File

@ -1,7 +0,0 @@
<%=stylesheet_link_tag "NewBlog/application"%>
<div class="widget_latest_post">
<h2><%= @post.title %> </h2>
<p>
<%= @post.body %>
</p>
</div>

View File

@ -1,20 +0,0 @@
zh_tw:
_locale: 中文
add: 新增
back: 回去
create: 創造
delete: 刪除
disable: 禁用
edit: 編輯
enable: 啟用
hide: 隱藏
homepage: 首頁
no_: "No"
nothing:
show: 顯示
sure?: 您肯定嗎?
update: 更新
yes_: "Yes"

View File

@ -1,13 +0,0 @@
Rails.application.routes.draw do
namespace :panel do
namespace :blog do
root :to => "posts#index"
resources :posts
resources :comments
match "widget_latest_post" => "posts#widget_latest_post"
match "widget_index" => "posts#widget_index"
end
end
end