Merge branch 'main' of https://github.com/frappe/community into upcoming-courses

This commit is contained in:
pateljannat
2021-07-26 11:14:38 +05:30
2 changed files with 45 additions and 43 deletions

View File

@@ -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

View File

@@ -661,7 +661,6 @@ div.custom-checkbox>label>input:checked+img {
.course-home-outline {
margin-top: 3rem;
flex: 1;
}
.small-title {
@@ -679,6 +678,7 @@ div.custom-checkbox>label>input:checked+img {
.chapter-description {
height: fit-content;
padding-left: 1rem;
padding-right: 1rem;
}
.chapter-icon {
@@ -686,26 +686,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;
}
}
@@ -737,18 +750,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%;
@@ -906,14 +907,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) {
@@ -946,10 +951,6 @@ div.custom-checkbox>label>input:checked+img {
}
}
.overtime-item {
margin: 16px 0px 16px;
}
.view-all-mentors {
width: 100%;
display: flex;
@@ -1018,8 +1019,7 @@ div.custom-checkbox>label>input:checked+img {
}
.course-details-outline {
margin-top: 16px;
flex: 1;
margin-top: 1rem;
}
.lesson-content-card {
@@ -1028,14 +1028,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;
}
}
@@ -1050,8 +1051,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) {
@@ -1221,12 +1221,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;
}