shopylist/templates/index.html
2018-08-16 18:57:42 +10:00

62 lines
1.6 KiB
HTML

<html>
<head>
<link rel="stylesheet" href="/static/css/table.css"/>
</head>
<body style="background: #868686">
<h1>Shopping list </h1>
<table >
<tr>
<th>Requester</th>
<th>Item</th>
<th>Quantity</th>
<th>Got It?</th>
</tr>
<!-- {% for res in data %}
<tr>
{% for field in res %}
<td>
{{ field }}
</td>
{% endfor %}
</tr>
{% endfor %} -->
{% for lists in data %}
<tr>
<td> {{ lists['req'] }}</td>
<td> {{ lists['item'] }}</td>
<td> {{ lists['quantity'] }}</td>
<td> {% if lists['gotten'] == "False" %}
no
{% else %}
yes
{% endif %}</td>
<td> <form action="/" method="post">
<input type="submit" name="gotten" value="*">
<input type="hidden" name="id" value="{{ lists['id'] }}" />
</form> </td>
</tr>
{% endfor %}
</table>
<table>
<form action="/" method="post">
<tr>
<td><label>Who Dat?</label></td>
<td><input type="text" name='requester'/><br/></td>
</tr>
<tr>
<td><label>Watchu Want?</label></td>
<td><input type="text" name='item'/><br/></td>
</tr>
<tr>
<td><label>How Many?</label></td>
<td><input type="text" name='quantity'/><br/></td>
</tr>
<tr>
<td><input type="submit" name="addItem" value="Add Item"/></td>
</tr>
</form>
</table>
</body>
</html>