diff --git a/mamweb/templates/base.html b/mamweb/templates/base.html index a53fa3df..18450af0 100644 --- a/mamweb/templates/base.html +++ b/mamweb/templates/base.html @@ -6,7 +6,8 @@ {% block title %}{% block nadpis1a %}{% endblock %} – Korespondenční seminář M&M{% endblock title %} - {% render_block "css" %} + {% render_block css %} + {% block custom_css %}{% endblock %} diff --git a/seminar/templates/seminar/archiv/base.html b/seminar/templates/seminar/archiv/base.html index d1401d28..efc3171d 100644 --- a/seminar/templates/seminar/archiv/base.html +++ b/seminar/templates/seminar/archiv/base.html @@ -1,6 +1,4 @@ {% extends "base.html" %} -{% block menu_archiv %}selected{% endblock %} - {# zmena fotky #}{% block header %}archiv{% endblock %} diff --git a/seminar/templates/seminar/treenode.html b/seminar/templates/seminar/treenode.html index 0fd734ef..c8e542d6 100644 --- a/seminar/templates/seminar/treenode.html +++ b/seminar/templates/seminar/treenode.html @@ -1,4 +1,16 @@ -{% extends "seminar/archiv/base_ulohy.html" %} +{% extends "seminar/archiv/base.html" %} +{% load staticfiles %} +{% load sekizai_tags %} + +{# toto z nejakeho duvodu nefunguje #} +{% addtoblock css %} +dfsdfs + +{% endaddtoblock "css" %} + +{% block custom_css %} + +{% endblock custom_css %} {% load comments %} diff --git a/seminar/templates/seminar/treenode_recursive.html b/seminar/templates/seminar/treenode_recursive.html index 0cf37d9a..cdee68f0 100644 --- a/seminar/templates/seminar/treenode_recursive.html +++ b/seminar/templates/seminar/treenode_recursive.html @@ -1,6 +1,12 @@ {% load treenodes %} {# {{depth}} #} -
+
+
+ {{obj.node}} + + + +
{% if obj.node|isRocnik %} Ročník {{obj.node.rocnik}} {% elif obj.node|isCislo %} @@ -17,11 +23,36 @@ Objekt jiného typu {{obj.node}} {% endif %} {%if obj.children %} -
+
+
Přidat před + + +
{%for ch in obj.children %} {%with obj=ch depth=depth|add:"1" template_name="seminar/treenode_recursive.html" %} {%include template_name%} {%endwith%} +
+ {% if forloop.last %} Přidat za {% else %} Přidat mezi {% endif %} + + + +     + {% if not forloop.last %} + + {% endif %} + +
{%endfor%}
{%endif%} diff --git a/seminar/templatetags/treenodes.py b/seminar/templatetags/treenodes.py index 0d60765e..f7e334c0 100644 --- a/seminar/templatetags/treenodes.py +++ b/seminar/templatetags/treenodes.py @@ -3,47 +3,60 @@ import seminar.models as m register = template.Library() +@register.filter +def nodeType(value): + if isinstance(value,RocnikNode): return "Ročník" + if isinstance(value,CisloNode): return "Číslo" + if isinstance(value,CastNode): return "Část" + if isinstance(value,TextNode): return "Text" + if isinstance(value,TemaVCisleNode): return "Téma v čísle" + if isinstance(value,KonferaNode): return "Konfera" + if isinstance(value,ClanekNode): return "Článek" + if isinstance(value,UlohaVzorakNode): return "Vzorák" + if isinstance(value,UlohaZadaniNode): return "Zadání úlohy" + if isinstance(value,PohadkaNode): return "Pohádka" + @register.filter def isRocnik(value): - return isinstance(value, m.RocnikNode) + return isinstance(value, m.RocnikNode) @register.filter def isCislo(value): - return isinstance(value, m.CisloNode) + return isinstance(value, m.CisloNode) @register.filter def isCast(value): - return isinstance(value, m.CastNode) + return isinstance(value, m.CastNode) @register.filter def isText(value): - return isinstance(value, m.TextNode) + return isinstance(value, m.TextNode) @register.filter def isTemaVCisle(value): - return isinstance(value, m.TemaVCisleNode) + return isinstance(value, m.TemaVCisleNode) @register.filter def isKonfera(value): - return isinstance(value, m.KonferaNode) + return isinstance(value, m.KonferaNode) @register.filter def isClanek(value): - return isinstance(value, m.ClanekNode) + return isinstance(value, m.ClanekNode) @register.filter def isUlohaVzorak(value): - return isinstance(value, m.UlohaVzorakNode) + return isinstance(value, m.UlohaVzorakNode) @register.filter def isUlohaZadani(value): - return isinstance(value, m.UlohaZadaniNode) + return isinstance(value, m.UlohaZadaniNode) @register.filter def isPohadka(value): - return isinstance(value, m.PohadkaNode) + return isinstance(value, m.PohadkaNode) #@register.filter #def isOtisteneReseniNode(value): -# return isinstance(value, m.OtisteneReseniNode) +# return isinstance(value, m.OtisteneReseniNode)