X-Git-Url: https://git.mdrn.pl/edumed.git/blobdiff_plain/cf52e60f9665dc878fc2b3ab9db17d981c52030b..05333a6f2d2ea77a602612c3aaff039dc7b97200:/catalogue/templatetags/catalogue_tags.py diff --git a/catalogue/templatetags/catalogue_tags.py b/catalogue/templatetags/catalogue_tags.py index 23ce402..80b1a0c 100755 --- a/catalogue/templatetags/catalogue_tags.py +++ b/catalogue/templatetags/catalogue_tags.py @@ -1,6 +1,7 @@ from django import template from django.utils.datastructures import SortedDict from ..models import Lesson, Section +from librarian.dcparser import WLURI, Person register = template.Library() @@ -51,9 +52,12 @@ def lesson_nav(lesson): "siblings": siblings, } +@register.inclusion_tag("catalogue/snippets/lesson_link.html") +def lesson_link(uri): + return {'lesson': Lesson.objects.get(slug=WLURI(uri).slug)} + @register.filter def person_list(persons): - from librarian.dcparser import Person return u", ".join(Person.from_text(p).readable() for p in persons)