From 276d64a66a73157e23cfeb8b89305cc18c18cfaf Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 20 Jul 2021 09:30:58 +0530 Subject: [PATCH 01/10] fix(style): don't mess with global container styles --- community/public/css/style.css | 7 ------- 1 file changed, 7 deletions(-) diff --git a/community/public/css/style.css b/community/public/css/style.css index ebd7da23..1aeb84bb 100644 --- a/community/public/css/style.css +++ b/community/public/css/style.css @@ -390,13 +390,6 @@ input[type=checkbox] { letter-spacing: -0.0175em } -@media (min-width: 576px) { - .container { - padding-left: 1rem; - padding-right: 1rem; - } -} - .button-links:hover { text-decoration: none; } From d125b02cec6c80a8fb77a72fa771d7e2c2dd767b Mon Sep 17 00:00:00 2001 From: Jannat Patel <31363128+pateljannat@users.noreply.github.com> Date: Tue, 20 Jul 2021 13:05:15 +0530 Subject: [PATCH 02/10] fix: added max width to container padding --- community/public/css/style.css | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/community/public/css/style.css b/community/public/css/style.css index 1aeb84bb..32220a32 100644 --- a/community/public/css/style.css +++ b/community/public/css/style.css @@ -390,6 +390,13 @@ input[type=checkbox] { letter-spacing: -0.0175em } +@media (min-width: 576px) and (max-width: 992px) { + .container { + padding-left: 1rem; + padding-right: 1rem; + } +} + .button-links:hover { text-decoration: none; } From 86596d0cfe2974636586248544477b9e82933afa Mon Sep 17 00:00:00 2001 From: pateljannat Date: Tue, 20 Jul 2021 17:19:18 +0530 Subject: [PATCH 03/10] fix: minor issues --- community/overrides/user.py | 14 +++++-- community/public/css/style.css | 74 ++++++++++++++++------------------ 2 files changed, 45 insertions(+), 43 deletions(-) diff --git a/community/overrides/user.py b/community/overrides/user.py index 91cd5abd..bcb1496a 100644 --- a/community/overrides/user.py +++ b/community/overrides/user.py @@ -10,7 +10,8 @@ class CustomUser(User): """ return frappe.get_all( 'LMS Course', { - 'owner': self.name + 'owner': self.name, + 'is_published': True }) def get_palette(self): @@ -62,9 +63,16 @@ class CustomUser(User): def get_mentored_courses(self): """ Returns all courses mentored by this user """ - return frappe.get_all("LMS Course Mentor Mapping", + mentored_courses = [] + mapping = frappe.get_all("LMS Course Mentor Mapping", { - "mentor": self.name + "mentor": self.name, }, ["name", "course"] ) + + for map in mapping: + if frappe.db.get_value("LMS Course", map.course, "is_published"): + mentored_courses.append(map) + + return mentored_courses diff --git a/community/public/css/style.css b/community/public/css/style.css index 32220a32..a6ad848e 100644 --- a/community/public/css/style.css +++ b/community/public/css/style.css @@ -655,7 +655,6 @@ div.custom-checkbox>label>input:checked+img { .course-home-outline { margin-top: 3rem; - flex: 1; } .small-title { @@ -673,6 +672,7 @@ div.custom-checkbox>label>input:checked+img { .chapter-description { height: fit-content; padding-left: 1rem; + padding-right: 1rem; } .chapter-icon { @@ -680,26 +680,39 @@ div.custom-checkbox>label>input:checked+img { } .course-outline-instructor-parent { - display: flex; - justify-content: space-between; + display: grid; + grid-gap: 2rem; + grid-template-columns: 4fr 1fr; +} + +@media (max-width: 768px) { + .course-outline-instructor-parent { + grid-gap: 1rem; + } } @media (max-width: 600px) { .course-outline-instructor-parent { - flex-direction: column; padding: 0px 24px 0px; + grid-template-columns: none; } } - .profile-parent-section { - display: flex; - justify-content: space-between; + display: grid; + grid-gap: 2rem; + grid-template-columns: 4fr 1fr; +} + +@media (max-width: 768px) { + .profile-parent-section { + grid-gap: 1rem; + } } @media (max-width: 600px) { .profile-parent-section { - flex-direction: column; + grid-template-columns: none; } } @@ -731,18 +744,6 @@ div.custom-checkbox>label>input:checked+img { margin-top: 3rem; } -@media (min-width: 1024px) { - .course-overview-section { - margin-left: 2rem; - } -} - -@media (min-width: 600px) { - .course-overview-section { - margin-left: 1rem; - } -} - .lesson-info { font-size: 16px; line-height: 250%; @@ -900,14 +901,18 @@ div.custom-checkbox>label>input:checked+img { } .description-card { - padding: 24px; + padding: 1.5rem; flex-direction: column; } .overview-card { - padding: 24px 26px 24px; + padding: 1.5rem; width: 256px; flex-direction: column; + display: grid; + -moz-column-gap: 1rem; + column-gap: 1rem; + row-gap: 1rem; } @media (max-width: 768px) { @@ -940,10 +945,6 @@ div.custom-checkbox>label>input:checked+img { } } -.overtime-item { - margin: 16px 0px 16px; -} - .view-all-mentors { width: 100%; display: flex; @@ -1012,8 +1013,7 @@ div.custom-checkbox>label>input:checked+img { } .course-details-outline { - margin-top: 16px; - flex: 1; + margin-top: 1rem; } .lesson-content-card { @@ -1022,14 +1022,15 @@ div.custom-checkbox>label>input:checked+img { } .course-content-parent { - display: flex; - justify-content: space-between; + display: grid; + grid-gap: 2rem; + grid-template-columns: 2fr minmax(600px, 5fr); } -@media (max-width: 768px) { +@media (max-width: 1024px) { .course-content-parent { + display: flex; flex-direction: column-reverse; - justify-content: center; } } @@ -1044,8 +1045,7 @@ div.custom-checkbox>label>input:checked+img { } .lesson-pagination-parent { - margin: 1rem 0px 0px 2rem; - flex: 3; + margin-top: 1rem; } @media (max-width: 768px) { @@ -1216,12 +1216,6 @@ div.custom-checkbox>label>input:checked+img { flex-direction: column; } -@media (min-width: 600px) { - .course-creator-progress-parent { - margin-left: 2rem; - } -} - .course-creator-section { margin-top: 3rem; } From dd2f830a334f2d37caf44a27902c8419145f5fdc Mon Sep 17 00:00:00 2001 From: pateljannat Date: Fri, 23 Jul 2021 19:07:26 +0530 Subject: [PATCH 04/10] fix: upcoming course and doctype cleanup --- community/lms/doctype/chapter/chapter.json | 9 +------ .../lms/doctype/lms_course/lms_course.json | 26 +++++++++---------- community/lms/doctype/lms_quiz/lms_quiz.json | 5 ++-- community/lms/widgets/CourseCard.html | 8 ++++-- community/public/css/style.css | 6 +++++ 5 files changed, 29 insertions(+), 25 deletions(-) diff --git a/community/lms/doctype/chapter/chapter.json b/community/lms/doctype/chapter/chapter.json index 93a1c09f..8b60641a 100644 --- a/community/lms/doctype/chapter/chapter.json +++ b/community/lms/doctype/chapter/chapter.json @@ -9,7 +9,6 @@ "course", "title", "description", - "locked", "index_" ], "fields": [ @@ -24,12 +23,6 @@ "fieldtype": "Markdown Editor", "label": "Description" }, - { - "default": "0", - "fieldname": "locked", - "fieldtype": "Check", - "label": "Locked" - }, { "fieldname": "course", "fieldtype": "Link", @@ -52,7 +45,7 @@ "link_fieldname": "chapter" } ], - "modified": "2021-05-13 21:05:20.531890", + "modified": "2021-07-23 19:03:57.946831", "modified_by": "Administrator", "module": "LMS", "name": "Chapter", diff --git a/community/lms/doctype/lms_course/lms_course.json b/community/lms/doctype/lms_course/lms_course.json index a654c9e0..d6358fbf 100644 --- a/community/lms/doctype/lms_course/lms_course.json +++ b/community/lms/doctype/lms_course/lms_course.json @@ -21,14 +21,14 @@ "engine": "InnoDB", "field_order": [ "title", - "short_code", "video_link", - "column_break_3", - "is_published", - "disable_self_learning", "image", - "section_break_5", + "column_break_3", "tags", + "is_published", + "upcoming", + "disable_self_learning", + "section_break_5", "short_introduction", "description" ], @@ -53,11 +53,6 @@ "fieldtype": "Check", "label": "Published" }, - { - "fieldname": "short_code", - "fieldtype": "Data", - "label": "Short Code" - }, { "fieldname": "column_break_3", "fieldtype": "Column Break" @@ -92,6 +87,12 @@ "fieldname": "tags", "fieldtype": "Data", "label": "Tags" + }, + { + "default": "0", + "fieldname": "upcoming", + "fieldtype": "Check", + "label": "Is an Upcoming Course" } ], "index_web_pages_for_search": 1, @@ -118,7 +119,7 @@ "link_fieldname": "course" } ], - "modified": "2021-07-09 15:05:05.372430", + "modified": "2021-07-23 19:01:29.765570", "modified_by": "Administrator", "module": "LMS", "name": "LMS Course", @@ -141,6 +142,5 @@ "sort_field": "creation", "sort_order": "DESC", "title_field": "title", - "track_changes": 1, - "track_views": 1 + "track_changes": 1 } \ No newline at end of file diff --git a/community/lms/doctype/lms_quiz/lms_quiz.json b/community/lms/doctype/lms_quiz/lms_quiz.json index 85cd2c42..e76c35a5 100644 --- a/community/lms/doctype/lms_quiz/lms_quiz.json +++ b/community/lms/doctype/lms_quiz/lms_quiz.json @@ -27,12 +27,13 @@ "fieldname": "lesson", "fieldtype": "Link", "label": "Lesson", - "options": "Lesson" + "options": "Lesson", + "read_only": 1 } ], "index_web_pages_for_search": 1, "links": [], - "modified": "2021-06-23 17:58:57.642873", + "modified": "2021-07-23 19:06:12.551633", "modified_by": "Administrator", "module": "LMS", "name": "LMS Quiz", diff --git a/community/lms/widgets/CourseCard.html b/community/lms/widgets/CourseCard.html index ba0250ee..04a8e47a 100644 --- a/community/lms/widgets/CourseCard.html +++ b/community/lms/widgets/CourseCard.html @@ -53,15 +53,19 @@ {% set query_parameter = "?batch=" + membership.batch if membership and membership.batch else "" %} - {% if membership %} + {% if course.upcoming %} + + + {% elif membership %} {% else %} - diff --git a/community/public/css/style.css b/community/public/css/style.css index 32220a32..397628c5 100644 --- a/community/public/css/style.css +++ b/community/public/css/style.css @@ -653,6 +653,12 @@ div.custom-checkbox>label>input:checked+img { color: #FFFFFF; } +.is-default { + background-color: white; + border: 1px solid #C8CFD5; + box-sizing: border-box; +} + .course-home-outline { margin-top: 3rem; flex: 1; From 11d070fa0ddbe92ee8c7375fe67575ed5fcb5bb0 Mon Sep 17 00:00:00 2001 From: pateljannat Date: Fri, 23 Jul 2021 19:16:36 +0530 Subject: [PATCH 05/10] fix: condition for chapter description --- community/lms/widgets/ChapterTeaser.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/community/lms/widgets/ChapterTeaser.html b/community/lms/widgets/ChapterTeaser.html index 9f8afba0..59db20d7 100644 --- a/community/lms/widgets/ChapterTeaser.html +++ b/community/lms/widgets/ChapterTeaser.html @@ -8,9 +8,11 @@