From 5728714d71fd0b3cfc301e197b74c8a29398a0c6 Mon Sep 17 00:00:00 2001 From: Anand Chitipothu Date: Mon, 3 May 2021 06:50:23 +0530 Subject: [PATCH] feat: added lesson doctype --- community/lms/doctype/chapter/chapter.json | 10 +++- community/lms/doctype/lesson/__init__.py | 0 community/lms/doctype/lesson/lesson.js | 8 +++ community/lms/doctype/lesson/lesson.json | 59 +++++++++++++++++++++ community/lms/doctype/lesson/lesson.py | 10 ++++ community/lms/doctype/lesson/test_lesson.py | 10 ++++ 6 files changed, 95 insertions(+), 2 deletions(-) create mode 100644 community/lms/doctype/lesson/__init__.py create mode 100644 community/lms/doctype/lesson/lesson.js create mode 100644 community/lms/doctype/lesson/lesson.json create mode 100644 community/lms/doctype/lesson/lesson.py create mode 100644 community/lms/doctype/lesson/test_lesson.py diff --git a/community/lms/doctype/chapter/chapter.json b/community/lms/doctype/chapter/chapter.json index 2744ca48..3504d67c 100644 --- a/community/lms/doctype/chapter/chapter.json +++ b/community/lms/doctype/chapter/chapter.json @@ -37,8 +37,14 @@ } ], "index_web_pages_for_search": 1, - "links": [], - "modified": "2021-05-03 05:57:39.715802", + "links": [ + { + "group": "Lessons", + "link_doctype": "Lesson", + "link_fieldname": "chapter" + } + ], + "modified": "2021-05-03 06:48:06.030438", "modified_by": "Administrator", "module": "LMS", "name": "Chapter", diff --git a/community/lms/doctype/lesson/__init__.py b/community/lms/doctype/lesson/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/community/lms/doctype/lesson/lesson.js b/community/lms/doctype/lesson/lesson.js new file mode 100644 index 00000000..54865506 --- /dev/null +++ b/community/lms/doctype/lesson/lesson.js @@ -0,0 +1,8 @@ +// Copyright (c) 2021, FOSS United and contributors +// For license information, please see license.txt + +frappe.ui.form.on('Lesson', { + // refresh: function(frm) { + + // } +}); diff --git a/community/lms/doctype/lesson/lesson.json b/community/lms/doctype/lesson/lesson.json new file mode 100644 index 00000000..9cb4353f --- /dev/null +++ b/community/lms/doctype/lesson/lesson.json @@ -0,0 +1,59 @@ +{ + "actions": [], + "creation": "2021-05-03 06:21:12.995987", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "chapter", + "lesson_type", + "title" + ], + "fields": [ + { + "fieldname": "chapter", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Chapter", + "options": "Chapter" + }, + { + "default": "Video", + "fieldname": "lesson_type", + "fieldtype": "Select", + "in_list_view": 1, + "label": "Lesson Type", + "options": "Video\nText\nQuiz" + }, + { + "fieldname": "title", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Title" + } + ], + "index_web_pages_for_search": 1, + "links": [], + "modified": "2021-05-03 06:22:07.329131", + "modified_by": "Administrator", + "module": "LMS", + "name": "Lesson", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + } + ], + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1 +} \ No newline at end of file diff --git a/community/lms/doctype/lesson/lesson.py b/community/lms/doctype/lesson/lesson.py new file mode 100644 index 00000000..3bf002de --- /dev/null +++ b/community/lms/doctype/lesson/lesson.py @@ -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 Lesson(Document): + pass diff --git a/community/lms/doctype/lesson/test_lesson.py b/community/lms/doctype/lesson/test_lesson.py new file mode 100644 index 00000000..86c86ba2 --- /dev/null +++ b/community/lms/doctype/lesson/test_lesson.py @@ -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 TestLesson(unittest.TestCase): + pass