Tomas Gavenciak
10 years ago
4 changed files with 27 additions and 3 deletions
@ -1,3 +1,12 @@ |
|||
{% load i18n cache %} |
|||
{% load i18n cache mam_menu %} |
|||
{% aktualni_rocniky as rs %} |
|||
|
|||
MENU |
|||
<h2>MENU</h2> |
|||
|
|||
<p><a href='{% url 'seminar.aktualni_zadani' %}'>Aktuální zadání</a> |
|||
|
|||
<ul> |
|||
{% for r in rs %} |
|||
<li><a href='{% url 'seminar.rocnik' r.id %}'>Ročník {{ r }}</a> |
|||
{% endfor %} |
|||
</ul> |
|||
|
@ -0,0 +1,15 @@ |
|||
from django import template |
|||
|
|||
from seminar.models import Rocnik |
|||
|
|||
register = template.Library() |
|||
|
|||
@register.inclusion_tag('results.html') |
|||
def seminar_rocniky(parser, token): |
|||
return { |
|||
'rocniky': Rocnik.objects.all() |
|||
} |
|||
|
|||
@register.assignment_tag |
|||
def aktualni_rocniky(): |
|||
return Rocnik.objects.all() |
Loading…
Reference in new issue