diff --git a/lms/lms/doctype/course_lesson/course_lesson.py b/lms/lms/doctype/course_lesson/course_lesson.py index cf3f8c9d..1379088c 100644 --- a/lms/lms/doctype/course_lesson/course_lesson.py +++ b/lms/lms/doctype/course_lesson/course_lesson.py @@ -53,7 +53,7 @@ class CourseLesson(Document): ex.course = None ex.index_ = 0 ex.index_label = "" - ex.save() + ex.save(ignore_permissions=True) def check_and_create_folder(self): args = { diff --git a/lms/lms/doctype/lms_course/lms_course.json b/lms/lms/doctype/lms_course/lms_course.json index 0b6a450c..839cf40a 100644 --- a/lms/lms/doctype/lms_course/lms_course.json +++ b/lms/lms/doctype/lms_course/lms_course.json @@ -57,7 +57,7 @@ }, { "fieldname": "description", - "fieldtype": "Markdown Editor", + "fieldtype": "Text Editor", "label": "Description", "reqd": 1 }, @@ -260,7 +260,7 @@ } ], "make_attachments_public": 1, - "modified": "2023-02-23 09:45:54.826327", + "modified": "2023-02-23 09:45:54.826328", "modified_by": "Administrator", "module": "LMS", "name": "LMS Course", diff --git a/lms/lms/widgets/CourseOutline.html b/lms/lms/widgets/CourseOutline.html index d42a6da7..5a765218 100644 --- a/lms/lms/widgets/CourseOutline.html +++ b/lms/lms/widgets/CourseOutline.html @@ -5,7 +5,7 @@ {% if course.edit_mode and course.name %} - + {% endif %} {% if course.name and (course.edit_mode or chapters | length) %} diff --git a/lms/patches.txt b/lms/patches.txt index e9e9e212..3666aef5 100644 --- a/lms/patches.txt +++ b/lms/patches.txt @@ -50,4 +50,5 @@ lms.patches.v0_0.video_embed_link lms.patches.v0_0.rename_exercise_doctype lms.patches.v0_0.add_question_type lms.patches.v0_0.add_evaluator_to_assignment -lms.patches.v0_0.convert_lesson_markdown_to_html #05-04-2023 \ No newline at end of file +lms.patches.v0_0.convert_lesson_markdown_to_html #05-04-2023 +lms.patches.v0_0.convert_course_description_to_html \ No newline at end of file diff --git a/lms/patches/v0_0/convert_course_description_to_html.py b/lms/patches/v0_0/convert_course_description_to_html.py new file mode 100644 index 00000000..30311f55 --- /dev/null +++ b/lms/patches/v0_0/convert_course_description_to_html.py @@ -0,0 +1,12 @@ +import frappe +from lms.lms.md import markdown_to_html + + +def execute(): + courses = frappe.get_all("LMS Course", fields=["name", "description"]) + + for course in courses: + html = markdown_to_html(course.description) + frappe.db.set_value("LMS Course", course.name, "description", html) + + frappe.reload_doc("lms", "doctype", "lms_course") diff --git a/lms/public/css/style.css b/lms/public/css/style.css index 872e9430..61271c10 100644 --- a/lms/public/css/style.css +++ b/lms/public/css/style.css @@ -1561,7 +1561,7 @@ li { outline: none; background-color: var(--bg-light-gray); border-radius: var(--border-radius); - border: 1px dashed var(--gray-600); + border: 1px solid var(--gray-300); padding: 0.5rem 0.75rem; color: var(--gray-900); } @@ -1575,7 +1575,7 @@ li { margin-top: 0.25rem; background-color: var(--bg-light-gray); border-radius: var(--border-radius); - border: 1px dashed var(--gray-600); + border: 1px solid var(--gray-300); padding: 0.5rem 0.75rem; width: fit-content; } diff --git a/lms/www/batch/learn.html b/lms/www/batch/learn.html index 373ae966..f106a366 100644 --- a/lms/www/batch/learn.html +++ b/lms/www/batch/learn.html @@ -176,7 +176,10 @@ id="quiz-id">{% if lesson.quiz_id %}{{ lesson.quiz_id }}{% endif %} -
+ {% if lesson.body %} + + {% endif %} +