diff --git a/lms/lms/widgets/CourseOutline.html b/lms/lms/widgets/CourseOutline.html
index 08de6b4e..c3149d9e 100644
--- a/lms/lms/widgets/CourseOutline.html
+++ b/lms/lms/widgets/CourseOutline.html
@@ -148,12 +148,13 @@ const rotate_chapter_icon = (e) => {
};
const show_no_preview_dialog = (e) => {
- frappe.warn(__("Not available for preview"),
- __("This lesson is not available for preview. Please join the course to access it."),
- () => {
- window.location.href = `/courses/${ $(e.currentTarget).data("course") }`
- },
- __("Start Learning"), false);
+ const d = frappe.warn(__("Not available for preview"),
+ __("This lesson is not available for preview. Please join the course to access it."),
+ () => {
+ const route = `/courses/${ $(e.currentTarget).data("course") }`;
+ window.location.pathname == route ? d.hide() : window.location.href = route;
+ },
+ __("Start Learning"), false);
};
diff --git a/lms/public/css/style.css b/lms/public/css/style.css
index 0557b4a2..e6d5ba9a 100644
--- a/lms/public/css/style.css
+++ b/lms/public/css/style.css
@@ -401,7 +401,7 @@ input[type=checkbox] {
}
.reviews-parent {
- margin: 5rem 0;
+ padding-bottom: 5rem;
color: var(--gray-900);
}
diff --git a/lms/www/courses/course.html b/lms/www/courses/course.html
index b83ad23e..aff55911 100644
--- a/lms/www/courses/course.html
+++ b/lms/www/courses/course.html
@@ -143,19 +143,19 @@
{% endif %}
+ {% if is_instructor(course.name) %}
+ {% endif %}
diff --git a/lms/www/courses/course.js b/lms/www/courses/course.js
index 305b4b95..bf8921b8 100644
--- a/lms/www/courses/course.js
+++ b/lms/www/courses/course.js
@@ -1,14 +1,7 @@
frappe.ready(() => {
- if (frappe.session.user != "Guest") {
- check_mentor_request();
- }
hide_wrapped_mentor_cards();
- $("#apply-now").click((e) => {
- create_mentor_request(e);
- });
-
$("#cancel-request").click((e) => {
cancel_mentor_request(e);
});
@@ -53,21 +46,6 @@ frappe.ready(() => {
})
-var check_mentor_request = () => {
- frappe.call({
- 'method': 'lms.lms.doctype.lms_mentor_request.lms_mentor_request.has_requested',
- 'args': {
- course: decodeURIComponent($("#course-title").attr("data-course")),
- },
- 'callback': (data) => {
- if (data.message > 0) {
- $("#mentor-request").addClass("hide");
- $("#already-applied").removeClass("hide")
- }
- }
- })
-}
-
var hide_wrapped_mentor_cards = () => {
var offset_top_prev;
@@ -87,26 +65,6 @@ var hide_wrapped_mentor_cards = () => {
}
}
-var create_mentor_request = (e) => {
- e.preventDefault();
- if (frappe.session.user == "Guest") {
- window.location.href = `/login?redirect-to=/courses/${$(e.currentTarget).attr("data-course")}`;
- return;
- }
- frappe.call({
- "method": "lms.lms.doctype.lms_mentor_request.lms_mentor_request.create_request",
- "args": {
- "course": decodeURIComponent($(e.currentTarget).attr("data-course"))
- },
- "callback": (data) => {
- if (data.message == "OK") {
- $("#mentor-request").addClass("hide");
- $("#already-applied").removeClass("hide")
- }
- }
- })
-}
-
var cancel_mentor_request = (e) => {
e.preventDefault()
frappe.call({