diff --git a/school/lms/widgets/CourseOutline.html b/school/lms/widgets/CourseOutline.html
index 970de9ed..e4144d62 100644
--- a/school/lms/widgets/CourseOutline.html
+++ b/school/lms/widgets/CourseOutline.html
@@ -4,7 +4,7 @@
{{ _("Course Content") }}
{% for chapter in get_chapters(course.name) %}
-
+

diff --git a/school/public/css/style.css b/school/public/css/style.css
index 97903fc5..31796330 100644
--- a/school/public/css/style.css
+++ b/school/public/css/style.css
@@ -467,10 +467,6 @@ input[type=checkbox] {
align-items: center;
}
-.chapter-title[aria-expanded="true"] {
- background: var(--gray-100);
-}
-
.chapter-description {
margin: 0.75rem 3rem 1rem;
}
@@ -480,7 +476,7 @@ input[type=checkbox] {
}
.chapter-icon {
- margin: 0 1.25rem;
+ margin-right: 1.25rem;
}
.course-outline-instructor-parent {
@@ -544,14 +540,12 @@ input[type=checkbox] {
.lesson-info {
font-size: 16px;
- line-height: 250%;
letter-spacing: -0.011em;
- margin-top: 0.5rem;
}
.lesson-links {
display: flex;
- padding: 0 1rem;
+ padding: 0.75rem 1rem;
color: inherit;
}
@@ -562,16 +556,14 @@ input[type=checkbox] {
border-radius: var(--border-radius-md);
}
-.course-content-parent .lesson-links {
- padding: 0.5rem 1rem;
- margin-bottom: 0.75rem;
- font-size: 0.85rem;
- line-height: 200%;
+.course-content-parent .chapter-title {
+ font-size: var(--text-md);
}
-.chapter-content {
- margin: 0;
- margin-left: .875rem;
+.course-content-parent .lesson-links {
+ padding: 0.5rem 1rem;
+ font-size: var(--text-md);
+ line-height: 200%;
}
.course-outline {
@@ -580,7 +572,7 @@ input[type=checkbox] {
}
.lessons {
- margin-left: 2rem;
+ margin-left: 2.5rem;
}
.course-buttons {
@@ -1386,6 +1378,8 @@ pre {
.related-courses {
background: var(--gray-50);
padding: 5rem 0;
+ position: relative;
+ z-index: 5;
}
.carousel-indicators {
@@ -1580,10 +1574,11 @@ pre {
box-shadow: var(--shadow-sm);
overflow: auto;
width: fit-content;
- position: absolute;
+ position: fixed;
top: 40%;
right: 7%;
max-width: 400px;
+ z-index: 4;
}
@media (max-width: 768px) {
@@ -1637,8 +1632,8 @@ pre {
.overlay-student-count {
display: flex;
align-items: center;
- justify-content: center;
margin-bottom: 1.5rem;
+ margin-top: 1rem;
}
.course-creators-card {
@@ -1722,6 +1717,10 @@ pre {
background-color: var(--gray-600);
}
+.course-home-top-container {
+ position: relative;
+}
+
.question-header {
display: flex;
align-items: center;
diff --git a/school/templates/quiz.html b/school/templates/quiz.html
index 84dcf1eb..3b517d47 100644
--- a/school/templates/quiz.html
+++ b/school/templates/quiz.html
@@ -17,8 +17,6 @@
-
-
{% set options = [question.option_1, question.option_2, question.option_3, question.option_4] %}
{% for option in options %}
{% if option %}
@@ -46,11 +44,11 @@
- {{ CourseHomeHeader(course) }}
-
-
- {{ Description(course) }}
- {{ widgets.CourseOutline(course=course, membership=membership) }}
- {{ CourseCreator(course) }}
- {{ widgets.Reviews(course=course, membership=membership) }}
+
+ {{ CourseHomeHeader(course) }}
+ {{ CourseHeaderOverlay(course) }}
+
+
+ {{ Description(course) }}
+ {{ widgets.CourseOutline(course=course, membership=membership) }}
+ {{ widgets.Reviews(course=course, membership=membership) }}
+
{{ RelatedCourses(course) }}
@@ -26,7 +28,6 @@
{{ BreadCrumb(course) }}
{{ CourseCardWide(course) }}
- {{ CourseHeaderOverlay(course) }}
@@ -125,6 +126,14 @@
You have opted to be notified for this course. You will receive an email when the course becomes available.
+
{{ course.title }}
+ {% if get_lessons(course.name) | length %}
+
+

+ {{ get_lessons(course.name) | length }} {{ _("Lessons") }}
+
+ {% endif %}
+
{% if get_students(course.name) | length %}
{% set initial_members = get_initial_members(course.name) %}
@@ -188,13 +197,6 @@
{% endif %}
-
{{ _("Course Include:") }}
- {% if get_lessons(course.name) | length %}
-
-

- {{ get_lessons(course.name) | length }} {{ _("Lessons") }}
-
- {% endif %}
diff --git a/school/www/courses/course.js b/school/www/courses/course.js
index e5f8c8ab..80068c4a 100644
--- a/school/www/courses/course.js
+++ b/school/www/courses/course.js
@@ -41,6 +41,12 @@ frappe.ready(() => {
create_certificate(e);
});
+ $(document).scroll(function() {
+ let timer;
+ clearTimeout(timer);
+ timer = setTimeout(() => { handle_overlay_display.apply(this, arguments); }, 500);
+ });
+
})
var check_mentor_request = () => {
@@ -226,3 +232,27 @@ const create_certificate = (e) => {
}
})
};
+
+
+const element_not_in_viewport = (el) => {
+ const rect = el.getBoundingClientRect();
+ return rect.bottom < 0 || rect.right < 0 || rect.left > window.innerWidth || rect.top > window.innerHeight;
+}
+
+const handle_overlay_display = () => {
+ const element = $(".related-courses").length && $(".related-courses")[0];
+ if (element && element_not_in_viewport(element)) {
+ $(".course-overlay-card").css({
+ "position": "fixed",
+ "top": "30%",
+ "bottom": "inherit"
+ });
+ }
+ else if (element && !element_not_in_viewport(element)) {
+ $(".course-overlay-card").css({
+ "position": "absolute",
+ "top": "inherit",
+ "bottom": "5%"
+ });
+ }
+}