diff --git a/lms/hooks.py b/lms/hooks.py index e45b76d4..188a9e45 100644 --- a/lms/hooks.py +++ b/lms/hooks.py @@ -193,7 +193,8 @@ jinja = { "lms.lms.utils.format_amount", "lms.lms.utils.first_lesson_exists", "lms.lms.utils.get_courses_under_review", - "lms.lms.utils.has_course_instructor_role" + "lms.lms.utils.has_course_instructor_role", + "lms.lms.utils.has_course_moderator_role" ], "filters": [] } diff --git a/lms/lms/utils.py b/lms/lms/utils.py index 1eaf9ca3..047b43f7 100644 --- a/lms/lms/utils.py +++ b/lms/lms/utils.py @@ -450,5 +450,8 @@ def has_course_moderator_role(): def get_courses_under_review(): - return "jan" + return frappe.get_all("LMS Course", { + "status": "Under Review" + }, ["name", "upcoming", "title", "image", "enable_certification", "status", "published"] + ) diff --git a/lms/lms/widgets/CourseCard.html b/lms/lms/widgets/CourseCard.html index a7555a65..c84ab45d 100644 --- a/lms/lms/widgets/CourseCard.html +++ b/lms/lms/widgets/CourseCard.html @@ -3,7 +3,7 @@
+ style="background-image: url( {{ course.image | urlencode }} );" {% endif %}>
{% for tag in get_tags(course.name) %}
{{ tag }}
diff --git a/lms/lms/widgets/CourseOutline.html b/lms/lms/widgets/CourseOutline.html index b146c3fd..d2f47904 100644 --- a/lms/lms/widgets/CourseOutline.html +++ b/lms/lms/widgets/CourseOutline.html @@ -185,3 +185,6 @@ const show_no_preview_dialog = (e) => { }; +dahanukar +sandesh +chetna diff --git a/lms/www/batch/learn.js b/lms/www/batch/learn.js index 197ca8a7..50178845 100644 --- a/lms/www/batch/learn.js +++ b/lms/www/batch/learn.js @@ -542,10 +542,6 @@ const build_attachment_table = (file_doc) => { const make_editor = () => { - let comment = `` this.code_field_group = new frappe.ui.FieldGroup({ fields: [ @@ -556,7 +552,7 @@ const make_editor = () => { wrap: true, max_lines: Infinity, min_lines: 20, - default: $("#body").data("body") || comment, + default: $("#body").data("body"), depends_on: 'eval:doc.type=="Markdown"', } ], diff --git a/lms/www/batch/learn.py b/lms/www/batch/learn.py index 659654dc..9519c776 100644 --- a/lms/www/batch/learn.py +++ b/lms/www/batch/learn.py @@ -27,7 +27,7 @@ def get_context(context): context.lesson = frappe._dict() if frappe.form_dict.get("edit"): - if not is_instructor(context.course.name) or has_course_moderator_role(): + if not is_instructor(context.course.name) and not has_course_moderator_role(): redirect_to_courses_list() context.lesson.edit_mode = True else: diff --git a/lms/www/courses/course.html b/lms/www/courses/course.html index c8f04de8..75d26a28 100644 --- a/lms/www/courses/course.html +++ b/lms/www/courses/course.html @@ -270,7 +270,7 @@ membership.current_lesson else "1.1" if first_lesson_exists(course.name) else None %} {% if show_start_learing_cta %} -
+
{{ _("Start Learning") }}
@@ -323,7 +323,7 @@ {% endif %} {% endif %} - {% if is_instructor(course.name) %} + {% if is_instructor(course.name) or has_course_moderator_role() %} {{ _("Edit Course") }} {% endif %} {% endmacro %} @@ -341,9 +341,9 @@ frappe.utils.format_time(certificate_request.start_time, "short")) }}

{% endif %} - {% if course.status == "Under Review" %} + {% if course.status == "Under Review" and is_instructor(course.name) %}
- {{ _("Your course is currently under review. Once the review is complete, the System Admins will publish it on the website.") }} + {{ _("This course is currently under review. Once the review is complete, the System Admins will publish it on the website.") }}
{% endif %} diff --git a/lms/www/courses/course.js b/lms/www/courses/course.js index 9e9f086b..083391f7 100644 --- a/lms/www/courses/course.js +++ b/lms/www/courses/course.js @@ -206,7 +206,7 @@ const submit_for_review = (e) => { }, 3); setTimeout(() => { window.location.reload(); - }, 3000); + }, 1000); } } }); diff --git a/lms/www/courses/course.py b/lms/www/courses/course.py index 4bf95a8e..f56f1ad2 100644 --- a/lms/www/courses/course.py +++ b/lms/www/courses/course.py @@ -28,7 +28,7 @@ def set_course_context(context, course_name): as_dict=True) if frappe.form_dict.get("edit"): - if not is_instructor(course.name) or not has_course_moderator_role(): + if not is_instructor(course.name) and not has_course_moderator_role(): redirect_to_courses_list() course.edit_mode = True