From 6543491a537464f35dfb9b66c142bdfe7e92fbfe Mon Sep 17 00:00:00 2001 From: chris Date: Mon, 3 Dec 2012 17:25:27 +0800 Subject: [PATCH 01/41] Save pages to generate page_parts when a layout is updated --- app/models/design/layout.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/models/design/layout.rb b/app/models/design/layout.rb index a782894d..8755b099 100644 --- a/app/models/design/layout.rb +++ b/app/models/design/layout.rb @@ -10,6 +10,7 @@ class Layout < DesignFile embeds_many :layout_parts before_save :parse_layout + after_save :save_pages def content self.file.read.force_encoding("UTF-8") rescue '' @@ -24,5 +25,9 @@ class Layout < DesignFile self.body = html.at_css("body").inner_html parse_body(self) end + + def save_pages + self.design.pages.each(&:save) + end end From bdcfb462941d6747d062161883a2566834d0a925 Mon Sep 17 00:00:00 2001 From: chris Date: Mon, 3 Dec 2012 17:38:55 +0800 Subject: [PATCH 02/41] Fix previous commit --- app/models/design/layout.rb | 2 +- app/models/page.rb | 36 ++++++++++++++++++++---------------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/app/models/design/layout.rb b/app/models/design/layout.rb index 8755b099..817ebc5e 100644 --- a/app/models/design/layout.rb +++ b/app/models/design/layout.rb @@ -27,7 +27,7 @@ class Layout < DesignFile end def save_pages - self.design.pages.each(&:save) + self.design.pages.each(&:generate_parts) end end diff --git a/app/models/page.rb b/app/models/page.rb index bee0700b..404e486f 100644 --- a/app/models/page.rb +++ b/app/models/page.rb @@ -26,26 +26,30 @@ class Page < Item # embeds_many :custom_images, :class_name => 'Image', as: :design_image + def generate_parts + page_design = self.design + parent = self.parent + menu_part = parent.page_parts.detect{|page_part| page_part.kind.eql?('public_r_tag') && page_part.public_r_tag.eql?('sub_menu') && page_part.public_r_tag_object_id.eql?(parent.id.to_s)} if parent + page_design.layout.layout_parts.each do |layout_part| + current_part = self.page_parts.detect{|page_part| page_part.name.eql?(layout_part.name)} + current_part = self.page_parts.build(:name => layout_part.name) unless current_part + if menu_part && current_part.name.eql?(menu_part.name) + if current_part.new_record? + current_part.kind = menu_part.kind + current_part.public_r_tag = menu_part.public_r_tag + current_part.public_r_tag_object_id = menu_part.public_r_tag_object_id + else + current_part.update_attributes(:kind => menu_part.kind, :public_r_tag => menu_part.public_r_tag, :public_r_tag_object_id => menu_part.public_r_tag_object_id) + end + end + end + end + protected def create_parts if self.new_record? || self.design_id_changed? - page_design = self.design - parent = self.parent - menu_part = parent.page_parts.detect{|page_part| page_part.kind.eql?('public_r_tag') && page_part.public_r_tag.eql?('sub_menu') && page_part.public_r_tag_object_id.eql?(parent.id.to_s)} if parent - page_design.layout.layout_parts.each do |layout_part| - current_part = self.page_parts.detect{|page_part| page_part.name.eql?(layout_part.name)} - current_part = self.page_parts.build(:name => layout_part.name) unless current_part - if menu_part && current_part.name.eql?(menu_part.name) - if current_part.new_record? - current_part.kind = menu_part.kind - current_part.public_r_tag = menu_part.public_r_tag - current_part.public_r_tag_object_id = menu_part.public_r_tag_object_id - else - current_part.update_attributes(:kind => menu_part.kind, :public_r_tag => menu_part.public_r_tag, :public_r_tag_object_id => menu_part.public_r_tag_object_id) - end - end - end + generate_parts end end From 2757044c321b86d6e9b4163995ecc30b609b0080 Mon Sep 17 00:00:00 2001 From: chris Date: Mon, 3 Dec 2012 17:49:26 +0800 Subject: [PATCH 03/41] Forgot to save the page_parts --- app/models/page.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/page.rb b/app/models/page.rb index 404e486f..09f7899d 100644 --- a/app/models/page.rb +++ b/app/models/page.rb @@ -38,6 +38,7 @@ class Page < Item current_part.kind = menu_part.kind current_part.public_r_tag = menu_part.public_r_tag current_part.public_r_tag_object_id = menu_part.public_r_tag_object_id + current_part.save else current_part.update_attributes(:kind => menu_part.kind, :public_r_tag => menu_part.public_r_tag, :public_r_tag_object_id => menu_part.public_r_tag_object_id) end From 5c7f1aa1648ef55800faf16ca2e30ef59315f755 Mon Sep 17 00:00:00 2001 From: chris Date: Mon, 3 Dec 2012 18:42:50 +0800 Subject: [PATCH 04/41] Fix saving of page_part after layout change --- app/models/page.rb | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/app/models/page.rb b/app/models/page.rb index 09f7899d..7797b237 100644 --- a/app/models/page.rb +++ b/app/models/page.rb @@ -28,20 +28,10 @@ class Page < Item def generate_parts page_design = self.design - parent = self.parent - menu_part = parent.page_parts.detect{|page_part| page_part.kind.eql?('public_r_tag') && page_part.public_r_tag.eql?('sub_menu') && page_part.public_r_tag_object_id.eql?(parent.id.to_s)} if parent page_design.layout.layout_parts.each do |layout_part| current_part = self.page_parts.detect{|page_part| page_part.name.eql?(layout_part.name)} current_part = self.page_parts.build(:name => layout_part.name) unless current_part - if menu_part && current_part.name.eql?(menu_part.name) - if current_part.new_record? - current_part.kind = menu_part.kind - current_part.public_r_tag = menu_part.public_r_tag - current_part.public_r_tag_object_id = menu_part.public_r_tag_object_id - current_part.save - else - current_part.update_attributes(:kind => menu_part.kind, :public_r_tag => menu_part.public_r_tag, :public_r_tag_object_id => menu_part.public_r_tag_object_id) - end + current_part.save if current_part.new_record? end end end @@ -50,7 +40,22 @@ class Page < Item def create_parts if self.new_record? || self.design_id_changed? - generate_parts + page_design = self.design + parent = self.parent + menu_part = parent.page_parts.detect{|page_part| page_part.kind.eql?('public_r_tag') && page_part.public_r_tag.eql?('sub_menu') && page_part.public_r_tag_object_id.eql?(parent.id.to_s)} if parent + page_design.layout.layout_parts.each do |layout_part| + current_part = self.page_parts.detect{|page_part| page_part.name.eql?(layout_part.name)} + current_part = self.page_parts.build(:name => layout_part.name) unless current_part + if menu_part && current_part.name.eql?(menu_part.name) + if current_part.new_record? + current_part.kind = menu_part.kind + current_part.public_r_tag = menu_part.public_r_tag + current_part.public_r_tag_object_id = menu_part.public_r_tag_object_id + else + current_part.update_attributes(:kind => menu_part.kind, :public_r_tag => menu_part.public_r_tag, :public_r_tag_object_id => menu_part.public_r_tag_object_id) + end + end + end end end From 4f9aa630455ebc0da09e27b4e7e95fe23c4e0856 Mon Sep 17 00:00:00 2001 From: chris Date: Mon, 3 Dec 2012 18:45:32 +0800 Subject: [PATCH 05/41] Remove extra end --- app/models/page.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/models/page.rb b/app/models/page.rb index 7797b237..f6e95a03 100644 --- a/app/models/page.rb +++ b/app/models/page.rb @@ -31,8 +31,7 @@ class Page < Item page_design.layout.layout_parts.each do |layout_part| current_part = self.page_parts.detect{|page_part| page_part.name.eql?(layout_part.name)} current_part = self.page_parts.build(:name => layout_part.name) unless current_part - current_part.save if current_part.new_record? - end + current_part.save if current_part.new_record? end end From fbe2b26e9f94ac39a8f7306898bbe66cd3856aa3 Mon Sep 17 00:00:00 2001 From: chris Date: Mon, 3 Dec 2012 18:59:32 +0800 Subject: [PATCH 06/41] Do not create layout part if it already exists --- lib/parsers/parser_layout.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/parsers/parser_layout.rb b/lib/parsers/parser_layout.rb index 817bf327..d3f6fb72 100644 --- a/lib/parsers/parser_layout.rb +++ b/lib/parsers/parser_layout.rb @@ -5,7 +5,7 @@ module ParserLayout body = Nokogiri::HTML(layout.body) body.css('.page_content').each do |content| - layout.layout_parts.build(:name => content['name']) + layout.layout_parts.build(:name => content['name']) unless layout.layout_parts.detect{|layout_part| layout_part.name.eql?(content['name'])} end body.css('.page_menu').each do |menu| From 9254b9960d51fa4a0baf04a1df5241aa7ef3bcea Mon Sep 17 00:00:00 2001 From: chris Date: Mon, 3 Dec 2012 21:45:00 +0800 Subject: [PATCH 07/41] Add timeout to user --- app/models/user/user.rb | 2 +- config/initializers/devise.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/user/user.rb b/app/models/user/user.rb index 0adf4691..100f851f 100644 --- a/app/models/user/user.rb +++ b/app/models/user/user.rb @@ -3,7 +3,7 @@ class User include Mongoid::Document include Mongoid::Timestamps - devise :database_authenticatable, :recoverable, :rememberable, :trackable, :registerable + devise :database_authenticatable, :recoverable, :rememberable, :trackable, :registerable, :timeoutable mount_uploader :avatar, AvatarUploader diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 817f12ea..d316396c 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -80,6 +80,7 @@ Devise.setup do |config| # The time you want to timeout the user session without activity. After this # time the user will be asked for credentials again. # config.timeout_in = 10.minutes + config.timeout_in = 10.minutes # ==> Configuration for :lockable # Defines which strategy will be used to lock an account. From 9c6c622a49e444979d0f12419eee219ffeee5b0e Mon Sep 17 00:00:00 2001 From: chris Date: Mon, 3 Dec 2012 22:31:00 +0800 Subject: [PATCH 08/41] Add missing icons and css for icons in layout --- app/assets/stylesheets/desktop.css | 1 + app/assets/stylesheets/site_editor.css.erb | 1 + app/helpers/admin/items_helper.rb | 2 +- app/views/layouts/_orbit_bar.html.erb | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/desktop.css b/app/assets/stylesheets/desktop.css index 48c2ee6a..3150f23c 100644 --- a/app/assets/stylesheets/desktop.css +++ b/app/assets/stylesheets/desktop.css @@ -12,4 +12,5 @@ *= require desktopmedia *= require orbitTimeline *= require orbit-bar + *= require icons */ \ No newline at end of file diff --git a/app/assets/stylesheets/site_editor.css.erb b/app/assets/stylesheets/site_editor.css.erb index 6506589e..5f571af4 100644 --- a/app/assets/stylesheets/site_editor.css.erb +++ b/app/assets/stylesheets/site_editor.css.erb @@ -13,4 +13,5 @@ *= require scroll_style *= require site_items *= require sidebar + *= require icons */ \ No newline at end of file diff --git a/app/helpers/admin/items_helper.rb b/app/helpers/admin/items_helper.rb index 2f46b15f..6763cff2 100644 --- a/app/helpers/admin/items_helper.rb +++ b/app/helpers/admin/items_helper.rb @@ -12,7 +12,7 @@ module Admin::ItemsHelper end ret << "
  • " # ret << "" - ret << "
    " + ret << "
    " ret << (link_to node.title, dest, :class => 'js_history') ret << "
    " ret << (link_to t(:edit), eval("edit_admin_#{node.class.to_s.downcase}_path(node)"), :class => 'js_history') if node.class.to_s.eql?('Page') diff --git a/app/views/layouts/_orbit_bar.html.erb b/app/views/layouts/_orbit_bar.html.erb index 6e498480..252af34c 100644 --- a/app/views/layouts/_orbit_bar.html.erb +++ b/app/views/layouts/_orbit_bar.html.erb @@ -54,7 +54,7 @@
  • <% else %> \ No newline at end of file diff --git a/app/views/admin/ad_banners/_modal_ad_banner_form.html.erb b/app/views/admin/ad_banners/_modal_ad_banner_form.html.erb index dc77bc5f..dc35a704 100644 --- a/app/views/admin/ad_banners/_modal_ad_banner_form.html.erb +++ b/app/views/admin/ad_banners/_modal_ad_banner_form.html.erb @@ -25,7 +25,7 @@
    <%= f.label :best_size, t('ad.best_size'),:class => "control-label" %>
    - <%= f.text_field :best_size %> Ex: 500px x 300px + <%= f.text_field :best_size %> <%= t('ad.best_size_example') %>
    diff --git a/app/views/admin/ad_banners/_modal_preview.html.erb b/app/views/admin/ad_banners/_modal_preview.html.erb index 3dc98521..adf84adb 100644 --- a/app/views/admin/ad_banners/_modal_preview.html.erb +++ b/app/views/admin/ad_banners/_modal_preview.html.erb @@ -3,7 +3,7 @@ diff --git a/vendor/built_in_modules/personal_research/init.rb b/vendor/built_in_modules/personal_research/init.rb index 18bc59f6..ca9cd058 100644 --- a/vendor/built_in_modules/personal_research/init.rb +++ b/vendor/built_in_modules/personal_research/init.rb @@ -16,7 +16,7 @@ end # :active_for_controllers=> ['news_bulletins', '/panel/news/back_end/tags', 'news_bulletin_categorys', 'news_approvals'], # :active_for_ob_auths_object => ['NewsBulletinCategory'], # :head_link => panel_news_back_end_news_bulletins_path , -# :head_label=> I18n.t('admin.news') +# :head_label=> I18n.t(:news) # context_link :link=>new_panel_news_back_end_news_bulletin_path , # :priority=>1,:label=>I18n.t('announcement.add_new'), diff --git a/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/_writing_seminar.html.erb b/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/_writing_seminar.html.erb index 0814f76d..b9571826 100644 --- a/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/_writing_seminar.html.erb +++ b/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/back_end/writing_seminars/_writing_seminar.html.erb @@ -11,7 +11,7 @@ diff --git a/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/plugin/writing_seminars/_writing_seminar.html.erb b/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/plugin/writing_seminars/_writing_seminar.html.erb index be2d983d..8d001c47 100644 --- a/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/plugin/writing_seminars/_writing_seminar.html.erb +++ b/vendor/built_in_modules/personal_seminar/app/views/panel/personal_seminar/plugin/writing_seminars/_writing_seminar.html.erb @@ -11,7 +11,7 @@ diff --git a/vendor/built_in_modules/personal_seminar/init.rb b/vendor/built_in_modules/personal_seminar/init.rb index 1bd9e9d0..6cb9829f 100644 --- a/vendor/built_in_modules/personal_seminar/init.rb +++ b/vendor/built_in_modules/personal_seminar/init.rb @@ -16,7 +16,7 @@ end # :active_for_controllers=> ['news_bulletins', '/panel/news/back_end/tags', 'news_bulletin_categorys', 'news_approvals'], # :active_for_ob_auths_object => ['NewsBulletinCategory'], # :head_link => panel_news_back_end_news_bulletins_path , -# :head_label=> I18n.t('admin.news') +# :head_label=> I18n.t(:news) # context_link :link=>new_panel_news_back_end_news_bulletin_path , # :priority=>1,:label=>I18n.t('announcement.add_new'), diff --git a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/_web_link.html.erb b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/_web_link.html.erb index 2e4ef99d..7032d761 100644 --- a/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/_web_link.html.erb +++ b/vendor/built_in_modules/web_resource/app/views/panel/web_resource/back_end/web_links/_web_link.html.erb @@ -26,7 +26,7 @@ From e2da22b29c134ca5c4f6eae8c3fbc3b8372f3068 Mon Sep 17 00:00:00 2001 From: chris Date: Tue, 4 Dec 2012 00:17:12 +0800 Subject: [PATCH 10/41] Clean translations --- config/locales/devise.zh_tw.yml | 71 ++-- config/locales/en.yml | 2 +- config/locales/mongoid.zh_tw.yml | 70 ++++ config/locales/rails.yml | 132 ------ config/locales/rails.zh_tw.yml | 202 +++++++++ config/locales/zh_tw.yml | 678 ++++--------------------------- 6 files changed, 392 insertions(+), 763 deletions(-) create mode 100644 config/locales/mongoid.zh_tw.yml delete mode 100644 config/locales/rails.yml create mode 100644 config/locales/rails.zh_tw.yml diff --git a/config/locales/devise.zh_tw.yml b/config/locales/devise.zh_tw.yml index d825f92e..0f2a5ad0 100644 --- a/config/locales/devise.zh_tw.yml +++ b/config/locales/devise.zh_tw.yml @@ -1,43 +1,42 @@ zh_tw: - errors: - messages: - not_found: "沒有找到" - already_confirmed: "已被確認過了" - not_locked: "被鎖定了" - devise: - failure: - unauthenticated: '您需要先註冊、登入後才能繼續。' - unconfirmed: '您的帳號需需要經過確認後,才能繼續。' - ldap_invalid: '您的LDAP帳號錯誤' - ldap_connection_failed: '與LDAP之間連線異常' - ldap_pass_but_account_not_in_orbit: '很抱歉,您的LDAP帳號並不支援在此網站登入' - locked: '您的帳號已被鎖定。' - invalid: 'Email 或密碼是無效的。' - invalid_token: '無效的認證代碼。' - timeout: '您的登入時效過期,請重新登入,才能繼續。' - inactive: '您的帳號尚未被啟用。' - sessions: - signed_in: '成功登入了。' - signed_out: '成功登出了。' - passwords: - send_instructions: '您將在幾分鐘後收到一封電子郵件,內有重新設定密碼的步驟說明。' - updated: '您的密碼已被修改,而您現在已重新登入。' confirmations: - send_instructions: '您將在幾分鐘後收到一封電子郵件,內有確認帳號的步驟說明。' - confirmed: '您的帳號已經過確認,現在您已成功登入。' - registrations: - signed_up: '您已經成功的登錄,確認信件已送至您的 Email 信箱。' - updated: '您已經成功的更新帳號資訊。' - destroyed: '再會!您的帳號已被取消。有緣再會。' - email_not_unique: '已被註冊' - unlocks: - send_instructions: '您將在幾分鐘後收到一封電子郵件,內有將帳號解除鎖定的步驟說明。' - unlocked: '您的帳號已被解鎖,現在您已成功登入。' + confirmed: 您的帳號已經過確認,現在您已成功登入。 + send_instructions: 您將在幾分鐘後收到一封電子郵件,內有確認帳號的步驟說明。 + failure: + already_authenticated: 你已經登入。 + inactive: 您的帳號尚未被啟用。 + invalid: Email 或密碼是無效的。 + invalid_token: 無效的認證代碼。 + locked: 您的帳號已被鎖定。 + timeout: 您的登入時效過期,請重新登入,才能繼續。 + unauthenticated: 您需要先註冊,登入後才能繼續。 + unconfirmed: 您的帳號需需要經過確認後,才能繼續。 mailer: confirmation_instructions: - subject: '確認步驟' + subject: 確認步驟 reset_password_instructions: - subject: '重設密碼步驟' + subject: 重設密碼步驟 unlock_instructions: - subject: '解鎖步驟' + subject: 解鎖步驟 + passwords: + send_instructions: 您將在幾分鐘後收到一封電子郵件,內有重新設定密碼的步驟說明。 + updated: 您的密碼已被修改,而您現在已重新登入。 + registrations: + destroyed: 再會!您的帳號已被取消。有緣再會。 + signed_up: 您已經成功註冊,確認信件已送至您的 Email 信箱。 + updated: 您已經成功的更新帳號資訊。 + sessions: + signed_in: 成功登入了。 + signed_out: 成功登出了。 + unlocks: + send_instructions: 您將在幾分鐘後收到一封電子郵件,內有將帳號解除鎖定的步驟說明。 + unlocked: 您的帳號已被解鎖,現在您已成功登入。 + errors: + messages: + already_confirmed: 已被確認過了 + not_found: 沒有找到 + not_locked: 被鎖定了 + not_saved: + one: 有一個錯誤導致%{resource}不能被儲存: + other: 有 %{count} 個錯誤導致%{resource}不能被儲存: \ No newline at end of file diff --git a/config/locales/en.yml b/config/locales/en.yml index 23cc4649..6867f090 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -6,7 +6,7 @@ en: denied: app: not_sub_manager: Access Denied for you are not SubManager for this app - not_manager: Access Denied for you are not SubManager for this app + not_manager: Access Denied for you are not Manager for this app not_authed_user: Access Denied for you are not User for this app object: Access Denied for you don't have permission for this object not_admin: Access Denied for you are not Admin diff --git a/config/locales/mongoid.zh_tw.yml b/config/locales/mongoid.zh_tw.yml new file mode 100644 index 00000000..2d3116eb --- /dev/null +++ b/config/locales/mongoid.zh_tw.yml @@ -0,0 +1,70 @@ +zh_tw: + mongoid: + errors: + messages: + blank: + 不能为空 + callbacks: + "Calling %{method} on %{klass} resulted in a false return from a callback." + taken: + 已占用 + document_not_found: + 没有发现类是%{klass}id(s)是%{identifiers}的文档 + eager_load: + "Eager loading :%{name} is not supported due to it being a many-to-many + or polymorphic belongs_to relation." + invalid_database: + 数据库应该是Mongo::DB,而不是%{name}. + invalid_time: + "'%{value}' is not a valid Time." + invalid_type: + 在类%{klass}中定义了字段,实际值是%{value}的%{other}. + invalid_options: + "Invalid option :%{invalid} provided to relation :%{name}. Valid options + are: %{valid}." + unsupported_version: + MongoDB %{version} 版本已过期,请升级到 %{mongo_version}. + validations: + 校验失败 - %{errors}. + invalid_collection: + 不允许直接访问嵌入式的集合%{klass} , 请从文档的根访问集合. + invalid_field: + 字段的名字不允许为 %{name}. 你不应该定义跟Mongoid内部属性或者方法相同的名字,详细请看Use Document#instance_methods. + too_many_nested_attribute_records: + 被关联的%{association} 嵌入式属性不能超过 %{limit}. + embedded_in_must_have_inverse_of: + embedded_in的关联属性必须包含inverse_of. + dependent_only_references_one_or_many: + dependent => destroy|delete 选项只有在references_one或者references_many时候有效. + association_cant_have_inverse_of: + 在当前的关联中,不允许定义inverse_of去,其只有在embedded_in或者references_many是数组的情况下使用 + unsaved_document: + You cannot call create or create! through a relational association + relation (%{document}) who's parent (%{base}) is not already saved. + mixed_relations: + Referencing a(n) %{embedded} document from the %{root} document via a + relational association is not allowed since the %{embedded} is embedded. + no_environment: + "Mongoid attempted to find the appropriate environment but no Rails.env, + Sinatra::Base.environment, or RACK_ENV could be found." + scope_overwrite: + "Cannot create scope :%{scope_name}, because of existing method + %{model_name}.%{scope_name}." + blank_on_locale: "can't be blank in %{in_locale}" + + + models: + news_bulletin: 新聞 + bulletin: 公告 + ad_banner: 廣告輪播 + web_link: 連結管理 + attributes: + news_bulletin: + title: 新聞標題 + bulletin: + title: 公告標題 + ad_banner: + title: 標題 + web_link: + title: 名稱 + url: 路徑 diff --git a/config/locales/rails.yml b/config/locales/rails.yml deleted file mode 100644 index 058a48e8..00000000 --- a/config/locales/rails.yml +++ /dev/null @@ -1,132 +0,0 @@ -# Chinese (Taiwan) translations for Ruby on Rails -# by tsechingho (http://github.com/tsechingho) - -:zh_tw: - 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}} 年多" - prompts: - year: "年" - month: "月" - day: "日" - hour: "時" - minute: "分" - second: "秒" - - number: - format: - separator: "." - delimiter: "," - precision: 3 - currency: - format: - format: "%u %n" - unit: "NT$" - separator: "." - delimiter: "," - precision: 2 - percentage: - format: - delimiter: "" - precision: - format: - delimiter: "" - human: - format: - delimiter: "" - precision: 1 - storage_units: - format: "%n %u" - units: - byte: - one: "Byte" - other: "Bytes" - kb: "KB" - mb: "MB" - gb: "GB" - tb: "TB" - - support: - array: - words_connector: ", " - two_words_connector: " 和 " - last_word_connector: ", 和 " - - activerecord: - errors: - template: - header: - one: "有 1 個錯誤發生使得「{{model}}」無法被儲存。" - other: "有 {{count}} 個錯誤發生使得「{{model}}」無法被儲存。" - body: "下面欄位有問題:" - messages: - inclusion: "沒有包含在列表中" - exclusion: "是被保留的" - invalid: "是無效的" - confirmation: "不符合確認值" - accepted: "必須是可被接受的" - empty: "不能留空" - blank: "不能是空白字元" - too_long: "過長(最長是 {{count}} 個字)" - too_short: "過短(最短是 {{count}} 個字)" - wrong_length: "字數錯誤(必須是 {{count}} 個字)" - taken: "已經被使用" - not_a_number: "不是數字" - greater_than: "必須大於 {{count}}" - greater_than_or_equal_to: "必須大於或等於 {{count}}" - equal_to: "必須等於 {{count}}" - less_than: "必須小於 {{count}}" - less_than_or_equal_to: "必須小於或等於 {{count}}" - odd: "必須是奇數" - even: "必須是偶數" - - diff --git a/config/locales/rails.zh_tw.yml b/config/locales/rails.zh_tw.yml new file mode 100644 index 00000000..c1e840af --- /dev/null +++ b/config/locales/rails.zh_tw.yml @@ -0,0 +1,202 @@ +# Chinese (Taiwan) translations for Ruby on Rails +# by tsechingho (http://github.com/tsechingho) + +zh_tw: + date: + abbr_day_names: + - 日 + - 一 + - 二 + - 三 + - 四 + - 五 + - 六 + abbr_month_names: + - + - 1月 + - 2月 + - 3月 + - 4月 + - 5月 + - 6月 + - 7月 + - 8月 + - 9月 + - 10月 + - 11月 + - 12月 + day_names: + - 星期日 + - 星期一 + - 星期二 + - 星期三 + - 星期四 + - 星期五 + - 星期六 + formats: + default: ! '%Y-%m-%d' + long: ! '%Y年%b%d日' + short: ! '%b%d日' + month_names: + - + - 一月 + - 二月 + - 三月 + - 四月 + - 五月 + - 六月 + - 七月 + - 八月 + - 九月 + - 十月 + - 十一月 + - 十二月 + order: + - :year + - :month + - :day + datetime: + distance_in_words: + about_x_hours: + one: 大約一小時 + other: 大約 %{count} 小時 + about_x_months: + one: 大約一個月 + other: 大約 %{count} 個月 + about_x_years: + one: 大約一年 + other: 大約 %{count} 年 + almost_x_years: + one: 接近一年 + other: 接近 %{count} 年 + half_a_minute: 半分鐘 + less_than_x_minutes: + one: 不到一分鐘 + other: 不到 %{count} 分鐘 + less_than_x_seconds: + one: 不到一秒 + other: 不到 %{count} 秒 + over_x_years: + one: 一年多 + other: ! '%{count} 年多' + x_days: + one: 一天 + other: ! '%{count} 天' + x_minutes: + one: 一分鐘 + other: ! '%{count} 分鐘' + x_months: + one: 一個月 + other: ! '%{count} 個月' + x_seconds: + one: 一秒 + other: ! '%{count} 秒' + prompts: + day: 日 + hour: 時 + minute: 分 + month: 月 + second: 秒 + year: 年 + errors: &errors + format: ! '%{attribute} %{message}' + messages: + accepted: 必須是可被接受的 + blank: 不能是空白字元 + confirmation: 不符合確認值 + empty: 不能留空 + equal_to: 必須等於 %{count} + even: 必須是偶數 + exclusion: 是被保留的關鍵字 + greater_than: 必須大於 %{count} + greater_than_or_equal_to: 必須大於或等於 %{count} + inclusion: 沒有包含在列表中 + invalid: 是無效的 + less_than: 必須小於 %{count} + less_than_or_equal_to: 必須小於或等於 %{count} + not_a_number: 不是數字 + not_an_integer: 必須是整數 + odd: 必須是奇數 + record_invalid: ! '校驗失敗: %{errors}' + taken: 已經被使用 + too_long: 過長(最長是 %{count} 個字) + too_short: 過短(最短是 %{count} 個字) + wrong_length: 字數錯誤(必須是 %{count} 個字) + template: + body: 以下欄位發生問題: + header: + one: 有 1 個錯誤發生使得「%{model}」無法被儲存。 + other: 有 %{count} 個錯誤發生使得「%{model}」無法被儲存。 + helpers: + select: + prompt: 請選擇 + submit: + create: 新增%{model} + submit: 儲存%{model} + update: 更新%{model} + number: + currency: + format: + delimiter: ! ',' + format: ! '%u %n' + precision: 2 + separator: . + significant: false + strip_insignificant_zeros: false + unit: NT$ + format: + delimiter: ! ',' + precision: 3 + separator: . + significant: false + strip_insignificant_zeros: false + human: + decimal_units: + format: ! '%n %u' + units: + billion: 十億 + million: 百萬 + quadrillion: 千兆 + thousand: 千 + trillion: 兆 + unit: '' + format: + delimiter: '' + precision: 1 + significant: false + strip_insignificant_zeros: false + storage_units: + format: ! '%n %u' + units: + byte: + one: Byte + other: Bytes + gb: GB + kb: KB + mb: MB + tb: TB + percentage: + format: + delimiter: '' + precision: + format: + delimiter: '' + support: + array: + last_word_connector: ! ', 和 ' + two_words_connector: ! ' 和 ' + words_connector: ! ', ' + time: + am: 上午 + formats: + default: ! '%Y年%b%d日 %A %H:%M:%S %Z' + long: ! '%Y年%b%d日 %H:%M' + short: ! '%b%d日 %H:%M' + pm: 下午 + # remove these aliases after 'activemodel' and 'activerecord' namespaces are removed from Rails repository + activemodel: + errors: + <<: *errors + activerecord: + errors: + <<: *errors \ No newline at end of file diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml index b37b8943..4e289988 100644 --- a/config/locales/zh_tw.yml +++ b/config/locales/zh_tw.yml @@ -13,28 +13,50 @@ zh_tw: account_settings: 帳號設定 action: 操作 ad: + chinese_1: 在套圖中出現次數 1次請輸入1 + chinese_2: 輸入連結 + chinese_3: 輸入標題 ab_fx: 轉場效果 + add_link: Add a reference link banner_best_size: 輪播圖片尺寸 best_size: 最佳尺寸 + best_size_example: "Ex: 500px x 300px" new_image: 新增輪播圖片 not_showing: 沒有顯示 picture_list: 圖片列表 sec_place_holder: 每張輪播圖片顯示秒數(3秒就請輸入3) + select_fx: Select the effect type + set_dates: Set the image to start and end dates + set_range: Set the range time showing: 顯示中 success_destroy_ad_image: 刪除圖片成功 trans_unit_sec: 秒 transition_sec: 轉場單位時間 update_banner: 更新輪播 + upload_pictures: Upload pictures widget_info_for_ad_image_size: "此區塊圖片尺寸使用: %{best_size}" ad_banner: 廣告輪播 add: 新增 + add_attribute_field: Add attribute field + add_image: Add image add_item: 新增項目 + add_member: Add member + add_more: Add more + address_modal: + default_title: 地址 + street_address: 街道地址 + city: 城市 + county: 縣市 + zip: 郵遞區號 + country: 國家/地區 addthis_tools: add_to_bookmark: 加入書籤 admin: 管理員 all_content: 所有內容 all_file: 所有檔案 all_member: 所有會員 + all_plugin_summary: All plugin summary + all_plugins: All plugins always_display_title: 永遠顯示標題 app_auth: list_setting_result: 授權列表 @@ -52,6 +74,7 @@ zh_tw: fail: 刪除次管理員失敗 success: 刪除次管理員成功 failed_no_user: 失敗,不是使用者 + operation_not_permitted: Operation not permitted approval: not_pass: 拒絕 not_pass_reason: 拒絕原因 @@ -61,6 +84,7 @@ zh_tw: user_list: 使用者列表 approval_: 審核 asset: 資產 + attributes: 屬性 auth: add_manager: 新增管理員 add_sub_manager: 新增次管理員 @@ -74,6 +98,7 @@ zh_tw: back: 回上一步 basic: 基本 browse: 瀏覽 + built_in: Built-in cancel: 取消 cant_delete_self: 不可以刪除自己 cant_empty_star: 不能為空白 (*) @@ -82,7 +107,9 @@ zh_tw: category: 類別 category_auth: 類別授權 clear: 清除 + close: Close content: 內容 + courses: 開課數 create: error: link: 建立連結時出錯 @@ -90,24 +117,44 @@ zh_tw: fail: 建立失敗 success: asset_category: 資產類別已成功建立 + co_author: Co-author was successfully created. + link: Link was successfully created. link: 連結已成功建立 page: 頁面已成功建立 user: 使用者已成功建立 create_: 建立 + cross_lang: 跨語言輸入 data: 資料 + date: + calendar: 紀年法 + range: 本欄為時間區段 + format: 格式 + tw_calendar: 民國 + minguo_calendar: + after: 民國 + before: 民前 + first_year: 民國元年 + year: 年 + month: 月 + west_calendar: 西元 + date_: Date dashboard: bulletin: 公告 news_bulletin: 新聞 - page_context: 頁面內容 - web_link: 連結 + page_context: 頁面 + web_link: 鏈接 dashboard_: 儀表版 deadline: 最後期限 default_css: 預設樣式表 - delete: 刪除 - delete_file: 刪除檔案 + delete: + file: 刪除檔案 + success: + paper: Paper was successfully deleted. + delete_: 刪除 description: 描述 desktop: 桌面 disable: 關閉 + disabled: Disabled dots: ●●●●●● download: 下載 downloaded: 已下載 @@ -130,6 +177,7 @@ zh_tw: upload: 上傳檔案 file_: 檔案 file_type: 檔案類型 + followers: Followers forgot_password: 忘記密碼? frequency: 頻率 help: 幫助 @@ -140,10 +188,14 @@ zh_tw: horizontal: 水平的 hot: 熱門 image: 圖片 + images: Images info: 信息 + initial: 起始值 intro: 簡介 is_published: 已發佈 item: 項目 + item_name: Item name + javascripts: Javascripts key: 索引 last_modified: 最後修改者 layout: 範本 @@ -158,25 +210,15 @@ zh_tw: user: 使用者列表 list_: 列表 list_lower: 列表 - address_modal: - default_title: 地址 - street_address: 街道地址 - city: 城市 - county: 縣市 - zip: 郵遞區號 - country: 國家/地區 - langs: - zh_tw: 中文 - en: 英文 lists: markups: - address: 地址欄位 text_field: 文字輸入框 select: 下拉選單 date: 日期 text_area: 文字輸入方塊 radio_button: 單選 checkbox: 多選 + locale: Locale login: 登入 logout: 登出 mail: @@ -191,20 +233,21 @@ zh_tw: user_name: 電子郵件帳號 manager: 管理者 manager: 管理者 - me: 我 + markup: 輸入模式 + markup_options: Markup options + markup_value: Markup value + me: Me member: 會員 menu_enabled_for: 選單啟用 - modal: - close: 關閉 - preview: 預覽 - module: 模組 + module: Module module_authorization: 模組授權 more_plus: 更多+ most_visited_page: 最多瀏覽頁面 multilingual: 多語系 name: 名稱 - nccu_c: - nccu_ldap_uid: 政治大學LDAP帳號 + need_home: You need a home page + neutral_title: Neutral title + neutral_for: Neutral for new: asset: 新增資產 banner: 新增橫幅 @@ -214,6 +257,7 @@ zh_tw: user: 新增使用者 info: 新增使用者資訊 role: 新增使用者角色 + new_: New news: 新聞 no_: "不是" no_deadline: 沒有期限 @@ -233,11 +277,15 @@ zh_tw: text: 文字區域 passed: 通過審核 password: 密碼 + password_confirmation: 確認密碼 pending: 待審核 picture: 圖片 + placeholder: Placeholder + plugins: Plugins postdate: 張貼日期 posted_by: 張貼人 preview: 預覽 + publications: Publications purchase: 購買 quantity: 數量 quick_edit: 快速編輯 @@ -249,9 +297,8 @@ zh_tw: rejected_reason: '拒絕原因:' rejected_reason_empty: "拒絕核准, 沒有參考資訊" related_links: 相關連結 - remember_me: 記住我 - role: 角色 - Roles: 角色 + role: 身份 + roles: 身份 ruling_site: 銳綸網站 search: domains: Google Search Domains @@ -260,12 +307,15 @@ zh_tw: sitesearch: 全站搜尋 too_many: "搜尋有關 ' %{search_word} '尋找到超過 %{exceed_num} 筆資料,請嘗試加入更多關鍵字縮小搜尋範圍,以作更精確的搜尋?" unit_get: "列出由 :%{unit_name}發佈的資料,共有%{item_num}筆" + search_: Search search_google: 搜尋Google - search_nccu: 搜尋政治大學 setup_member: 會員設定 show: 顯示 + show_mode: + index: 清單 + summary: 摘要 + thumbnail: 縮圖 site: - default_image: 預設圖像 description: 網站描述 description_help: '' footer: 網站頁尾 @@ -284,6 +334,7 @@ zh_tw: site_info: 網站資訊 sitemap: 網站地圖 site_name: 網站名稱 + size: Size start: 開始 start_date: 開始日期 statistics: 統計資訊 @@ -301,6 +352,7 @@ zh_tw: module_page_lang_not_support: "很抱歉,此頁面沒有開放中文版本" not_previewable: "不支援預覽" preview_only_for_img: "預覽僅支援:jpg,png,gif,bmp等圖片格式" + sys_basic_form: 系統基本資料表 system_info: 系統資訊 tag_cloud: 標籤雲 tags: 標籤 @@ -315,18 +367,20 @@ zh_tw: traffic: 流量 type: 類型 unit_name: 單位名稱 + unzip_success: "App unzip procress is finished, please restart the server to apply effect" up_to_date: 最新版本 update: error: link: 更新連接時出錯 fail: 更新消息 success: + co_author: Co-author was successfully updated. content: 內容已更新成功 link: 連結已更新成功 page: 頁面已更新成功 - user: 使用者已更新成功 - success_: 更新成功 - update_: 更新 + paper: Paper was successfully updated. + user: User was successfully updated. + success_: S使用者已更新成功 update_at: 最後更新時間 url: 網址 use_status: '' @@ -340,567 +394,3 @@ zh_tw: visitors_this_year: 今年造訪人次 visitors_today: 今日造訪人次 yes_: "是" - - nccu: - date: 起迄日期 - file: 附加檔案 - file_description: 檔案描述 - file_name: 檔案名稱 - link_name: 連結名稱 - picture: 刊頭圖片 - selected_file: 選擇檔案 - tags: 頁籤 - url: 連結位置 - - - - - - -# : <<<<<<< HEAD -# : ======= - errors: - at_least_one: 必須至少有一個值 - admin: - infos: - add_attribute_field: 新增 - save: 儲存 - initial: 起始值 - markup: 輸入模式 - item_name: 資料表名稱 - name: 名稱 - options: 選項 - :cross_lang: 跨語言輸入 - add_more: 使用者可自行延伸欄位 - add: 新增 - placeholder: 輸入協助 - type: 類型 - placeholder: 提示內容 - list: 自定選單 - is_range: 是 - not_range: 否 - date: - calendar: 紀年法 - range: 本欄為時間區段 - format: 格式 - tw_calendar: 民國 - minguo_calendar: - after: 民國 - before: 民前 - first_year: 民國元年 - year: 年 - month: 月 - west_calendar: 西元 - access: - denied: - app: - not_sub_manager: 拒絕存取因你不是此應用程式次管理員 - not_manager: 拒絕存取因你不是此應用程式管理員 - not_authed_user: 拒絕存取因你不是此應用程式授權使用者 - not_admin: 拒絕存取因你不是此應用程式次管理員 - object: 拒絕存取因你不是網站管理者 - action: 操作 - ad_banner: 廣告輪播 - orbit_gallery: 活動花絮 - ad: - sec_place_holder: 3秒請輸入3 - ab_fx: 轉場特效 - all_banners: 輪播清單 - banner_best_size: Banner 尺寸 - best_size: 最佳尺寸 - cate_auth: 分類授權 - delete_banner: 刪除整組輪播 - new_banner: 新增輪播 - new_image: 新增橫幅 - showing: 顯示中 - not_showing: 沒有顯示 - picture_list: 圖片列表 - title: 標題 - transition_sec: 轉場單位時間 - trans_unit_sec: 秒 - update_banner: 更新輪播 - widget_info_for_ad_image_size: "此區塊圖片尺寸請使用 %{best_size}" - add: 新增 - add_item: 新增項目 - add_language: 新增語言 - add_drop_down_item: +增加Orbit選單 - admin: 網站管理者 - all_articles: 列表 - always_display_title: 永遠顯示於標題列 - announcement: 公告管理 - asset: 資產 - assets: - file: 檔案 - album: 相簿 - video: 影片 - book: 書籍 - attributes: 屬性 - author: 作者 - calendar: 行事曆 - cant_delete_self: 您不可以刪除自己。 - cant_revoke_self_admin: 您不可以撤銷自己的管理身份。 - category: 類別 - choose_file: 請選擇一個文件... - class: 階級 - content: 內容 - contenteditable: - update_done: 更新完成 - update_failed: 更新失敗 - create_error_link: 新增連接時出錯。 - create_error_page: 新增頁面時出錯。 - create_success_home: 首頁已成功新增。 - create_success_layout: 樣板已成功新增。 - create_success_link: 連結已成功新增。 - create_success_page: 頁面已成功新增。 - create_success_home: 首頁已成功新增。 - create_success_layout: 佈局已成功新增。 - create_success_link: 連結已成功新增。 - create_success_page: 頁面已成功新增。 - create_success_snippet: 片段已成功新增。 - create_success_user: 用戶已成功新增。。 - dashboard: 儀表板 - data: 選擇檔案 - delete_language: 刪除語言 - description: 描述 - design: 版型管理 - disable_language: 禁用語言 - edit: 編輯 - editing_home: 編輯首頁 - editing_layout: 編輯樣板 - editing_link: 編輯連結 - editing_page: 編輯頁面 - editing_snippet: 編輯片段 - editing_info: 編輯用戶資料 - editing_role: 編輯用戶身份 - email: Email - enable_language: 啟用語言 - enabled_for: 啟用 - file_name: 檔名 - file_size: 檔案大小 - file_upload: 文件上載 - format: 格式 - home: 首頁 - id: ID - info: 資料 - intro: 簡介 - is_published: 被出版 - item: 網站架構 - key: 關鍵 - keywords: 關鍵字 - language: 語言 - layout: 佈局 - layout_name: 佈局名字 - link: 連結管理 - links: 網路資源 - list_assets: 資產列表 - list_designs: 設計列表 - list_items: 項目列表 - list_puchases: 購買清單 - list_snippets: 斷片列表 - list_users: 使用列表 - list_infos: 用戶資料列表 - list_roles: 用戶身份列表 - mail_address: 郵件地址 - mail_port: 傳輸埠 - mail_domain: 網域名稱 - mail_authentication: 認證 - mail_user_name: 帳號 - mail_password: 密碼 - mail_tls: TLS - mail_enable_starttls_auto: Enable Start TLS Auto - member: 會員 - menu_enabled_for: 選單啟用 - module: - authorization: 模組授權 - move_down: 往下移 - move_up: 往上移 - multilingual: 多種語言 - my_avatar: 我的頭像 - no_home_page: 您沒有首頁 - no_layout: 您沒有佈局 - name: 名稱 - new_admin: - side_bar: - all_user: 所有使用者 - add_user: 新增使用者 - user_roles: 角色 - user_info: 使用者資訊 - user: 會員 - users: - all_plugin_summary: 全部 - profile: 基本資料 - roles: - staff: 職員資料 - student: 學生資料 - teacher: 教師資料 - action: - add: 新增 - edit: 編輯 - delete: 刪除 - quick_edit: 快速編輯 - next: 下一頁 - prev: 上一頁 - attributes: - roles: 角色 - name: 名稱 - publications: 出版數 - courses: 開課數 - followers: 被關注數 - show_mode: - index: 清單 - summary: 摘要 - thumbnail: 縮圖 - table_header: - status: 狀態 - category: 分類 - tags: 標籤 - clear_filter: 重置 - new_asset: 新增資產 - new_component: 新增元件 - new_design: 新設計 - new_home: 新增首頁 - new_layout: 新增樣板 - new_link: 新增連結 - new_page: 新增頁面 - new_snippet: 新增片段 - new_user: 新增使用 - new_info: 新增用戶資料 - new_role: 新增用戶身份 - news: 新聞 - non_multilingual: - object_auth: - list_title_of_users: 授權清單-%{auth_title} - update_done: 更新完成,結果顯示於清單 - update_failed: 更新失敗 - options: 選項 - orig_upload_file: 原上傳檔名 - page: 頁面管理 - page_context: - edit: 編輯 - ob_auth: - edit: 分類授權 - page_part_kinds: - text: 文字區塊 - public_r_tag: 系統模塊 - module_widget: 外掛模塊 - position: 位置 - published?: 發布? - purchase: 購買 - role: 身份 - roles: 身份 - site_description: 網站描述 - site_footer: 網站頁尾 - site_settings: 基本設定 - site_sub_menu: 網站次選單 - site_title: 網站標題 - setup_member: 成員設置 - setup_translations: 語系設定 - setup_designs: 版型設定 - site: 網站 - site_setting: 網站設定 - super_pages: 可編頁面 - structure: 網站結構 - tags: 標籤 - title: 標題 - translation: 翻譯 - type: 類型 - up_to_date: 最新版本 - 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: 用戶已成功更新 - upload_design: 上傳設計 - url: URL - user: 用戶 - user_new_interface: - sys_basic_form: 系統基本資料表 - password: 密碼 - password_confirmation: 確認密碼 - email: 使用者帳號信箱 - user_role: - auth: - all_member: 所有會員 - manager: 管理員 - sub_manager: 次管理員 - by_role: 根據身份 - by_sub_role: 根據次身份 - block_list: 封鎖名單 - add_manager: 增加到管理員 - add_sub_manager: 增加到次管理員 - add_to_block_list: 封鎖名單 - add_to_privilege_list: 特許名單 - auth_by: -由%{user_display_name}授權 - user: 使用會員 - info: 用戶資料 - panel: 用戶面板 - role: 用戶身份 - - dashboard: - bulletin: 公告 - news_bulletin: 新聞 - page_context: 頁面 - web_link: 鏈接 - - panel: - - - -# : >>>>>>> various_bugs -# 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: "請選擇" - - search: - not_found: "沒有搜尋結果" - domains: Google Search Domains - site_search: "全站搜尋" - sitesearch: Google Site Search - site_setting_help: 請輸入送交Google搜尋的參數 - result_get: "搜尋有關 ' %{search_word} ' 共搜尋到%{item_num}筆資料" - too_many: "搜尋有關 ' %{search_word} ' 尋找到超過 %{exceed_num} 筆資料,請嘗試加入更多關鍵字縮小搜尋範圍,以作更精確的搜尋" - - result_get: "搜尋標題有關 ' %{search_word} ' 共搜尋到%{item_num}筆資料" - unit_get: "列出由:%{unit_name}發佈的資料,共有%{item_num}筆" - 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: "以下欄位發生問題:" - -# : <<<<<<< HEAD - mongoid: - models: - news_bulletin: 新聞 - bulletin: 公告 - ad_banner: 廣告輪播 - web_link: 連結管理 - attributes: - news_bulletin: - title: 新聞標題 - bulletin: - title: 公告標題 - ad_banner: - title: 標題 - web_link: - title: 名稱 - url: 路徑 -# : ======= - helpers: - select: - prompt: "請選擇" - submit: - create: "新增%{model}" - update: "更新%{model}" - submit: "儲存%{model}" - modal: - save_and_close: "儲存並關閉" - close: "關閉" - preview: "預覽" - sys: - not_previewable: "不支援預覽" - limit_of_upload_file_size: "上傳檔案大小限制: %{best_size}" - preview_only_for_img: "預覽僅支援:jpg,png,gif,bmp...等圖片格式" - can_not_display_due_to_no_context: "因為沒有中文版本,所以無法顯示" - module_page_lang_not_support: "很抱歉,本頁沒有開放中文版本" - object_disable: - change_to_true: "設為停用" - change_to_false: "重新啓用" -# : >>>>>>> various_bugs From 5a9d9151d9a60fdaeebdc61071a702f57cbaab34 Mon Sep 17 00:00:00 2001 From: Rueshyna Date: Wed, 28 Nov 2012 11:45:23 +0800 Subject: [PATCH 11/41] add journal list template --- .../desktop/journal_lists_controller.rb | 83 +++++++++ app/helpers/desktop/journal_lists_helper.rb | 2 + .../desktop/journal_lists/_form.html.erb | 17 ++ app/views/desktop/journal_lists/edit.html.erb | 6 + .../desktop/journal_lists/index.html.erb | 21 +++ app/views/desktop/journal_lists/new.html.erb | 5 + app/views/desktop/journal_lists/show.html.erb | 5 + .../desktop/journal_lists_controller_spec.rb | 164 ++++++++++++++++++ .../desktop/journal_lists_helper_spec.rb | 15 ++ .../desktop/desktop_journal_lists_spec.rb | 11 ++ .../desktop/journal_lists_routing_spec.rb | 35 ++++ .../journal_lists/edit.html.erb_spec.rb | 15 ++ .../journal_lists/index.html.erb_spec.rb | 15 ++ .../journal_lists/new.html.erb_spec.rb | 15 ++ .../journal_lists/show.html.erb_spec.rb | 12 ++ 15 files changed, 421 insertions(+) create mode 100644 app/controllers/desktop/journal_lists_controller.rb create mode 100644 app/helpers/desktop/journal_lists_helper.rb create mode 100644 app/views/desktop/journal_lists/_form.html.erb create mode 100644 app/views/desktop/journal_lists/edit.html.erb create mode 100644 app/views/desktop/journal_lists/index.html.erb create mode 100644 app/views/desktop/journal_lists/new.html.erb create mode 100644 app/views/desktop/journal_lists/show.html.erb create mode 100644 spec/controllers/desktop/journal_lists_controller_spec.rb create mode 100644 spec/helpers/desktop/journal_lists_helper_spec.rb create mode 100644 spec/requests/desktop/desktop_journal_lists_spec.rb create mode 100644 spec/routing/desktop/journal_lists_routing_spec.rb create mode 100644 spec/views/desktop/journal_lists/edit.html.erb_spec.rb create mode 100644 spec/views/desktop/journal_lists/index.html.erb_spec.rb create mode 100644 spec/views/desktop/journal_lists/new.html.erb_spec.rb create mode 100644 spec/views/desktop/journal_lists/show.html.erb_spec.rb diff --git a/app/controllers/desktop/journal_lists_controller.rb b/app/controllers/desktop/journal_lists_controller.rb new file mode 100644 index 00000000..f4a0d980 --- /dev/null +++ b/app/controllers/desktop/journal_lists_controller.rb @@ -0,0 +1,83 @@ +class Desktop::JournalListsController < ApplicationController + # GET /desktop/journal_lists + # GET /desktop/journal_lists.json + def index + @desktop_journal_lists = Desktop::JournalList.all + + respond_to do |format| + format.html # index.html.erb + format.json { render json: @desktop_journal_lists } + end + end + + # GET /desktop/journal_lists/1 + # GET /desktop/journal_lists/1.json + def show + @desktop_journal_list = Desktop::JournalList.find(params[:id]) + + respond_to do |format| + format.html # show.html.erb + format.json { render json: @desktop_journal_list } + end + end + + # GET /desktop/journal_lists/new + # GET /desktop/journal_lists/new.json + def new + @desktop_journal_list = Desktop::JournalList.new + + respond_to do |format| + format.html # new.html.erb + format.json { render json: @desktop_journal_list } + end + end + + # GET /desktop/journal_lists/1/edit + def edit + @desktop_journal_list = Desktop::JournalList.find(params[:id]) + end + + # POST /desktop/journal_lists + # POST /desktop/journal_lists.json + def create + @desktop_journal_list = Desktop::JournalList.new(params[:desktop_journal_list]) + + respond_to do |format| + if @desktop_journal_list.save + format.html { redirect_to @desktop_journal_list, notice: 'Journal list was successfully created.' } + format.json { render json: @desktop_journal_list, status: :created, location: @desktop_journal_list } + else + format.html { render action: "new" } + format.json { render json: @desktop_journal_list.errors, status: :unprocessable_entity } + end + end + end + + # PUT /desktop/journal_lists/1 + # PUT /desktop/journal_lists/1.json + def update + @desktop_journal_list = Desktop::JournalList.find(params[:id]) + + respond_to do |format| + if @desktop_journal_list.update_attributes(params[:desktop_journal_list]) + format.html { redirect_to @desktop_journal_list, notice: 'Journal list was successfully updated.' } + format.json { head :ok } + else + format.html { render action: "edit" } + format.json { render json: @desktop_journal_list.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /desktop/journal_lists/1 + # DELETE /desktop/journal_lists/1.json + def destroy + @desktop_journal_list = Desktop::JournalList.find(params[:id]) + @desktop_journal_list.destroy + + respond_to do |format| + format.html { redirect_to desktop_journal_lists_url } + format.json { head :ok } + end + end +end diff --git a/app/helpers/desktop/journal_lists_helper.rb b/app/helpers/desktop/journal_lists_helper.rb new file mode 100644 index 00000000..e21dc09f --- /dev/null +++ b/app/helpers/desktop/journal_lists_helper.rb @@ -0,0 +1,2 @@ +module Desktop::JournalListsHelper +end diff --git a/app/views/desktop/journal_lists/_form.html.erb b/app/views/desktop/journal_lists/_form.html.erb new file mode 100644 index 00000000..ac7f7ac6 --- /dev/null +++ b/app/views/desktop/journal_lists/_form.html.erb @@ -0,0 +1,17 @@ +<%= form_for(@desktop_journal_list) do |f| %> + <% if @desktop_journal_list.errors.any? %> +
    +

    <%= pluralize(@desktop_journal_list.errors.count, "error") %> prohibited this desktop_journal_list from being saved:

    + +
      + <% @desktop_journal_list.errors.full_messages.each do |msg| %> +
    • <%= msg %>
    • + <% end %> +
    +
    + <% end %> + +
    + <%= f.submit %> +
    +<% end %> diff --git a/app/views/desktop/journal_lists/edit.html.erb b/app/views/desktop/journal_lists/edit.html.erb new file mode 100644 index 00000000..d628e895 --- /dev/null +++ b/app/views/desktop/journal_lists/edit.html.erb @@ -0,0 +1,6 @@ +

    Editing desktop_journal_list

    + +<%= render 'form' %> + +<%= link_to 'Show', @desktop_journal_list %> | +<%= link_to 'Back', desktop_journal_lists_path %> diff --git a/app/views/desktop/journal_lists/index.html.erb b/app/views/desktop/journal_lists/index.html.erb new file mode 100644 index 00000000..618d2ae1 --- /dev/null +++ b/app/views/desktop/journal_lists/index.html.erb @@ -0,0 +1,21 @@ +

    Listing desktop_journal_lists

    + + + + + + + + +<% @desktop_journal_lists.each do |desktop_journal_list| %> + + + + + +<% end %> +
    <%= link_to 'Show', desktop_journal_list %><%= link_to 'Edit', edit_desktop_journal_list_path(desktop_journal_list) %><%= link_to 'Destroy', desktop_journal_list, confirm: 'Are you sure?', method: :delete %>
    + +
    + +<%= link_to 'New Journal list', new_desktop_journal_list_path %> diff --git a/app/views/desktop/journal_lists/new.html.erb b/app/views/desktop/journal_lists/new.html.erb new file mode 100644 index 00000000..95017361 --- /dev/null +++ b/app/views/desktop/journal_lists/new.html.erb @@ -0,0 +1,5 @@ +

    New desktop_journal_list

    + +<%= render 'form' %> + +<%= link_to 'Back', desktop_journal_lists_path %> diff --git a/app/views/desktop/journal_lists/show.html.erb b/app/views/desktop/journal_lists/show.html.erb new file mode 100644 index 00000000..d454b78f --- /dev/null +++ b/app/views/desktop/journal_lists/show.html.erb @@ -0,0 +1,5 @@ +

    <%= notice %>

    + + +<%= link_to 'Edit', edit_desktop_journal_list_path(@desktop_journal_list) %> | +<%= link_to 'Back', desktop_journal_lists_path %> diff --git a/spec/controllers/desktop/journal_lists_controller_spec.rb b/spec/controllers/desktop/journal_lists_controller_spec.rb new file mode 100644 index 00000000..99d2e2dc --- /dev/null +++ b/spec/controllers/desktop/journal_lists_controller_spec.rb @@ -0,0 +1,164 @@ +require 'spec_helper' + +# This spec was generated by rspec-rails when you ran the scaffold generator. +# It demonstrates how one might use RSpec to specify the controller code that +# was generated by Rails when you ran the scaffold generator. +# +# It assumes that the implementation code is generated by the rails scaffold +# generator. If you are using any extension libraries to generate different +# controller code, this generated spec may or may not pass. +# +# It only uses APIs available in rails and/or rspec-rails. There are a number +# of tools you can use to make these specs even more expressive, but we're +# sticking to rails and rspec-rails APIs to keep things simple and stable. +# +# Compared to earlier versions of this generator, there is very limited use of +# stubs and message expectations in this spec. Stubs are only used when there +# is no simpler way to get a handle on the object needed for the example. +# Message expectations are only used when there is no simpler way to specify +# that an instance is receiving a specific message. + +describe Desktop::JournalListsController do + + # This should return the minimal set of attributes required to create a valid + # Desktop::JournalList. As you add validations to Desktop::JournalList, be sure to + # update the return value of this method accordingly. + def valid_attributes + {} + end + + # This should return the minimal set of values that should be in the session + # in order to pass any filters (e.g. authentication) defined in + # Desktop::JournalListsController. Be sure to keep this updated too. + def valid_session + {} + end + + describe "GET index" do + it "assigns all desktop_journal_lists as @desktop_journal_lists" do + journal_list = Desktop::JournalList.create! valid_attributes + get :index, {}, valid_session + assigns(:desktop_journal_lists).should eq([journal_list]) + end + end + + describe "GET show" do + it "assigns the requested desktop_journal_list as @desktop_journal_list" do + journal_list = Desktop::JournalList.create! valid_attributes + get :show, {:id => journal_list.to_param}, valid_session + assigns(:desktop_journal_list).should eq(journal_list) + end + end + + describe "GET new" do + it "assigns a new desktop_journal_list as @desktop_journal_list" do + get :new, {}, valid_session + assigns(:desktop_journal_list).should be_a_new(Desktop::JournalList) + end + end + + describe "GET edit" do + it "assigns the requested desktop_journal_list as @desktop_journal_list" do + journal_list = Desktop::JournalList.create! valid_attributes + get :edit, {:id => journal_list.to_param}, valid_session + assigns(:desktop_journal_list).should eq(journal_list) + end + end + + describe "POST create" do + describe "with valid params" do + it "creates a new Desktop::JournalList" do + expect { + post :create, {:desktop_journal_list => valid_attributes}, valid_session + }.to change(Desktop::JournalList, :count).by(1) + end + + it "assigns a newly created desktop_journal_list as @desktop_journal_list" do + post :create, {:desktop_journal_list => valid_attributes}, valid_session + assigns(:desktop_journal_list).should be_a(Desktop::JournalList) + assigns(:desktop_journal_list).should be_persisted + end + + it "redirects to the created desktop_journal_list" do + post :create, {:desktop_journal_list => valid_attributes}, valid_session + response.should redirect_to(Desktop::JournalList.last) + end + end + + describe "with invalid params" do + it "assigns a newly created but unsaved desktop_journal_list as @desktop_journal_list" do + # Trigger the behavior that occurs when invalid params are submitted + Desktop::JournalList.any_instance.stub(:save).and_return(false) + post :create, {:desktop_journal_list => {}}, valid_session + assigns(:desktop_journal_list).should be_a_new(Desktop::JournalList) + end + + it "re-renders the 'new' template" do + # Trigger the behavior that occurs when invalid params are submitted + Desktop::JournalList.any_instance.stub(:save).and_return(false) + post :create, {:desktop_journal_list => {}}, valid_session + response.should render_template("new") + end + end + end + + describe "PUT update" do + describe "with valid params" do + it "updates the requested desktop_journal_list" do + journal_list = Desktop::JournalList.create! valid_attributes + # Assuming there are no other desktop_journal_lists in the database, this + # specifies that the Desktop::JournalList created on the previous line + # receives the :update_attributes message with whatever params are + # submitted in the request. + Desktop::JournalList.any_instance.should_receive(:update_attributes).with({'these' => 'params'}) + put :update, {:id => journal_list.to_param, :desktop_journal_list => {'these' => 'params'}}, valid_session + end + + it "assigns the requested desktop_journal_list as @desktop_journal_list" do + journal_list = Desktop::JournalList.create! valid_attributes + put :update, {:id => journal_list.to_param, :desktop_journal_list => valid_attributes}, valid_session + assigns(:desktop_journal_list).should eq(journal_list) + end + + it "redirects to the desktop_journal_list" do + journal_list = Desktop::JournalList.create! valid_attributes + put :update, {:id => journal_list.to_param, :desktop_journal_list => valid_attributes}, valid_session + response.should redirect_to(journal_list) + end + end + + describe "with invalid params" do + it "assigns the desktop_journal_list as @desktop_journal_list" do + journal_list = Desktop::JournalList.create! valid_attributes + # Trigger the behavior that occurs when invalid params are submitted + Desktop::JournalList.any_instance.stub(:save).and_return(false) + put :update, {:id => journal_list.to_param, :desktop_journal_list => {}}, valid_session + assigns(:desktop_journal_list).should eq(journal_list) + end + + it "re-renders the 'edit' template" do + journal_list = Desktop::JournalList.create! valid_attributes + # Trigger the behavior that occurs when invalid params are submitted + Desktop::JournalList.any_instance.stub(:save).and_return(false) + put :update, {:id => journal_list.to_param, :desktop_journal_list => {}}, valid_session + response.should render_template("edit") + end + end + end + + describe "DELETE destroy" do + it "destroys the requested desktop_journal_list" do + journal_list = Desktop::JournalList.create! valid_attributes + expect { + delete :destroy, {:id => journal_list.to_param}, valid_session + }.to change(Desktop::JournalList, :count).by(-1) + end + + it "redirects to the desktop_journal_lists list" do + journal_list = Desktop::JournalList.create! valid_attributes + delete :destroy, {:id => journal_list.to_param}, valid_session + response.should redirect_to(desktop_journal_lists_url) + end + end + +end diff --git a/spec/helpers/desktop/journal_lists_helper_spec.rb b/spec/helpers/desktop/journal_lists_helper_spec.rb new file mode 100644 index 00000000..47b911a9 --- /dev/null +++ b/spec/helpers/desktop/journal_lists_helper_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +# Specs in this file have access to a helper object that includes +# the Desktop::JournalListsHelper. For example: +# +# describe Desktop::JournalListsHelper do +# describe "string concat" do +# it "concats two strings with spaces" do +# helper.concat_strings("this","that").should == "this that" +# end +# end +# end +describe Desktop::JournalListsHelper do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/requests/desktop/desktop_journal_lists_spec.rb b/spec/requests/desktop/desktop_journal_lists_spec.rb new file mode 100644 index 00000000..c1ac52e3 --- /dev/null +++ b/spec/requests/desktop/desktop_journal_lists_spec.rb @@ -0,0 +1,11 @@ +require 'spec_helper' + +describe "Desktop::JournalLists" do + describe "GET /desktop_journal_lists" do + it "works! (now write some real specs)" do + # Run the generator again with the --webrat flag if you want to use webrat methods/matchers + get desktop_journal_lists_path + response.status.should be(200) + end + end +end diff --git a/spec/routing/desktop/journal_lists_routing_spec.rb b/spec/routing/desktop/journal_lists_routing_spec.rb new file mode 100644 index 00000000..79eac59e --- /dev/null +++ b/spec/routing/desktop/journal_lists_routing_spec.rb @@ -0,0 +1,35 @@ +require "spec_helper" + +describe Desktop::JournalListsController do + describe "routing" do + + it "routes to #index" do + get("/desktop/journal_lists").should route_to("desktop/journal_lists#index") + end + + it "routes to #new" do + get("/desktop/journal_lists/new").should route_to("desktop/journal_lists#new") + end + + it "routes to #show" do + get("/desktop/journal_lists/1").should route_to("desktop/journal_lists#show", :id => "1") + end + + it "routes to #edit" do + get("/desktop/journal_lists/1/edit").should route_to("desktop/journal_lists#edit", :id => "1") + end + + it "routes to #create" do + post("/desktop/journal_lists").should route_to("desktop/journal_lists#create") + end + + it "routes to #update" do + put("/desktop/journal_lists/1").should route_to("desktop/journal_lists#update", :id => "1") + end + + it "routes to #destroy" do + delete("/desktop/journal_lists/1").should route_to("desktop/journal_lists#destroy", :id => "1") + end + + end +end diff --git a/spec/views/desktop/journal_lists/edit.html.erb_spec.rb b/spec/views/desktop/journal_lists/edit.html.erb_spec.rb new file mode 100644 index 00000000..92a7ab73 --- /dev/null +++ b/spec/views/desktop/journal_lists/edit.html.erb_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +describe "desktop/journal_lists/edit" do + before(:each) do + @desktop_journal_list = assign(:desktop_journal_list, stub_model(Desktop::JournalList)) + end + + it "renders the edit desktop_journal_list form" do + render + + # Run the generator again with the --webrat flag if you want to use webrat matchers + assert_select "form", :action => desktop_journal_lists_path(@desktop_journal_list), :method => "post" do + end + end +end diff --git a/spec/views/desktop/journal_lists/index.html.erb_spec.rb b/spec/views/desktop/journal_lists/index.html.erb_spec.rb new file mode 100644 index 00000000..93bfc83b --- /dev/null +++ b/spec/views/desktop/journal_lists/index.html.erb_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +describe "desktop/journal_lists/index" do + before(:each) do + assign(:desktop_journal_lists, [ + stub_model(Desktop::JournalList), + stub_model(Desktop::JournalList) + ]) + end + + it "renders a list of desktop/journal_lists" do + render + # Run the generator again with the --webrat flag if you want to use webrat matchers + end +end diff --git a/spec/views/desktop/journal_lists/new.html.erb_spec.rb b/spec/views/desktop/journal_lists/new.html.erb_spec.rb new file mode 100644 index 00000000..b9751d44 --- /dev/null +++ b/spec/views/desktop/journal_lists/new.html.erb_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +describe "desktop/journal_lists/new" do + before(:each) do + assign(:desktop_journal_list, stub_model(Desktop::JournalList).as_new_record) + end + + it "renders new desktop_journal_list form" do + render + + # Run the generator again with the --webrat flag if you want to use webrat matchers + assert_select "form", :action => desktop_journal_lists_path, :method => "post" do + end + end +end diff --git a/spec/views/desktop/journal_lists/show.html.erb_spec.rb b/spec/views/desktop/journal_lists/show.html.erb_spec.rb new file mode 100644 index 00000000..d18b4ece --- /dev/null +++ b/spec/views/desktop/journal_lists/show.html.erb_spec.rb @@ -0,0 +1,12 @@ +require 'spec_helper' + +describe "desktop/journal_lists/show" do + before(:each) do + @desktop_journal_list = assign(:desktop_journal_list, stub_model(Desktop::JournalList)) + end + + it "renders attributes in

    " do + render + # Run the generator again with the --webrat flag if you want to use webrat matchers + end +end From 4a0cc61852cc71a6c4eba998525c2a0b7387d492 Mon Sep 17 00:00:00 2001 From: Rueshyna Date: Thu, 29 Nov 2012 11:21:05 +0800 Subject: [PATCH 12/41] can add multiple file --- .../desktop/journal_pages/_form.html.erb | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/app/views/desktop/journal_pages/_form.html.erb b/app/views/desktop/journal_pages/_form.html.erb index e72db279..5eb26a76 100644 --- a/app/views/desktop/journal_pages/_form.html.erb +++ b/app/views/desktop/journal_pages/_form.html.erb @@ -185,26 +185,20 @@

    • -
      <%= label_tag("", "Full Text", class: "s_grid_2 s_grid") %>
      - - +
      - - - + + + - @@ -245,7 +239,7 @@
      FileFile NameFileFile Name
      +
      <%= hidden_field_tag 'plugin_file_field_count', @writing_journal.writing_journal_files.count %> - add + add