diff --git a/community/lms/doctype/chapter/chapter.py b/community/lms/doctype/chapter/chapter.py index b616de2c..a563c7e0 100644 --- a/community/lms/doctype/chapter/chapter.py +++ b/community/lms/doctype/chapter/chapter.py @@ -5,6 +5,7 @@ from __future__ import unicode_literals import frappe from frappe.model.document import Document +from ...utils import slugify class Chapter(Document): def get_lessons(self): @@ -13,3 +14,6 @@ class Chapter(Document): fields='name', order_by="index_") return [frappe.get_doc('Lesson', row['name']) for row in rows] + + def get_slugified_chapter_title(self): + return slugify(self.title) diff --git a/community/lms/widgets/ChapterTeaser.html b/community/lms/widgets/ChapterTeaser.html index 5a49f5b3..537c952c 100644 --- a/community/lms/widgets/ChapterTeaser.html +++ b/community/lms/widgets/ChapterTeaser.html @@ -1,28 +1,42 @@ -
-
-
{{index}}. {{ chapter.title }}
-
- {{ chapter.description or "" }} +
+ +