feat: Added ChapterTeaser widget
This commit is contained in:
@@ -131,25 +131,9 @@
|
||||
{% endmacro %}
|
||||
|
||||
{% macro CourseOutline(course) %}
|
||||
<h2>Course Outline</h2>
|
||||
<h2>Course Outline</h2>
|
||||
|
||||
{% for chapter in course.topics %}
|
||||
<div class="chapter-plan">
|
||||
<h3><span class="chapter-number">{{loop.index}}</span> {{chapter.title}}</h3>
|
||||
<div class="chapter-description">
|
||||
{{chapter.preview | markdown}}
|
||||
</div>
|
||||
|
||||
{#
|
||||
<div class="lessons">
|
||||
{% for lesson in chapter.lessons %}
|
||||
<div class="lesson">
|
||||
<span class="lesson-type"><i class="{{lesson.icon}}"></i></span>
|
||||
<span class="lesson-title">{{lesson.title}}</span>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
#}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% for chapter in course.chapters %}
|
||||
{{ widgets.ChapterTeaser(chapter=chapter)}}
|
||||
{% endfor %}
|
||||
{% endmacro %}
|
||||
|
||||
@@ -29,11 +29,11 @@ def get_course(slug):
|
||||
course = frappe.db.get_value("LMS Course", {"slug": slug},
|
||||
["name", "slug", "title", "description", "short_introduction", "video_link", "owner"], as_dict=1)
|
||||
|
||||
course["topics"] = frappe.db.get_all("LMS Topic",
|
||||
course["chapters"] = frappe.db.get_all("Chapter",
|
||||
filters={
|
||||
"course": course["name"]
|
||||
},
|
||||
fields=["name", "slug", "title", "preview"],
|
||||
fields=["name", "title", "description"],
|
||||
order_by="creation"
|
||||
)
|
||||
return course
|
||||
|
||||
Reference in New Issue
Block a user