diff --git a/app/assets/images/cancerpredict/triangle_add.png b/app/assets/images/cancerpredict/triangle_add.png new file mode 100644 index 0000000..086202d Binary files /dev/null and b/app/assets/images/cancerpredict/triangle_add.png differ diff --git a/app/assets/images/cancerpredict/triangle_sub.png b/app/assets/images/cancerpredict/triangle_sub.png new file mode 100644 index 0000000..c6ae87c Binary files /dev/null and b/app/assets/images/cancerpredict/triangle_sub.png differ diff --git a/app/assets/javascripts/cancer_predict.js b/app/assets/javascripts/cancer_predict.js index 24e11a3..d156fc8 100644 --- a/app/assets/javascripts/cancer_predict.js +++ b/app/assets/javascripts/cancer_predict.js @@ -15,6 +15,109 @@ $(document).ready(function(){ $('#show_help_modal').modal('hide'); }); }); + $('.btn-add').click(function(){ + $(this).parent().find('.num_only').removeClass('cancertable_empty'); + if($(this).parent().find('.num_only').val()!=""){ + var input_value = Number($(this).parent().find('.num_only').val()); + if(Array.isArray($(this).parent().find('.num_only').data('range'))){ + var compare_value = $(this).parent().find('.num_only').data('range')[1]; + if(compare_value != undefined){ + if(input_value+1 <= Number(compare_value)) + $(this).parent().find('.num_only').val(input_value+1); + else{ + input_value = $(this).parent().find('.num_only').data('range')[0]; + if(input_value != undefined) + $(this).parent().find('.num_only').val(input_value); + }; + }else{ + $(this).parent().find('.num_only').val(input_value+1); + }; + }; + }else{ + try{ + var input_value = $(this).parent().find('.num_only').data('range')[0]; + if(input_value != undefined) + $(this).parent().find('.num_only').val(input_value); + }catch{ + $(this).parent().find('.num_only').val(0); + }; + }; + }); + $('.btn-sub').click(function(){ + $(this).parent().find('.num_only').removeClass('cancertable_empty'); + if($(this).parent().find('.num_only').val()!=""){ + var input_value = Number($(this).parent().find('.num_only').val()); + if(Array.isArray($(this).parent().find('.num_only').data('range'))){ + var compare_value = $(this).parent().find('.num_only').data('range')[0]; + if(compare_value != undefined){ + if(input_value-1 >= Number(compare_value)) + $(this).parent().find('.num_only').val(input_value-1); + else{ + input_value = $(this).parent().find('.num_only').data('range')[1]; + if(input_value != undefined) + $(this).parent().find('.num_only').val(input_value); + }; + }else{ + $(this).parent().find('.num_only').val(input_value-1); + }; + }; + }else{ + try{ + var input_value = $(this).parent().find('.num_only').data('range')[1]; + if(input_value != undefined) + $(this).parent().find('.num_only').val(input_value); + }catch{ + $(this).parent().find('.num_only').val(0); + }; + }; + }); + $('.cancer_table_btn').click(function(){ + var index = $(this).index()/2; + $(this).parent().find('>input').attr('value',0); + $(this).parent().find('>input').eq(index).attr('value',1); + $(this).parent().find('>button').removeClass('active'); + $(this).addClass('active'); + $(this).parent().removeClass('cancertable_empty'); + }); + $('#cancer_table_reset').click(function(){ + $('.cancer_table_btn').removeClass('active'); + $('.cancer-btn-group input').attr('value',0); + $('.num_only').val(''); + $('.cancer_form_field').removeClass('cancertable_empty'); + }); + $('#cancer_table_submit').click(function(){ + var flag = 1; + for(var i = 0;i < $('.cancer_form_field').length;i++){ + if($('.cancer_form_field').eq(i).hasClass('num_only')){ + if($('.cancer_form_field').eq(i).val()==""){ + flag = 0; + $('.cancer_form_field').eq(i).addClass('cancertable_empty'); + }else{ + $('.cancer_form_field').eq(i).removeClass('cancertable_empty'); + }; + }else{ + if($('.cancer_form_field').eq(i).find('[value="1"]').length == 0){ + flag = 0; + $('.cancer_form_field').eq(i).addClass('cancertable_empty'); + }else{ + $('.cancer_form_field').eq(i).removeClass('cancertable_empty'); + } + }; + } + if(flag == 1){ + var post_json= {}; + for(var i = 0;i < $('.cancer_form_field').length;i++){ + var name = $('.cancer_form_field').eq(i).attr('id') + if($('.cancer_form_field').eq(i).hasClass('num_only')) + post_json[name] = $('.cancer_form_field').eq(i).val(); + else{ + var index = ($('.cancer_form_field').eq(i).find('[value="1"]').index()+1)/2; + post_json[name] = index; + }; + }; + var result = $.post("/cancerpredictResult",{"data":post_json},function(data){console.log(data)}); + } + }); $('.num_only').focus for(var i=0;i<$('.num_only').length;i++) $('.num_only').eq(i).data('range') diff --git a/app/assets/javascripts/react.js b/app/assets/javascripts/react.js index 06e0fae..6db4e76 100644 --- a/app/assets/javascripts/react.js +++ b/app/assets/javascripts/react.js @@ -3104,7 +3104,7 @@ if (typeof Math.imul == "undefined" || (Math.imul(0xffffffff, 5) == 0)) { null), React.createElement("p", null, "Which ", React.createElement("strong", null, "result tab"), " should appear first?"), Y(OQ(NB))), React.createElement("div", { className: "modal-footer" }, React.createElement("button", { type: "button", onClick: function () { return $("#settingsModal").modal("hide") }, className: "btn btn-default" }, "Close"))))) }, new R(null, 1, 5, S, [aH], null), "settings-modal"); var $W = QG(function () { return Y(p(bH(FQ)) ? function () { sU("tool-postamble"); return new R(null, 4, 5, S, [gB, new m(null, 4, [ps, "button", nu, function () { return zQ.ma(null, "print") }, lC, function (a) { return B.h("Enter", a.nativeEvent.code) ? zQ.ma(null, "print") : null }, Ru, ni([Bn, Do, cp, dr, Fr, xt, $t, Gx, jy, xz, Uz], ["#ffffff", 16, 300, "#444466", 70, 10, 10, .5, "0.9375em 5px 0.9375em 5px", -1, "fixed"])], null), function () { var a = new m(null, 1, [Qm, DF], null); return XQ.h ? XQ.h(a, "print") : XQ.call(null, a, "print") }(), " Print"], null) }() : null) }, new R(null, 1, 5, S, [aH], null), "results-footer"),is_submit={flag: true , submit_func: function(){var a = bH(FQ);return (cc(E(a)) || null == a)}} , aX = QG(function () { - var a = bH(FQ); console.log(cc(E(a)) || null == a);return is_submit.flag ? React.createElement("div", { className: "row" }, React.createElement("div", { className: "col-sm-10 col-sm-offset-1 col-xs-12" }, React.createElement("div", { style: { backgroundColor: "#d3e7fd", padding: "0.625em 0.625em 3px 0.625em", marginBottom: 20 } }, React.createElement("div", { style: { color: "#002e5d", fontSize: "1.25em" } }, React.createElement("p", { style: { paddingBottom: 0 } }, Y(function () { + var a = bH(FQ); /*important it's result*/return cc(E(a)) || null == a ? React.createElement("div", { className: "row" }, React.createElement("div", { className: "col-sm-10 col-sm-offset-1 col-xs-12" }, React.createElement("div", { style: { backgroundColor: "#d3e7fd", padding: "0.625em 0.625em 3px 0.625em", marginBottom: 20 } }, React.createElement("div", { style: { color: "#002e5d", fontSize: "1.25em" } }, React.createElement("p", { style: { paddingBottom: 0 } }, Y(function () { var a = new m(null, 2, [Qm, DF, Ru, new m(null, 2, [Do, 35, iu, 8], null)], null); return XQ.h ? XQ.h(a, "info-circle") : XQ.call(null, a, "info-circle") }()), " Treatment options and results will appear here when you have filled in all the information needed above."))))) : React.createElement("div", null, React.createElement("div", { className: "row" }, React.createElement("div", { className: "col-md-6 clearfix" }, React.createElement("h3", null, "Treatment Options"), Y(VW.l ? VW.l() : VW.call(null))), function () { diff --git a/app/controllers/cancerpredicts_controller.rb b/app/controllers/cancerpredicts_controller.rb index 9e3b40c..0b4ce63 100644 --- a/app/controllers/cancerpredicts_controller.rb +++ b/app/controllers/cancerpredicts_controller.rb @@ -5,88 +5,153 @@ class CancerpredictsController < ApplicationController super @app_title = "cancerpredict" end - + def calculate + uid = OrbitHelper.params[:uid] rescue "" + tags = OrbitHelper.widget_tags + categories = OrbitHelper.widget_categories || [] + locale = OrbitHelper.get_site_locale.to_s + result = {:result=>"123"} + result['age1'] = -(params['data']['age'].to_f/100)**(-0.5) + result['age2'] = -(params['data']['age'].to_f/100)**(-0.5)*Math.log(params['data']['age'].to_f/100,10) + result['size1'] = -Math.log(params['data']['size'].to_f/10,10) + result['nposit'] = -((params['data']['ratio'].to_f+0.1)/0.1)**0.5 + if params['data']['grade'].to_i == 2 + result['grade_2'] = 1 + else + result['grade_2'] = 0 + end + if params['data']['grade'].to_i == 3 + result['grade_3'] = 1 + else + result['grade_3'] = 0 + end + if params['data']['subtype'].to_i == 2 + result['subtype_HER2'] = 1 + else + result['subtype_HER2'] = 0 + end + if params['data']['subtype'].to_i == 3 + result['subtype_triple'] = 1 + else + result['subtype_triple'] = 0 + end + if params['data']['pstage'].to_i == 2 + result['pstage_2'] = 1 + else + result['pstage_2'] = 0 + end + if params['data']['pstage'].to_i == 3 + result['pstage_3'] = 1 + else + result['pstage_3'] = 0 + end + if params['data']['pstage'].to_i == 4 + result['pstage_4'] = 1 + else + result['pstage_4'] = 0 + end + if params['data']['lvi'].to_i == 1 + result['lvi_yes'] = 1 + else + result['lvi_yes'] = 0 + end + result['lpv'] = ((result['age1']-0.7276655)*(-10.87)+(result['age2']-0.4540707)*8.968+(result['size1']-0.643632)*0.7678+(result['nposit']-1.346932)*0.5339+ + result['grade_2']*0.4795+result['grade_3']*0.818+result['subtype_HER2']*0.1806+result['subtype_triple']*0.6457+result['pstage_2']*0.5311+ + result['pstage_3']*1.134+result['pstage_4']*2.172+result['lvi_yes']*0.3321-0.04 rescue 0) + result['table'] = '此分析微針對已接受手術後病人,下表為此病人分別在第1年、3及5年下,根據選定的術後治療所估計的存活率' + result = result.merge(params) + render :json=> result + end def index uid = OrbitHelper.params[:uid] rescue "" tags = OrbitHelper.widget_tags categories = OrbitHelper.widget_categories || [] locale = OrbitHelper.get_site_locale.to_s - @table_str = '
' - @table_str_left = '
' - @table_str_right = '
' - create_first_field - @form_to_show.form_show.each do |num,property| - @field_property = {} - property.each do |key,value| - @value= value - if @value.class == BSON::Document || @value.class == Hash - @disp_value = @value[I18n.locale.to_s] rescue "" - else - @disp_value = @value - end - @field_property[key] = @disp_value - end - if @field_property['right'] == 0 - @table_str_left += '
' - break if @field_property["name"] == "" - @table_str_left += '' - if @field_property["comment_text"] != "" - @table_str_left += '' - @table_str_left += '' - else - @table_str_left += '
' - end - if @field_property["is_num"] == 1 - @table_str_left += '' - else - @table_str_left += '
' - @field_property["choice_fields"].each do |create_choice| - @table_str_left += '' - @table_str_left += '' + if (OrbitHelper.params[:result] == nil rescue true) + @table_str = '
' + @table_str_left = '
' + @table_str_right = '
' + create_first_field + @form_to_show.form_show.each do |num,property| + @field_property = {} + property.each do |key,value| + @value= value + if @value.class == BSON::Document || @value.class == Hash + @disp_value = @value[I18n.locale.to_s] rescue "" + else + @disp_value = @value end - @table_str_left += '
' + @field_property[key] = @disp_value end - if @field_property["hint"].to_s != "" - @table_str_left +='
'+@field_property["hint"]+'
' - end - @table_str_left += '
' - else - @table_str_right += '
' - break if @field_property["name"] == "" - @table_str_right += '' - if @field_property["comment_text"] != "" - @table_str_right += '' - @table_str_right += '' - else - @table_str_right += '
' - end - if @field_property["is_num"] == 1 - @table_str_right += '' - else - @table_str_right += '
' - @field_property["choice_fields"].each do |create_choice| - @table_str_right += '' - @table_str_right += '' + if @field_property['right'] == 0 + @table_str_left += '
' + break if @field_property["name"] == "" + @table_str_left += '' + if @field_property["comment_text"] != "" + @table_str_left += '' + @table_str_left += '' + else + @table_str_left += '
' end - @table_str_right += '
' + if @field_property["is_num"] == 1 + @table_str_left += '' + else + @table_str_left += '
' + @field_property["choice_fields"].each do |create_choice| + @table_str_left += '' + @table_str_left += '' + end + @table_str_left += '
' + end + if @field_property["hint"].to_s != "" + @table_str_left +='
'+@field_property["hint"]+'
' + end + @table_str_left += '
' + else + @table_str_right += '
' + break if @field_property["name"] == "" + @table_str_right += '' + if @field_property["comment_text"] != "" + @table_str_right += '' + @table_str_right += '' + else + @table_str_right += '
' + end + if @field_property["is_num"] == 1 + @table_str_right += '' + else + @table_str_right += '
' + @field_property["choice_fields"].each do |create_choice| + @table_str_right += '' + @table_str_right += '' + end + @table_str_right += '
' + end + if @field_property["hint"].to_s != "" + @table_str_right +='
'+@field_property["hint"]+'
' + end + @table_str_right += '
' end - if @field_property["hint"].to_s != "" - @table_str_right +='
'+@field_property["hint"]+'
' - end - @table_str_right += '
' end + @table_str_left += '
' + @table_str_right += '
' + @table_str += (@table_str_left+@table_str_right) + @table_str +='
' + @table_result_str = '
'+t("cancerpredict.table.result").to_s+'
' + @table_result_str += '
' + @table_result_str += '
' + @table_result_str += '
' + @table_result_str += '
' + @submit_btn_str='' + @reset_btn_str='' + @table_str += (@submit_btn_str+@reset_btn_str+@table_result_str+'
') + else + @table_str = OrbitHelper.params.to_s end - @table_str_left += '
' - @table_str_right += '
' - @table_str += (@table_str_left+@table_str_right) - @table_str +='
' - @submit_btn_str='' - @reset_btn_str='' - @table_str += (@submit_btn_str+@reset_btn_str+'
') { "cancerpredict" => [], "extras"=>{"table"=> @table_str} diff --git a/app/views/cancerpredict/index.html.erb b/app/views/cancerpredict/index.html.erb deleted file mode 100644 index 51749a0..0000000 --- a/app/views/cancerpredict/index.html.erb +++ /dev/null @@ -1,9 +0,0 @@ - - - -
-
-
 
-
Loading...
-
-
\ No newline at end of file diff --git a/config/locales/en.yml b/config/locales/en.yml index b4b6017..ca59c11 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -24,4 +24,9 @@ en: Surgeryonly: Surgery only Hormonetherapy: Hormone therapy Chemotherapy: Chemotherapy - years: years \ No newline at end of file + years: years + result: result + table: Table + curve: Curves + text: Texts + \ No newline at end of file diff --git a/config/locales/zh_tw.yml b/config/locales/zh_tw.yml index 7dc965c..b96b94a 100644 --- a/config/locales/zh_tw.yml +++ b/config/locales/zh_tw.yml @@ -25,4 +25,8 @@ zh_tw: Surgeryonly: 純手術 Hormonetherapy: 賀爾蒙治療 Chemotherapy: 化學治療 - years: 年 \ No newline at end of file + years: 年 + result: 結果 + table: 列表 + curve: 曲線 + text: 文字 \ No newline at end of file diff --git a/modules/cancerpredict/cancer_predict_index.html.erb b/modules/cancerpredict/cancer_predict_index.html.erb index 9b5ec5e..e033915 100644 --- a/modules/cancerpredict/cancer_predict_index.html.erb +++ b/modules/cancerpredict/cancer_predict_index.html.erb @@ -3,13 +3,20 @@ {{table}} \ No newline at end of file diff --git a/routes.rb b/routes.rb new file mode 100644 index 0000000..5387f1b --- /dev/null +++ b/routes.rb @@ -0,0 +1,361 @@ +Orbit::Application.routes.draw do + + mount Ckeditor::Engine => '/ckeditor' + + resources :sessions + + + + get "logout", to: "sessions#destroy", as: "logout" + get "cancerpredictResult",to: "cancerpredicts#calculate" + post "cancerpredictResult",to: "cancerpredicts#calculate" + get "/pages/edit_view" => "pages#edit_view" + get "/pages/preview" => "pages#preview" + get "/pages/get_categories" => "pages#get_categories" + get "/pages/get_member_attributes" => 'pages#get_member_attributes' + post "/pages/update_item_position" => "pages#update_item_position" + post "/pages/save_member_frontend_fields" => 'pages#save_member_frontend_fields' + + get "/page_parts/getwidgets" => "page_parts#getwidgets" + get "/page_parts/info" => "page_parts#info" + get "/page_parts/edit_sub_part" => "page_parts#edit_sub_part" + get "/admin/license_denied" => "store_api#render_license_denied" + + #routes for google to callback after omniauth + get 'auth/:provider/callback', to: 'sessions#google_callback' + get 'auth/:provider/remove', to: 'sessions#google_remove' + get 'auth/google/result', to: 'sessions#google_result' + get 'auth/google/result', to: 'sessions#google_result' + get 'auth/failure', to: 'sessions#google_faliure' + + post "pages/:id/import_widgets", to: 'pages#import_widgets' + resources :pages + + resources :page_parts do + member do + patch 'update_sub_part' + end + end + + get "/module/:name" => "home#index" + get "/module/:name/show" => "home#show" + post "/store/confirmation" => "store_api#confirmation" + post "/store/install_module" => "store_api#install_module" + post "/store/uninstall_module" => "store_api#uninstall_module" + post "/store/restart_srever_after_install" => "store_api#restart_server_after_install" + post "/store/ticket_response_update" => "store_api#ticket_response_update" + get "/feeds/channel_lists" => 'store_api#get_channel_lists' + + # The priority is based upon order of creation: first created -> highest priority. + # See how all your routes lay out with "rake routes". + + # You can have the root of your site routed with "root" + root 'pages#home' + get 'admin/authorizations/modal_select/:module' => 'admin/authorizations#modal_select', :as => :modal_select_authorizations + match 'admin/authorizations/add_users/:module' => 'admin/authorizations#add_users', :as => :add_users_authorizations, via: [:get, :post] + match 'admin/authorizations/add_roles/:module' => 'admin/authorizations#add_roles', :as => :add_roles_authorizations, via: [:get, :post] + match 'admin/authorizations/remove_users/:module' => 'admin/authorizations#remove_users', :as => :remove_users_authorizations, via: [:delete] + + locales = Site.first.in_use_locales rescue I18n.available_locales + + scope "(:locale)", locale: Regexp.new((locales+[:zh_cn]).join("|")) do + + get "sitemap.xml" => "sitemaps#sitemap_xml", as: "sitemap", defaults: { format: "xml" } + + # get 'users/form' => "users#form_page" + get 'users/role_page' => "users#role_page" + get 'users/check_availability' => "users#check_availability" + get 'users/connect_google' => "users#connect_google" + get 'users/confirmation' => "users#confirmation" + get 'users/skip_google' => 'users#skip_google' + get 'users/registration_complete' => 'users#registration_complete' + patch 'users/member_roles_update' => 'users#member_roles_update' + # get 'users/connect_google_account' => 'users#connect_google_account' + # get 'users/get_role_statuses' => "users#get_role_statuses" + # patch 'users/role_update' => "users#role_update" + # patch 'users/basic_info_update' => "users#basic_info_update" + + resources :users do + collection do + get 'confirm_user' + get 'post_confirmation' + end + end + + + + + # Facebook routes + + get "/facebook/register_fb" => "facebook#register_fb" + get "/facebook/get_friends" => "facebook#get_friends" + get "/facebook/get_feed" => "facebook#get_feed" + get "/facebook/disconnect" => "facebook#disconnect" + get "/facebook/server" => "facebook#server_redirect" + get "/facebook/profile_import" => "facebook#profile_import" + + resources :passwords + # resources :members do + # collection do + # get ':name-:uid', to: 'members#show', as: :display + # end + # end + + namespace :admin do + resources :dashboards do + collection do + get 'reload_all_content' + get 'reload_most_visited' + get 'reload_recent_update' + get 'get_system_stats' + get 'get_month_traffic' + end + end + + # routes for playground + get "playground", to: 'playground#index' + post "playground/command", to: 'playground#command' + get "playground/console_output", to: 'playground#console_output' + post "playground/generatefakedata", to: 'playground#generatefakedata' + post "playground/deletefakedata", to: 'playground#deletefakedata' + + # routes for tickets + resources :tickets + post "ticket/close" => 'tickets#close' + post "ticket/reopen" => 'tickets#reopen' + post "tickets/tourcomplete" => 'tickets#tourcomplete' + + get "members/get_role_fields/:id" => "members#get_role_fields", :as => :get_role_fields + get "members/import_members" => "members#import_members" + get "members/unapproved_members" => "members#unapproved_members" + post "members/save_autobiography" => "members#save_autobiography" + post "members/new_tag" => "members#new_tag" + post "members/set_privacy" => "members#set_privacy" + + + resources :members do + collection do + get 'edit_order_card' + get 'edit_order_list' + post 'update_order_card' + post 'update_order_list' + post 'import_members' + post 'download_export' + end + match "setting_account" => "members#setting_account" ,:as => :setting_account, via: [:get, :post] + match "edit_passwd" => "members#edit_passwd" ,:as => :edit_passwd, via: [:get, :post] + match "accept_member" => "members#accept_member" ,:as => :accept_member, via: [:get, :post] + match "edit_privilege" => "members#edit_privilege" ,:as => :edit_privilege, via: [:get, :post] + end + + resources :member_dashboards do + collection do + get 'window' + end + end + + # GROUPS START HERE + get "groups/categories" => 'groups#categories' + post "groups/create_category" => 'groups#create_category' + post "groups/:group_id/remove_user" => 'groups#remove_user' + get "groups/:group_id/get_members_to_add" => 'groups#get_members_to_add' + post "groups/:group_id/join" => 'groups#join' + post "groups/:group_id/leave" => 'groups#leave' + get "groups/:group_id/requests" => 'groups#requests' + post "groups/approveuser" => 'groups#approveuser' + post "groups/approveall" => 'groups#approveall' + + post "groups/:group_id/toggle_admin" => 'groups#toggle_admin' + get "groups/existing_member_template" => 'groups#get_existing_member_template' + get "groups/get_role_members" => 'groups#get_role_members' + get "groups/public" => 'groups#public_groups' + patch "groups/updatecategory/:category_id" => 'groups#update_category' + get "posts/:id" => 'groups#showpost' + post "posts/image" => 'groups#upload_photo' + post "posts/file" => 'groups#upload_file' + get "posts/file/:id" => "groups#download_file" + delete "posts/:id" => "groups#deletepost" + get "post/:id/edit" => "groups#editpost" + patch "post/:id/updatepost" => "groups#updatepost" + post "posts/comment" => 'groups#new_comment' + delete "comments/:id" => 'groups#delete_comment' + + resources :groups do + get "newpost" => 'groups#newpost' + post "createpost" => 'groups#createpost' + get "members" => 'groups#members' + get "joingroup" => 'groups#joingroup' + end + + + get 'members/:name-:uid/:show_plugin_profile' => "members#show", :as=> :show_plugin_profile + + resources :personal_plugins + + post "/personal_plugins/save_order" => 'personal_plugins#save_order' + + resources :roles do + get 'role_field' + get 'add_attribute_field' + post 'toggle' + end + + resources :member_infos + + resources :role_statuses do + post 'toggle' + end + + get 'select_emails' => 'member_selects#select_emails', :as => "select_emails" + + resources :module_apps do + resources :categories do + collection do + post 'create_in_form' + end + member do + post 'toggle' + end + end + resources :tags do + collection do + post 'add_to_default' + post 'add_from_default' + post 'create_in_form' + post 'delete_tags' + post 'merge' + post 'remove_default' + post 'update_included_default' + end + end + end + + resources :assets do + collection do + post 'file_upload' + get 'delete' + post 'delete_files' + end + end + + get 'authorizations(/:module)' => 'authorizations#index', :as => :authorizations + resources :authorizations + resources :items + resources :categories do + member do + post 'toggle' + end + end + resources :tags do + collection do + post 'add_to_default' + post 'add_from_default' + post 'delete_tags' + post 'merge' + post 'remove_default' + post 'update_included_default' + end + end + + resources :sites do + get 'mail_setting' + get 'site_info' + get 'responsive_setting' + get 'search_engine' + get 'sitemap' + get 'sitemap_frontend' + get 'sitemap_toggle', :on => :member + get 'system_info' + get 'ui_theme' + get 'change_design' + get 'reset_default_locale' + get 'preference' + get 'update_manager' + get 'get_update_history' + get 'check_updates' + get 'update_orbit' + get 'bundle_install' + get 'restart_server' + get 'delete_mail_log' + end + + resources :designs do + collection do + get 'upload_package' + get 'delete' + post 'upload_package' + end + member do + post 'edit_file' => 'designs#edit_file' + post 'update_file' => 'designs#update_file' + post 'upload_image' => 'designs#upload_image' + end + end + get 'design_list' => 'designs#design_list' + get 'module_store' => 'module_store#index' + get 'module_store/show' => 'module_store#show' + post 'module_store/update_module' => 'module_store#update_module' + get 'module_store/download' => 'module_store#download' + get 'module_store/remove_module' => 'module_store#remove_module' + get 'module_store/toggle_module' => 'module_store#toggle_module' + post 'module_store/restart' => 'module_store#restart' + get 'module_store/modules_to_update' => 'module_store#modules_to_update' + + #store routes + + get "/store/check_credentials" => "store#check_credentials" + get "/store/register_form" => "store#register_form" + post "/store/register_site" => "store#register_site" + post "/store/authorize_default_modules" => "store#authorize_default_modules" + get "/store/check_permissions" => "store#check_permissions" + get "/store/template_store" => "store#template_store" + get "/store/app_store" => "store#app_store" + get "/store/send_email" => "store#send_email" + post "/store/re_register_url" => "store#re_register_url" + + + get "import" => "import#index" + get "import/check_url" => "import#check_url" + get "import/module_categories" => "import#module_categories" + get "import/module_data_list" => "import#module_data_list" + get "import/module_data" => "import#module_data" + post "import/rss2_news" => "import#rss2_news" + post "import/rss2_archive" => "import#rss2_archive" + get "import/rss2_pages" => "import#rss2_pages" + post "import/rss2_child_page" => "import#rss2_child_page" + get "import/rss2_pages_info" => "import#rss2_pages_info" + get "import/get_import_status" => "import#get_import_status" + post "import/rss2_galleries" => "import#rss2_galleries" + post "import/rss2_album_image" => "import#rss2_album_image" + post "import/rss2_links" => "import#rss2_links" + post "import/rss2_members" => "import#rss2_members" + post "import/rss2_members_info" => "import#rss2_members_info" + get "import/import_plugin" => "import#import_plugin" + post "import/clean_old_data" => "import#clean_old_data" + + get "import/rss2_rikis" => "import#rss2_rikis" + get "import/rss2_rikis_info" => "import#rss2_rikis_info" + get "import/convert_riki_link" => "import#convert_riki_link" + + #sync routes + + post "/sync_handler/initiate_sync", to: 'sync_handler#initiate_sync' + post "/sync_handler/blacklist", to: 'sync_handler#blacklist' + post "/sync_handler/whitelist", to: 'sync_handler#whitelist' + + end + + get 'mobile', to: 'pages#home' + get 'mobile/:page(/:page)(/:page)(/:page)', to: 'pages#show', constraints: KeywordConstraint.new + + get ':page(/:page)(/:page)(/:page)', to: 'pages#show', constraints: KeywordConstraint.new + get '(/:page)(/:page)(/:page)/members(/:name-:uid)', to: 'pages#show' + get '(/:page)(/:page)(/:page)/member(/:name-:uid)', to: 'pages#show' + resources :pages + end + namespace :admin do + # Directs /admin/products/* to Admin::ProductsController + # (app/controllers/admin/products_controller.rb) + resources :users + end +end