]> asedeno.scripts.mit.edu Git - bluechips.git/blobdiff - bluechips/templates/transfer/index.mako
added XSRF protection to all forms and associated tests
[bluechips.git] / bluechips / templates / transfer / index.mako
index a6684241c6f298c79ae9a091b2ab545207f5e6f2..7c3daa925f2d2a0fd1b28354ccd58344b43e48e3 100644 (file)
@@ -1,8 +1,38 @@
 <%inherit file="/base.mako"/>
 
-<%def name="title()">${parent.title()} :: ${c.title}</%def>
-<%!
-import bluechips.widgets.transfer as forms
-%>
-
-${forms.new_transfer_form(c.transfer, action=h.url_for(action='new'))}
+<form action="${h.url_for(controller='transfer', action='update', id=c.transfer.id)}" method="post">
+  ${h.auth_token_hidden_field()}
+  <table class="form">
+    <tr>
+      <th><label for="debtor_id">From</label></th>
+      <td>${h.select('debtor_id', c.transfer.debtor_id, c.users)}</td>
+    </tr>
+    <tr>
+      <th><label for="creditor_id">To</label></th>
+      <td>${h.select('creditor_id', c.transfer.creditor_id, c.users)}</td>
+    </tr>
+    <tr>
+      <th><label for="amount">Amount</label></th>
+      <td>${h.currency('amount', c.transfer.amount, size=8)}</td>
+    </tr>
+    <tr>
+      <th><label for="date">Date</label></th>
+      <%
+        if c.transfer.date is None:
+            date_string = ''
+        else:
+            date_string = c.transfer.date.strftime('%m/%d/%Y')
+      %>
+      <td>${h.text('date', date_string, size=16, class_='datepicker')}</td>
+    </tr>
+    <tr>
+      <th><label for="description">Description</label></th>
+      <td>${h.text('description', c.transfer.description, size=64)}</td>
+    </tr>
+    <tr>
+      <td colspan="2">
+        <input type="submit" value="Submit" />
+      </td>
+    </tr>
+  </table>
+</form>