+
+ <%#= share_links(@ad_image, 'ad_image') %>
+
+
+<% else %>
+
+<% end %>
\ No newline at end of file
diff --git a/app/views/front/show_page_sub_menu.html.erb b/app/views/front/show_page_sub_menu.html.erb
index 7dfcb0af..ebe51f73 100644
--- a/app/views/front/show_page_sub_menu.html.erb
+++ b/app/views/front/show_page_sub_menu.html.erb
@@ -1,7 +1,7 @@
<% if @menu_page && @menu_page.visible_children.size > 0 %>
<%= @menu_page.title %>
-
"
+
<% @menu_page.visible_children.each do |child| %>
<%= child.title %>
diff --git a/app/views/kaminari/_first_page.mobile.erb b/app/views/kaminari/_first_page.mobile.erb
new file mode 100644
index 00000000..d6509d9e
--- /dev/null
+++ b/app/views/kaminari/_first_page.mobile.erb
@@ -0,0 +1,11 @@
+<%# Link to the "First" page
+ - available local variables
+ url: url to the first page
+ current_page: a page object for the currently displayed page
+ num_pages: total number of pages
+ per_page: number of items to fetch per page
+ remote: data-remote
+-%>
+
diff --git a/app/views/kaminari/_gap.mobile.erb b/app/views/kaminari/_gap.mobile.erb
new file mode 100644
index 00000000..c680799d
--- /dev/null
+++ b/app/views/kaminari/_gap.mobile.erb
@@ -0,0 +1,8 @@
+<%# Non-link tag that stands for skipped pages...
+ - available local variables
+ current_page: a page object for the currently displayed page
+ num_pages: total number of pages
+ per_page: number of items to fetch per page
+ remote: data-remote
+-%>
+
diff --git a/app/views/kaminari/_last_page.mobile.erb b/app/views/kaminari/_last_page.mobile.erb
new file mode 100644
index 00000000..fab90b65
--- /dev/null
+++ b/app/views/kaminari/_last_page.mobile.erb
@@ -0,0 +1,11 @@
+<%# Link to the "Last" page
+ - available local variables
+ url: url to the last page
+ current_page: a page object for the currently displayed page
+ num_pages: total number of pages
+ per_page: number of items to fetch per page
+ remote: data-remote
+-%>
+
diff --git a/app/views/kaminari/_next_page.mobile.erb b/app/views/kaminari/_next_page.mobile.erb
new file mode 100644
index 00000000..1af41ec0
--- /dev/null
+++ b/app/views/kaminari/_next_page.mobile.erb
@@ -0,0 +1,11 @@
+<%# Link to the "Next" page
+ - available local variables
+ url: url to the next page
+ current_page: a page object for the currently displayed page
+ num_pages: total number of pages
+ per_page: number of items to fetch per page
+ remote: data-remote
+-%>
+
diff --git a/app/views/kaminari/_page.mobile.erb b/app/views/kaminari/_page.mobile.erb
new file mode 100644
index 00000000..38f9533f
--- /dev/null
+++ b/app/views/kaminari/_page.mobile.erb
@@ -0,0 +1,16 @@
+<%# Link showing page number
+ - available local variables
+ page: a page object for "this" page
+ url: url to this page
+ current_page: a page object for the currently displayed page
+ num_pages: total number of pages
+ per_page: number of items to fetch per page
+ remote: data-remote
+-%>
+
diff --git a/app/views/kaminari/_paginator.mobile.erb b/app/views/kaminari/_paginator.mobile.erb
new file mode 100644
index 00000000..8871496f
--- /dev/null
+++ b/app/views/kaminari/_paginator.mobile.erb
@@ -0,0 +1,25 @@
+<%# The container tag
+ - available local variables
+ current_page: a page object for the currently displayed page
+ num_pages: total number of pages
+ per_page: number of items to fetch per page
+ remote: data-remote
+ paginator: the paginator that renders the pagination tags inside
+-%>
+<%= paginator.render do -%>
+
+<% end -%>
diff --git a/app/views/kaminari/_prev_page.mobile.erb b/app/views/kaminari/_prev_page.mobile.erb
new file mode 100644
index 00000000..d39b7618
--- /dev/null
+++ b/app/views/kaminari/_prev_page.mobile.erb
@@ -0,0 +1,11 @@
+<%# Link to the "Previous" page
+ - available local variables
+ url: url to the previous page
+ current_page: a page object for the currently displayed page
+ num_pages: total number of pages
+ per_page: number of items to fetch per page
+ remote: data-remote
+-%>
+
\ No newline at end of file
diff --git a/app/views/layouts/_member_orbit_menu.erb b/app/views/layouts/_member_orbit_menu.erb
index fc703960..c617b143 100644
--- a/app/views/layouts/_member_orbit_menu.erb
+++ b/app/views/layouts/_member_orbit_menu.erb
@@ -1,7 +1,7 @@
Orbit
+
+ <%= link_to mobile_dialog_language_path, {:class => "ui-btn-right language", "data-iconpos" => "notext", "data-icon" => "search", "data-rel" => "dialog"} do %>
+
+ <% end %>
+
\ No newline at end of file
diff --git a/app/views/mobile/_header_dialog_contact.mobile.erb b/app/views/mobile/_header_dialog_contact.mobile.erb
new file mode 100644
index 00000000..bb512814
--- /dev/null
+++ b/app/views/mobile/_header_dialog_contact.mobile.erb
@@ -0,0 +1,3 @@
+
+
<%= t('mobile.contact') %>
+
\ No newline at end of file
diff --git a/app/views/mobile/_header_dialog_copyright.mobile.erb b/app/views/mobile/_header_dialog_copyright.mobile.erb
new file mode 100644
index 00000000..99dbd8c3
--- /dev/null
+++ b/app/views/mobile/_header_dialog_copyright.mobile.erb
@@ -0,0 +1,3 @@
+
+
<%= t('mobile.copyright') %>
+
\ No newline at end of file
diff --git a/app/views/mobile/_header_dialog_language.mobile.erb b/app/views/mobile/_header_dialog_language.mobile.erb
new file mode 100644
index 00000000..cfb754b7
--- /dev/null
+++ b/app/views/mobile/_header_dialog_language.mobile.erb
@@ -0,0 +1,3 @@
+
+
<%= t('mobile.language') %>
+
\ No newline at end of file
diff --git a/app/views/mobile/_header_map.mobile.erb b/app/views/mobile/_header_map.mobile.erb
new file mode 100644
index 00000000..4911cf01
--- /dev/null
+++ b/app/views/mobile/_header_map.mobile.erb
@@ -0,0 +1,3 @@
+
+
<%= t('mobile.location') %>
+
\ No newline at end of file
diff --git a/app/views/mobile/_language_select.mobile.erb b/app/views/mobile/_language_select.mobile.erb
new file mode 100644
index 00000000..8e897dbd
--- /dev/null
+++ b/app/views/mobile/_language_select.mobile.erb
@@ -0,0 +1,9 @@
+
\ No newline at end of file
diff --git a/app/views/mobile/_menu.mobile.erb b/app/views/mobile/_menu.mobile.erb
new file mode 100644
index 00000000..eecc8226
--- /dev/null
+++ b/app/views/mobile/_menu.mobile.erb
@@ -0,0 +1,7 @@
+
+
+
\ No newline at end of file
diff --git a/app/views/mobile/announcement.mobile.erb b/app/views/mobile/announcement.mobile.erb
new file mode 100644
index 00000000..247ca214
--- /dev/null
+++ b/app/views/mobile/announcement.mobile.erb
@@ -0,0 +1,13 @@
+
+
+
diff --git a/app/views/mobile/map.mobile.erb b/app/views/mobile/map.mobile.erb
new file mode 100644
index 00000000..ba969acb
--- /dev/null
+++ b/app/views/mobile/map.mobile.erb
@@ -0,0 +1,5 @@
+<%= content_for :header do %>
+ <%= render 'header_map' %>
+<% end %>
+
+
\ No newline at end of file
diff --git a/app/views/mobile/page.mobile.erb b/app/views/mobile/page.mobile.erb
new file mode 100644
index 00000000..91c8ab71
--- /dev/null
+++ b/app/views/mobile/page.mobile.erb
@@ -0,0 +1,10 @@
+
+ <% @page_contexts.each do |page_context| %>
+
+ <%= link_to mobile_page_content_path(page_context) do %>
+
<%= page_context.page.title %>
+ <% end %>
+
+ <% end %>
+
+<%= paginate @page_contexts, :param_name => :page_main, :window => 2 %>
\ No newline at end of file
diff --git a/app/views/mobile/page_content.mobile.erb b/app/views/mobile/page_content.mobile.erb
new file mode 100644
index 00000000..bea0ab95
--- /dev/null
+++ b/app/views/mobile/page_content.mobile.erb
@@ -0,0 +1,2 @@
+
<%= @page_context.page.title %>
+
<%= @page_context.context.html_safe rescue '' %>
\ No newline at end of file
diff --git a/config/environments/development.rb b/config/environments/development.rb
index 1ae657f6..ed5dc3a6 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -10,7 +10,7 @@ Orbit::Application.configure do
config.whiny_nils = true
# Show full error reports and disable caching
- config.consider_all_requests_local = false
+ config.consider_all_requests_local = true
#config.action_view.debug_rjs = true
config.action_controller.perform_caching = true
diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb
index 1a997c5f..8ab419a1 100644
--- a/config/initializers/devise.rb
+++ b/config/initializers/devise.rb
@@ -80,7 +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
+ config.timeout_in = 5.days
# ==> Configuration for :lockable
# Defines which strategy will be used to lock an account.
diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb
index 72aca7e4..087fb2ca 100644
--- a/config/initializers/mime_types.rb
+++ b/config/initializers/mime_types.rb
@@ -3,3 +3,5 @@
# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf
# Mime::Type.register_alias "text/html", :iphone
+
+Mime::Type.register_alias "text/html", :mobile
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 8dea5eb3..b499353e 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -284,7 +284,9 @@ en:
text: Text Area
passed: Approved
password: Password
- password_confirmation: Password Confirmation
+ password_change: Change password
+ password_confirmation: Password confirmation
+ password_current: Current password
pending: Pending
picture: Picture
placeholder: Placeholder
@@ -327,11 +329,13 @@ en:
description: Site description
description_help: ''
footer: Site footer
+ header: Site header
footer_help: ''
info: Site information
keywords: Site keywords
keywords_help: ''
language: Site language
+ mobile_version: Mobile version
search: Site Search
search_help: Please Enter the search argument for Google search.
settings: Site setting
diff --git a/config/locales/mobile.en.yml b/config/locales/mobile.en.yml
new file mode 100644
index 00000000..b72ca7c0
--- /dev/null
+++ b/config/locales/mobile.en.yml
@@ -0,0 +1,11 @@
+en:
+
+ mobile:
+ bulletin: Bulletin
+ contact: Contact
+ copyright: Copyright
+ home: Home
+ language: Language
+ location: Location
+ location_description: '
國立政治大學
11605 臺北市文山區指南路二段64號'
+ page: Page
\ No newline at end of file
diff --git a/config/locales/mobile.zh_tw.yml b/config/locales/mobile.zh_tw.yml
new file mode 100644
index 00000000..75dea668
--- /dev/null
+++ b/config/locales/mobile.zh_tw.yml
@@ -0,0 +1,11 @@
+zh_tw:
+
+ mobile:
+ bulletin: 公告
+ contact: 聯絡資訊
+ copyright: 版權宣告
+ home: 首頁
+ language: 語言
+ location: 地理位置
+ location_description: '
國立政治大學
11605 臺北市文山區指南路二段64號'
+ page: 頁面
\ No newline at end of file
diff --git a/config/locales/ntu.en.yml b/config/locales/ntu.en.yml
new file mode 100644
index 00000000..bffdd7c5
--- /dev/null
+++ b/config/locales/ntu.en.yml
@@ -0,0 +1,15 @@
+en:
+
+ ntu:
+ site_names:
+ "00": "Dean of General Affairs"
+ "01": "Documentation Division"
+ "02": "Cashier Division"
+ "03": "General Service Division"
+ "04": "General Affairs Division, College of Social Science"
+ "05": "Property Management Division"
+ "06": "Procurement Division"
+ "07": "Facilities Service Division"
+ "08": "General Service Division"
+ "09": "Campus Security"
+ "10": "Construction and Maintenance Division"
\ No newline at end of file
diff --git a/config/locales/ntu.zh_tw.yml b/config/locales/ntu.zh_tw.yml
new file mode 100644
index 00000000..cfd0f499
--- /dev/null
+++ b/config/locales/ntu.zh_tw.yml
@@ -0,0 +1,15 @@
+zh_tw:
+
+ ntu:
+ site_names:
+ "00": "總務處"
+ "01": "文書組"
+ "02": "出納組"
+ "03": "事務組"
+ "04": "社科院總務分處"
+ "05": "保管組"
+ "06": "採購組"
+ "07": "經營管理組"
+ "08": "事務組"
+ "09": "駐警隊"
+ "10": "營繕組"
\ No newline at end of file
diff --git a/config/locales/picker.en.yml b/config/locales/picker.en.yml
new file mode 100644
index 00000000..999d9195
--- /dev/null
+++ b/config/locales/picker.en.yml
@@ -0,0 +1,14 @@
+en:
+
+ datetime_picker:
+ date:
+ label: Date
+ placeholder: "YYYY-MM-DD"
+ default:
+ label: Date and time
+ placeholder: "YYYY-MM-DD HH:MM"
+ separated:
+ label: Date and time
+ time:
+ label: Time
+ placeholder: "HH:MM"
\ No newline at end of file
diff --git a/config/locales/picker.zh_tw.yml b/config/locales/picker.zh_tw.yml
new file mode 100644
index 00000000..1bedaa99
--- /dev/null
+++ b/config/locales/picker.zh_tw.yml
@@ -0,0 +1,14 @@
+zh_tw:
+
+ datetime_picker:
+ date:
+ label: 日期
+ placeholder: "YYYY-MM-DD"
+ default:
+ label: 日期和時間
+ placeholder: "YYYY-MM-DD HH:MM"
+ separated:
+ label: 日期和時間
+ time:
+ label: 時間
+ placeholder: "HH:MM"
\ No newline at end of file
diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml
index c8075b24..a79e7897 100644
--- a/config/locales/zh_tw.yml
+++ b/config/locales/zh_tw.yml
@@ -150,6 +150,25 @@ zh_tw:
deadline: 最後期限
default: Default
default_css: 預設樣式表
+ default_widget:
+ no_support_setting: 沒有可以使用的設定
+ no_value: 不設定(全部)
+ fields_order: 輸出欄位順序
+ fields_style: 輸出欄位樣式
+ select_module_app: 外掛模組選擇
+ select_widget_path: 外掛樣版選擇
+ select_widget_style: 排版樣式
+ widget_data_count: 模組輸出則數
+ select_widget_ext_option: 模組延伸選項
+ caption:
+ typeA: 表格式排版,簡單明瞭呈現內容
+ typeB_style2: 一圖一文式,輸出欄位水平排列
+ typeB_style3: 一圖一文式,輸出欄位垂直排列,圖片在左方
+ typeB_style4: 一圖一文式,輸出欄位垂直排列,圖片在右方
+ typeC: 一圖多文式,輸出欄位垂直排列
+ data_source:
+ category: 資料來源:類別
+ tag: 資料來源:標籤
delete:
file: 刪除檔案
success:
@@ -284,7 +303,9 @@ zh_tw:
text: 文字區域
passed: 通過審核
password: 密碼
+ password_change: 更改密碼
password_confirmation: 確認密碼
+ password_current: 目前的密碼
pending: 待審核
picture: 圖片
placeholder: Placeholder
@@ -327,11 +348,13 @@ zh_tw:
description: 網站描述
description_help: ''
footer: 網站頁尾
+ header: 網站頁首
footer_help: ''
info: 網站資訊
keywords: 搜尋關鍵字
keywords_help: ''
language: 網站語言
+ mobile_version: 手機版
search: 網站搜尋
search_help: 請輸入送交Google搜尋的參數
settings: 基本設定
@@ -389,6 +412,7 @@ zh_tw:
paper: Paper was successfully updated.
user: User was successfully updated.
success_: S使用者已更新成功
+ update_: 更新
update_at: 最後更新時間
url: 網址
use_status: ''
@@ -402,3 +426,4 @@ zh_tw:
visitors_this_year: 今年造訪人次
visitors_today: 今日造訪人次
yes_: "是"
+
diff --git a/config/resque_schedule.yml b/config/resque_schedule.yml
index 67d006ed..7c16fc24 100644
--- a/config/resque_schedule.yml
+++ b/config/resque_schedule.yml
@@ -16,8 +16,8 @@ nccu_daily_backup:
args:
description: Backup NCCU site
-nccu_claender_sync:
+update_tag_cloud:
cron: 0 0 [0,12] * * *
- class: NccuCalendar
+ class: UpdateTagCloud
args:
- description: Sync NCCU calendar RSS Feeds
\ No newline at end of file
+ description: UpdateTagCloud
\ No newline at end of file
diff --git a/config/routes.rb b/config/routes.rb
index d682f14a..0d51680a 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -40,7 +40,6 @@ Orbit::Application.routes.draw do
end
end
-
match 'ad_banners/:id/preview' => 'ad_banners#realtime_preview',:as => :realtime_preview_ad_banner,:via => :put
match 'ad_banners/:id/rename' => 'ad_banners#rename',:as => :rename_ad_banner,:via => :post
@@ -51,6 +50,7 @@ Orbit::Application.routes.draw do
end
resources :ad_images ,:except => [:show,:index]
end
+
resources :dashboards
resources :designs do
collection do
@@ -64,22 +64,27 @@ Orbit::Application.routes.draw do
post 'upload_image' => 'designs#upload_image'
end
end
+
resources :infos do
get 'add_attribute_field'
end
+
resources :items
+
match 'update_position' => 'items#update_position'
resources :links do
member do
get 'delete'
end
end
+
resources :pages do
member do
get 'delete'
get 'reload_themes'
end
end
+
resources :module_apps do
match 'manager_auth_proc' => "module_apps_new_interface#setting" ,:as => :manager_auth_proc,:via => :get
match 'manager_auth_proc' => "module_apps_new_interface#update_setting" ,:as => :manager_auth_proc,:via => :post
@@ -99,6 +104,7 @@ Orbit::Application.routes.draw do
get 'reload_frontend_pages'
end
end
+
resources :page_parts do
member do
get 'reload_widgets'
@@ -106,6 +112,7 @@ Orbit::Application.routes.draw do
get 'reload_r_tag_options'
end
end
+
resources :plugins
resources :purchases do
collection do
@@ -116,6 +123,7 @@ Orbit::Application.routes.draw do
get 'download'
end
end
+
resources :roles do
get 'role_field'
get 'sub_role_field'
@@ -124,6 +132,7 @@ Orbit::Application.routes.draw do
get 'edit_sub_role'
get 'add_attribute_field'
end
+
resources :sites do
get 'mail_setting'
get 'site_info'
@@ -134,18 +143,20 @@ Orbit::Application.routes.draw do
get 'ui_theme'
get 'change_design'
end
+
resources :tags
resources :users
+
resources :users_new_interface do
member do
get 'temp_edit'
end
end
-
+
resources :member_selects do
- match 'member_select_search' => "member_selects#member_select_search" ,:as => :member_select_search,:via => "post"
- match 'member_select_add' => "member_selects#member_select_add" ,:as => :member_select_add,:via => "post"
- end
+ match 'member_select_search' => "member_selects#member_select_search" ,:as => :member_select_search,:via => "post"
+ match 'member_select_add' => "member_selects#member_select_add" ,:as => :member_select_add,:via => "post"
+ end
match 'module_store' => 'module_store#index'
match 'module_store/show' => 'module_store#show'
@@ -168,33 +179,24 @@ Orbit::Application.routes.draw do
end
match "desktop" => "desktop#index"
- namespace :desktop do
- match "desktop" => "desktop#desktop"
- match '/journal_pages/get_journals_json' => 'journal_pages#get_journals_json'
- match '/desktop'=>'desktop#desktop'
- match '/app_manager'=>'desktop#app_manager'
- match '/allsections'=>'desktop#allsections'
- match '/settings'=>'desktop#settings'
- match '/get_desktop_settings/'=>'desktop#get_desktop_settings'
- match '/save_desktop_settings/'=>'desktop#save_desktop_settings'
- match '/getgroups/'=>'desktop#getgroups'
- match '/getsectionlist/'=>'desktop#getsectionlist'
- match '/themes/'=>'desktop#themes'
- match '/sections/'=>'desktop#sections'
- match '/getapplist/'=>'desktop#getapplist'
- match '/newpositions/'=>'desktop#newpositions'
- match '/connections/'=>'desktop#connections'
- match '/widget_layout' => 'desktop#widget_layout'
- match '/temp_func/'=>'desktop#temp_func'
-
- resources :journal_pages, except: :show
- resources :journal_lists, only: :index
- resources :co_authors, except: :show
- resources :co_author_relations, except: :show
- end
+ match "/desktop/desktop" => "desktop#desktop"
+ match '/desktop/desktop'=>'desktop#desktop'
+ match '/desktop/app_manager'=>'desktop#app_manager'
+ match '/desktop/allsections'=>'desktop#allsections'
+ match '/desktop/settings'=>'desktop#settings'
+ match '/desktop/get_desktop_settings/'=>'desktop#get_desktop_settings'
+ match '/desktop/save_desktop_settings/'=>'desktop#save_desktop_settings'
+ match '/desktop/getgroups/'=>'desktop#getgroups'
+ match '/desktop/getsectionlist/'=>'desktop#getsectionlist'
+ match '/desktop/themes/'=>'desktop#themes'
+ match '/desktop/sections/'=>'desktop#sections'
+ match '/desktop/getapplist/'=>'desktop#getapplist'
+ match '/desktop/newpositions/'=>'desktop#newpositions'
+ match '/desktop/connections/'=>'desktop#connections'
+ match '/desktop/widget_layout' => 'desktop#widget_layout'
+ match '/desktop/temp_func/'=>'desktop#temp_func'
# namespace :desktop_publications do
- match 'desktop_publications/journal_p'=>'desktop_publications#journal_p'
match 'desktop_publications/books' => 'desktop_publications#books'
match 'desktop_publications/books_list'=>'desktop_publications#books_list'
match 'desktop_publications/books_add'=>'desktop_publications#books_add'
@@ -235,16 +237,38 @@ Orbit::Application.routes.draw do
#match '/desktop_orbit/eventajaxload' => 'desktop_publications#delete_journal'
# match '/desktop_orbit/eventajaxload' => 'desktop_publications#update_journal'
-
- scope '/front' do
- match 'show_banner/:id' => 'front#show_banner', :as => :front_show_banner
- match 'show_footer' => 'front#show_footer', :as => :front_show_footer
- match 'show_menu/:id' => 'front#show_menu', :as => :front_show_menu
- match 'show_page_sub_menu' => 'front#show_page_sub_menu', :as => :front_show_page_sub_menu
- match 'show_site_sub_menu' => 'front#show_site_sub_menu', :as => :front_show_site_sub_menu
- match 'show_sitemap' => 'front#show_sitemap', :as => :front_show_sitemap
+ def controller_paths(controller, actions)
+ actions.each do |action|
+ if action.eql? 'index'
+ match "#{controller}" => "#{controller}##{action}", :as => "#{controller}"
+ else
+ match "#{controller}/#{action}(/:id)" => "#{controller}##{action}", :as => "#{controller}_#{action}"
+ end
+ end
end
+ controller_paths :front, %w[show_banner show_footer show_menu show_page_sub_menu show_site_sub_menu show_sitemap]
+ controller_paths :mobile, %w[index announcement announcement_content dialog_contact dialog_copyright dialog_language map page page_content]
+
+ scope 'app' do
+ controller_paths :mobile, %w[index announcement announcement_content dialog_contact dialog_copyright dialog_language map page page_content]
+ end
+
+ scope '/mobile' do
+ match 'announcement' => 'mobile#announcement', :as => 'mobile_announcement'
+ match 'announcement_content/:id' => 'mobile#announcement_content', :as => 'mobile_announcement_content'
+ match 'dialog_contact' => 'mobile#dialog_contact', :as => 'mobile_dialog_contact'
+ match 'dialog_copyright' => 'mobile#dialog_copyright', :as => 'mobile_dialog_copyright'
+ match 'dialog_language' => 'mobile#dialog_language', :as => 'mobile_dialog_language'
+ match 'map' => 'mobile#map', :as => 'mobile_map'
+ match 'page' => 'mobile#page', :as => 'mobile_page'
+ match 'page_content/:id' => 'mobile#page_content', :as => 'mobile_page_content'
+ root :to => 'mobile#index', :as => 'mobile'
+ end
+
+
+ match '/panel/orbit_app/widget/:type' => 'default_widget#default_widget'
+
match '/panel/:app_name/front_end/:app_action/:id(/:controller_action)' => 'pages#show_from_link', :constraints => lambda { |request|
!request.query_string.include?("inner=true")
@@ -269,4 +293,6 @@ Orbit::Application.routes.draw do
root :to => 'pages#index'
+ match '/panel/ad_banner/front_end/inner_page/:id' => 'front#show_inner_ad_image', :as => :front_show_inner_ad_image
+
end
diff --git a/lib/orbit_app/error_handlers/applications_error_handler.rb b/lib/orbit_app/error_handlers/applications_error_handler.rb
new file mode 100644
index 00000000..2748f8c4
--- /dev/null
+++ b/lib/orbit_app/error_handlers/applications_error_handler.rb
@@ -0,0 +1,14 @@
+
+# require "#{File.dirname(__FILE__)}/module_app_error_handler.rb"
+# require "#{File.dirname(__FILE__)}/object_auth_error_handler.rb"
+# require "#{File.dirname(__FILE__)}/module_app_error_handler.rb"
+# require "#{File.dirname(__FILE__)}/page_error_handler.rb"
+
+
+# module OrbitApp
+# module ErrorHandlers
+# module ApplicationsErrorHandler
+
+# end
+# end
+# end
diff --git a/lib/orbit_app/error_handlers/module_app_error_handler.rb b/lib/orbit_app/error_handlers/module_app_error_handler.rb
new file mode 100644
index 00000000..8cf5decd
--- /dev/null
+++ b/lib/orbit_app/error_handlers/module_app_error_handler.rb
@@ -0,0 +1,17 @@
+module OrbitApp
+ module ErrorHandlers
+ module ModuleAppErrorHandler
+
+
+ def render_module_app_error(exception = nil)
+ default_message = 'ModuleAppErrorHandler'
+ meaasge = ''
+
+ if exception
+ meaasge = default_message +" " + exception.message
+ end
+ render :text=>meaasge
+ end
+ end
+ end
+end
diff --git a/lib/orbit_app/error_handlers/object_auth_error_handler.rb b/lib/orbit_app/error_handlers/object_auth_error_handler.rb
new file mode 100644
index 00000000..62eb137c
--- /dev/null
+++ b/lib/orbit_app/error_handlers/object_auth_error_handler.rb
@@ -0,0 +1,16 @@
+module OrbitApp
+ module ErrorHandlers
+ module ObjectAuthErrorHandler
+
+
+ def render_object_auth_error(exception = nil)
+ default_message = 'This is a render_object_auth_error'
+ meaasge = ''
+ if exception
+ meaasge = default_message +" " + exception.message
+ end
+ render :text=>meaasge
+ end
+ end
+ end
+end
diff --git a/lib/orbit_app/error_handlers/page_error_handler.rb b/lib/orbit_app/error_handlers/page_error_handler.rb
new file mode 100644
index 00000000..44ecda1f
--- /dev/null
+++ b/lib/orbit_app/error_handlers/page_error_handler.rb
@@ -0,0 +1,16 @@
+module OrbitApp
+ module ErrorHandlers
+ module PageErrorHandler
+
+
+ def render_page_error(exception = nil)
+ default_message = 'ModuleAppErrorHandler'
+ meaasge = ''
+ if exception
+ meaasge = default_message +" " + exception.message
+ end
+ render :text=>meaasge
+ end
+ end
+ end
+end
diff --git a/lib/orbit_core_lib.rb b/lib/orbit_core_lib.rb
index 3abeeddd..4f1e6fd2 100644
--- a/lib/orbit_core_lib.rb
+++ b/lib/orbit_core_lib.rb
@@ -140,7 +140,7 @@ module OrbitCoreLib
protected
def generate_token
- self.s_token = ActiveSupport::SecureRandom.hex(16)
+ self.s_token = SecureRandom.hex(16)
self.save!
end
end
diff --git a/lib/parsers/parser_back_end.rb b/lib/parsers/parser_back_end.rb
index c3c43fe8..d0c1eab6 100644
--- a/lib/parsers/parser_back_end.rb
+++ b/lib/parsers/parser_back_end.rb
@@ -30,6 +30,7 @@ module ParserBackEnd
parse_images_edit(body, page)
parse_footer_edit(body, page)
parse_sub_menu_edit(body, page)
+ parse_counter_edit(body)
public_r_tags.each do |tag|
send("parse_#{tag}s_edit", body, page, true)
end
diff --git a/lib/parsers/parser_common.rb b/lib/parsers/parser_common.rb
index 6dbec1e2..1075fe75 100644
--- a/lib/parsers/parser_common.rb
+++ b/lib/parsers/parser_common.rb
@@ -9,7 +9,7 @@ module ParserCommon
res << "'>"
i = nil
i = 1 if menu.values["li_incremental_#{current}"]
- children = current == 1 ? page.visible_children.reverse : page.visible_children
+ children = current == 1 ? page.visible_children : page.visible_children
children.each do |child|
res << menu_li(child, current_page, current, menu, i, edit)
i += 1 if i
@@ -206,8 +206,14 @@ module ParserCommon
when 'text'
ret << part.content rescue ''
when 'module_widget'
- url = "/panel/#{part.module_app.key}/widget/#{part.widget_path}?inner=true"
- options = "&category_id=#{!part[:category].blank? ? part[:category].blank? : category}&tag_id=#{!part[:tag].blank? ? part[:tag] : tag}&page=#{params[:page]}&search_query=#{params[:search_query]}&part_title=#{Rack::Utils.escape(part_title).gsub("+", "%20") rescue nil}"
+ url = case part.widget_path
+ when 'default_widget'
+ "/panel/orbit_app/widget/#{part.widget_style}?inner=true"
+ else
+ raise ModuleAppError,"PagePart can't find ModuleApp" if part.module_app.nil?
+ "/panel/#{part.module_app.key}/widget/#{part.widget_path}?inner=true"
+ end
+ options = "&part_id=#{part.id}&category_id=#{!part[:category].blank? ? part[:category].blank? : category}&tag_id=#{!part[:tag].blank? ? part[:tag] : tag}&page=#{params[:page]}&search_query=#{params[:search_query]}&part_title=#{Rack::Utils.escape(part_title).gsub("+", "%20") rescue nil}"
ret << ""
when 'public_r_tag'
ret << ""
@@ -228,7 +234,7 @@ module ParserCommon
end
# page_counter
- def parse_counter(body = nil, page = nil, edit=nil)
+ def parse_counter_edit(body = nil)
body.css('.page_counter').each do |counter|
res = ''
case counter['option']
@@ -243,7 +249,7 @@ module ParserCommon
when 'this_year'
res << display_visitors_this_year.to_s
end
- fragment = Nokogiri::HTML::DocumentFragment.new(body, res)
+ fragment = Nokogiri::HTML::DocumentFragment.new(body, "
#{res}
")
counter.swap(fragment)
end
end
diff --git a/lib/parsers/parser_front_end.rb b/lib/parsers/parser_front_end.rb
index 11fe5934..246e6c20 100644
--- a/lib/parsers/parser_front_end.rb
+++ b/lib/parsers/parser_front_end.rb
@@ -11,6 +11,7 @@ module ParserFrontEnd
parse_images(body, page)
parse_menu(body, page)
parse_sub_menu(body, page, site)
+ parse_counter(body)
i18n.merge!({locale => body.to_html})
end
i18n
@@ -21,10 +22,14 @@ module ParserFrontEnd
tag = params[:tag_id].blank? ? page[:tag] : params[:tag_id]
body = Nokogiri::HTML(page.content)
body.css('orbit_front').each do |front|
- ret = ''
- part = PagePart.find(front['part_id']) if front['part_id']
- ret << eval("\"#{front['path']}\"") rescue ''
- fragment = Nokogiri::HTML::DocumentFragment.new(body, "")
+ if front['value']
+ fragment = Nokogiri::HTML::DocumentFragment.new(body, "
#{eval(front['value']).to_s}
")
+ else
+ ret = ''
+ part = PagePart.find(front['part_id']) if front['part_id']
+ ret << eval("\"#{front['path']}\"") rescue ''
+ fragment = Nokogiri::HTML::DocumentFragment.new(body, "")
+ end
front.swap(fragment)
end
body.to_html
@@ -102,9 +107,18 @@ module ParserFrontEnd
when 'text'
ret << part.content_translations[locale.to_s] rescue ''
when 'module_widget'
- url = "/panel/\#{part.module_app.key}/widget/\#{part.widget_path}?inner=true"
- options = "&category_id=\#{!part[:category].blank? ? part[:category].blank? : category}&tag_id=\#{!part[:tag].blank? ? part[:tag] : tag}&page=\#{params[:page]}&search_query=\#{params[:search_query]}&part_title=\#{Rack::Utils.escape(part_title).gsub(\"\+\", \"\%20\") rescue nil}"
- ret << "
\ No newline at end of file
diff --git a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_filter.html.erb b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_filter.html.erb
index 7fc9cb80..906db029 100644
--- a/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_filter.html.erb
+++ b/vendor/built_in_modules/announcement/app/views/panel/announcement/back_end/bulletins/_filter.html.erb
@@ -2,21 +2,21 @@
<% end %>
-
\ No newline at end of file
+
diff --git a/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/_form.html.erb b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/_form.html.erb
index 1314a7c4..8912b1d2 100644
--- a/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/_form.html.erb
+++ b/vendor/built_in_modules/archive/app/views/panel/archive/back_end/archive_files/_form.html.erb
@@ -7,10 +7,10 @@
\ No newline at end of file
diff --git a/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/_form.html.erb b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/_form.html.erb
index 6f767502..a232af26 100644
--- a/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/_form.html.erb
+++ b/vendor/built_in_modules/personal_journal/app/views/panel/personal_journal/back_end/writing_journals/_form.html.erb
@@ -7,8 +7,8 @@