feat: Added chapter doctype

Also linked it from the LMS Course doctype.

Issue #56
This commit is contained in:
Anand Chitipothu
2021-05-03 06:06:35 +05:30
parent 59dba7730f
commit a52a01ef7f
6 changed files with 96 additions and 3 deletions

View File

@@ -0,0 +1,8 @@
// Copyright (c) 2021, FOSS United and contributors
// For license information, please see license.txt
frappe.ui.form.on('Chapter', {
// refresh: function(frm) {
// }
});

View File

@@ -0,0 +1,65 @@
{
"actions": [],
"creation": "2021-05-03 05:49:08.383057",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"course",
"title",
"description",
"locked"
],
"fields": [
{
"fieldname": "title",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Title"
},
{
"fieldname": "description",
"fieldtype": "Markdown Editor",
"label": "Description"
},
{
"default": "0",
"fieldname": "locked",
"fieldtype": "Check",
"label": "Locked"
},
{
"fieldname": "course",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Course",
"options": "LMS Course"
}
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2021-05-03 05:57:39.715802",
"modified_by": "Administrator",
"module": "LMS",
"name": "Chapter",
"owner": "Administrator",
"permissions": [
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"share": 1,
"write": 1
}
],
"search_fields": "title",
"sort_field": "modified",
"sort_order": "DESC",
"title_field": "title",
"track_changes": 1
}

View File

@@ -0,0 +1,10 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2021, FOSS United and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
# import frappe
from frappe.model.document import Document
class Chapter(Document):
pass

View File

@@ -0,0 +1,10 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2021, FOSS United and Contributors
# See license.txt
from __future__ import unicode_literals
# import frappe
import unittest
class TestChapter(unittest.TestCase):
pass

View File

@@ -74,8 +74,8 @@
"is_published_field": "is_published",
"links": [
{
"group": "Topics",
"link_doctype": "LMS Topic",
"group": "Chapters",
"link_doctype": "Chapter",
"link_fieldname": "course"
},
{
@@ -89,7 +89,7 @@
"link_fieldname": "course"
}
],
"modified": "2021-04-21 14:45:41.658056",
"modified": "2021-05-03 05:52:30.396824",
"modified_by": "Administrator",
"module": "LMS",
"name": "LMS Course",