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;
|
background: white;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
border: 1px solid #ddd;
|
border: 1px solid #ddd;
|
||||||
|
|
||||||
|
.teaser-body {
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
.teaser-footer {
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.sketch-teaser {
|
.sketch-teaser {
|
||||||
@@ -66,3 +73,14 @@ section.lightgray {
|
|||||||
#hero .jumbotron {
|
#hero .jumbotron {
|
||||||
background: inherit;
|
background: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.chapter-teaser {
|
||||||
|
.teaser();
|
||||||
|
color: #444;
|
||||||
|
margin: 20px 0px;
|
||||||
|
|
||||||
|
h3, h4 {
|
||||||
|
color: black;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -131,25 +131,9 @@
|
|||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
{% macro CourseOutline(course) %}
|
{% macro CourseOutline(course) %}
|
||||||
<h2>Course Outline</h2>
|
<h2>Course Outline</h2>
|
||||||
|
|
||||||
{% for chapter in course.topics %}
|
{% for chapter in course.chapters %}
|
||||||
<div class="chapter-plan">
|
{{ widgets.ChapterTeaser(chapter=chapter)}}
|
||||||
<h3><span class="chapter-number">{{loop.index}}</span> {{chapter.title}}</h3>
|
{% endfor %}
|
||||||
<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 %}
|
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|||||||
@@ -29,11 +29,11 @@ def get_course(slug):
|
|||||||
course = frappe.db.get_value("LMS Course", {"slug": slug},
|
course = frappe.db.get_value("LMS Course", {"slug": slug},
|
||||||
["name", "slug", "title", "description", "short_introduction", "video_link", "owner"], as_dict=1)
|
["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={
|
filters={
|
||||||
"course": course["name"]
|
"course": course["name"]
|
||||||
},
|
},
|
||||||
fields=["name", "slug", "title", "preview"],
|
fields=["name", "title", "description"],
|
||||||
order_by="creation"
|
order_by="creation"
|
||||||
)
|
)
|
||||||
return course
|
return course
|
||||||
|
|||||||
Reference in New Issue
Block a user