]> asedeno.scripts.mit.edu Git - bluechips.git/blobdiff - bluechips/templates/base.mako
Added UI for working with tags
[bluechips.git] / bluechips / templates / base.mako
index 38117c92a1c4526bebff6a4c48c2b6131661dce2..43db6e4246c1871b543fc69aa83ca5a6c66c3618 100644 (file)
@@ -4,8 +4,11 @@
   <head>
     <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')}
+    ${h.stylesheet_link('%s/css/main.css' % request.script_name)}
+    ${h.stylesheet_link('//ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/flick/jquery-ui.css')}
+    ${h.javascript_link('//ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js')}
+    ${h.javascript_link('//ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js')}
+    ${h.javascript_link('%s/js/admin.js' % request.script_name)}
   </head>
   <body>
     % if c.mobile_client:
             </h1>
           </td>
           <td>
-            <a href="${h.url_for(controller='status', action='index', id=None)}">
-              <img src="/icons/status.png" alt="">
+            <a href="${h.url_for(controller='status', action='index')}">
+              <img src="${request.script_name}/icons/status.png" alt="">
               <span>Dashboard</span>
             </a>
           </td>
           <td>
-            <a href="${h.url_for(controller='spend', action='index', id=None)}">
-              <img src="/icons/spend.png" alt="">
+            <a href="${h.url_for(controller='spend', action='index')}">
+              <img src="${request.script_name}/icons/spend.png" alt="">
               <span>Expense</span>
             </a>
           </td>
           <td>
-            <a href="${h.url_for(controller='transfer', action='index', id=None)}">
-              <img src="/icons/transfer.png" alt="">
+            <a href="${h.url_for(controller='transfer', action='index')}">
+              <img src="${request.script_name}/icons/transfer.png" alt="">
               <span>Transfer</span>
             </a>
           </td>
           <td>
-            <a href="${h.url_for(controller='history', action='index', id=None)}">
-              <img src="/icons/history.png" alt="">
+            <a href="${h.url_for(controller='history', action='index')}">
+              <img src="${request.script_name}/icons/history.png" alt="">
               <span>History</span>
             </a>
           </td>
           <td>
-            <a href="${h.url_for(controller='user', action='index', id=None)}">
-              <img src="/icons/user.png" alt="">
+            <a href="${h.url_for(controller='user', action='index')}">
+              <img src="${request.script_name}/icons/user.png" alt="">
               <span>User</span>
             </a>
           </td>
       </table>
     </div>
     % for message in h.flash.pop_messages():
-      <div class="flash">${message | n}</div>
+      <div class="flash">${str(message) | n}</div>
     % endfor
     <div id="content">
       ${next.body()}
     </div>
-    ${h.javascript_link('//ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js')}
-    ${h.javascript_link('/js/jquery.date_input.js')}
-    ${h.javascript_link('/js/admin.js')}
   </body>
 </html>
 
@@ -84,7 +84,7 @@
   % endif
 </%def>
 
-<%def name="listExpenditures(es)">
+<%def name="listExpenditures(es, total=None, share=None)">
   <table class="list">
     <tr>
       <th class="date">Date</th>
@@ -93,7 +93,6 @@
       <th class="amount">Amount</th>
       <th class="share">My Share</th>
       <th class="editlink"></th>
-      <th class="deletelink"></th>
     </tr>
     % for e in es:
       <%
         <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
+    % if total is not None and share is not None:
+      <tr class="user-involved">
+        <td class="total" colspan=3></td>
+       <td class="total">${total}</td>
+       <td class="total">${share}</td>
+       <td class="total"></td>
+      </tr>
+
+    % endif
   </table>
 </%def>
 
       <th class="description">Description</th>
       <th class="amount">Amount</th>
       <th class="editlink"></th>
-      <th class="deletelink"></th>
     </tr>
     % for t in ts:
       <%
         <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>
 </%def>
 
+<%def name="listTags()">
+<%
+x = ',\n'.join([h.link_to(tag.name, h.url_for(controller='history', action='tag', id=tag.id)) for tag in c.tags])
+%>
+${x|n}
+</%def>
+
+
 <%def name="expenditureIcon()">
 &larr;<span class="dollarsign">&rarr;
 </%def>