]> asedeno.scripts.mit.edu Git - bluechips.git/blobdiff - bluechips/templates/spend/index.mako
We have pie charts.
[bluechips.git] / bluechips / templates / spend / index.mako
index 1b0c6e3c493279f5f25c78ea4b96fcd7a8804582..d4064cb58e914a3808e6daf92aa5d33de85cf32c 100644 (file)
@@ -9,7 +9,7 @@
     </tr>
     <tr>
       <th><label for="amount">Amount</label></th>
-      <td>${h.currency('amount', c.expenditure.amount, size=8)}</td>
+      <td>${h.currency('amount', c.expenditure.amount, size=8, onkeyup="calcSplit();")}</td>
     </tr>
     <tr>
       <th><label for="date">Date</label></th>
       <th><label for="description">Description</label></th>
       <td>${h.text('description', c.expenditure.description, size=64)}</td>
     </tr>
+    <tr>
+      <th><label for="tags">Tags</label></th>
+      <td>${h.text('tags', c.tags, size=64)}</td>
+    </tr>
   </table>
 
   <p>Change how an expenditure is split up. Enter a percentage, or something like a percentage, for each user. They don't have to add to 100.</p>
       <tr>
         <th><label for="shares-${ii}amount">${user.name}</label></th>
         <td>
-          ${h.text('shares-%d.amount' % ii, percent)}
+          ${h.text('shares-%d.amount' % ii, percent, class_="share-text", onkeyup="calcSplit();")}
           ${h.hidden('shares-%d.user_id' % ii, user.id)}
         </td>
+        <td id="shares-${ii}amount-calc" align="right">
+          0.00
+        </td>
       </tr>
     % endfor
     <tr>
+      <td></td>
       <td colspan="2">
         ${h.submit(None, 'Submit', class_="submitbutton")}
+        %if c.expenditure.id:
+       <input type="button" value="Delete" onClick="window.location.href='${h.url_for(controller='spend', action='delete', id=c.expenditure.id)}'">
+       %endif
       </td>
     </tr>
   </table>
 </form>
+${h.javascript_link('%s/js/calculator.js' % request.script_name)}