Merge branch 'nccu_master' into demo_site
Conflicts: Gemfile app/assets/javascripts/tinymce_orbit.js.erb app/assets/stylesheets/style.css.erb app/controllers/admin/assets_controller.rb app/controllers/admin/module_apps_new_interface_controller.rb app/controllers/admin/page_parts_controller.rb app/jobs/sync_db.rb app/models/page.rb app/models/page_part.rb app/models/user/user.rb app/uploaders/image_uploader.rb app/views/admin/assets/create.js.erb app/views/admin/module_apps/reload_frontend_pages.js.erb app/views/layouts/_orbit_bar.html.erb app/views/layouts/_side_bar.html.erb app/views/layouts/_users_checkbox_ary.html.erb app/views/shared/_privilege_user.html.erb config/mongoid.yml lib/parsers/parser_common.rb vendor/built_in_modules/announcement/announcement.json vendor/built_in_modules/announcement/app/controllers/panel/announcement/front_end/bulletins_controller.rb vendor/built_in_modules/announcement/app/controllers/panel/announcement/widget/bulletins_controller.rb vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_form_bulletin_link.html.erb vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/fact_checks/_privilege_user.html.erb vendor/built_in_modules/announcement/app/views/panel/announcement/front_end/bulletins/index.html.erb vendor/built_in_modules/announcement/app/views/panel/announcement/widget/bulletins/_index.html.erb
This commit is contained in:
commit
7d5531bf01
432 files changed
+8773
-17035
No files matched your search
@@ -21,7 +21,6 @@ module Orbit
|
||||
config.paths["vendor/plugins"] += %W(#{config.root}/vendor/downloaded_modules)
|
||||
config.paths["app/views"] += %W(#{config.root}/app/views/devise)
|
||||
|
||||
|
||||
# Settings in config/environments/* take precedence over those specified here.
|
||||
# Application configuration should go into files in config/initializers
|
||||
# -- all .rb files in that directory are automatically loaded.
|
||||
|
||||
+3
-1
@@ -5,4 +5,6 @@ defaults: &defaults
|
||||
ruling_digital: 'RulingDigital'
|
||||
|
||||
development:
|
||||
<<: *defaults
|
||||
<<: *defaults
|
||||
production:
|
||||
<<: *defaults
|
||||
@@ -12,7 +12,7 @@ Orbit::Application.configure do
|
||||
# Show full error reports and disable caching
|
||||
config.consider_all_requests_local = false
|
||||
#config.action_view.debug_rjs = true
|
||||
config.action_controller.perform_caching = false
|
||||
config.action_controller.perform_caching = true
|
||||
|
||||
# Don't care if the mailer can't send
|
||||
config.action_mailer.raise_delivery_errors = false
|
||||
@@ -23,6 +23,8 @@ Orbit::Application.configure do
|
||||
# Only use best-standards-support built into browsers
|
||||
config.action_dispatch.best_standards_support = :builtin
|
||||
|
||||
# config.cache_store = :mem_cache_store
|
||||
|
||||
|
||||
config.assets.debug = true
|
||||
|
||||
|
||||
@@ -1,22 +1,34 @@
|
||||
Orbit::Application.configure do
|
||||
# Settings specified here will take precedence over those in config/application.rb
|
||||
|
||||
# The production environment is meant for finished, "live" apps.
|
||||
# Code is not reloaded between requests
|
||||
config.cache_classes = true
|
||||
config.cache_classes = false
|
||||
|
||||
# Full error reports are disabled and caching is turned on
|
||||
config.consider_all_requests_local = false
|
||||
config.action_controller.perform_caching = true
|
||||
|
||||
# Disable Rails's static asset server (Apache or nginx will already do this)
|
||||
config.serve_static_assets = false
|
||||
|
||||
# Compress JavaScripts and CSS
|
||||
config.assets.compress = true
|
||||
|
||||
# Don't fallback to assets pipeline if a precompiled asset is missed
|
||||
config.assets.compile = true
|
||||
|
||||
# Generate digests for assets URLs
|
||||
config.assets.digest = true
|
||||
|
||||
# Defaults to Rails.root.join("public/assets")
|
||||
# config.assets.manifest = YOUR_PATH
|
||||
|
||||
# Specifies the header that your server uses for sending files
|
||||
config.action_dispatch.x_sendfile_header = "X-Sendfile"
|
||||
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
|
||||
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
|
||||
|
||||
# For nginx:
|
||||
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
|
||||
|
||||
# If you have no front-end server that supports something like X-Sendfile,
|
||||
# just comment this out and Rails will serve the files
|
||||
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
||||
# config.force_ssl = true
|
||||
|
||||
# See everything in the log (default is :info)
|
||||
# config.log_level = :debug
|
||||
@@ -27,13 +39,13 @@ Orbit::Application.configure do
|
||||
# Use a different cache store in production
|
||||
# config.cache_store = :mem_cache_store
|
||||
|
||||
# Disable Rails's static asset server
|
||||
# In production, Apache or nginx will already do this
|
||||
config.serve_static_assets = false
|
||||
|
||||
# Enable serving of images, stylesheets, and javascripts from an asset server
|
||||
# Enable serving of images, stylesheets, and JavaScripts from an asset server
|
||||
# config.action_controller.asset_host = "http://assets.example.com"
|
||||
|
||||
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
|
||||
# config.assets.precompile += %w( search.js )
|
||||
config.assets.precompile += %w( *.js *.css *.js.* *.css.* tinymce/tiny_mce_popup.js )
|
||||
|
||||
# Disable delivery errors, bad email addresses will be ignored
|
||||
# config.action_mailer.raise_delivery_errors = false
|
||||
|
||||
@@ -46,9 +58,4 @@ Orbit::Application.configure do
|
||||
|
||||
# Send deprecation notices to registered listeners
|
||||
config.active_support.deprecation = :notify
|
||||
|
||||
|
||||
#compress both stylesheets and Javascripts
|
||||
config.assets.js_compressor = :uglifier
|
||||
config.assets.css_compressor = :scss
|
||||
end
|
||||
@@ -0,0 +1,54 @@
|
||||
PrototypeR4::Application.configure do
|
||||
# Settings specified here will take precedence over those in config/application.rb
|
||||
|
||||
# The production environment is meant for finished, "live" apps.
|
||||
# Code is not reloaded between requests
|
||||
config.cache_classes = true
|
||||
|
||||
# Full error reports are disabled and caching is turned on
|
||||
config.consider_all_requests_local = false
|
||||
config.action_controller.perform_caching = true
|
||||
|
||||
# Specifies the header that your server uses for sending files
|
||||
config.action_dispatch.x_sendfile_header = "X-Sendfile"
|
||||
|
||||
# For nginx:
|
||||
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
|
||||
|
||||
# If you have no front-end server that supports something like X-Sendfile,
|
||||
# just comment this out and Rails will serve the files
|
||||
|
||||
# See everything in the log (default is :info)
|
||||
# config.log_level = :debug
|
||||
|
||||
# Use a different logger for distributed setups
|
||||
# config.logger = SyslogLogger.new
|
||||
|
||||
# Use a different cache store in production
|
||||
# config.cache_store = :mem_cache_store
|
||||
|
||||
# Disable Rails's static asset server
|
||||
# In production, Apache or nginx will already do this
|
||||
config.serve_static_assets = false
|
||||
|
||||
# Enable serving of images, stylesheets, and javascripts from an asset server
|
||||
# config.action_controller.asset_host = "http://assets.example.com"
|
||||
|
||||
# Disable delivery errors, bad email addresses will be ignored
|
||||
# config.action_mailer.raise_delivery_errors = false
|
||||
|
||||
# Enable threaded mode
|
||||
# config.threadsafe!
|
||||
|
||||
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
||||
# the I18n.default_locale when a translation can not be found)
|
||||
config.i18n.fallbacks = true
|
||||
|
||||
# Send deprecation notices to registered listeners
|
||||
config.active_support.deprecation = :notify
|
||||
|
||||
|
||||
#compress both stylesheets and Javascripts
|
||||
config.assets.js_compressor = :uglifier
|
||||
config.assets.css_compressor = :scss
|
||||
end
|
||||
@@ -0,0 +1,44 @@
|
||||
PrototypeR4::Application.configure do
|
||||
# Settings specified here will take precedence over those in config/application.rb
|
||||
|
||||
# In the development environment your application's code is reloaded on
|
||||
# every request. This slows down response time but is perfect for development
|
||||
# since you don't have to restart the webserver when you make code changes.
|
||||
config.cache_classes = false
|
||||
|
||||
# Log error messages when you accidentally call methods on nil.
|
||||
config.whiny_nils = true
|
||||
|
||||
# Show full error reports and disable caching
|
||||
config.consider_all_requests_local = false
|
||||
#config.action_view.debug_rjs = true
|
||||
config.action_controller.perform_caching = false
|
||||
|
||||
# Don't care if the mailer can't send
|
||||
config.action_mailer.raise_delivery_errors = false
|
||||
|
||||
# Print deprecation notices to the Rails logger
|
||||
config.active_support.deprecation = :log
|
||||
|
||||
# Only use best-standards-support built into browsers
|
||||
config.action_dispatch.best_standards_support = :builtin
|
||||
|
||||
|
||||
config.middleware.use ExceptionNotifier,
|
||||
:email_prefix => "[R4_error]",
|
||||
:sender_address => %{"notifier" <redmine@rulingcom.com>},
|
||||
:exception_recipients => %w{chris@rulingcom.com}
|
||||
|
||||
config.action_mailer.delivery_method = :smtp
|
||||
config.action_mailer.smtp_settings = {
|
||||
:tls => true,
|
||||
:enable_starttls_auto => true,
|
||||
:address => "smtp.gmail.com",
|
||||
:port => '587',
|
||||
:domain => "smtp.gmail.com",
|
||||
:authentication => "plain",
|
||||
:user_name => "redmine@rulingcom.com",
|
||||
:password => "rulingredmine" }
|
||||
|
||||
end
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
class AtLeastOneValidator < ActiveModel::EachValidator
|
||||
|
||||
def validate_each(record, attribute, value)
|
||||
record.errors[attribute] << (options[:message] || I18n.t("errors.at_least_one")) if (value.blank? || value.values.join.eql?(''))
|
||||
end
|
||||
|
||||
end
|
||||
@@ -21,6 +21,8 @@ Devise.setup do |config|
|
||||
# parameters are used only when authenticating and not when retrieving from
|
||||
# session. If you need permissions, you should implement that in a before filter.
|
||||
# config.authentication_keys = [ :email ]
|
||||
config.authentication_keys = [ :nccu_ldap_uid ]
|
||||
|
||||
|
||||
# Tell if authentication through request.params is enabled. True by default.
|
||||
# config.params_authenticatable = true
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
APP_CONFIG = YAML.load_file("#{Rails.root}/config/config.yml")[Rails.env]
|
||||
APP_CONFIG = YAML.load_file("#{Rails.root}/config/config.yml")[Rails.env]
|
||||
LDAP_CONFIG = YAML.load_file("#{Rails.root}/config/ldap.yml")[Rails.env]
|
||||
@@ -0,0 +1,21 @@
|
||||
#encoding: utf-8
|
||||
require 'mysql2'
|
||||
|
||||
$mid_site_connection
|
||||
|
||||
module MiddleSiteConnection
|
||||
|
||||
@mid_host = {
|
||||
:host => 'mruling.nccu.edu.tw', #mruling.nccu.edu.tw or 127.0.0.1
|
||||
:port => 3306, #3306 or 8005
|
||||
:username => "rulingcom",
|
||||
:password => "5w3iJQ9OJQMGhJibKP6YQje8",
|
||||
:database => "RSS23_NCCU_MIDDLE",
|
||||
:encoding => "UTF8"
|
||||
}
|
||||
|
||||
def self.establish
|
||||
$mid_site_connection = Mysql2::Client.new(@mid_host)
|
||||
end
|
||||
|
||||
end
|
||||
@@ -0,0 +1,16 @@
|
||||
#encoding: utf-8
|
||||
require 'mysql2'
|
||||
|
||||
$nccu_ldap_connection
|
||||
|
||||
module NccuLdapConnection
|
||||
BASE = 'ou=People,dc=nccu,dc=edu,dc=tw'
|
||||
|
||||
def self.establish
|
||||
$nccu_ldap_connection = Net::LDAP.new
|
||||
$nccu_ldap_connection.port =LDAP_CONFIG["port"]
|
||||
$nccu_ldap_connection.host = LDAP_CONFIG["host"]
|
||||
$nccu_ldap_connection.authenticate(LDAP_CONFIG["authenticate_info"],LDAP_CONFIG["authenticate_pwd"])
|
||||
end
|
||||
|
||||
end
|
||||
@@ -3,3 +3,24 @@ Integer.class_eval do
|
||||
!self.zero?
|
||||
end
|
||||
end
|
||||
|
||||
module SocialShareButton
|
||||
module Helper
|
||||
def social_share_button_tag(title = "", opts = {})
|
||||
rel = opts[:rel]
|
||||
html = []
|
||||
html << "<div class='social-share-button' data-title='#{title}' data-img='#{opts[:image]}' data-fb_url='#{opts[:fb_url]}'>"
|
||||
|
||||
SocialShareButton.config.allow_sites.each do |name|
|
||||
link_title = t "social_share_button.share_to", :name => t("social_share_button.#{name.downcase}")
|
||||
html << link_to("","#", :rel => "nofollow #{rel}",
|
||||
"data-site" => name,
|
||||
:class => "social-share-button-#{name}",
|
||||
:onclick => "return SocialShareButton.share(this);",
|
||||
:title => h(link_title))
|
||||
end
|
||||
html << "</div>"
|
||||
raw html.join("\n")
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,3 @@
|
||||
Resque::Server.use(Rack::Auth::Basic) do |user, password|
|
||||
password == "SD-7506D"
|
||||
end
|
||||
@@ -0,0 +1,19 @@
|
||||
# Warden::Strategies.add(:check_nccu_ldap) do
|
||||
# def valid?
|
||||
# # code here to check whether to try and authenticate using this strategy;
|
||||
# params['nccu_ldap_uid'] && params['password']
|
||||
# end
|
||||
# def authenticate!
|
||||
# debugger
|
||||
# user = User.first(conditions:{ nccu_ldap_uid: "901001" })
|
||||
# if user
|
||||
# success! user
|
||||
# else
|
||||
# success! User.create
|
||||
#
|
||||
# # fail!(message)
|
||||
# # User.create
|
||||
# end
|
||||
# end
|
||||
#
|
||||
# end
|
||||
@@ -0,0 +1,3 @@
|
||||
SocialShareButton.configure do |config|
|
||||
config.allow_sites = %w(twitter facebook)
|
||||
end
|
||||
@@ -0,0 +1,12 @@
|
||||
defaults: &defaults
|
||||
authenticate_info: 'cn=uccn,ou=profile,dc=nccu,dc=edu,dc=tw'
|
||||
authenticate_pwd: 'nccu2ucc'
|
||||
|
||||
development:
|
||||
<<: *defaults
|
||||
host: '127.0.0.1'
|
||||
port: 8001
|
||||
production:
|
||||
<<: *defaults
|
||||
host: '140.119.166.23'
|
||||
port: 389
|
||||
+2
-1
@@ -10,6 +10,7 @@ markups:
|
||||
public_r_tags:
|
||||
- ad_banner
|
||||
- sub_menu
|
||||
- sitemap
|
||||
|
||||
page_part_kinds:
|
||||
- text
|
||||
@@ -37,4 +38,4 @@ widget_field_type:
|
||||
- status
|
||||
- tag
|
||||
- viewcount
|
||||
- poster
|
||||
- poster
|
||||
@@ -9,6 +9,9 @@ en:
|
||||
failure:
|
||||
unauthenticated: 'You need to sign in or sign up before continuing.'
|
||||
unconfirmed: 'You have to confirm your account before continuing.'
|
||||
ldap_invalid: 'Your LDAP account is invalid'
|
||||
ldap_connection_failed: 'LDAP connection failed'
|
||||
ldap_pass_but_account_not_in_orbit: 'LDAP account is not supported to sign up this site.'
|
||||
locked: 'Your account is locked.'
|
||||
invalid: 'Invalid email or password.'
|
||||
invalid_token: 'Invalid authentication token.'
|
||||
|
||||
@@ -9,6 +9,9 @@ zh_tw:
|
||||
failure:
|
||||
unauthenticated: '您需要先註冊、登入後才能繼續。'
|
||||
unconfirmed: '您的帳號需需要經過確認後,才能繼續。'
|
||||
ldap_invalid: '您的LDAP帳號錯誤'
|
||||
ldap_connection_failed: '與LDAP之間連線異常'
|
||||
ldap_pass_but_account_not_in_orbit: '很抱歉,您的LDAP帳號並不支援在此網站登入'
|
||||
locked: '您的帳號已被鎖定。'
|
||||
invalid: 'Email 或密碼是無效的。'
|
||||
invalid_token: '無效的認證代碼。'
|
||||
|
||||
+24
-2
@@ -11,6 +11,7 @@ en:
|
||||
back: Back
|
||||
browse: Browse
|
||||
cancel: Cancel
|
||||
cant_empty_star: Cannot be empty (*)
|
||||
create_fail: Creation failed
|
||||
create: Create
|
||||
delete: Delete
|
||||
@@ -33,6 +34,8 @@ en:
|
||||
nccu: NCCU
|
||||
nccu_c:
|
||||
nccu_ldap_uid: NCCU LDAP Account
|
||||
off_upcase: "OFF"
|
||||
on_upcase: "ON"
|
||||
or_lower: or
|
||||
password: Password
|
||||
register: Register
|
||||
@@ -46,7 +49,8 @@ en:
|
||||
view: View
|
||||
view_count: View count
|
||||
yes_: "Yes"
|
||||
|
||||
addthis_tools:
|
||||
add_to_bookmark: Add this to bookmark
|
||||
all_content: All Content
|
||||
all_file: All File
|
||||
all_member: All Member
|
||||
@@ -65,6 +69,7 @@ en:
|
||||
role: Role
|
||||
site_info: Site Info
|
||||
site_name: Site Name
|
||||
sitemap: Sitemap
|
||||
statistics: Statistics
|
||||
title: Title
|
||||
total_visitors: Total Visitors
|
||||
@@ -75,6 +80,9 @@ en:
|
||||
visitors_this_month: This month's visitors
|
||||
visitors_this_year: This year's visitors
|
||||
|
||||
errors:
|
||||
at_least_one: must at least have one value
|
||||
|
||||
admin:
|
||||
access:
|
||||
denied:
|
||||
@@ -289,4 +297,18 @@ en:
|
||||
modal:
|
||||
close: Close
|
||||
preview: Preview
|
||||
|
||||
sys:
|
||||
not_previewable: "Preview not support"
|
||||
limit_of_upload_file_size: "Upload file must be less than: %{best_size}"
|
||||
preview_only_for_img: "Preview only supprt with file type:jpg,png,gif,bmp"
|
||||
can_not_display_due_to_no_context: "Can not display due to no context for English"
|
||||
module_page_lang_not_support: "We are sorry, this page is not available for English"
|
||||
search:
|
||||
not_found: "NOT FOUND"
|
||||
domains: Google Search Domains
|
||||
site_search: Site Search
|
||||
sitesearch: Google Site Search
|
||||
site_setting_help: Please Enter the search argument for Google search.
|
||||
result_get: "Searched about ' %{search_word} ' Found %{item_num} items"
|
||||
too_many: "Search about ' %{search_word} 'resulted more than %{exceed_num} items maybe try to search with more specific terms?"
|
||||
unit_get: "Listed items created by :%{unit_name} Found %{item_num} items"
|
||||
@@ -0,0 +1,14 @@
|
||||
en:
|
||||
social_share_button:
|
||||
share_to: Share to %{name}
|
||||
weibo: Sina Weibo
|
||||
twitter: Twitter
|
||||
facebook: Facebook
|
||||
douban: Douban
|
||||
qq: Qzone
|
||||
tqq: Tqq
|
||||
delicious: Delicious
|
||||
baidu: Baidu.com
|
||||
kaixin001: Kaixin001.com
|
||||
renren: Renren.com
|
||||
google_plus: Google+
|
||||
@@ -0,0 +1,14 @@
|
||||
zh_tw:
|
||||
social_share_button:
|
||||
share_to: 分享到%{name}
|
||||
weibo: 新浪微博
|
||||
twitter: Twitter
|
||||
facebook: Facebook
|
||||
douban: 豆瓣
|
||||
qq: QQ空間
|
||||
tqq: 腾讯微博
|
||||
delicious: Delicious
|
||||
baidu: 百度收藏
|
||||
kaixin001: 開心網
|
||||
renren: 人人網
|
||||
google_plus: Google+
|
||||
@@ -8,6 +8,7 @@ zh_tw:
|
||||
back: 回上一步
|
||||
browse: 選擇檔案
|
||||
cancel: 取消
|
||||
cant_empty_star: 不能為空 (*)
|
||||
create: 新增
|
||||
create_fail: 創建失敗
|
||||
delete: 刪除
|
||||
@@ -25,8 +26,13 @@ zh_tw:
|
||||
homepage: 首頁
|
||||
login: 登入
|
||||
logout: 登出
|
||||
nccu: 政大
|
||||
nccu_c:
|
||||
nccu_ldap_uid: iNCCU帳號
|
||||
no_: "No"
|
||||
nothing: 無
|
||||
off_upcase: "OFF"
|
||||
on_upcase: "ON"
|
||||
or_lower: 或
|
||||
password: 密碼
|
||||
register: 註冊
|
||||
@@ -41,6 +47,8 @@ zh_tw:
|
||||
view_count: 查看次數
|
||||
yes_: "Yes"
|
||||
|
||||
addthis_tools:
|
||||
add_to_bookmark: 加入書籤
|
||||
all_content: 全部內容有
|
||||
all_file: 全部檔案有
|
||||
all_member: 成員總數
|
||||
@@ -59,6 +67,7 @@ zh_tw:
|
||||
role: 角色
|
||||
site_info: 網站資訊
|
||||
site_name: 網站名稱
|
||||
sitemap: 網站地圖
|
||||
statistics: 統計
|
||||
title: 標題
|
||||
total_visitors: 造訪次數
|
||||
@@ -69,6 +78,9 @@ zh_tw:
|
||||
visitors_this_month: 本月造訪
|
||||
visitors_this_year: 今年造訪
|
||||
|
||||
errors:
|
||||
at_least_one: 必須至少有一個值
|
||||
|
||||
admin:
|
||||
access:
|
||||
denied:
|
||||
@@ -138,11 +150,12 @@ zh_tw:
|
||||
create_success_snippet: 片段已成功新增。
|
||||
create_success_user: 用戶已成功新增。。
|
||||
dashboard: 儀表板
|
||||
data: 資料數據
|
||||
data: 選擇檔案
|
||||
delete_language: 刪除語言
|
||||
description: 描述
|
||||
design: 版型管理
|
||||
disable_language: 禁用語言
|
||||
edit: 編輯
|
||||
editing_home: 編輯首頁
|
||||
editing_layout: 編輯樣板
|
||||
editing_link: 編輯連結
|
||||
@@ -198,6 +211,8 @@ zh_tw:
|
||||
no_layout: 您沒有佈局
|
||||
name: 名稱
|
||||
nccu: 政大客制
|
||||
nccu_c:
|
||||
nccu_ldap_uid: NCCU LDAP 帳號
|
||||
new_asset: 新增資產
|
||||
new_component: 新增元件
|
||||
new_design: 新設計
|
||||
@@ -423,6 +438,17 @@ zh_tw:
|
||||
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
|
||||
@@ -500,4 +526,13 @@ zh_tw:
|
||||
submit: "儲存%{model}"
|
||||
modal:
|
||||
close: "關閉"
|
||||
preview: "預覽"
|
||||
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: "重新啓用"
|
||||
+2
-1
@@ -21,4 +21,5 @@ production:
|
||||
# password: <%= ENV['MONGOID_PASSWORD'] %>
|
||||
# database: <%= ENV['MONGOID_DATABASE'] %>
|
||||
<<: *defaults
|
||||
database: prototype_r4_development
|
||||
database: prototype_r4_ldap0229
|
||||
slave_ok: true
|
||||
+25
-12
@@ -1,19 +1,31 @@
|
||||
rails_env = 'development' #ENV['RAILS_ENV'] || "production"
|
||||
rails_root = ENV['RAILS_ROOT'] || "/Users/kaito/Documents/MyWorkspeace/orbit/orbit"
|
||||
#developer pls change here
|
||||
rails_root = "/home/nccu/NCCU/" #keep this blank when development
|
||||
|
||||
development_uid = 'kaito' #when dev
|
||||
development_gid = 'staff' #when dev
|
||||
|
||||
#rails_env = "developement"
|
||||
rails_env = "production"
|
||||
|
||||
development_rails_root = File.expand_path("..",File.dirname(__FILE__))
|
||||
#rails_root = (rails_env == 'production' )? production_rails_root : development_rails_root
|
||||
num_workers = rails_env == 'production' ? 5 : 2
|
||||
|
||||
num_workers.times do |num|
|
||||
God.watch do |w|
|
||||
w.dir = "#{rails_root}"
|
||||
w.name = "resque-#{num}"
|
||||
w.group = 'resque'
|
||||
w.interval = 30.seconds
|
||||
p "/usr/bin/rake -f #{rails_root}/Rakefile resque:work QUEUE=* RAILS_ENV=#{rails_env}"
|
||||
# w.env = {"QUEUE"=>"critical,high,low", "RAILS_ENV"=>rails_env}
|
||||
w.start = "rake -f #{rails_root}/Rakefile resque:work QUEUE=* RAILS_ENV=#{rails_env}"
|
||||
|
||||
w.uid = 'kaito'
|
||||
w.gid = 'staff'
|
||||
w.dir = rails_root
|
||||
w.name = "resque-#{num}"
|
||||
w.group = 'resque'
|
||||
|
||||
w.interval = 30.seconds
|
||||
w.env = {"QUEUE"=>"critical,high,low", "RAILS_ENV"=>rails_env}
|
||||
w.start = "rake -f #{rails_root}/Rakefile resque:work QUEUE=* RAILS_ENV=#{rails_env}"
|
||||
|
||||
w.uid = (rails_env == 'production' )? "root" : development_uid
|
||||
w.gid = (rails_env == 'production' )? "root" : development_gid
|
||||
|
||||
w.log = (rails_env == 'production' )? "/var/log/#{w.name}.log":"#{rails_root}/log/#{w.name}.log"
|
||||
|
||||
# restart if memory gets too high
|
||||
w.transition(:up, :restart) do |on|
|
||||
@@ -52,4 +64,5 @@ num_workers.times do |num|
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
#developer pls change here
|
||||
rails_root = "/home/nccu/NCCU/" #keep this blank when development
|
||||
|
||||
development_uid = 'kaito' #when dev
|
||||
development_gid = 'staff' #when dev
|
||||
|
||||
#rails_env = "developement"
|
||||
rails_env = "production"
|
||||
|
||||
development_rails_root = File.expand_path("..",File.dirname(__FILE__))
|
||||
#rails_root = (rails_env == 'production' )? production_rails_root : development_rails_root
|
||||
|
||||
God.watch do |w|
|
||||
w.dir = rails_root
|
||||
w.name = "resque-scheduler"
|
||||
w.group = 'resque'
|
||||
w.interval = 30.seconds
|
||||
w.env = {"QUEUE"=>"critical,high,low", "RAILS_ENV"=>rails_env}
|
||||
w.start = "rake -f #{rails_root}/Rakefile resque:scheduler RAILS_ENV=#{rails_env}"
|
||||
|
||||
w.uid = (rails_env == 'production' )? "root" : development_uid
|
||||
w.gid = (rails_env == 'production' )? "root" : development_gid
|
||||
|
||||
w.log = (rails_env == 'production' )? "/var/log/#{w.name}.log":"#{rails_root}/log/#{w.name}.log"
|
||||
|
||||
# restart if memory gets too high
|
||||
w.transition(:up, :restart) do |on|
|
||||
on.condition(:memory_usage) do |c|
|
||||
c.above = 350.megabytes
|
||||
c.times = 2
|
||||
end
|
||||
end
|
||||
|
||||
# determine the state on startup
|
||||
w.transition(:init, { true => :up, false => :start }) do |on|
|
||||
on.condition(:process_running) do |c|
|
||||
c.running = true
|
||||
end
|
||||
end
|
||||
|
||||
# determine when process has finished starting
|
||||
w.transition([:start, :restart], :up) do |on|
|
||||
on.condition(:process_running) do |c|
|
||||
c.running = true
|
||||
c.interval = 5.seconds
|
||||
end
|
||||
|
||||
# failsafe
|
||||
on.condition(:tries) do |c|
|
||||
c.times = 5
|
||||
c.transition = :start
|
||||
c.interval = 5.seconds
|
||||
end
|
||||
end
|
||||
|
||||
# start if process is not running
|
||||
w.transition(:up, :start) do |on|
|
||||
on.condition(:process_running) do |c|
|
||||
c.running = false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -5,19 +5,19 @@
|
||||
# description: Runs the perform method in FetchTime
|
||||
|
||||
nccu_daily_ldap_sync:
|
||||
cron: * * [0,12] * * *
|
||||
cron: 0 0 [0,12] * * *
|
||||
class: SyncDb
|
||||
args:
|
||||
description: Sync NCCU middle site with Orbit for LDAP data
|
||||
|
||||
nccu_daily_restart:
|
||||
cron: * * */3 * * *
|
||||
class: RestartServer
|
||||
nccu_daily_backup:
|
||||
cron: 0 0 3 * * *
|
||||
class: BackupServer
|
||||
args:
|
||||
description: Restart NCCU site
|
||||
description: Backup NCCU site
|
||||
|
||||
nccu_claender_sync:
|
||||
cron: * * [0,12] * * *
|
||||
cron: 0 0 [0,12] * * *
|
||||
class: NccuCalendar
|
||||
args:
|
||||
description: Sync NCCU calendar RSS Feeds
|
||||
+13
-7
@@ -1,6 +1,7 @@
|
||||
Orbit::Application.routes.draw do
|
||||
|
||||
devise_for :users,:controllers => {:sessions => 'sessions'}
|
||||
mount Resque::Server, :at => "/admin/resque"
|
||||
devise_for :users
|
||||
|
||||
# routes for sinatra app
|
||||
match '/site/set_registered', :to => CentralServerExchangeApp
|
||||
@@ -16,7 +17,7 @@ Orbit::Application.routes.draw do
|
||||
resources :assets do
|
||||
collection do
|
||||
get 'file_upload'
|
||||
post 'delete'
|
||||
get 'delete'
|
||||
end
|
||||
end
|
||||
resources :asset_categories
|
||||
@@ -52,7 +53,7 @@ Orbit::Application.routes.draw do
|
||||
resources :designs do
|
||||
collection do
|
||||
get 'upload_package'
|
||||
post 'delete'
|
||||
get 'delete'
|
||||
post 'upload_package'
|
||||
end
|
||||
member do
|
||||
@@ -114,10 +115,12 @@ Orbit::Application.routes.draw do
|
||||
get 'add_attribute_field'
|
||||
end
|
||||
resources :sites do
|
||||
get 'site_info'
|
||||
get 'system_info'
|
||||
get 'language'
|
||||
get 'mail_setting'
|
||||
get 'site_info'
|
||||
get 'sitemap'
|
||||
get 'sitemap_frontend'
|
||||
get 'sitemap_toggle', :on => :member
|
||||
get 'system_info'
|
||||
get 'ui_theme'
|
||||
end
|
||||
resources :snippets
|
||||
@@ -230,9 +233,12 @@ Orbit::Application.routes.draw do
|
||||
match '/panel/:app_name/front_end/:app_action' => 'pages#index_from_link', :constraints => lambda { |request|
|
||||
!request.query_string.include?("inner=true")
|
||||
}
|
||||
|
||||
match '/share/:model/:id' => 'application#render_share'
|
||||
|
||||
# routes for gridfs files
|
||||
match "/gridfs/*path" => "gridfs#serve"
|
||||
match "/gridfs/*path" => "gridfs#serve"
|
||||
|
||||
# match "/images/*path" => "gridfs#serve_images"
|
||||
# match "/admin/pages/images/*path" => "gridfs#serve_images"
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
production:
|
||||
solr:
|
||||
hostname: localhost
|
||||
port: 8983
|
||||
log_level: WARNING
|
||||
|
||||
development:
|
||||
solr:
|
||||
hostname: localhost
|
||||
port: 8982
|
||||
log_level: INFO
|
||||
|
||||
test:
|
||||
solr:
|
||||
hostname: localhost
|
||||
port: 8981
|
||||
log_level: WARNING
|
||||
Reference in new issue
Block a user