|
@ -2,91 +2,53 @@ |
|
|
{# <b>{{depth}}</b> #} |
|
|
{# <b>{{depth}}</b> #} |
|
|
<div class="borderized parent"> |
|
|
<div class="borderized parent"> |
|
|
<div class="node_type"> |
|
|
<div class="node_type"> |
|
|
{{obj.node}} |
|
|
{{obj.node}} |
|
|
{% if obj.node|deletable %} |
|
|
{% if obj.node|deletable %} |
|
|
<button>Smazat</button> |
|
|
<button>Smazat</button> |
|
|
{% endif %} |
|
|
{% endif %} |
|
|
{% if not obj.children and obj.node|appendableChildren %} |
|
|
{% if obj.parent and obj.parent|editableSiblings %} |
|
|
{% endif %} |
|
|
|
|
|
</div> |
|
|
|
|
|
{% if obj|editableSiblings %} |
|
|
|
|
|
<div class="node_move"> |
|
|
|
|
|
<button>Odvěsit na úroveň {{obj.parent.node}}</button> |
|
|
<button>Odvěsit na úroveň {{obj.parent.node}}</button> |
|
|
<button>Podvěsit pod předchozí</button> |
|
|
{% endif %} |
|
|
|
|
|
{% if obj|canPodvesitPred %} |
|
|
|
|
|
<button>Podvěsit pod předchozí</button> - nejsou testovací data |
|
|
|
|
|
{% endif %} |
|
|
|
|
|
{% if obj|canPodvesitZa %} |
|
|
|
|
|
<button>Podvěsit pod následující</button> - nejsou testovací data |
|
|
|
|
|
{% endif %} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
|
|
|
{% if False %} |
|
|
|
|
|
<div class="node_move"> |
|
|
|
|
|
FIXME: není zatím implementováno |
|
|
|
|
|
<button>Zvyš úroveň nadpisu</button> - nejsou testovací data |
|
|
|
|
|
</div> |
|
|
{% endif %} |
|
|
{% endif %} |
|
|
{% if obj.node|isRocnik %} |
|
|
{% include "seminar/treenode_name.html" %} |
|
|
<h{{depth}}> Ročník {{obj.node.rocnik}} </h{{depth}}> |
|
|
|
|
|
{% elif obj.node|isCislo %} |
|
|
|
|
|
<h{{depth}}> Číslo {{obj.node.cislo}} </h{{depth}}> |
|
|
|
|
|
{% elif obj.node|isTemaVCisle %} |
|
|
|
|
|
<h{{depth}}> Téma {{obj.node.tema.nazev}} </h{{depth}}> |
|
|
|
|
|
{% elif obj.node|isUlohaZadani %} |
|
|
|
|
|
<h{{depth}}>Úloha {{obj.node.uloha.kod_v_rocniku}} ({{obj.node.uloha.max_body}} b)</h{{depth}}> |
|
|
|
|
|
{% elif obj.node|isUlohaVzorak %} |
|
|
|
|
|
<h{{depth}}>Řešení: {{obj.node.uloha.kod_v_rocniku}}</h{{depth}}> |
|
|
|
|
|
{% elif obj.node|isText %} |
|
|
|
|
|
{{obj.node.text.na_web}} |
|
|
|
|
|
{% else %} |
|
|
|
|
|
Objekt jiného typu {{obj.node}} |
|
|
|
|
|
{% endif %} |
|
|
|
|
|
|
|
|
|
|
|
{%if obj.children %} |
|
|
{%if obj.children %} |
|
|
<div class="borderized children"> |
|
|
<div class="borderized children"> |
|
|
|
|
|
|
|
|
{# ----------- Přidáváme před prvního syna -------- #} |
|
|
{% with kam="před" %} {% include "seminar/treenode_add_stub.html" %} {% endwith %} |
|
|
{% if obj.node|appendableChildren %} |
|
|
|
|
|
<div class="pink">Přidat před |
|
|
|
|
|
<select> |
|
|
|
|
|
{% for chld in obj.node|appendableChildren %} |
|
|
|
|
|
<option value="{{chld.0}}">{{chld.1}}</option> |
|
|
|
|
|
{% endfor %} |
|
|
|
|
|
</select> |
|
|
|
|
|
<button>Přídat</button> |
|
|
|
|
|
</div> |
|
|
|
|
|
{% endif %}{# appendablebleChildren #} |
|
|
|
|
|
{# ----------- /Přidáváme před -------- #} |
|
|
|
|
|
{%for ch in obj.children %} |
|
|
{%for ch in obj.children %} |
|
|
|
|
|
|
|
|
{# ----------- Vypisujeme podstrom ----------#} |
|
|
{# ----------- Vypisujeme podstrom ----------#} |
|
|
{%with obj=ch depth=depth|add:"1" template_name="seminar/treenode_recursive.html" %} |
|
|
{%with obj=ch depth=depth|add:"1" %} {%include "seminar/treenode_recursive.html" %} {%endwith%} |
|
|
{%include template_name%} |
|
|
|
|
|
{%endwith%} |
|
|
|
|
|
{# ----------- /Vypisujeme podstrom ---------#} |
|
|
|
|
|
{# ----------- Přidáváme mezi syny / za posledního -------- #} |
|
|
{# ----------- Přidáváme mezi syny / za posledního -------- #} |
|
|
{% if obj.node|appendableChildren %} |
|
|
{% if forloop.last %} |
|
|
<div class="pink"> |
|
|
{% with kam="za" %} {% include "seminar/treenode_add_stub.html" %} {% endwith %} |
|
|
{% if forloop.last %} Přidat za {% else %} Přidat mezi {% endif %} |
|
|
{% else %} |
|
|
<select> |
|
|
{% with kam="mezi" %} {% include "seminar/treenode_add_stub.html" %} {% endwith %} |
|
|
{% for chld in obj.node|appendableChildren %} |
|
|
{% endif %} |
|
|
<option value="{{chld.0}}">{{chld.1}}</option> |
|
|
{# ----------- Prohazujeme sousedy ----------#} |
|
|
{% endfor %} |
|
|
|
|
|
</select> |
|
|
|
|
|
<button>Přídat</button> |
|
|
|
|
|
</div> |
|
|
|
|
|
{% endif %}{# appendablebleChildren #} |
|
|
|
|
|
{# ----------- /Přidáváme mezi syny / za posledního -------- #} |
|
|
|
|
|
<div class="pink"> |
|
|
<div class="pink"> |
|
|
{% if not forloop.last and ch|editableSiblings %} |
|
|
{% if not forloop.last and ch|editableSiblings %} |
|
|
<button>Prohodit ^ a v</button> |
|
|
<button>Prohodit ^ a v</button> |
|
|
{% endif %} |
|
|
{% endif %} |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
{% empty %} |
|
|
|
|
|
{# ----------- Přidáváme prvního syna -------- #} |
|
|
|
|
|
{% if obj.node|appendableChildren %} |
|
|
|
|
|
<div class="pink"> |
|
|
|
|
|
Přidat jako syna |
|
|
|
|
|
<select> |
|
|
|
|
|
{% for chld in obj.node|appendableChildren %} |
|
|
|
|
|
<option value="{{chld.0}}">{{chld.1}}</option> |
|
|
|
|
|
{% endfor %} |
|
|
|
|
|
</select> |
|
|
|
|
|
<button>Přidat</button> |
|
|
|
|
|
</div> |
|
|
|
|
|
{% endif %} |
|
|
|
|
|
{# ----------- /Přidáváme prvního syna -------- #} |
|
|
|
|
|
{% endfor %} |
|
|
{% endfor %} |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
{% else %} |
|
|
|
|
|
{# ----------- Přidáváme prvního syna ----------#} |
|
|
|
|
|
{% with kam="jako syna" %} {% include "seminar/treenode_add_stub.html" %} {% endwith %} |
|
|
{%endif%} |
|
|
{%endif%} |
|
|
</div> |
|
|
</div> |
|
|