From 1fcacbb4af5fde791bda39922e0f7e5ef9d11a7c Mon Sep 17 00:00:00 2001 From: chris2tof Date: Sun, 20 Nov 2011 12:59:04 +0800 Subject: [PATCH] Matt's code for NewBlog interface --- .../app/views/panel/blog/posts/index.html.erb | 11 +- .../app/views/panel/blog/posts/new.html.erb | 7 + vendor/plugins/NewBlog/config/locales/en.yml | 129 ++++++++++++++++++ .../plugins/NewBlog/config/locales/zh_tw.yml | 20 +++ 4 files changed, 165 insertions(+), 2 deletions(-) create mode 100644 vendor/plugins/NewBlog/config/locales/en.yml create mode 100644 vendor/plugins/NewBlog/config/locales/zh_tw.yml diff --git a/vendor/plugins/NewBlog/app/views/panel/blog/posts/index.html.erb b/vendor/plugins/NewBlog/app/views/panel/blog/posts/index.html.erb index 346cd133..477429cd 100644 --- a/vendor/plugins/NewBlog/app/views/panel/blog/posts/index.html.erb +++ b/vendor/plugins/NewBlog/app/views/panel/blog/posts/index.html.erb @@ -1,3 +1,11 @@ +<% content_for :secondary do %> + +<% end -%> + +<%= flash_messages %> +

<%= t('blog.list_post') %>

@@ -12,7 +20,7 @@ <% @posts.each do |post| %> - + @@ -22,4 +30,3 @@
-<%= link_to t('blog.new_post'), new_panel_blog_post_path %> \ No newline at end of file diff --git a/vendor/plugins/NewBlog/app/views/panel/blog/posts/new.html.erb b/vendor/plugins/NewBlog/app/views/panel/blog/posts/new.html.erb index 5e6eee2f..fc4e591d 100644 --- a/vendor/plugins/NewBlog/app/views/panel/blog/posts/new.html.erb +++ b/vendor/plugins/NewBlog/app/views/panel/blog/posts/new.html.erb @@ -1,3 +1,10 @@ +<% content_for :secondary do %> + +<% end -%> + +<%= flash_messages %>

<%= t('blog.new_post') %>

<%= form_for @post, :url => panel_blog_posts_path do |f| %> <%= render :partial => 'form', :locals => {:f => f} %> diff --git a/vendor/plugins/NewBlog/config/locales/en.yml b/vendor/plugins/NewBlog/config/locales/en.yml new file mode 100644 index 00000000..3c421024 --- /dev/null +++ b/vendor/plugins/NewBlog/config/locales/en.yml @@ -0,0 +1,129 @@ +# Sample localization file for English. Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +en: + + _locale: English + + add: Add + back: Back + create: Create + delete: Delete + disable: Disable + downloaded: Downloaded + download: Download + edit: Edit + enable: Enable + hide: Hide + homepage: Homepage + no_: "No" + nothing: Nothing + show: Show + sure?: Are you sure? + update: Update + yes_: "Yes" + + blog: + sure?: Sure? + + # admin: + # action: Action + # add_language: Add language + # admin: Admin + # action: Action + # announcement: Announcement + # asset: Asset + # attributes: Attributes + # cant_delete_self: You can not delete yourself. + # cant_revoke_self_admin: You can not revoke your admin role yourself. + # class: Class + # content: Content + # create_error_link: Error when creating link. + # create_error_page: Error when creating page. + # create_success_home: Homepage was successfully created. + # create_success_layout: Layout was successfully created. + # create_success_link: Link was successfully created. + # create_success_page: Page was successfully created. + # create_success_snippet: Snippet was successfully created. + # create_success_user: User was successfully created. + # data: Data + # delete_language: Delete language + # description: Description + # design: Design + # disable_language: Disable language + # editing_home: Editing homepage + # editing_layout: Editing layout + # editing_link: Editing link + # editing_page: Editing page + # editing_snippet: Editing snippet + # editing_user_info: Editing user information + # editing_user_role: Editing user role + # email: Email + # enable_language: Enable language + # file_name: Filename + # file_size: File size + # format: Format + # home: Home + # id: ID + # info: Information + # is_published: Is published + # item: Item + # key: Key + # language: Language + # layout: Layout + # layout_name: Layout name + # list_assets: Assets list + # list_designs: Designs list + # list_items: Items list + # list_puchases: Purchases list + # list_snippets: Snippets list + # list_users: Users list + # list_user_infos: User information list + # list_user_roles: User roles list + # member: Member + # move_down: Move down + # move_up: Move up + # multilingual: Multilingual + # my_avatar: My Avatar + # no_home_page: You don't have a homepage + # no_layout: You don't have a layout + # name: Name + # new_asset: New asset + # new_component: New component + # new_home: New homepage + # new_layout: New layout + # new_link: New link + # new_page: New page + # new_snippet: New snippet + # new_user: New user + # new_user_info: New user information + # new_user_role: New user role + # non_multilingual: Non multilingual + # options: Options + # orig_upload_file: Original filename + # position: Position + # published?: Published? + # purchase: Purchase + # registered: Registered + # role: Role + # roles: Roles + # title: Title + # translation: Translation + # type: Type + # up_to_date: Up-to-date + # update_error_link: Error when updating link. + # update_error_page: Error when updating page. + # update_success_content: Content was successfully updated. + # update_success_home: Homepage was successfully updated. + # update_success_layout: Layout was successfully updated. + # update_success_link: Link was successfully updated. + # update_success_page: Page was successfully updated. + # update_success_snippet: Snippet was successfully updated. + # update_success_user: User was successfully updated. + # url: URL + # user: User + # user_info: User information + # user_panel: User panel + # user_role: User role + + panel: diff --git a/vendor/plugins/NewBlog/config/locales/zh_tw.yml b/vendor/plugins/NewBlog/config/locales/zh_tw.yml new file mode 100644 index 00000000..d34b583d --- /dev/null +++ b/vendor/plugins/NewBlog/config/locales/zh_tw.yml @@ -0,0 +1,20 @@ +zh_tw: + + _locale: 中文 + + add: 新增 + back: 回去 + create: 創造 + delete: 刪除 + disable: 禁用 + edit: 編輯 + enable: 啟用 + hide: 隱藏 + homepage: 首頁 + no_: "No" + nothing: 無 + show: 顯示 + sure?: 您肯定嗎? + update: 更新 + yes_: "Yes" +
<%= post.title %><%= post.body %><%= truncate(post.body,:length=>15) %> <%= 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 %>