{% load dictionary_extras i18n %} <ul class="value-tree"> {% for value, subtree in value_tree %} <li> <span class="value-name"> {{ value.label }} </span> <span class="value-controls"> {% if value.is_empty and not subtree %} <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"> {% trans 'delete' %} </button> </form> {% endif %} <form action="" method="post"> {% 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"> {% trans 'rename' %} </button> </form> </span> {% if subtree %} {% value_tree subtree %} {% endif %} </li> {% endfor %} </ul>