merge with november_presentation
This commit is contained in:
1 parent
afbffe37d5
commit
a09f8e4551
101 files changed
+891
-10632
No files matched your search
Vendored
+5
-4
@@ -1,9 +1,10 @@
|
||||
{
|
||||
"title": "NewBlog",
|
||||
"version": "0.1",
|
||||
"organization": "Rulingcom",
|
||||
"version": "0.1",
|
||||
"organization": "Rulingcom",
|
||||
"author": "RD dep",
|
||||
"intro": "A simple blog……",
|
||||
"update_info": "Some info",
|
||||
"create_date": "11-11-2011"
|
||||
}
|
||||
"create_date": "11-11-2011",
|
||||
"app_pages": ["/panel/blog/front_end/"]
|
||||
}
|
||||
+1
-28
@@ -1,17 +1,7 @@
|
||||
class Panel::Blog::PostsController < ApplicationController
|
||||
class Panel::Blog::BackEnd::PostsController < ApplicationController
|
||||
|
||||
layout 'admin'
|
||||
|
||||
# GET /posts
|
||||
# GET /posts.xml
|
||||
def widget_index
|
||||
@posts = Post.all
|
||||
widget_default_layout
|
||||
end
|
||||
def widget_latest_post
|
||||
@post = Post.all.last
|
||||
widget_default_layout
|
||||
end
|
||||
def index
|
||||
@posts = Post.all
|
||||
|
||||
@@ -92,20 +82,3 @@ class Panel::Blog::PostsController < ApplicationController
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def widget_default_layout
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
if params[:edit_view]
|
||||
#in the case of editing,should be displayed in modal window and
|
||||
#be restricted by the border developer sat.
|
||||
render :layout => 'admin'
|
||||
else
|
||||
#in the case of fetching data for ajax display,should
|
||||
render :layout => 'production'
|
||||
end
|
||||
}
|
||||
format.xml { render :xml => @posts }
|
||||
end
|
||||
end
|
||||
@@ -1,7 +0,0 @@
|
||||
class Panel::Blog::CommentsController < ApplicationController
|
||||
def create
|
||||
@post = Post.find(params[:post_id])
|
||||
@comment = @post.comments.create!(params[:comment])
|
||||
redirect_to panel_blog_post_url(@post)
|
||||
end
|
||||
end
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
class Panel::Blog::FrontEnd::CommentsController < ApplicationController
|
||||
def create
|
||||
@post = Post.find(params[:post_id])
|
||||
@comment = @post.comments.create!(params[:comment])
|
||||
redirect_to panel_blog_front_end_post_url(@post)
|
||||
end
|
||||
end
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
class Panel::Blog::FrontEnd::PostsController < ApplicationController
|
||||
|
||||
layout 'production'
|
||||
|
||||
# GET /posts
|
||||
# GET /posts.xml
|
||||
|
||||
def index
|
||||
@posts = Post.all
|
||||
end
|
||||
|
||||
def show
|
||||
@post = Post.find(params[:id])
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
@@ -0,0 +1,15 @@
|
||||
class Panel::Blog::Widget::PostsController < ApplicationController
|
||||
|
||||
layout 'production'
|
||||
|
||||
# GET /posts
|
||||
# GET /posts.xml
|
||||
def index
|
||||
@posts = Post.all
|
||||
end
|
||||
|
||||
def latest_post
|
||||
@post = Post.all.last
|
||||
end
|
||||
|
||||
end
|
||||
File renamed without changes.
@@ -0,0 +1,8 @@
|
||||
<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 %>
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
<% content_for :secondary do %>
|
||||
<ul class="list">
|
||||
<li><%= link_to t('blog.new_post'), new_panel_blog_post_path, :class => 'seclink1' %></li>
|
||||
<li><%= link_to t('blog.new_post'), new_panel_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_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>
|
||||
<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>
|
||||
File renamed without changes.
+2
-2
@@ -1,12 +1,12 @@
|
||||
<% content_for :secondary do %>
|
||||
<ul class="list">
|
||||
<li><%= link_to t('blog.index'), panel_blog_posts_path, :class => 'seclink2' %></li>
|
||||
<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_posts_path do |f| %>
|
||||
<%= form_for @post, :url => panel_blog_back_end_posts_path do |f| %>
|
||||
<%= render :partial => 'form', :locals => {:f => f} %>
|
||||
<% end %>
|
||||
|
||||
+2
-2
@@ -18,7 +18,7 @@
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
<%= form_for Comment.new, :url => panel_blog_comments_path do |f| %>
|
||||
<%= form_for Comment.new, :url => panel_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_post_path(@post) %> |
|
||||
<%= link_to t('blog.edit'), edit_panel_blog_back_end_post_path(@post) %> |
|
||||
<%= link_back %>
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
<div>
|
||||
<%= post_frontend.title %><br />
|
||||
<p>
|
||||
<%= truncate(post_frontend.body,:length=>25) %>
|
||||
<%= link_to 'Read more...',panel_blog_front_end_post_path(post_frontend) %>
|
||||
</p>
|
||||
</div>
|
||||
@@ -0,0 +1,11 @@
|
||||
<% 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.front_end_index') %></h1>
|
||||
|
||||
<%= render :partial => "post_frontend", :collection => @posts %>
|
||||
@@ -0,0 +1,34 @@
|
||||
<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 %>
|
||||
@@ -1,8 +0,0 @@
|
||||
<h1><%= t('blog.editing_post') %></h1>
|
||||
|
||||
<%= form_for @post, :url => panel_blog_post_path(@post) do |f| %>
|
||||
<%= render :partial => 'form', :locals => {:f => f} %>
|
||||
<% end %>
|
||||
|
||||
<%= link_to t('blog.show'), panel_blog_post_path(@post) %> |
|
||||
<%= link_back %>
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
|
||||
<% @posts.each do |post| %>
|
||||
<tr>
|
||||
<td><%= link_to post.title,panel_blog_post_path(post) %></td>
|
||||
<td><%= link_to post.title,panel_blog_front_end_post_path(post) %></td>
|
||||
<td><%= post.body.truncate(14) %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
File renamed without changes.
+310
@@ -17,4 +17,314 @@ zh_tw:
|
||||
sure?: 您肯定嗎?
|
||||
update: 更新
|
||||
yes_: "Yes"
|
||||
|
||||
admin:
|
||||
action: 行動
|
||||
add_language: 新增語言
|
||||
admin: 管理
|
||||
action: 行動
|
||||
announcement: 公告
|
||||
asset: 資產
|
||||
attributes: 屬性
|
||||
cant_delete_self: 您不可以刪除自己。
|
||||
cant_revoke_self_admin: 您不可以撤銷自己的管理作用。
|
||||
class: 階級
|
||||
content: 內容
|
||||
create_error_link: 創建連接時出錯。
|
||||
create_error_page: 創建頁面時出錯。
|
||||
create_success_home: 首頁已成功創建。
|
||||
create_success_layout: 樣板已成功創建。
|
||||
create_success_link: 連結已成功創建。
|
||||
create_success_page: 頁面已成功創建。
|
||||
create_success_snippet: 片段已成功創建
|
||||
create_success_user: 用戶已成功創建。。
|
||||
data: 數據
|
||||
delete_language: 刪除語言
|
||||
description: 描述
|
||||
disable_language: 禁用語言
|
||||
editing_home: 編輯首頁
|
||||
editing_layout: 編輯樣板
|
||||
editing_link: 編輯連結
|
||||
editing_page: 編輯頁面
|
||||
editing_snippet: 編輯片段
|
||||
editing_user_info: 編輯用戶資料
|
||||
editing_user_role: 編輯用戶角色
|
||||
email: Email
|
||||
enable_language: 啟用語言
|
||||
file_name: 檔名
|
||||
file_size: 檔案大小
|
||||
format: 格式
|
||||
home: 首頁
|
||||
id: ID
|
||||
info: 資料
|
||||
is_published: 被出版
|
||||
item: 項目
|
||||
key: 關鍵
|
||||
language: 語言
|
||||
layout: 佈局
|
||||
layout_name: 佈局名字
|
||||
list_assets: 資產清單
|
||||
list_items: 項目清單
|
||||
list_layouts: 佈局清單
|
||||
list_snippets: 斷片清單
|
||||
list_users: 使用清單
|
||||
list_user_infos: 用戶資料清單
|
||||
list_user_roles: 用戶角色清單
|
||||
member: 會員
|
||||
move_down: 往下移
|
||||
move_up: 往上移
|
||||
multilingual: 多種語言
|
||||
my_avatar: 我的頭像
|
||||
no_home_page: 您沒有首頁
|
||||
no_layout: 您沒有佈局
|
||||
name: 名稱
|
||||
new_asset: 新增資產
|
||||
new_component: 新增元件
|
||||
new_home: 新增首頁
|
||||
new_layout: 新增樣板
|
||||
new_link: 新增連結
|
||||
new_page: 新增頁面
|
||||
new_snippet: 新增片段
|
||||
new_user: 新增使用
|
||||
new_user_info: 新增用戶資料
|
||||
new_user_role: 新增用戶角色
|
||||
non_multilingual: 非多種語言
|
||||
options: 選項
|
||||
orig_upload_file: 原上傳檔名
|
||||
position: 位置
|
||||
published?: 發布?
|
||||
role: 角色
|
||||
roles: 角色。
|
||||
title: 標題
|
||||
translation: 翻譯
|
||||
type: 類型
|
||||
update_error_link: 更新鏈接時出現錯誤。
|
||||
update_error_page: 更新頁面時出現錯誤。
|
||||
update_success_content: 內容已成功更新。
|
||||
update_success_home: 首頁已成功更新。
|
||||
update_success_layout: 樣板已成功更新。
|
||||
update_success_link: 連結已成功更新。
|
||||
update_success_page: 頁面已成功更新。
|
||||
update_success_snippet: 片段已成功更新。
|
||||
update_success_user: 用戶已成功更新
|
||||
url: URL
|
||||
user: 用戶
|
||||
user_info: 用戶資料
|
||||
user_panel: 用戶面板
|
||||
user_role: 用戶角色
|
||||
|
||||
panel:
|
||||
|
||||
|
||||
|
||||
# Chinese (Taiwan) translations for Ruby on Rails
|
||||
# by tsechingho (http://github.com/tsechingho)
|
||||
date:
|
||||
formats:
|
||||
default: "%Y-%m-%d"
|
||||
short: "%b%d日"
|
||||
long: "%Y年%b%d日"
|
||||
day_names: [星期日, 星期一, 星期二, 星期三, 星期四, 星期五, 星期六]
|
||||
abbr_day_names: [日, 一, 二, 三, 四, 五, 六]
|
||||
month_names: [~, 一月, 二月, 三月, 四月, 五月, 六月, 七月, 八月, 九月, 十月, 十一月, 十二月]
|
||||
abbr_month_names: [~, 1月, 2月, 3月, 4月, 5月, 6月, 7月, 8月, 9月, 10月, 11月, 12月]
|
||||
order: [ :year, :month, :day ]
|
||||
|
||||
time:
|
||||
formats:
|
||||
default: "%Y年%b%d日 %A %H:%M:%S %Z"
|
||||
short: "%b%d日 %H:%M"
|
||||
long: "%Y年%b%d日 %H:%M"
|
||||
am: "上午"
|
||||
pm: "下午"
|
||||
|
||||
datetime:
|
||||
distance_in_words:
|
||||
half_a_minute: "半分鐘"
|
||||
less_than_x_seconds:
|
||||
one: "不到一秒"
|
||||
other: "不到 %{count} 秒"
|
||||
x_seconds:
|
||||
one: "一秒"
|
||||
other: "%{count} 秒"
|
||||
less_than_x_minutes:
|
||||
one: "不到一分鐘"
|
||||
other: "不到 %{count} 分鐘"
|
||||
x_minutes:
|
||||
one: "一分鐘"
|
||||
other: "%{count} 分鐘"
|
||||
about_x_hours:
|
||||
one: "大約一小時"
|
||||
other: "大約 %{count} 小時"
|
||||
x_days:
|
||||
one: "一天"
|
||||
other: "%{count} 天"
|
||||
about_x_months:
|
||||
one: "大約一個月"
|
||||
other: "大約 %{count} 個月"
|
||||
x_months:
|
||||
one: "一個月"
|
||||
other: "%{count} 個月"
|
||||
about_x_years:
|
||||
one: "大約一年"
|
||||
other: "大約 %{count} 年"
|
||||
over_x_years:
|
||||
one: "一年多"
|
||||
other: "%{count} 年多"
|
||||
almost_x_years:
|
||||
one: "接近一年"
|
||||
other: "接近 %{count} 年"
|
||||
prompts:
|
||||
year: "年"
|
||||
month: "月"
|
||||
day: "日"
|
||||
hour: "時"
|
||||
minute: "分"
|
||||
second: "秒"
|
||||
|
||||
number:
|
||||
format:
|
||||
separator: "."
|
||||
delimiter: ","
|
||||
precision: 3
|
||||
significant: false
|
||||
strip_insignificant_zeros: false
|
||||
currency:
|
||||
format:
|
||||
format: "%u %n"
|
||||
unit: "NT$"
|
||||
separator: "."
|
||||
delimiter: ","
|
||||
precision: 2
|
||||
significant: false
|
||||
strip_insignificant_zeros: false
|
||||
percentage:
|
||||
format:
|
||||
delimiter: ""
|
||||
precision:
|
||||
format:
|
||||
delimiter: ""
|
||||
human:
|
||||
format:
|
||||
delimiter: ""
|
||||
precision: 1
|
||||
significant: false
|
||||
strip_insignificant_zeros: false
|
||||
storage_units:
|
||||
format: "%n %u"
|
||||
units:
|
||||
byte:
|
||||
one: "Byte"
|
||||
other: "Bytes"
|
||||
kb: "KB"
|
||||
mb: "MB"
|
||||
gb: "GB"
|
||||
tb: "TB"
|
||||
decimal_units:
|
||||
format: "%n %u"
|
||||
units:
|
||||
# 10^-21 zepto, 10^-24 yocto
|
||||
atto: "渺" # 10^-18
|
||||
femto: "飛" # 10^-15 毫微微
|
||||
pico: "漠" # 10^-12 微微
|
||||
nano: "奈" # 10^-9 毫微
|
||||
micro: "微" # 10^-6
|
||||
mili: "毫" # 10^-3 milli
|
||||
centi: "厘" # 10^-2
|
||||
deci: "分" # 10^-1
|
||||
unit: ""
|
||||
ten:
|
||||
one: "十"
|
||||
other: "十" # 10^1
|
||||
hundred: "百" # 10^2
|
||||
thousand: "千" # 10^3 kilo
|
||||
million: "百萬" # 10^6 mega
|
||||
billion: "十億" # 10^9 giga
|
||||
trillion: "兆" # 10^12 tera
|
||||
quadrillion: "千兆" # 10^15 peta
|
||||
# 10^18 exa, 10^21 zetta, 10^24 yotta
|
||||
|
||||
support:
|
||||
array:
|
||||
words_connector: ", "
|
||||
two_words_connector: " 和 "
|
||||
last_word_connector: ", 和 "
|
||||
select:
|
||||
prompt: "請選擇"
|
||||
|
||||
activerecord:
|
||||
errors:
|
||||
template: # ~ 2.3.5 backward compatible
|
||||
header:
|
||||
one: "有 1 個錯誤發生使得「%{model}」無法被儲存。"
|
||||
other: "有 %{count} 個錯誤發生使得「%{model}」無法被儲存。"
|
||||
body: "以下欄位發生問題:"
|
||||
full_messages:
|
||||
format: "%{attribute} %{message}"
|
||||
messages:
|
||||
inclusion: "沒有包含在列表中"
|
||||
exclusion: "是被保留的關鍵字"
|
||||
invalid: "是無效的"
|
||||
confirmation: "不符合確認值"
|
||||
accepted: "必須是可被接受的"
|
||||
empty: "不能留空"
|
||||
blank: "不能是空白字元"
|
||||
too_long: "過長(最長是 %{count} 個字)"
|
||||
too_short: "過短(最短是 %{count} 個字)"
|
||||
wrong_length: "字數錯誤(必須是 %{count} 個字)"
|
||||
not_a_number: "不是數字"
|
||||
not_an_integer: "必須是整數"
|
||||
greater_than: "必須大於 %{count}"
|
||||
greater_than_or_equal_to: "必須大於或等於 %{count}"
|
||||
equal_to: "必須等於 %{count}"
|
||||
less_than: "必須小於 %{count}"
|
||||
less_than_or_equal_to: "必須小於或等於 %{count}"
|
||||
odd: "必須是奇數"
|
||||
even: "必須是偶數"
|
||||
taken: "已經被使用"
|
||||
record_invalid: "校驗失敗: %{errors}"
|
||||
|
||||
activemodel:
|
||||
errors:
|
||||
template:
|
||||
header:
|
||||
one: "有 1 個錯誤發生使得「%{model}」無法被儲存。"
|
||||
other: "有 %{count} 個錯誤發生使得「%{model}」無法被儲存。"
|
||||
body: "以下欄位發生問題:"
|
||||
|
||||
errors:
|
||||
format: "%{attribute} %{message}"
|
||||
messages:
|
||||
inclusion: "沒有包含在列表中"
|
||||
exclusion: "是被保留的關鍵字"
|
||||
invalid: "是無效的"
|
||||
confirmation: "不符合確認值"
|
||||
accepted: "必須是可被接受的"
|
||||
empty: "不能留空"
|
||||
blank: "不能是空白字元"
|
||||
too_long: "過長(最長是 %{count} 個字)"
|
||||
too_short: "過短(最短是 %{count} 個字)"
|
||||
wrong_length: "字數錯誤(必須是 %{count} 個字)"
|
||||
not_a_number: "不是數字"
|
||||
not_an_integer: "必須是整數"
|
||||
greater_than: "必須大於 %{count}"
|
||||
greater_than_or_equal_to: "必須大於或等於 %{count}"
|
||||
equal_to: "必須等於 %{count}"
|
||||
less_than: "必須小於 %{count}"
|
||||
less_than_or_equal_to: "必須小於或等於 %{count}"
|
||||
odd: "必須是奇數"
|
||||
even: "必須是偶數"
|
||||
template:
|
||||
header:
|
||||
one: "有 1 個錯誤發生使得「%{model}」無法被儲存。"
|
||||
other: "有 %{count} 個錯誤發生使得「%{model}」無法被儲存。"
|
||||
body: "以下欄位發生問題:"
|
||||
|
||||
helpers:
|
||||
select:
|
||||
prompt: "請選擇"
|
||||
submit:
|
||||
create: "新增%{model}"
|
||||
update: "更新%{model}"
|
||||
submit: "儲存%{model}"
|
||||
|
||||
+17
-5
@@ -2,12 +2,24 @@ 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"
|
||||
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
|
||||
Reference in new issue
Block a user