]> asedeno.scripts.mit.edu Git - bluechips.git/blobdiff - bluechips/templates/base.mako
added ability to switch back and forth between mobile and non-mobile interface on iphone
[bluechips.git] / bluechips / templates / base.mako
index 97ae8576a4281ee0bae862eb6aff564d19d2cec6..97f0b9b7805ca15542bd5d316860feacb33eb983 100644 (file)
@@ -5,15 +5,13 @@
     <meta http-equiv="content-type" content="text/html; charset=utf-8" />
     <title>${self.title()}</title>
     ${h.stylesheet_link('/css/main.css')}
+    ${h.stylesheet_link('/js/jquery.date_input.css')}
   </head>
   <body>
-    <% messages = h.flash.pop_messages() %>
-    % if messages:
-    <ul id="flash-messages">
-    % for message in messages:
-        <li>${message}</li>
-    % endfor
-    </ul>
+    % 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>
@@ -29,7 +27,7 @@
           </td>
           <td>
             <a href="${h.url_for(controller='status', action='index', id=None)}">
-              <img src="/icons/dashboard.png" alt="">
+              <img src="/icons/status.png" alt="">
               <span>Dashboard</span>
             </a>
           </td>
               <span>History</span>
             </a>
           </td>
+          <td>
+            <a href="${h.url_for(controller='user', action='index', id=None)}">
+              <img src="/icons/user.png" alt="">
+              <span>User</span>
+            </a>
+          </td>
         </tr>
       </table>
     </div>
+    % for message in h.flash.pop_messages():
+      <div class="flash">${message | n}</div>
+    % endfor
     <div id="content">
       ${next.body()}
     </div>
+    ${h.javascript_link('/js/jquery-1.3.2.js')}
+    ${h.javascript_link('/js/jquery.date_input.js')}
+    ${h.javascript_link('/js/admin.js')}
   </body>
 </html>
 
@@ -67,7 +77,7 @@
 </%def>
 
 <%def name="formatUser(user)">
-  % if user == c.user:
+  % if user == request.environ['user']:
     <strong>Me</strong>
   % else:
     ${user.name}
       <th class="user">Spender</th>
       <th class="description">Description</th>
       <th class="amount">Amount</th>
+      <th class="share">My Share</th>
       <th class="editlink"></th>
+      <th class="deletelink"></th>
     </tr>
     % for e in es:
       <%
-        if e.involves(c.user):
+        if e.involves(request.environ['user']):
           klass = 'user-involved'
         else:
           klass = 'user-not-involved'
         <td class="user">${formatUser(e.spender)}</td>
         <td class="description">${e.description}</td>
         <td class="amount">${e.amount}</td>
+        <td class="share">${e.share(request.environ['user'])}</td>
         <td class="editlink">${h.link_to('Edit', h.url_for(controller='spend', action='edit', id=e.id))}</td>
+        <td class="deletelink">${h.link_to('Delete', h.url_for(controller='spend', action='delete', id=e.id))}</td>
       </tr>
     % endfor
   </table>
       <th class="description">Description</th>
       <th class="amount">Amount</th>
       <th class="editlink"></th>
+      <th class="deletelink"></th>
     </tr>
     % for t in ts:
       <%
-        if t.involves(c.user):
+        if t.involves(request.environ['user']):
           klass = 'user-involved'
         else:
           klass = 'user-not-involved'
         <td class="description">${t.description}</td>
         <td class="amount">${t.amount}</td>
         <td class="editlink">${h.link_to('Edit', h.url_for(controller='transfer', action='edit', id=t.id))}</td>
+        <td class="deletelink">${h.link_to('Delete', h.url_for(controller='transfer', action='delete', id=t.id))}</td>
       </tr>
     % endfor
   </table>