-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
43 lines (39 loc) · 1016 Bytes
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!DOCTYPE html>
{% autoescape true %}
<html>
<head>
<title>Viikkoharkka 2</title>
</head>
<body>
<h3>Ravintoketju</h3>
<form action="/newanimal" method="POST">
<input type="text" name="animal" placeholder="Eläin" />
<input type="submit" value="Lisää eläin">
</form>
<table>
<tr><th>Eläin</th><th>Saaliseläimet</th><th></th></tr>
{% for animal in animals %}
<tr>
<td>{{animal.name}}</td>
<td>
{% for prey in animal.prey %}
{{prey}}
{% endfor %}
</td>
<td>
<form action="/newprey" method="POST">
<select name="prey">
{% for newprey in animals %}
<option value="{{newprey.id}}">{{newprey.name}}</option>
{% endfor %}
</select>
<input type="hidden" name="predator" value="{{animal.id}}" />
<input type="submit" value="Lisää saaliseläin">
</form>
</td>
</tr>
{% endfor %}
</table>
</body>
</html>
{% endautoescape %}