diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/customers.pt | 23 | ||||
-rw-r--r-- | templates/products.pt | 25 |
2 files changed, 48 insertions, 0 deletions
diff --git a/templates/customers.pt b/templates/customers.pt new file mode 100644 index 0000000..23fa70e --- /dev/null +++ b/templates/customers.pt | |||
@@ -0,0 +1,23 @@ | |||
1 | <title>Customer List</title> | ||
2 | <html> | ||
3 | <h1>Customers</h1> | ||
4 | <table> | ||
5 | <tr><th>Name</th><th span="2">E-Mail</th><th>Purchase</th></tr> | ||
6 | <tr tal:repeat="cust customers"> | ||
7 | <td><a href="/customer/${customers[cust].name}">${customers[cust].name}</a></td> | ||
8 | <td><a href="mailto:${customers[cust].email}"><span tal:replace="customers[cust].email" /></a></td> | ||
9 | <td><form action="/purchaseNew"> | ||
10 | <input type="hidden" name="customer" value="${customers[cust].name}" /> | ||
11 | <select name="product"> | ||
12 | <option tal:repeat="prod products" value="${products[prod].name}">${products[prod].name} – €${products[prod].price}</option> | ||
13 | </select> | ||
14 | <input type="submit" value="Buy"/> | ||
15 | </form></td> | ||
16 | </tr> | ||
17 | <tr><form action="/customerNew"> | ||
18 | <td><input type="text" name="name" /></td> | ||
19 | <td><input type="text" name="email" /></td> | ||
20 | <td><input type="submit" value="Add"/></td> | ||
21 | </form></tr> | ||
22 | </table> | ||
23 | </html> | ||
diff --git a/templates/products.pt b/templates/products.pt new file mode 100644 index 0000000..16cb19c --- /dev/null +++ b/templates/products.pt | |||
@@ -0,0 +1,25 @@ | |||
1 | <title>Products List</title> | ||
2 | <html> | ||
3 | <h1>Products</h1> | ||
4 | <table> | ||
5 | <tr><th>Name</th><th span="2">Type</th><th>Price</th><th>Purchase</th></tr> | ||
6 | <tr tal:repeat="item products"> | ||
7 | <td><a href="/product/${products[item].name}">${products[item].name}</a></td> | ||
8 | <td>${products[item].type}</td> | ||
9 | <td>${products[item].price}</td> | ||
10 | <td><form action="/purchaseNew"> | ||
11 | <input type="hidden" name="product" value="${products[item].name}" /> | ||
12 | <select name="customer"> | ||
13 | <option tal:repeat="cust customers" value="${customers[cust].name}">${customers[cust].name}</option> | ||
14 | </select> | ||
15 | <input type="submit" value="Buy" /> | ||
16 | </form></td> | ||
17 | </tr> | ||
18 | <tr><form action="/productNew"> | ||
19 | <td><input type="text" name="name" /></td> | ||
20 | <td><input type="text" name="type" /></td> | ||
21 | <td><input type="number" name="price" value="5" /></td> | ||
22 | <td><input type="submit" value="Add"/></td> | ||
23 | </form></tr> | ||
24 | </table> | ||
25 | </html> | ||