From 752fe5b4ba5a46dc8c99555ce20be8c2ee4dbe6c Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Mon, 8 May 2023 19:07:28 +0530 Subject: [PATCH] feat: reorder chapters, lessons --- lms/lms/utils.py | 4 +- lms/lms/widgets/CourseOutline.html | 2 +- lms/public/css/style.css | 18 +++- lms/public/icons/quiz.svg | 3 + lms/public/icons/symbol-defs.svg | 10 ++ lms/public/icons/upload.svg | 7 ++ lms/public/icons/video.svg | 10 ++ lms/public/js/common_functions.js | 8 -- lms/www/batch/edit.html | 56 +++++++--- lms/www/batch/edit.js | 12 ++- lms/www/batch/quiz.html | 160 +++++++++++++++++------------ lms/www/batch/quiz.js | 70 +++++++------ lms/www/batch/quiz_list.html | 95 ++++++++--------- lms/www/courses/create.html | 28 +++-- lms/www/courses/create.js | 2 +- lms/www/courses/outline.html | 79 ++++++++------ lms/www/courses/outline.js | 78 ++++++++++++++ 17 files changed, 425 insertions(+), 217 deletions(-) create mode 100644 lms/public/icons/quiz.svg create mode 100644 lms/public/icons/upload.svg create mode 100644 lms/public/icons/video.svg diff --git a/lms/lms/utils.py b/lms/lms/utils.py index b7574fa3..e8c2554d 100644 --- a/lms/lms/utils.py +++ b/lms/lms/utils.py @@ -141,8 +141,8 @@ def get_lesson_details(chapter): macros = find_macros(lesson_details.body) for macro in macros: - if macro[0] == "YouTubeVideo": - lesson_details.icon = "icon-video" + if macro[0] == "YouTubeVideo" or macro[0] == "Video": + lesson_details.icon = "icon-youtube" elif macro[0] == "Quiz": lesson_details.icon = "icon-quiz" lessons.append(lesson_details) diff --git a/lms/lms/widgets/CourseOutline.html b/lms/lms/widgets/CourseOutline.html index f7da14a6..ac7ebf0a 100644 --- a/lms/lms/widgets/CourseOutline.html +++ b/lms/lms/widgets/CourseOutline.html @@ -62,7 +62,7 @@ title="{{ _('This lesson is not available for preview. As you are the Instructor of the course only you can see it.') }}" {% endif %}> - + diff --git a/lms/public/css/style.css b/lms/public/css/style.css index a7d31474..dd4a6429 100644 --- a/lms/public/css/style.css +++ b/lms/public/css/style.css @@ -181,9 +181,24 @@ textarea.field-input { text-decoration: none; } -.form-checkbox { +.codex-editor path { + stroke: var(--gray-800); +} + +.drag-handle { + cursor: grabbing; +} + +.edit-header { display: flex; align-items: center; + justify-content: space-between; +} + +.btn-default:not(:disabled):not(.disabled).active { + color: white; + background-color: var(--primary); + border: none; } body { @@ -610,6 +625,7 @@ input[type=checkbox] { .lesson-links { display: flex; + align-items: center; padding: 0.5rem; color: var(--gray-900); font-size: var(--text-base); diff --git a/lms/public/icons/quiz.svg b/lms/public/icons/quiz.svg new file mode 100644 index 00000000..1682823b --- /dev/null +++ b/lms/public/icons/quiz.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/lms/public/icons/symbol-defs.svg b/lms/public/icons/symbol-defs.svg index 68602344..cf71d382 100644 --- a/lms/public/icons/symbol-defs.svg +++ b/lms/public/icons/symbol-defs.svg @@ -5,6 +5,16 @@ + + + + + + + + + + diff --git a/lms/public/icons/upload.svg b/lms/public/icons/upload.svg new file mode 100644 index 00000000..2ee38de6 --- /dev/null +++ b/lms/public/icons/upload.svg @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/lms/public/icons/video.svg b/lms/public/icons/video.svg new file mode 100644 index 00000000..22e5d0c3 --- /dev/null +++ b/lms/public/icons/video.svg @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/lms/public/js/common_functions.js b/lms/public/js/common_functions.js index c0a51a6c..af50679d 100644 --- a/lms/public/js/common_functions.js +++ b/lms/public/js/common_functions.js @@ -45,14 +45,6 @@ frappe.ready(() => { show_no_preview_dialog(e); }); - $(".lesson-dropzone").each((i, el) => { - setSortable(el); - }); - - $(".chapter-dropzone").each((i, el) => { - setSortable(el); - }); - $("#create-class").click((e) => { open_class_dialog(e); }); diff --git a/lms/www/batch/edit.html b/lms/www/batch/edit.html index eaf13fb9..c1b0bcf4 100644 --- a/lms/www/batch/edit.html +++ b/lms/www/batch/edit.html @@ -22,23 +22,49 @@
- +
- {% if lesson.name %} - - - {{ _("Preview") }} - - - {% endif %} +
+
+ {{ course.title if course.name else _("Course Outline") }} +
+ +
-
- {{ course.title if course.name else _("Course Outline") }} +
+ {% if lesson.name %} + + + {{ _("Preview") }} + + + {% endif %} + + +
+ + + + + +
{% endmacro %} @@ -60,7 +86,7 @@
-