fnp
/
edumed.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
repair build_*
[edumed.git]
/
catalogue
/
templatetags
/
catalogue_tags.py
diff --git
a/catalogue/templatetags/catalogue_tags.py
b/catalogue/templatetags/catalogue_tags.py
index
09113d9
..
fd1fc62
100755
(executable)
--- a/
catalogue/templatetags/catalogue_tags.py
+++ b/
catalogue/templatetags/catalogue_tags.py
@@
-37,19
+37,25
@@
def section_box(section):
def lesson_nav(lesson):
if lesson.type == 'course':
root = lesson.section
def lesson_nav(lesson):
if lesson.type == 'course':
root = lesson.section
- siblings = root.lesson_set.filter(type='course')
+ siblings = root.lesson_set.filter(type='course', level=lesson.level)
+ mark_level = False
else:
root = None
siblings = Lesson.objects.filter(type=lesson.type)
else:
root = None
siblings = Lesson.objects.filter(type=lesson.type)
+ mark_level = True
return {
"lesson": lesson,
"root": root,
"siblings": siblings,
return {
"lesson": lesson,
"root": root,
"siblings": siblings,
+ "mark_level": mark_level
}
@register.inclusion_tag("catalogue/snippets/lesson_link.html")
def lesson_link(uri):
}
@register.inclusion_tag("catalogue/snippets/lesson_link.html")
def lesson_link(uri):
- return {'lesson': Lesson.objects.get(slug=WLURI(uri).slug)}
+ try:
+ return {'lesson': Lesson.objects.get(slug=WLURI(uri).slug)}
+ except Lesson.DoesNotExist:
+ return {}
@register.filter
def person_list(persons):
@register.filter
def person_list(persons):