style: course home
This commit is contained in:
@@ -6,6 +6,7 @@ from frappe.model.document import Document
|
||||
from frappe.utils import nowdate, add_years
|
||||
from frappe import _
|
||||
from frappe.utils.pdf import get_pdf
|
||||
from school.lms.utils import is_certified
|
||||
|
||||
class LMSCertification(Document):
|
||||
|
||||
@@ -22,8 +23,7 @@ class LMSCertification(Document):
|
||||
|
||||
@frappe.whitelist()
|
||||
def create_certificate(course):
|
||||
course_details = frappe.get_doc("LMS Course", course)
|
||||
certificate = course_details.is_certified()
|
||||
certificate = is_certified()
|
||||
|
||||
if certificate:
|
||||
return certificate
|
||||
|
||||
@@ -20,6 +20,14 @@ frappe.ui.form.on('LMS Course', {
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
frm.set_query("course", "related_courses", function () {
|
||||
return {
|
||||
filters: {
|
||||
"is_published": true,
|
||||
}
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"allow_guest_to_view": 1,
|
||||
"allow_import": 1,
|
||||
"allow_rename": 1,
|
||||
"creation": "2021-03-01 16:49:33.622422",
|
||||
"creation": "2022-02-08 16:34:42.721203",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
@@ -31,6 +31,7 @@
|
||||
"short_introduction",
|
||||
"description",
|
||||
"chapters",
|
||||
"related_courses",
|
||||
"certification_section",
|
||||
"enable_certification",
|
||||
"expiry"
|
||||
@@ -141,6 +142,12 @@
|
||||
"fieldtype": "Select",
|
||||
"label": "Certification Expires After Years",
|
||||
"options": "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10"
|
||||
},
|
||||
{
|
||||
"fieldname": "related_courses",
|
||||
"fieldtype": "Table",
|
||||
"label": "Related Courses",
|
||||
"options": "Related Courses"
|
||||
}
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
@@ -167,7 +174,7 @@
|
||||
"link_fieldname": "course"
|
||||
}
|
||||
],
|
||||
"modified": "2022-02-07 11:41:39.735325",
|
||||
"modified": "2022-02-16 11:50:20.661085",
|
||||
"modified_by": "Administrator",
|
||||
"module": "LMS",
|
||||
"name": "LMS Course",
|
||||
@@ -192,4 +199,4 @@
|
||||
"states": [],
|
||||
"title_field": "title",
|
||||
"track_changes": 1
|
||||
}
|
||||
}
|
||||
0
school/lms/doctype/related_courses/__init__.py
Normal file
0
school/lms/doctype/related_courses/__init__.py
Normal file
8
school/lms/doctype/related_courses/related_courses.js
Normal file
8
school/lms/doctype/related_courses/related_courses.js
Normal file
@@ -0,0 +1,8 @@
|
||||
// Copyright (c) 2022, Frappe and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Related Courses', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
||||
32
school/lms/doctype/related_courses/related_courses.json
Normal file
32
school/lms/doctype/related_courses/related_courses.json
Normal file
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"actions": [],
|
||||
"allow_rename": 1,
|
||||
"creation": "2022-02-16 11:45:07.200407",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"course"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "course",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
"label": "Course",
|
||||
"options": "LMS Course"
|
||||
}
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"istable": 1,
|
||||
"links": [],
|
||||
"modified": "2022-02-16 11:48:30.964916",
|
||||
"modified_by": "Administrator",
|
||||
"module": "LMS",
|
||||
"name": "Related Courses",
|
||||
"owner": "Administrator",
|
||||
"permissions": [],
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"states": []
|
||||
}
|
||||
8
school/lms/doctype/related_courses/related_courses.py
Normal file
8
school/lms/doctype/related_courses/related_courses.py
Normal file
@@ -0,0 +1,8 @@
|
||||
# Copyright (c) 2022, Frappe and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class RelatedCourses(Document):
|
||||
pass
|
||||
@@ -0,0 +1,8 @@
|
||||
# Copyright (c) 2022, Frappe and Contributors
|
||||
# See license.txt
|
||||
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
class TestRelatedCourses(unittest.TestCase):
|
||||
pass
|
||||
Reference in New Issue
Block a user