wldoc = WLDocument.from_file(self.xml_file.path)
self.dc = wldoc.book_info.to_dict()
self.type = self.dc["type"]
- assert self.type in ('appendix', 'course', 'synthetic', 'project'), \
+ assert self.type in ('appendix', 'course', 'synthetic', 'project', 'added'), \
u"Unknown lesson type: %s" % self.type
self.save()
</ul>
</li>
{% endif %}
+
+ {% if added %}
+ <li class="curriculumcourses"><a href="#{{ level.slug }}_inne">Inne</a>
+ <ul style="list-style: none; padding: 0 0 0 1em; margin: 0;">
+ {% for item in added %}
+ <li><a href="#{{ level.slug }}_{{ item.slug }}">{{ item.title }}</a></li>
+ {% endfor %}
+ </ul>
+ </li>
+ {% endif %}
+
</ul>
+
+
</section>
+
<h1>{{ level }}</h1>
<section class="box-button button"><a href="{{ level.package.url }}" class="dl-button">Pobierz wszystkie lekcje</a></section>
</section>
{% endif %}
+
+ {% if added %}
+ <section id="{{ level.slug }}_inne">
+ <h1>Inne</h1>
+
+ {% for item in added %}
+ <section id="{{ level.slug }}_{{ item.slug }}">
+ <h1>{{ item.title }}</h1>
+
+ <ul class="link-list">
+ {% for lesson in item.lessons %}
+ <li><a href="{{ lesson.get_absolute_url }}" title="{{ lesson.description }}">{{ lesson }}</a></li>
+ {% endfor %}
+ </ul>
+ </section>
+ {% endfor %}
+ </section>
+ {% endif %}
+
+
</section>
if lesson.section not in lessons['course']:
lessons['course'][lesson.section] = []
lessons['course'][lesson.section].append(lesson)
+ elif lesson.type == 'added': continue
else:
lessons[lesson.type].append(lesson)
courses = [(course, by_course[course]) for course in
CurriculumCourse.objects.filter(lesson__level=level).distinct()]
+ added = []
+ if level.slug == 'liceum':
+ added.append({
+ 'slug': 'filmowa',
+ 'title': u'Edukacja filmowa',
+ 'lessons': [
+ Lesson.objects.get(slug=s) for s in [
+'film-co-to-wlasciwie-jest',
+'scenariusz-scenopis-i-srodki-realizacyjne',
+'kompozycja-obrazu-filmowego',
+'praca-kamery-kadr-kat',
+'montaz-materialu-filmowego',
+'swiatlo-i-dzwiek-w-filmie',
+'scenografia-charakteryzacja-kostiumy-i-aktorzy',
+'narracja-w-filmie-tekst-i-fabula',
+ ]
+ ],
+ })
+
return {
"level": level,
"lessons": lessons,
"courses": courses,
+ "added": added,
}
@register.inclusion_tag("catalogue/snippets/lesson_nav.html")
elif lesson.type == 'appendix':
root = None
siblings = Lesson.objects.filter(type=lesson.type)
+ elif lesson.type == 'added':
+ root = None
+ siblings = [
+ Lesson.objects.get(slug=s) for s in [
+'film-co-to-wlasciwie-jest',
+'scenariusz-scenopis-i-srodki-realizacyjne',
+'kompozycja-obrazu-filmowego',
+'praca-kamery-kadr-kat',
+'montaz-materialu-filmowego',
+'swiatlo-i-dzwiek-w-filmie',
+'scenografia-charakteryzacja-kostiumy-i-aktorzy',
+'narracja-w-filmie-tekst-i-fabula',
+ ]
+ ]
else:
root = None
siblings = Lesson.objects.filter(type=lesson.type, level=lesson.level)