From c4a270ef8bbce8f4a8a7d6d53c2f55a1ffd5dd42 Mon Sep 17 00:00:00 2001
From: maxwell <maxwell@joindiaspora.com>
Date: Sun, 21 Nov 2010 17:14:43 -0800
Subject: [PATCH] putting mobile interface back in so we can get it cleaned up

---
 app/controllers/application_controller.rb | 9 ++++++++-
 app/views/layouts/application.mobile.haml | 7 +++----
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index caafdeab30..035bd64f57 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -3,9 +3,10 @@
 #   the COPYRIGHT file.
 
 class ApplicationController < ActionController::Base
-  #has_mobile_fu
+  has_mobile_fu
   protect_from_forgery :except => :receive
 
+  before_filter :mobile_except_ipad
   before_filter :set_contacts_and_status, :except => [:create, :update]
   before_filter :count_requests
   before_filter :set_invites
@@ -25,6 +26,12 @@ class ApplicationController < ActionController::Base
     end
   end
 
+  def mobile_except_ipad
+    if is_mobile_device?
+      session[:mobile_view] = false if request.env["HTTP_USER_AGENT"].include? "iPad"
+    end
+  end
+  
   def count_requests
     @request_count = current_user.requests_for_me.size if current_user
   end
diff --git a/app/views/layouts/application.mobile.haml b/app/views/layouts/application.mobile.haml
index eddd63cd7f..be524275c0 100644
--- a/app/views/layouts/application.mobile.haml
+++ b/app/views/layouts/application.mobile.haml
@@ -10,10 +10,9 @@
 
     %meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"}/
 
-    = javascript_include_tag 'vendor/jquery144.min'
-    = javascript_include_tag 'vendor/jquery.mobile-1.0a1.js', 'rails' 
-    = stylesheet_link_tag 'vendor/jquery_mobile.min'
-    = stylesheet_link_tag 'mobile'
+    = javascript_include_tag 'vendor/jquery144.min','rails' 
+    = include_javascripts :mobile 
+    = stylesheet_link_tag 'mobile', 'vendor/jquery_mobile.min'
     = csrf_meta_tag
 
     = yield(:head)
-- 
GitLab