feat: Added ChapterTeaser widget
This commit is contained in:
8
community/lms/widgets/ChapterTeaser.html
Normal file
8
community/lms/widgets/ChapterTeaser.html
Normal file
@@ -0,0 +1,8 @@
|
||||
<div class="chapter-teaser">
|
||||
<div class="teaser-body">
|
||||
<h3 class="chapter-title">{{ chapter.title }}</h3>
|
||||
<div class="chapter-description">
|
||||
{{ chapter.description or "" }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -4,6 +4,13 @@
|
||||
background: white;
|
||||
border-radius: 10px;
|
||||
border: 1px solid #ddd;
|
||||
|
||||
.teaser-body {
|
||||
padding: 20px;
|
||||
}
|
||||
.teaser-footer {
|
||||
padding: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.sketch-teaser {
|
||||
@@ -66,3 +73,14 @@ section.lightgray {
|
||||
#hero .jumbotron {
|
||||
background: inherit;
|
||||
}
|
||||
|
||||
.chapter-teaser {
|
||||
.teaser();
|
||||
color: #444;
|
||||
margin: 20px 0px;
|
||||
|
||||
h3, h4 {
|
||||
color: black;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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