-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathview_restart.html
71 lines (65 loc) · 1.93 KB
/
view_restart.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
{% extends "base.html" %}
{% block body %}
<h1>Monsters</h1>
<form
method="POST"
action=""
hx-post=""
hx-vals='{"use_block": ["happy-monsters", "sad-monsters"]}'
hx-swap="none"
>{% csrf_token %}
<table>
<thead>
<tr>
<th>Happy monsters</th>
<th>Sad monsters</th>
</tr>
</thead>
<tbody>
<tr>
<td style="max-height: 10em; overflow: scroll;">
{% block happy-monsters %}
<div id="happy-monsters"
hx-swap-oob="true"
>
{% for monster in happy_monsters %}
<label>
<input name="happy_monster_{{ monster.id }}" type="checkbox"
{% if monster in selected_happy_monsters %}checked{% endif %}
>
{{ monster.name }}
</label><br>
{% endfor %}
</div>
{% endblock %}
</td>
<td style="max-height: 10em; overflow: scroll;">
{% block sad-monsters %}
<div id="sad-monsters"
hx-swap-oob="true"
>
{% for monster in sad_monsters %}
<label>
<input name="sad_monster_{{ monster.id }}" type="checkbox"
{% if monster in selected_sad_monsters %}checked{% endif %}
>
{{ monster.name }}
</label><br>
{% endfor %}
</div>
{% endblock %}
</td>
</tr>
<tr>
<td>
<button name="kick" type="submit">Kick them!</button>
</td>
<td>
<button name="hug" type="submit">Hug them!</button>
</td>
</tr>
</tbody>
</table>
</form>
<p>See also: <a href="{% url 'simple_post_form' %}">create monsters page</a></p>
{% endblock %}