From 6995bb16227e900aaa4357afb279a109e6b916f4 Mon Sep 17 00:00:00 2001 From: "Matthew K. Fu JuYuan" Date: Thu, 29 Nov 2012 14:21:46 +0800 Subject: [PATCH] put module app json into init,making orbit app work with module app. --- .../admin/page_parts_controller.rb | 7 +- app/models/item.rb | 5 +- app/models/module_app.rb | 51 +- .../admin/page_parts/_module_widget.html.erb | 14 +- .../admin/page_parts/reload_widgets.js.erb | 2 +- config/list.yml | 7 + config/locales/zh_tw.yml | 1378 ++++++++++++----- lib/orbit_app.rb | 2 + lib/orbit_app/module/front_end.rb | 56 + lib/orbit_app/module/registration.rb | 79 +- lib/orbit_app/module/side_bar.rb | 41 +- lib/orbit_app/module/summary.rb | 2 +- lib/orbit_app/module/widget.rb | 108 ++ .../announcement/config/locales/zh_tw.yml | 3 + vendor/built_in_modules/announcement/init.rb | 29 +- 15 files changed, 1317 insertions(+), 467 deletions(-) create mode 100644 lib/orbit_app/module/front_end.rb create mode 100644 lib/orbit_app/module/widget.rb diff --git a/app/controllers/admin/page_parts_controller.rb b/app/controllers/admin/page_parts_controller.rb index f78c6ae3..f4672800 100644 --- a/app/controllers/admin/page_parts_controller.rb +++ b/app/controllers/admin/page_parts_controller.rb @@ -31,9 +31,9 @@ class Admin::PagePartsController < ApplicationController @widget_path = @part.widget_path ? @part.widget_path : @module_app.widgets.keys[0] - if @module_app.widgets.any?{|b| b.class == Array} - @widget_style = @module_app.widgets[@widget_path] if !@widget_path.blank? && !@module_app.widgets.blank? - end + # if @module_app.widgets.any?{|b| b.class == Array} + # @widget_style = @module_app.widgets[@widget_path] if !@widget_path.blank? && !@module_app.widgets.blank? + # end case @module_app.key when 'announcement' @@ -119,7 +119,6 @@ class Admin::PagePartsController < ApplicationController def reload_widget_styles @module_app = ModuleApp.find(params[:module_app_id]) - @widget_style = @module_app.widgets[params[:id]] respond_to do |format| diff --git a/app/models/item.rb b/app/models/item.rb index 81366a21..c12620fa 100644 --- a/app/models/item.rb +++ b/app/models/item.rb @@ -4,7 +4,8 @@ class Item include Mongoid::Timestamps include Mongoid::Tree include Mongoid::Tree::Ordering - + LIST = YAML.load(File.read('config/list.yml')) + field :name field :path field :is_published, :type => Boolean, :default => false @@ -15,7 +16,7 @@ class Item validates_format_of :name, :with => /^[0-9a-zA-Z\-_]+$/ - validates :name, :exclusion => { :in => LIST[:forbidden_item_names] } + # validates :name, :exclusion => { :in => LIST[:forbidden_item_names] } validates_uniqueness_of :name, :scope => :parent_id validates_presence_of :name validates_associated :parent, :children diff --git a/app/models/module_app.rb b/app/models/module_app.rb index 669d82aa..22fb4814 100644 --- a/app/models/module_app.rb +++ b/app/models/module_app.rb @@ -5,30 +5,45 @@ class ModuleApp field :key field :title - field :version - field :organization - field :author - field :intro - field :update_info - field :create_date - field :enable_frontend, type: Boolean, :default => true - - field :app_pages ,type: Array - # field :widgets ,type: Array - field :widgets ,type: Hash - field :widget_fields ,type: Array - + has_many :managers,as: :managing_app ,:class_name => "AppManager" ,:dependent => :destroy#,:foreign_key => "managing_app_id",:inverse_of => :managing_app has_many :sub_managers,as: :sub_managing_app ,:class_name => "AppManager", :dependent => :destroy#,:foreign_key => "sub_managing_app_id",:inverse_of => :sub_managing_app - has_many :tags + # has_many :tags has_many :page_parts has_many :pages has_one :app_auth,dependent: :delete - + before_save :set_key - + + def get_registration + OrbitApp::Module::Registration.find_by_key(key) + end + + # %w{label_i18n }.each do |field| + # define_method(field){|var| get_registration.send("get_#{m}") } + # end + + def label_i18n + reg = get_registration + reg.nil? ? 'Init is not defined completely' : get_registration.get_label_i18n + end + + # def method_missing(m, *args, &block) + # # get_registration.send("get_#{m}") + # end + + def using_default_widget? + !get_registration.get_default_widget.blank? + end + + def get_widget_for_select + widgets = get_registration.get_widgets + ary = widgets.collect{|k,v| [I18n.t(v["label"]),k]} + ary << [I18n.t('widget.default_widget'),'default_widget']if using_default_widget? + end + def is_manager?(user) managing_users.include?(user) end @@ -79,6 +94,10 @@ class ModuleApp end end + def label + I18n.t(label_i18n) + end + protected def set_key diff --git a/app/views/admin/page_parts/_module_widget.html.erb b/app/views/admin/page_parts/_module_widget.html.erb index 44358601..e6a6e2a0 100644 --- a/app/views/admin/page_parts/_module_widget.html.erb +++ b/app/views/admin/page_parts/_module_widget.html.erb @@ -10,12 +10,12 @@ - <%= f.select :module_app, options_from_collection_for_select(@module_apps, :id, :title, :selected => @module_app.id), {}, {:rel => admin_page_parts_path} %> + <%= f.select :module_app, options_from_collection_for_select(@module_apps, :id, :label, :selected => @module_app.id), {}, {:rel => admin_page_parts_path} %> <%#= f.select :widget_path, @module_app.widgets.collect{|widget| [widget.humanize, widget]}, :selected => @part.widget_path %> - <%= f.select :widget_path, @module_app.widgets.collect{|k,v| [k.humanize, k]}, {}, { :selected => @part.widget_path, :rel => admin_page_parts_path } %> + <%= f.select :widget_path, @module_app.get_widget_for_select, {}, { :selected => @part.widget_path, :rel => admin_page_parts_path } %> @@ -34,18 +34,10 @@ - <%= render 'widget_fields' %> - - <%#= f.label :widget_field %> - <%# @module_app.widget_fields.each_with_index do |widget_field, i| %> - <%#= i+1 %> - <%#= select_tag "page_part[widget_field][]", options_for_select(@module_app.widget_fields.collect{|widget_field| [widget_field.humanize, widget_field]}, (@part.widget_field ? @part.widget_field[i] : nil) ), :include_blank => true %>
- <%# end %> - - <%#= select_tag "page_part[widget_field][]", options_for_select(@module_app.widget_fields.collect{|widget_field| [widget_field.humanize, widget_field]}, @part.widget_field.collect{|widget_field| widget_field}), {:multiple => :multiple, :size => 6} %>
+
<%= f.label :widget_data_count %> <%= f.text_field :widget_data_count %> diff --git a/app/views/admin/page_parts/reload_widgets.js.erb b/app/views/admin/page_parts/reload_widgets.js.erb index c66c44e9..3b7082fc 100644 --- a/app/views/admin/page_parts/reload_widgets.js.erb +++ b/app/views/admin/page_parts/reload_widgets.js.erb @@ -1,4 +1,4 @@ -$('#widget_list select').html("<%= j options_for_select(@module_app.widgets.collect{|k,v| k}) %>"); +$('#widget_list select').html("<%= j options_for_select(@module_app.get_widget_for_select) %>"); $('#widget_style_list').html("<%= escape_javascript(select 'page_part', 'widget_style', @module_app.widgets[@widget_path]) if !@widget_path.blank? %>"); $('#widget_field').html("<%= j render 'widget_fields' %>"); $('#widget_category').html("<%= j render 'widget_categories' %>"); diff --git a/config/list.yml b/config/list.yml index bae7a90d..a3b48cfc 100644 --- a/config/list.yml +++ b/config/list.yml @@ -70,3 +70,10 @@ widget_field_type: - tag - viewcount - poster + +default_widget_style: + - style1 + - style2 + - style3 + - style4 + - style5 \ No newline at end of file diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml index c8075b24..441048af 100644 --- a/config/locales/zh_tw.yml +++ b/config/locales/zh_tw.yml @@ -1,404 +1,978 @@ -zh_tw: +# zh_tw: - _locale: 中文 +# _locale: 中文 - access: - denied: - app: - not_sub_manager: 拒絕存取,因你不是此應用程式次管理員 - not_manager: 拒絕存取,因你不是此應用程式管理員 - not_authed_user: 拒絕存取,因你不是此應用程式授權使用者 - object: 拒絕存取,因你沒有權限 - not_admin: 拒絕存取,因你不是此應用程式管理員 - 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: All - all_content: 所有內容 - all_file: 所有檔案 - all_member: 所有會員 - all_plugin_summary: All plugin summary - all_plugins: All plugins - always_display_title: 永遠顯示標題 - app_auth: - list_setting_result: 授權列表 - assigning_manager: - add_manager_fail: 新增管理員失敗 - add_manager_ok: 新增管理員成功 - assigning_sub_manager: - add_sub_manager_fail: 新增次管理員失敗 - add_sub_manager_ok: 新增次管理員成功 - can_not_add_this_user: 不能新增這個使用員 - delete_manager: - fail: 刪除管理員失敗 - success: 刪除管理員成功 - delete_sub_manager: - fail: 刪除次管理員失敗 - success: 刪除次管理員成功 - failed_no_user: 失敗,不是使用者 - operation_not_permitted: Operation not permitted - approval: - not_pass: 拒絕 - not_pass_reason: 拒絕原因 - pass: 已認可 - setting: 審核設定 - stat: 審核狀態 - user_list: 使用者列表 - approval_: 審核 - archive: Archive - asset: 資產 - attributes: 屬性 - auth: - add_manager: 新增管理員 - add_sub_manager: 新增次管理員 - add_to_block_list: 增加到封鎖名單 - add_to_privilege_list: 增加到特許名單 - all_member: 所有會員 - auth_by: -由%{user_display_name}授權 - by_role: 用戶狀態 - by_sub_role: 次用戶狀態 - author: 作者 - back: 回上一步 - basic: 基本 - browse: 瀏覽 - built_in: Built-in - calendar: Calendar - cancel: 取消 - cant_delete_self: 不可以刪除自己 - cant_empty_star: 不能為空白 (*) - cant_revoke_self_admin: 不可以撤銷自己的管理狀態 - categories: 類別 - category: 類別 - category_auth: 類別授權 - clear: 清除 - close: Close - content: 內容 - courses: 開課數 - create: - error: - link: 建立連結時出錯 - page: 建立頁面時出錯 - 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: 鏈接 - dashboard_: 儀表版 - deadline: 最後期限 - default: Default - default_css: 預設樣式表 - delete: - file: 刪除檔案 - success: - paper: Paper was successfully deleted. - delete_: 刪除 - description: 描述 - desktop: 桌面 - disable: 關閉 - disabled: Disabled - dots: ●●●●●● - download: 下載 - downloaded: 已下載 - edit: 編輯 - editing: - asset: 編輯資產 - design: 編輯設計 - link: 編輯連結 - page: 編輯頁面 - email: 電子郵件 - enable: 開啟 - enabled_for: 啟用 - end: 結束 - end_date: 結束日期 - errors: - at_least_one: 至少擁有一個值 - file: - size: 檔案大小 - type: 檔案類型 - upload: 上傳檔案 - file_: 檔案 - file_type: 檔案類型 - followers: Followers - forgot_password: 忘記密碼? - frequency: 頻率 - frontend_data_count: Frontend data count - gallery: Gallery - help: 幫助 - hidden: 隱藏的 - hide: 隱藏 - hits: 點擊次數 - homepage: 首頁 - horizontal: 水平的 - hot: 熱門 - image: 圖片 - images: Images - info: 信息 - initial: 起始值 - intro: 簡介 - is_published: 已發佈 - item: 項目 - item_name: Item name - javascripts: Javascripts - key: 索引 - last_modified: 最後修改者 - layout: 範本 - link: 連結 - list: - ad_banner: 廣告輪播列表 - asset: 資產列表 - info: 使用者資訊列表 - link: 連結列表 - purchase: 已購買項目列表 - role: 使用者角色列表 - user: 使用者列表 - list_: 列表 - list_lower: 列表 - lists: - markups: - text_field: 文字輸入框 - select: 下拉選單 - date: 日期 - text_area: 文字輸入方塊 - radio_button: 單選 - checkbox: 多選 - locale: Locale - location: Location - login: 登入 - logout: 登出 - mail: - address: 電子郵件地址 - authentication: 電子郵件認證 - domain: 電子郵件網域名稱 - enable_starttls_auto: 啟用安全通訊 - password: 密碼 - port: 電子郵件傳輸埠 - setting: 電子郵件設定 - tls: 電子郵件TLS - user_name: 電子郵件帳號 - manager: 管理者 - manager: 管理者 - markup: 輸入模式 - markup_options: Markup options - markup_value: Markup value - me: Me - member: 會員 - menu_enabled_for: 選單啟用 - module: Module - module_authorization: 模組授權 - more_plus: 更多+ - most_visited_page: 最多瀏覽頁面 - multilingual: 多語系 - name: 名稱 - need_home: You need a home page - neutral_title: Neutral title - neutral_for: Neutral for - new: - asset: 新增資產 - banner: 新增橫幅 - design: 新增設計 - link: 新增連結 - page: 新增頁面 - user: 新增使用者 - info: 新增使用者資訊 - role: 新增使用者角色 - new_: New - news: 新聞 - no_: "不是" - no_deadline: 沒有期限 - object_auth: - a_object_must_have_only_one_object_auth_profile_for_each_action: '' - list_title_of_users: 授權列表 - new_object_auth: 新增授權 - off_upcase: "開啟" - on_upcase: "關閉" - options: 選項 - or_lower: 或 - organization: 組織 - page: 頁面 - page_part_kinds: - module_widget: 外掛模塊 - public_r_tag: 系統模塊 - text: 文字區域 - passed: 通過審核 - password: 密碼 - password_confirmation: 確認密碼 - pending: 待審核 - picture: 圖片 - placeholder: Placeholder - plugins: Plugins - postdate: 張貼日期 - posted_by: 張貼人 - preview: 預覽 - profile: Profile - publications: Publications - purchase: 購買 - quantity: 數量 - quick_edit: 快速編輯 - recent_update: 近期更新 - referral_in_links: 參考連結 - register: 註冊 - registered: 已註冊 - rejected: 拒絕 - rejected_reason: '拒絕原因:' - rejected_reason_empty: "拒絕核准, 沒有參考資訊" - related_links: 相關連結 - role: 身份 - roles: 身份 - ruling_site: 銳綸網站 - search: - domains: Google Search Domains - not_found: "沒有搜尋結果" - result_get: "搜尋標題有關 ' %{search_word} ' 共搜尋到%{item_num}筆資料" - sitesearch: 全站搜尋 - too_many: "搜尋有關 ' %{search_word} '尋找到超過 %{exceed_num} 筆資料,請嘗試加入更多關鍵字縮小搜尋範圍,以作更精確的搜尋?" - unit_get: "列出由 :%{unit_name}發佈的資料,共有%{item_num}筆" - search_: Search - search_google: 搜尋Google - setup_member: 會員設定 - show: 顯示 - show_mode: - index: 清單 - summary: 摘要 - thumbnail: 縮圖 - site: - description: 網站描述 - description_help: '' - footer: 網站頁尾 - footer_help: '' - info: 網站資訊 - keywords: 搜尋關鍵字 - keywords_help: '' - language: 網站語言 - search: 網站搜尋 - search_help: 請輸入送交Google搜尋的參數 - settings: 基本設定 - sub_menu: 次選單 - title: 網站標題 - title_help: '' - site_: 網站 - site_info: 網站資訊 - sitemap: 網站地圖 - site_name: 網站名稱 - size: Size - start: 開始 - start_date: 開始日期 - statistics: 統計資訊 - status: 狀態 - structure: 結構 - sub_manager: 次管理員 - subtitle: 副標題 - submit: 送出 - submit_approval: 送出已核准 - submit_user_list: 送出使用者列表 - sure?: "您確定嗎?" - sys: - can_not_display_due_to_no_context: "因為沒有中文版本,所以無法顯示" - limit_of_upload_file_size: "上傳檔案大小限制: %{best_size}" - module_page_lang_not_support: "很抱歉,此頁面沒有開放中文版本" - not_previewable: "不支援預覽" - preview_only_for_img: "預覽僅支援:jpg,png,gif,bmp等圖片格式" - sys_basic_form: 系統基本資料表 - system_info: 系統資訊 - tag_cloud: 標籤雲 - tags: 標籤 - template: 樣版 - template_name: 樣版名稱 - text: 內文 - theme: 主題 - themes: 主題 - title: 標題 - top: 置頂 - total_visitors: 總計造訪人次 - 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: 頁面已更新成功 - paper: Paper was successfully updated. - user: User was successfully updated. - success_: S使用者已更新成功 - update_at: 最後更新時間 - url: 網址 - use_status: '' - user: 使用者 - version: 版本 - vertical: 垂直的 - view: 檢視 - view_count: 查看次數 - visitors_this_month: 本月造訪人次 - visitors_this_week: 本星期造訪人次 - visitors_this_year: 今年造訪人次 - visitors_today: 今日造訪人次 - yes_: "是" +# access: +# denied: +# app: +# not_sub_manager: 拒絕存取,因你不是此應用程式次管理員 +# not_manager: 拒絕存取,因你不是此應用程式管理員 +# not_authed_user: 拒絕存取,因你不是此應用程式授權使用者 +# object: 拒絕存取,因你沒有權限 +# not_admin: 拒絕存取,因你不是此應用程式管理員 +# 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: All +# all_content: 所有內容 +# all_file: 所有檔案 +# all_member: 所有會員 +# all_plugin_summary: All plugin summary +# all_plugins: All plugins +# always_display_title: 永遠顯示標題 +# app_auth: +# list_setting_result: 授權列表 +# assigning_manager: +# add_manager_fail: 新增管理員失敗 +# add_manager_ok: 新增管理員成功 +# assigning_sub_manager: +# add_sub_manager_fail: 新增次管理員失敗 +# add_sub_manager_ok: 新增次管理員成功 +# can_not_add_this_user: 不能新增這個使用員 +# delete_manager: +# fail: 刪除管理員失敗 +# success: 刪除管理員成功 +# delete_sub_manager: +# fail: 刪除次管理員失敗 +# success: 刪除次管理員成功 +# failed_no_user: 失敗,不是使用者 +# operation_not_permitted: Operation not permitted +# approval: +# not_pass: 拒絕 +# not_pass_reason: 拒絕原因 +# pass: 已認可 +# setting: 審核設定 +# stat: 審核狀態 +# user_list: 使用者列表 +# approval_: 審核 +# archive: Archive +# asset: 資產 +# attributes: 屬性 +# auth: +# add_manager: 新增管理員 +# add_sub_manager: 新增次管理員 +# add_to_block_list: 增加到封鎖名單 +# add_to_privilege_list: 增加到特許名單 +# all_member: 所有會員 +# auth_by: -由%{user_display_name}授權 +# by_role: 用戶狀態 +# by_sub_role: 次用戶狀態 +# author: 作者 +# back: 回上一步 +# basic: 基本 +# browse: 瀏覽 +# built_in: Built-in +# calendar: Calendar +# cancel: 取消 +# cant_delete_self: 不可以刪除自己 +# cant_empty_star: 不能為空白 (*) +# cant_revoke_self_admin: 不可以撤銷自己的管理狀態 +# categories: 類別 +# category: 類別 +# category_auth: 類別授權 +# clear: 清除 +# close: Close +# content: 內容 +# courses: 開課數 +# create: +# error: +# link: 建立連結時出錯 +# page: 建立頁面時出錯 +# 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: 鏈接 +# dashboard_: 儀表版 +# deadline: 最後期限 +# default: Default +# default_css: 預設樣式表 +# delete: +# file: 刪除檔案 +# success: +# paper: Paper was successfully deleted. +# delete_: 刪除 +# description: 描述 +# desktop: 桌面 +# disable: 關閉 +# disabled: Disabled +# dots: ●●●●●● +# download: 下載 +# downloaded: 已下載 +# edit: 編輯 +# editing: +# asset: 編輯資產 +# design: 編輯設計 +# link: 編輯連結 +# page: 編輯頁面 +# email: 電子郵件 +# enable: 開啟 +# enabled_for: 啟用 +# end: 結束 +# end_date: 結束日期 +# errors: +# at_least_one: 至少擁有一個值 +# file: +# size: 檔案大小 +# type: 檔案類型 +# upload: 上傳檔案 +# file_: 檔案 +# file_type: 檔案類型 +# followers: Followers +# forgot_password: 忘記密碼? +# frequency: 頻率 +# frontend_data_count: Frontend data count +# gallery: Gallery +# help: 幫助 +# hidden: 隱藏的 +# hide: 隱藏 +# hits: 點擊次數 +# homepage: 首頁 +# horizontal: 水平的 +# hot: 熱門 +# image: 圖片 +# images: Images +# info: 信息 +# initial: 起始值 +# intro: 簡介 +# is_published: 已發佈 +# item: 項目 +# item_name: Item name +# javascripts: Javascripts +# key: 索引 +# last_modified: 最後修改者 +# layout: 範本 +# link: 連結 +# list: +# ad_banner: 廣告輪播列表 +# asset: 資產列表 +# info: 使用者資訊列表 +# link: 連結列表 +# purchase: 已購買項目列表 +# role: 使用者角色列表 +# user: 使用者列表 +# list_: 列表 +# list_lower: 列表 +# lists: +# markups: +# text_field: 文字輸入框 +# select: 下拉選單 +# date: 日期 +# text_area: 文字輸入方塊 +# radio_button: 單選 +# checkbox: 多選 +# locale: Locale +# location: Location +# login: 登入 +# logout: 登出 +# mail: +# address: 電子郵件地址 +# authentication: 電子郵件認證 +# domain: 電子郵件網域名稱 +# enable_starttls_auto: 啟用安全通訊 +# password: 密碼 +# port: 電子郵件傳輸埠 +# setting: 電子郵件設定 +# tls: 電子郵件TLS +# user_name: 電子郵件帳號 +# manager: 管理者 +# manager: 管理者 +# markup: 輸入模式 +# markup_options: Markup options +# markup_value: Markup value +# me: Me +# member: 會員 +# menu_enabled_for: 選單啟用 +# module: Module +# module_authorization: 模組授權 +# more_plus: 更多+ +# most_visited_page: 最多瀏覽頁面 +# multilingual: 多語系 +# name: 名稱 +# need_home: You need a home page +# neutral_title: Neutral title +# neutral_for: Neutral for +# new: +# asset: 新增資產 +# banner: 新增橫幅 +# design: 新增設計 +# link: 新增連結 +# page: 新增頁面 +# user: 新增使用者 +# info: 新增使用者資訊 +# role: 新增使用者角色 +# new_: New +# news: 新聞 +# no_: "不是" +# no_deadline: 沒有期限 +# object_auth: +# a_object_must_have_only_one_object_auth_profile_for_each_action: '' +# list_title_of_users: 授權列表 +# new_object_auth: 新增授權 +# off_upcase: "開啟" +# on_upcase: "關閉" +# options: 選項 +# or_lower: 或 +# organization: 組織 +# page: 頁面 +# page_part_kinds: +# module_widget: 外掛模塊 +# public_r_tag: 系統模塊 +# text: 文字區域 +# passed: 通過審核 +# password: 密碼 +# password_confirmation: 確認密碼 +# pending: 待審核 +# picture: 圖片 +# placeholder: Placeholder +# plugins: Plugins +# postdate: 張貼日期 +# posted_by: 張貼人 +# preview: 預覽 +# profile: Profile +# publications: Publications +# purchase: 購買 +# quantity: 數量 +# quick_edit: 快速編輯 +# recent_update: 近期更新 +# referral_in_links: 參考連結 +# register: 註冊 +# registered: 已註冊 +# rejected: 拒絕 +# rejected_reason: '拒絕原因:' +# rejected_reason_empty: "拒絕核准, 沒有參考資訊" +# related_links: 相關連結 +# role: 身份 +# roles: 身份 +# ruling_site: 銳綸網站 +# search: +# domains: Google Search Domains +# not_found: "沒有搜尋結果" +# result_get: "搜尋標題有關 ' %{search_word} ' 共搜尋到%{item_num}筆資料" +# sitesearch: 全站搜尋 +# too_many: "搜尋有關 ' %{search_word} '尋找到超過 %{exceed_num} 筆資料,請嘗試加入更多關鍵字縮小搜尋範圍,以作更精確的搜尋?" +# unit_get: "列出由 :%{unit_name}發佈的資料,共有%{item_num}筆" +# search_: Search +# search_google: 搜尋Google +# setup_member: 會員設定 +# show: 顯示 +# show_mode: +# index: 清單 +# summary: 摘要 +# thumbnail: 縮圖 +# site: +# description: 網站描述 +# description_help: '' +# footer: 網站頁尾 +# footer_help: '' +# info: 網站資訊 +# keywords: 搜尋關鍵字 +# keywords_help: '' +# language: 網站語言 +# search: 網站搜尋 +# search_help: 請輸入送交Google搜尋的參數 +# settings: 基本設定 +# sub_menu: 次選單 +# title: 網站標題 +# title_help: '' +# site_: 網站 +# site_info: 網站資訊 +# sitemap: 網站地圖 +# site_name: 網站名稱 +# size: Size +# start: 開始 +# start_date: 開始日期 +# statistics: 統計資訊 +# status: 狀態 +# structure: 結構 +# sub_manager: 次管理員 +# subtitle: 副標題 +# submit: 送出 +# submit_approval: 送出已核准 +# submit_user_list: 送出使用者列表 +# sure?: "您確定嗎?" +# sys: +# can_not_display_due_to_no_context: "因為沒有中文版本,所以無法顯示" +# limit_of_upload_file_size: "上傳檔案大小限制: %{best_size}" +# module_page_lang_not_support: "很抱歉,此頁面沒有開放中文版本" +# not_previewable: "不支援預覽" +# preview_only_for_img: "預覽僅支援:jpg,png,gif,bmp等圖片格式" +# sys_basic_form: 系統基本資料表 +# system_info: 系統資訊 +# tag_cloud: 標籤雲 +# tags: 標籤 +# template: 樣版 +# template_name: 樣版名稱 +# text: 內文 +# theme: 主題 +# themes: 主題 +# title: 標題 +# top: 置頂 +# total_visitors: 總計造訪人次 +# 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: 頁面已更新成功 +# paper: Paper was successfully updated. +# user: User was successfully updated. +# success_: S使用者已更新成功 +# update_at: 最後更新時間 +# url: 網址 +# use_status: '' +# user: 使用者 +# version: 版本 +# vertical: 垂直的 +# view: 檢視 +# view_count: 查看次數 +# visitors_this_month: 本月造訪人次 +# visitors_this_week: 本星期造訪人次 +# visitors_this_year: 今年造訪人次 +# visitors_today: 今日造訪人次 +# yes_: "是" +# <<<<<<< HEAD +# ======= + +# 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: +# claendar: 紀年法 +# range: 本欄為時間區段 +# format: 格式 +# tw_claendar: 民國 +# minguo_calendar: +# after: 民國 +# before: 民前 +# first_year: 民國元年 +# year: 年 +# month: 月 +# west_claendar: 西元 +# 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: "以下欄位發生問題:" +# widget: +# default_widget: 系統預設Widget +# _default_widget: +# style1: 表格列表 +# style2: 單行列佐圖(同邊) +# style3: 多行列佐圖(同邊) +# style4: 多行列佐圖(異邊) +# style5: 單行列佐單圖(同邊) +# # : <<<<<<< 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 +# >>>>>>> put module app json into init,making orbit app work with module app. diff --git a/lib/orbit_app.rb b/lib/orbit_app.rb index f218c1e4..5b20f7a5 100644 --- a/lib/orbit_app.rb +++ b/lib/orbit_app.rb @@ -4,6 +4,8 @@ require "orbit_app/helper/renderer" require "orbit_app/helper/side_bar_renderer" require "orbit_app/helper/context_link_renderer" require "orbit_app/module/side_bar" +require "orbit_app/module/widget" +require "orbit_app/module/front_end" require "orbit_app/plugin/summary" require "orbit_app/plugin/registration" require "orbit_app/module/summary" diff --git a/lib/orbit_app/module/front_end.rb b/lib/orbit_app/module/front_end.rb new file mode 100644 index 00000000..65f79f8e --- /dev/null +++ b/lib/orbit_app/module/front_end.rb @@ -0,0 +1,56 @@ +module OrbitApp + module Module + module FrontendUtility + Version = "0.1" + + module ClassMethods + @@frontend_pages = [] + + def add(var) + @@frontend_pages << var + end + + def all + return @@frontend_pages + end + + end + + extend ClassMethods + def self.included( other ) + other.extend( ClassMethods ) + end + + class AppPageSet + def initialize(&block) + @frontend_pages = [] + block.arity < 1 ? instance_eval(&block) : block.call(self) if block_given? + end + + def app_page(name,options ={}) + @frontend_pages << AppPage.new(name,options) + end + + def to_module_app_format + @frontend_pages.collect{|t| t.name} + end + + end + + class AppPage + attr_reader :name + + def initialize(name,options ={}) + @name = name + end + + def finalize! + + end + + protected + + end# of AppPage + end # of FrontendUtility + end # of Module +end # of OrbitApp diff --git a/lib/orbit_app/module/registration.rb b/lib/orbit_app/module/registration.rb index 9a40eda3..c7967663 100644 --- a/lib/orbit_app/module/registration.rb +++ b/lib/orbit_app/module/registration.rb @@ -12,7 +12,7 @@ module OrbitApp def find_by_key(key) @@registrations.each{|t| - return t if t.name == key + return t if t.key == key } return nil end @@ -28,20 +28,69 @@ module OrbitApp end class DataSheet - attr_reader :name - attr_reader :base_path + attr_reader :name,:key,:base_path,:module_label def initialize(name, &block) @name = name + @key = name.underscore.singularize @side_bar = nil + @front_end_app_pages = nil block.arity < 1 ? instance_eval(&block) : block.call(self) if block_given? + setup_module_app + end + + def setup_module_app + module_app = ModuleApp.first(conditions: {:key=>@key,:title=>name}) + module_app = ModuleApp.new(:key=>@key,:title=>name) if module_app.nil? + + begin + module_app.save(:validate=>false) + rescue + retry + end + + end + + def get_label_i18n + @module_label + end + + def get_default_widget + if @widget_set.nil? # Init not defining widget + return {} + elsif @widget_set.get_default_widget.nil? # Init had defining widget,but say nothing about default_widget + return {} + else + @widget_set.get_default_widget.to_module_app_format + end + end + + def get_enable_frontend + (@front_end_app_pages.nil? ? false : true) + end + + def get_app_pages + @front_end_app_pages.nil? ? [] : @front_end_app_pages.to_module_app_format + end + + def get_widgets + @widget_set.nil? ? {} : @widget_set.to_module_app_format + end + + def get_categories + eval(@widget_set.categories_query) rescue nil + end + + def get_tags + eval(@widget_set.tags_query) rescue nil + end + + def front_end(&block) + @front_end_app_pages = FrontendUtility::AppPageSet.new(&block) end def side_bar(&block) - @side_bar = SideBarRegisition::SideBar.new(&block) - @side_bar.module_app_key = @name - @side_bar.finalize! - OrbitApp::Module::SideBarRegisition.add(@side_bar) + @side_bar = SideBarRegisition::SideBar.new(@name,@key,&block) end def personal_plugin(params) @@ -49,10 +98,20 @@ module OrbitApp Plugin::Registration.new_from_module_app(@name,@base_path,params) end - def base_url(var) - @base_path = var + def widgets(&block) + # @widgets = WidgetRegisition::WidgetSet.new(&block) + @widget_set = WidgetUtility::WidgetSet.new(&block) + + # @widgets = widget_set.widgets + # @default_widget = widget_set.default_widget end - end + + %w{module_label category base_url version organization author intro update_info}.each do |field| + define_method(field){|var| instance_variable_set( "@" + field, var)} + end + + end # of class DataSheet + end end end \ No newline at end of file diff --git a/lib/orbit_app/module/side_bar.rb b/lib/orbit_app/module/side_bar.rb index a1ca3e63..d82cac84 100644 --- a/lib/orbit_app/module/side_bar.rb +++ b/lib/orbit_app/module/side_bar.rb @@ -37,8 +37,7 @@ module OrbitApp # def is_manager? # binding.pry # end - def initialize( &block) - name = '' + def initialize(name = '',key,&block) @head_label = name @context_links = [] @available_for = [] @@ -48,18 +47,16 @@ module OrbitApp @head_link = "" @app_base_path = '' block.arity < 1 ? instance_eval(&block) : block.call(self) if block_given? + # setup_module_app(module_app_key) + @module_app_key = key + finalize! + SideBarRegisition.add(self) end - def module_app_key=(var) - @module_app_title = var - @module_app = ModuleApp.where(:title=>var).desc(:create_date).first - @module_app_key = @module_app.key - end - - def head_label_i18n(var,optoins =nil) + def head_label_i18n(var,options ={}) @head_label = var - @icon_class = optoins[:icon_class] + @icon_class = options[:icon_class] end def available_for(var) @@ -85,17 +82,23 @@ module OrbitApp def finalize! set_controllers_scope - set_default_active_app_auth + # set_default_active_app_auth @context_links.each do |t| - t.set_module_app = @module_app + # t.set_module_app = @module_app t.finalize! end end protected - def set_default_active_app_auth - @active_for_app_auth = @module_app.title - end + # def setup_module_app(var) + # @module_app_title = var + # @module_app = ModuleApp.where(:key=>var).desc(:create_date).first + # @module_app_key = @module_app.key + # end + + # def set_default_active_app_auth + # @active_for_app_auth = @module_app.title + # end def set_controllers_scope var = @active_for_controllers @@ -131,10 +134,10 @@ module OrbitApp @active_for_action[controller] == action end - def set_module_app=(var) - @module_app = var - @module_app_key = var.key - end + # def set_module_app=(var) + # @module_app = var + # @module_app_key = var.key + # end def finalize! set_active_actions diff --git a/lib/orbit_app/module/summary.rb b/lib/orbit_app/module/summary.rb index c3098cb1..16634055 100644 --- a/lib/orbit_app/module/summary.rb +++ b/lib/orbit_app/module/summary.rb @@ -3,7 +3,7 @@ require "orbit_app/summary" module OrbitApp module Module - module Summary + module Summary include OrbitApp::Summary class Item diff --git a/lib/orbit_app/module/widget.rb b/lib/orbit_app/module/widget.rb new file mode 100644 index 00000000..708dc28d --- /dev/null +++ b/lib/orbit_app/module/widget.rb @@ -0,0 +1,108 @@ +module OrbitApp + module Module + module WidgetUtility + Version = "0.1" + + module ClassMethods + @@widgets = [] + + def add(var) + @@widgets << var + end + + def all + return @@widgets + end + end + + extend ClassMethods + def self.included( other ) + other.extend( ClassMethods ) + end + + class WidgetSet + attr_reader :widgets,:categories_query,:tags_query + def initialize(&block) + @widgets = [] + @default_widget = nil + @categories_query = '' + @tags_query = '' + block.arity < 1 ? instance_eval(&block) : block.call(self) if block_given? + end + + %w{categories_query tags_query}.each do |field| + define_method(field){|var| instance_variable_set( "@" + field, var)} + end + + def get_categories + @categories_query + end + + def get_tags + @tags_query + end + + def default_widget(&block) + @default_widget = DefaultWidget.new(&block) + end + + def customize_widget(name,label,options ={}) + @widgets << Widget.new(name,label,options) + end + + def to_module_app_format + hash = {} + @widgets.collect{|t| hash[t.name] = t.to_hash} + hash + end + + def get_default_widget + return @default_widget + end + + end + + class DefaultWidget + def initialize(&block) + @query = nil + @image = nil + block.arity < 1 ? instance_eval(&block) : block.call(self) if block_given? + end + + def to_module_app_format + {:query=>@query,:image=>@image} rescue nil + end + + def query(var) + @query = var + end + + def image(var) + @image = var + end + + end + + class Widget + attr_reader :name,:default_template,:fields + + def initialize(name,label,options ={}) + @name = name + @fields = options[:fields] + @label = label + end + + def to_hash + {:name => @name,:fields=>@fields,:label=>@label} + end + + def finalize! + + end + + protected + + end# of widget + end # of WidgetRegisition + end # of Module +end # of OrbitApp diff --git a/vendor/built_in_modules/announcement/config/locales/zh_tw.yml b/vendor/built_in_modules/announcement/config/locales/zh_tw.yml index 4814586b..5fd57d49 100644 --- a/vendor/built_in_modules/announcement/config/locales/zh_tw.yml +++ b/vendor/built_in_modules/announcement/config/locales/zh_tw.yml @@ -15,3 +15,6 @@ zh_tw: search: 搜尋公告 update_bulletin_success: 公告已成功更新 update_bulletin_category_success: 公告類別已成功更新 + widget: + index: 目錄Widget + bulletins_and_web_links: 公告與連結並排Widget \ No newline at end of file diff --git a/vendor/built_in_modules/announcement/init.rb b/vendor/built_in_modules/announcement/init.rb index 8eb89423..c9f0771d 100644 --- a/vendor/built_in_modules/announcement/init.rb +++ b/vendor/built_in_modules/announcement/init.rb @@ -1,9 +1,36 @@ module Announcement OrbitApp.registration "Announcement",:type=> 'ModuleApp' do - + module_label 'announcement.announcement' base_url File.expand_path File.dirname(__FILE__) personal_plugin :enable => true,:path=>"panel/announcement/plugin/profile",:i18n=>'admin.announcement' + version "0.1" + organization "Rulingcom" + author "RD dep" + intro "I am intro" + update_info 'some update_info' + + front_end do + app_page 'bulletins' + end + + category ["BulletinCategory"] + + widgets do + default_widget do + query 'Bulletin.all' + image :image + end + + categories_query 'BulletinCategory.all' + tags_query 'AnnouncementTag.all' + + customize_widget "index","announcement.widget.index",:fields=>["title","category","postdate"] + customize_widget "bulletins_and_web_links","announcement.widget.bulletins_and_web_links" + # item "index","announcement.widget.index",:default_template=>true,:fields=>["title","category","postdate"] + # item "bulletins_and_web_links","announcement.widget.bulletins_and_web_links" + end + side_bar do head_label_i18n 'admin.announcement',:icon_class=>"icons-announcement" available_for [:admin,:guest,:manager,:sub_manager]