orbit-basic/config/routes.rb

261 lines
9.9 KiB
Ruby

Orbit::Application.routes.draw do
devise_for :users,:controllers => {:sessions => 'sessions'}
mount Resque::Server, :at => "/admin/resque"
# routes for sinatra app
match '/site/set_registered', :to => CentralServerExchangeApp
match '/site/public_key', :to => CentralServerExchangeApp
match '/site/update', :to => GithubApp
match '/purchase/:type', :to => CentralServerExchangeApp
match 'load_orbit_bar' => 'pages#load_orbit_bar'
# routes for admin
namespace :admin do
mount Resque::Server.new, :at => "/resque"
resources :assets do
collection do
get 'file_upload'
get 'delete'
end
end
resources :asset_categories
resources :asset_tags
resources :app_auths
resources :object_auths do
match 'new_interface/:ob_type/:title/new' => "object_auths_new_interface#new" ,:as => :init_ob_auth,:via => :get
match 'new_interface' => "object_auths_new_interface#setting" ,:as => :ob_auth,:via => :get
match 'new_interface' => "object_auths_new_interface#update_setting" ,:as => :ob_auth,:via => :post
match 'new_interface' => "object_auths_new_interface#user_list" ,:as => :ob_auth_show,:via => :put
collection do
match 'new/:type/:obj_id',:action => 'new',:via => "get",:as => :init
end
member do
match ':id/create_role',:action => 'create_role',:via => "post",:as => :create_role
match 'remove/:type/:target_id' ,:action=> 'remove_role',:via => "delete",:as =>:remove
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
resources :ad_banners do
collection do
match 'new_ad_image' => 'ad_images#new',:as => :new_ad_image,:via => :get
match 'new_ad_image' => 'ad_images#create',:as => :create_ad_image,:via => :post
end
resources :ad_images ,:except => [:show,:index]
end
resources :dashboards
resources :designs do
collection do
get 'upload_package'
get 'delete'
post 'upload_package'
end
member do
post 'edit_file' => 'designs#edit_file'
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
match 'manager_auth_proc' => "module_apps_new_interface#user_list" ,:as => :manager_auth_show,:via => :put
resources :app_auths do
member do
match 'remove/:type/:target_id' ,:action=> 'remove',:via => "delete",:as =>:remove
end
end
member do
match 'assign_manager' ,:action=> 'assign_manager',:via => "post",:as =>:assign_manager
match 'assign_sub_manager' ,:action=> 'assign_sub_manager',:via => "post",:as =>:assign_sub_manager
match 'remove_manager/:app_manager_id' ,:action=> 'remove_manager',:via => "delete",:as =>:remove_manager
match 'remove_sub_manager/:app_sub_manager_id' ,:action=> 'remove_sub_manager',:via => "delete",:as =>:remove_sub_manager
get 'reload_frontend_pages'
end
end
resources :page_parts do
member do
get 'reload_widgets'
get 'reload_widget_styles'
get 'reload_r_tag_options'
end
end
resources :plugins
resources :purchases do
collection do
get 'install_app'
end
member do
get 'download'
end
end
resources :roles do
get 'add_sub_role'
get 'add_attribute_field'
end
resources :sites do
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
resources :tags
resources :translations
resources :users
resources :users_new_interface do
member do
get 'temp_edit'
end
end
end
# end admin
namespace :panel do
resources :users
end
match '/desktop/'=>'desktop#index'
# Sinatra Routes start
# match '/desktop/desktop', :to => Desktopapp::DesktopApp
# match '/desktop/app_manager', :to => Desktopapp::DesktopApp
# match '/desktop/sections', :to => Desktopapp::DesktopApp
# match '/desktop/settings', :to => Desktopapp::DesktopApp
# match '/desktop/get_desktop_settings/', :to => Desktopapp::DesktopApp
# match '/desktop/save_desktop_settings/', :to => Desktopapp::DesktopApp
# match '/desktop/getgroups/', :to => Desktopapp::DesktopApp
# match '/desktop/getsectionlist/', :to => Desktopapp::DesktopApp
# match '/desktop/settingthemes/', :to => Desktopapp::DesktopApp
# match '/desktop/settingsections/', :to => Desktopapp::DesktopApp
# match '/desktop/getapplist/', :to => Desktopapp::DesktopApp
# match '/desktop/newpositions/', :to => Desktopapp::DesktopApp
# match '/desktop/settingconnection/', :to => Desktopapp::DesktopApp
# match '/desktop/journal_p/', :to => Desktopapp::DesktopAppPublications
# match '/desktop/journal_p_list/', :to => Desktopapp::DesktopAppPublications
# match '/desktop/journal_p_add/', :to => Desktopapp::DesktopAppPublications
# match '/desktop_publications/getjournals', :to => Desktopapp::DesktopAppPublications
# match '/desktop/twitter/', :to => Desktopapp::Otheraccounts
# match '/desktop/forgmail/', :to => Desktopapp::Otheraccounts
# match '/desktop/getaccounts', :to => Desktopapp::Otheraccounts
# match '/desktop/save_account_info/', :to => Desktopapp::Otheraccounts
# match '/desktop_appstore/appstore', :to => Desktopapp::DesktopAppAppstore
# match '/desktop_appstore/widgets', :to => Desktopapp::DesktopAppAppstore
# match '/desktop_appstore/getuserwidgets', :to => Desktopapp::DesktopAppAppstore
# match '/desktop_appstore/widgets_settings', :to => Desktopapp::DesktopAppAppstore
# Sinatra Routes end
match '/desktop/desktop'=>'desktop#desktop'
match '/desktop/app_manager'=>'desktop#app_manager'
match '/desktop/sections'=>'desktop#sections'
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/settingthemes/'=>'desktop#settingthemes'
match '/desktop/settingsections/'=>'desktop#settingsections'
match '/desktop/getapplist/'=>'desktop#getapplist'
match '/desktop/newpositions/'=>'desktop#newpositions'
match '/desktop/settingconnection/'=>'desktop#settingconnection'
match '/desktop/journal_p/'=>'desktop_publications#journal_p'
match '/desktop/journal_p_list/'=>'desktop_publications#journal_p_list'
match '/desktop/journal_p_add/'=>'desktop_publications#journal_p_add'
match '/desktop_publications/getjournals' => 'desktop_publications#getjournals'
match '/desktop/books' => 'desktop_publications#books'
match '/desktop/books_list/'=>'desktop_publications#books_list'
match '/desktop/books_add/'=>'desktop_publications#books_add'
match '/desktop/seminar_p' => 'desktop_publications#seminar_p'
match '/desktop/seminar_p_list/'=>'desktop_publications#seminar_p_list'
match '/desktop/seminar_p_add/'=>'desktop_publications#seminar_p_add'
match '/desktop/research_d' => 'desktop_research#research_d'
match '/desktop/research_d_list/' => 'desktop_research#research_d_list'
match '/desktop/research_d_add' => 'desktop_research#research_d_add'
match '/desktop/research_p' => 'desktop_research#research_p'
match '/desktop/research_p_list/' => 'desktop_research#research_p_list'
match '/desktop/research_p_add' => 'desktop_research#research_p_add'
match '/desktop/twitter/'=>'otheraccounts#twitter'
match '/desktop/forgmail/'=>'otheraccounts#gmail'
match '/desktop/getaccounts'=>'otheraccounts#getaccounts'
match '/desktop/save_account_info/'=>'otheraccounts#saveaccountinfo'
match '/desktop_appstore/appstore'=>'desktop_appstore#appstore'
match '/desktop_appstore/widgets'=>'desktop_appstore#widgets'
match '/desktop_appstore/getuserwidgets'=>'desktop_appstore#getuserwidgets'
match '/desktop_appstore/widgets_settings'=>'desktop_appstore#widgets_settings'
match '/desktop_orbit/orbit' => 'desktop_orbit#orbit'
match '/desktop_orbit/eventajaxload'=> 'desktop_orbit#eventajaxload'
match '/desktop_orbit/gettimelinespan' => 'desktop_orbit#gettimelinespan'
#match '/desktop_orbit/eventajaxload' => 'desktop_publications#create_journal'
#match '/desktop_orbit/eventajaxload' => 'desktop_publications#delete_journal'
# match '/desktop_orbit/eventajaxload' => 'desktop_publications#update_journal'
match '/desktop/temp_func/'=>'desktop#temp_func'
match '/panel/:app_name/front_end/:app_action/:id(/:controller_action)' => 'pages#show_from_link', :constraints => lambda { |request|
!request.query_string.include?("inner=true")
}
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 "/images/*path" => "gridfs#serve_images"
# match "/admin/pages/images/*path" => "gridfs#serve_images"
# routes for pages to generate
match '*page_name' => 'pages#show', :as => :page, :constraints => lambda{|request|
!request.path.starts_with?("/panel")
}
root :to => 'pages#index'
end