{% extends "base.html" %}
{% load url from future %}
-{% load lesson_nav person_list from catalogue_tags %}
+{% load lesson_link lesson_nav person_list from catalogue_tags %}
{% load competence curriculum url_for_level from curriculum_tags %}
{% lesson_nav object %}
</section>
+ {% if object.dc.relations %}
+ <section class="section-minor">
+ <h1>PowiÄ…zane lekcje</h1>
+ {% for uri in object.dc.relations %}
+ <ul class="link-list">
+ <li>{% lesson_link uri %}</li>
+ </ul>
+ {% endfor %}
+ </section>
+ {% endif %}
+
{% if object.dc.competences %}
<section class="section-minor">
<h1>Kompetencje:</h1>
from django import template
from django.utils.datastructures import SortedDict
from ..models import Lesson, Section
+from librarian.dcparser import WLURI, Person
register = template.Library()
"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)