|
1
2
|
{% load dictionary_extras %}
<ul class="value-tree">
|
|
3
4
|
{% for value, subtree in value_tree %}
<li>
|
|
5
6
7
8
9
|
<span class="value-name">
{{ value.label }}
</span>
<span class="value-controls">
{% if value.is_empty and not subtree %}
|
|
10
11
12
13
14
15
16
17
18
|
<form action="" method="post">
{% csrf_token %}
<input type="hidden" name="det" value="value_remove"/>
<input type="hidden" name="id" value="{{ value.pk }}"/>
<button type="submit">
usuń
</button>
</form>
{% endif %}
|
|
19
|
<form action="" method="post">
|
|
20
21
22
23
24
25
26
|
{% csrf_token %}
<input type="hidden" name="det" value="value_rename"/>
<input type="hidden" name="id" value="{{ value.pk }}"/>
<input type="text" name="new_name"/>
<button type="submit">
zmień nazwę
</button>
|
|
27
28
|
</form>
</span>
|
|
29
30
31
32
33
|
{% if subtree %}
{% value_tree subtree %}
{% endif %}
</li>
{% endfor %}
|
|
34
|
</ul>
|