Changed Mobile App, fixed announcement default widget

This commit is contained in:
Saurabh Bhatia 2014-03-18 14:59:30 +08:00
parent 2725aefb71
commit c0105e7cb8
1 changed files with 6 additions and 4 deletions

View File

@ -467,8 +467,9 @@ class ApplicationController < ActionController::Base
end
def prepare_for_mobile
if @site.mobile_on
session[:mobile_param] = if request.path =~ /mobile/
if (@site.mobile_on.eql?(true) && mobile_device?)
mobile_path = "/mobile"
session[:mobile_param] = if request.path.eql?(mobile_path)
'1'
elsif params[:mobile]
params[:mobile]
@ -476,8 +477,9 @@ class ApplicationController < ActionController::Base
session[:mobile_param]
end
request.format = :mobile if mobile_device?
else
session[:mobile_param] = if request.path =~ /app/
elsif (@site.mobile_on.eql?(false) && mobile_device?)
mobile_path = "/mobile/app"
session[:mobile_param] = if request.path.eql?(mobile_path)
'1'
elsif params[:mobile]
params[:mobile]