]> asedeno.scripts.mit.edu Git - bluechips.git/commitdiff
added ability to switch back and forth between mobile and non-mobile interface on iphone
authorScott Torborg <scott@crookedmedia.com>
Fri, 13 Nov 2009 04:35:02 +0000 (20:35 -0800)
committerScott Torborg <scott@crookedmedia.com>
Fri, 13 Nov 2009 04:35:02 +0000 (20:35 -0800)
bluechips/lib/base.py
bluechips/public/css/main.css
bluechips/public/css/mobile.css
bluechips/templates/base.mako
bluechips/templates/mobile/base.mako

index 8e7c20cfdfefe88a529456f2f335114ccf33250a..df659939f79df0ed6c1eabe25a92a0903ebc0b05 100644 (file)
@@ -53,6 +53,9 @@ def redirect_on_get(action):
 
 def render(name, *args, **kwargs):
     if 'iPhone' in request.user_agent:
+        if 'use_non_mobile' in request.params:
+            session['use_non_mobile'] = (request.params['use_non_mobile'] ==
+                                         'yes')
         if session.get('use_non_mobile'):
             c.mobile_client = True
         else:
index 86d9122d06a47b7870f874b633e43213ed4977b7..d941e6626811ed955ba8553259505b75b479034b 100644 (file)
@@ -123,3 +123,8 @@ input.currency {
 span.see-all {
     font-size: 0.7em;
 }
+#mobile {
+    padding: 5px;
+    font-weight: bold;
+    border-bottom: 1px solid #bbb;
+}
index 78a669d94dce228d003f0c005fc80977fac70dc0..76476baacfdf60975aeeadb196aeb8fb0f5d6a1e 100644 (file)
@@ -12,11 +12,11 @@ body {
     width: 98px;
     float: left;
     border-top: 1px solid #fff;
-    border-bottom: 1px solid #000;
+    border-bottom: 1px solid #aaa;
     padding: 5px 1px;
 }
 #tabs a.selected {
-    border: 1px solid #000;
+    border: 1px solid #aaa;
     border-bottom: 1px solid #fff;
     padding: 5px 0;
     -webkit-border-top-left-radius: 10px;
@@ -34,3 +34,10 @@ body {
 div.tab {
     display: none;
 }
+#non-mobile a {
+    display: block;
+    width: 100%;
+    text-align: center;
+    padding: 5px 0;
+    border: 1px solid #aaa;
+}
index 8ad40aa4ede7e1db41a14497dfbfabf397f29dd9..97f0b9b7805ca15542bd5d316860feacb33eb983 100644 (file)
@@ -8,6 +8,11 @@
     ${h.stylesheet_link('/js/jquery.date_input.css')}
   </head>
   <body>
+    % if c.mobile_client:
+      <div id="mobile">
+        <a href="${h.url_for(request.url, use_non_mobile='no')}">Use mobile interface</a>
+      </div>
+    % endif
     <div id="nav" class="block">
       <table>
         <tr>
index b96ce4fa6cad83ad377d185a49e39d1c1afb3d8e..37aca7f0aabf52ccfca1689d37e24f568f94adf9 100644 (file)
@@ -14,6 +14,9 @@
       <div class="flash">${message | n}</div>
     % endfor
     ${next.body()}
+    <div id="non-mobile">
+      <a href="${h.url_for(request.url, use_non_mobile='yes')}">Use non mobile interface</a>
+    </div>
     ${h.javascript_link('/js/jquery-1.3.2.js')}
     ${h.javascript_link('/js/mobile.js')}
   </body>