From 1f3806a7bdfc58c855dc9a8ea4c1a6bb0a994cd7 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Mon, 6 Jun 2022 11:15:06 +0530 Subject: [PATCH 1/2] fix: replaced some dialogs with alerts --- lms/hooks.py | 1 - lms/lms/md.py | 2 +- lms/lms/web_form/chapter/chapter.js | 5 ++- lms/lms/web_form/lesson/lesson.js | 7 +++-- lms/lms/web_form/profile/profile.json | 6 ++-- lms/lms/widgets/CourseOutline.html | 11 +++---- lms/public/css/style.css | 28 ++++++++--------- lms/public/js/common_functions.js | 17 ++++++----- lms/templates/quiz.html | 6 ++-- lms/www/batch/learn.html | 11 ++++--- lms/www/courses/course.js | 44 ++++++++++++++++----------- lms/www/jobs/job.js | 25 ++++++++------- 12 files changed, 89 insertions(+), 74 deletions(-) diff --git a/lms/hooks.py b/lms/hooks.py index 99d428cf..67affeb8 100644 --- a/lms/hooks.py +++ b/lms/hooks.py @@ -214,7 +214,6 @@ profile_mandatory_fields = [ "bio", "linkedin", "education", - "work_experience", "skill", "preferred_functions", "preferred_industries", diff --git a/lms/lms/md.py b/lms/lms/md.py index b02ed68f..8105c72f 100644 --- a/lms/lms/md.py +++ b/lms/lms/md.py @@ -105,7 +105,7 @@ def sanitize_html(html, macro): any broken tags. This makes sures that all those things are fixed before passing to the etree parser. """ - soup = BeautifulSoup(html, features="lxml") + soup = BeautifulSoup(html, features="html5lib") nodes = soup.body.children classname = "" if macro == "YouTubeVideo": diff --git a/lms/lms/web_form/chapter/chapter.js b/lms/lms/web_form/chapter/chapter.js index 6d710013..da98bb5e 100644 --- a/lms/lms/web_form/chapter/chapter.js +++ b/lms/lms/web_form/chapter/chapter.js @@ -1,6 +1,9 @@ frappe.ready(function() { frappe.web_form.after_save = () => { - frappe.msgprint(__("Chapter has been saved successfully. Go back to the course and add this chapter to the chapters table.")) + frappe.show_alert({ + message:__("Chapter has been saved successfully. Go back to the course and add this chapter to the chapters table."), + indicator:'green' + }, 3); setTimeout(() => { window.location.href = `/courses/${frappe.web_form.doc.course}`; }, 3000); diff --git a/lms/lms/web_form/lesson/lesson.js b/lms/lms/web_form/lesson/lesson.js index ad73a38c..82214a05 100644 --- a/lms/lms/web_form/lesson/lesson.js +++ b/lms/lms/web_form/lesson/lesson.js @@ -49,10 +49,13 @@ const show_upload_modal = () => { }; const show_success_message = () => { - frappe.msgprint(__(`Lesson has been saved successfully. Go back to the chapter and add this lesson to the lessons table.`)); + frappe.show_alert({ + message: __(`Lesson has been saved successfully. Go back to the chapter and add this lesson to the lessons table.`), + indicator:'green' + }, 3); setTimeout(() => { window.location.href = `/courses/${this.course}`; - }, 2000); + }, 3000); }; const add_file_upload_component = () => { diff --git a/lms/lms/web_form/profile/profile.json b/lms/lms/web_form/profile/profile.json index 70dcf10d..a0a78e8d 100644 --- a/lms/lms/web_form/profile/profile.json +++ b/lms/lms/web_form/profile/profile.json @@ -22,7 +22,7 @@ "is_standard": 1, "login_required": 1, "max_attachment_size": 0, - "modified": "2022-02-23 09:32:37.352930", + "modified": "2022-06-06 10:38:37.784113", "modified_by": "Administrator", "module": "LMS", "name": "profile", @@ -83,7 +83,7 @@ "max_length": 0, "max_value": 0, "read_only": 0, - "reqd": 0, + "reqd": 1, "show_in_filter": 0 }, { @@ -244,7 +244,7 @@ "max_value": 0, "options": "Work Experience", "read_only": 0, - "reqd": 1, + "reqd": 0, "show_in_filter": 0 }, { diff --git a/lms/lms/widgets/CourseOutline.html b/lms/lms/widgets/CourseOutline.html index 567b8010..0dd138d5 100644 --- a/lms/lms/widgets/CourseOutline.html +++ b/lms/lms/widgets/CourseOutline.html @@ -29,13 +29,12 @@ {% if membership or lesson.include_in_preview %} - + - {{ lesson.title }} - + {{ lesson.title }} {% if membership %} - + {% endif %} @@ -48,7 +47,7 @@ href="{{ get_lesson_url(course.name, lesson.number) }}{{course.query_parameter}}" data-course="{{ course.name }}"> - +
{{ lesson.title }}
@@ -57,7 +56,7 @@ {% else %}