]> asedeno.scripts.mit.edu Git - bluechips.git/blobdiff - bluechips/templates/base.mako
ripped out toscawidgets, replaced with formencode, put split editing on main expendit...
[bluechips.git] / bluechips / templates / base.mako
index d12f45688243b2b7e4d40ce4dd62f2a9a7df49bf..f194e2001c90d6113e7019123cda634edc5cb37a 100644 (file)
@@ -5,16 +5,9 @@
     <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>
-    % endif
     <div id="nav" class="block">
       <table>
         <tr>
         </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,8 +66,8 @@
 </%def>
 
 <%def name="formatUser(user)">
-  % if user.username == request.environ['REMOTE_USER']:
-    <strong>${user.name}</strong>
+  % if user == request.environ['user']:
+    <strong>Me</strong>
   % else:
     ${user.name}
   % endif
       <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>
     </tr>
     % for e in es:
-      <tr>
+      <%
+        if e.involves(request.environ['user']):
+          klass = 'user-involved'
+        else:
+          klass = 'user-not-involved'
+      %>
+      <tr class="${klass}">
         <td class="date">${e.date}</td>
         <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>
       </tr>
     % endfor
       <th class="editlink"></th>
     </tr>
     % for t in ts:
-      <tr>
+      <%
+        if t.involves(request.environ['user']):
+          klass = 'user-involved'
+        else:
+          klass = 'user-not-involved'
+      %>
+      <tr class="${klass}">
         <td class="date">${t.date}</td>
         <td class="user">${formatUser(t.debtor)}</td>
         <td class="user">${formatUser(t.creditor)}</td>