You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
2.1 KiB

{% load treenodes %}
{# <b>{{depth}}</b> #}
<div class="borderized parent">
<div class="node_type">
{{obj.node}}
{% if obj.node|deletable %}
<button type="submit" formaction="{%url 'treenode_smazat' obj.node.id%}">Smazat</button>
{% endif %}
{% if obj.parent and obj.parent|editableSiblings %}
<button type="submit" formaction="{%url 'treenode_odvesit' obj.node.id%}">Odvěsit na úroveň {{obj.parent.node}}</button>
{% endif %}
{% if obj|canPodvesitPred %}
<button type="submit" formaction="{%url 'treenode_podvesit' obj.node.id 'pred'%}">Podvěsit pod předchozí</button> - nejsou testovací data
{% endif %}
{% if obj|canPodvesitZa %}
<button type="submit" formaction="{%url 'treenode_podvesit' obj.node.id 'za'%}">Podvěsit pod následující</button> - nejsou testovací data
{% endif %}
</div>
{% if False %}
<div class="node_move">
FIXME: není zatím implementováno
<button>Zvyš úroveň nadpisu</button> - nejsou testovací data
</div>
{% endif %}
{% include "seminar/treenode_name.html" %}
{%if obj.children %}
<div class="borderized children">
{% with kam="před" kam_slug="syn" %} {% include "seminar/treenode_add_stub.html" %} {% endwith %}
{%for ch in obj.children %}
{# ----------- Vypisujeme podstrom ----------#}
{%with obj=ch depth=depth|add:"1" %} {%include "seminar/treenode_recursive.html" %} {%endwith%}
{# ----------- Přidáváme mezi syny / za posledního -------- #}
{% if forloop.last %}
{% with kam="za" kam_slug="za" obj=ch %} {% include "seminar/treenode_add_stub.html" %} {% endwith %}
{% else %}
{% with kam="mezi" obj=ch kam_slug="za" %} {% include "seminar/treenode_add_stub.html" %} {% endwith %}
{% endif %}
{# ----------- Prohazujeme sousedy ----------#}
<div class="pink">
{% if not forloop.last and ch|editableSiblings %}
<button type="submit" formaction="{%url 'treenode_prohodit' ch.node.id%}">Prohodit ^ a v</button>
{% endif %}
</div>
{% endfor %}
</div>
{% else %}
{# ----------- Přidáváme prvního syna ----------#}
{% with kam="jako syna" kam_slug="syn" %} {% include "seminar/treenode_add_stub.html" %} {% endwith %}
{%endif%}
</div>