fnp
/
edumed.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added lesson-curriculum relation.
[edumed.git]
/
catalogue
/
templatetags
/
catalogue_tags.py
diff --git
a/catalogue/templatetags/catalogue_tags.py
b/catalogue/templatetags/catalogue_tags.py
index
203b794
..
09113d9
100755
(executable)
--- 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 django import template
from django.utils.datastructures import SortedDict
from ..models import Lesson, Section
+from librarian.dcparser import WLURI, Person
register = template.Library()
register = template.Library()
@@
-16,11
+17,6
@@
def catalogue_section_buttons():
"object_list": Section.objects.all()
}
"object_list": Section.objects.all()
}
-@register.inclusion_tag("catalogue/snippets/chosen_topics.html")
-def catalogue_chosen_topics():
- return {
- }
-
@register.inclusion_tag("catalogue/snippets/section_box.html")
def section_box(section):
lessons = SortedDict()
@register.inclusion_tag("catalogue/snippets/section_box.html")
def section_box(section):
lessons = SortedDict()
@@
-33,7
+29,6
@@
def section_box(section):
if lesson.type not in lessons[lesson.level]:
lessons[lesson.level][lesson.type] = []
lessons[lesson.level][lesson.type].append(lesson)
if lesson.type not in lessons[lesson.level]:
lessons[lesson.level][lesson.type] = []
lessons[lesson.level][lesson.type].append(lesson)
- print lessons
return {
"lessons": lessons,
}
return {
"lessons": lessons,
}
@@
-52,9
+47,12
@@
def lesson_nav(lesson):
"siblings": siblings,
}
"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):
@register.filter
def person_list(persons):
- from librarian.dcparser import Person
return u", ".join(Person.from_text(p).readable() for p in persons)
return u", ".join(Person.from_text(p).readable() for p in persons)