feat: course details page structure

This commit is contained in:
pateljannat
2021-07-06 20:51:20 +05:30
parent 68fd32d536
commit 0ed5309b97
10 changed files with 129 additions and 76 deletions

View File

@@ -65,8 +65,7 @@
"fieldname": "course",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Course",
"read_only": 1
"label": "Course"
},
{
"fieldname": "current_lesson",
@@ -84,7 +83,7 @@
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2021-06-21 12:10:28.808803",
"modified": "2021-07-06 20:50:46.885325",
"modified_by": "Administrator",
"module": "LMS",
"name": "LMS Batch Membership",

View File

@@ -1,7 +1,6 @@
<div class="course-instructor breadcrumb">
<a class="dark-links" href="/courses">All Courses</a>
<img class="ml-1 mr-1" src="/assets/community/icons/side-arrow.svg">
{% if lesson %}
<a class="dark-links" href="/courses/{{ course.name }}">{{ course.title }}</a>
<img class="ml-1 mr-1" src="/assets/community/icons/side-arrow.svg">

View File

@@ -1,6 +1,6 @@
<div>
<div class="small-title chapter-title" data-target="#{{ chapter.get_slugified_chapter_title() }}" data-toggle="collapse"
aria-expanded="false">
<div class="small-title chapter-title" data-target="#{{ chapter.get_slugified_chapter_title() }}"
data-toggle="collapse" aria-expanded="false">
<img class="chapter-icon" src="/assets/community/icons/side-arrow.svg">
{{ index }}. {{ chapter.title }}
</div>
@@ -12,7 +12,8 @@
{% for lesson in chapter.get_lessons() %}
<div class="lesson-info">
{% if show_link or lesson.include_in_preview %}
<a class="dark-links" href="{{ course.get_learn_url(course.get_lesson_index(lesson.name)) }}{{course.query_parameter}}"
<a class="dark-links"
href="{{ course.get_learn_url(course.get_lesson_index(lesson.name)) }}{{course.query_parameter}}"
data-course="{{ course.name }}">
{{ lesson.title }}</a>
{% else %}
@@ -31,3 +32,20 @@
{% if index != course.get_chapters() | length %}
<div class="card-divider"></div>
{% endif %}
<script>
frappe.ready(() => {
expand_the_first_chapter();
})
var expand_the_first_chapter = () => {
var elements = $(".collapse");
elements.each((i, elem) => {
if (i <= 1) {
$(elem).addClass("show");
$(elem).siblings(".chapter-title").children(".chapter-icon").css("transform", "rotate(90deg)");
}
});
}
</script>