some more changes to the condition for mobile_on and api on

This commit is contained in:
Saurabh Bhatia 2014-04-09 17:04:09 +08:00
parent 2d29493f1a
commit f800ac63ed
2 changed files with 5 additions and 20 deletions

View File

@ -472,14 +472,12 @@ class ApplicationController < ActionController::Base
if (@site.mobile_on.eql?(true) && @site.mobile_api_openness_on.eql?(true)) if (@site.mobile_on.eql?(true) && @site.mobile_api_openness_on.eql?(true))
session[:mobile_param] = if request.path.eql?(@mobile_path) session[:mobile_param] = if request.path =~ /mobile/
'1' '1'
elsif (request.path.eql?(root_path) && mobile_device?)
redirect_to mobile_path
elsif params[:mobile] elsif params[:mobile]
params[:mobile] params[:mobile]
else else
session[:mobile_param] session[:mobile_param]
end end
request.format = :mobile if mobile_device? request.format = :mobile if mobile_device?
@ -501,7 +499,6 @@ class ApplicationController < ActionController::Base
session[:mobile_param] = if (request.path.eql?(@mobile_path)) session[:mobile_param] = if (request.path.eql?(@mobile_path))
'1' '1'
elsif (request.path.eql?(@mobile_app_path) && mobile_device?) elsif (request.path.eql?(@mobile_app_path) && mobile_device?)
redirect_to root_path(mobile: 0) redirect_to root_path(mobile: 0)
elsif params[:mobile] elsif params[:mobile]

View File

@ -416,19 +416,7 @@ Orbit::Application.routes.draw do
end end
end end
scope '/mobile/:app' do scope '/mobile(/:app)' 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
scope '/mobile' do
match '/announcement' => 'mobile#announcement', :as => 'mobile_announcement' match '/announcement' => 'mobile#announcement', :as => 'mobile_announcement'
match '/announcement_content/:id' => 'mobile#announcement_content', :as => 'mobile_announcement_content' match '/announcement_content/:id' => 'mobile#announcement_content', :as => 'mobile_announcement_content'
match '/dialog_contact' => 'mobile#dialog_contact', :as => 'mobile_dialog_contact' match '/dialog_contact' => 'mobile#dialog_contact', :as => 'mobile_dialog_contact'