feat: claasses
This commit is contained in:
0
lms/lms/doctype/class_course/__init__.py
Normal file
0
lms/lms/doctype/class_course/__init__.py
Normal file
34
lms/lms/doctype/class_course/class_course.json
Normal file
34
lms/lms/doctype/class_course/class_course.json
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
{
|
||||||
|
"actions": [],
|
||||||
|
"autoname": "autoincrement",
|
||||||
|
"creation": "2022-11-09 16:23:26.454527",
|
||||||
|
"doctype": "DocType",
|
||||||
|
"editable_grid": 1,
|
||||||
|
"engine": "InnoDB",
|
||||||
|
"field_order": [
|
||||||
|
"course"
|
||||||
|
],
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"fieldname": "course",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"in_list_view": 1,
|
||||||
|
"label": "Course",
|
||||||
|
"options": "LMS Course",
|
||||||
|
"reqd": 1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"index_web_pages_for_search": 1,
|
||||||
|
"istable": 1,
|
||||||
|
"links": [],
|
||||||
|
"modified": "2022-11-09 16:25:01.648986",
|
||||||
|
"modified_by": "Administrator",
|
||||||
|
"module": "LMS",
|
||||||
|
"name": "Class Course",
|
||||||
|
"naming_rule": "Autoincrement",
|
||||||
|
"owner": "Administrator",
|
||||||
|
"permissions": [],
|
||||||
|
"sort_field": "modified",
|
||||||
|
"sort_order": "DESC",
|
||||||
|
"states": []
|
||||||
|
}
|
||||||
8
lms/lms/doctype/class_course/class_course.py
Normal file
8
lms/lms/doctype/class_course/class_course.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 ClassCourse(Document):
|
||||||
|
pass
|
||||||
0
lms/lms/doctype/class_student/__init__.py
Normal file
0
lms/lms/doctype/class_student/__init__.py
Normal file
8
lms/lms/doctype/class_student/class_student.js
Normal file
8
lms/lms/doctype/class_student/class_student.js
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
// Copyright (c) 2022, Frappe and contributors
|
||||||
|
// For license information, please see license.txt
|
||||||
|
|
||||||
|
frappe.ui.form.on('Class Student', {
|
||||||
|
// refresh: function(frm) {
|
||||||
|
|
||||||
|
// }
|
||||||
|
});
|
||||||
43
lms/lms/doctype/class_student/class_student.json
Normal file
43
lms/lms/doctype/class_student/class_student.json
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
{
|
||||||
|
"actions": [],
|
||||||
|
"allow_rename": 1,
|
||||||
|
"creation": "2022-11-09 16:20:44.602545",
|
||||||
|
"default_view": "List",
|
||||||
|
"doctype": "DocType",
|
||||||
|
"editable_grid": 1,
|
||||||
|
"engine": "InnoDB",
|
||||||
|
"field_order": [
|
||||||
|
"student",
|
||||||
|
"student_name"
|
||||||
|
],
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"fieldname": "student",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"in_list_view": 1,
|
||||||
|
"label": "Student",
|
||||||
|
"options": "User",
|
||||||
|
"reqd": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fetch_from": "student.full_name",
|
||||||
|
"fieldname": "student_name",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"in_list_view": 1,
|
||||||
|
"label": "Student Name",
|
||||||
|
"read_only": 1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"index_web_pages_for_search": 1,
|
||||||
|
"istable": 1,
|
||||||
|
"links": [],
|
||||||
|
"modified": "2022-11-09 16:25:07.819344",
|
||||||
|
"modified_by": "Administrator",
|
||||||
|
"module": "LMS",
|
||||||
|
"name": "Class Student",
|
||||||
|
"owner": "Administrator",
|
||||||
|
"permissions": [],
|
||||||
|
"sort_field": "modified",
|
||||||
|
"sort_order": "DESC",
|
||||||
|
"states": []
|
||||||
|
}
|
||||||
8
lms/lms/doctype/class_student/class_student.py
Normal file
8
lms/lms/doctype/class_student/class_student.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 ClassStudent(Document):
|
||||||
|
pass
|
||||||
9
lms/lms/doctype/class_student/test_class_student.py
Normal file
9
lms/lms/doctype/class_student/test_class_student.py
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# Copyright (c) 2022, Frappe and Contributors
|
||||||
|
# See license.txt
|
||||||
|
|
||||||
|
# import frappe
|
||||||
|
from frappe.tests.utils import FrappeTestCase
|
||||||
|
|
||||||
|
|
||||||
|
class TestClassStudent(FrappeTestCase):
|
||||||
|
pass
|
||||||
0
lms/lms/doctype/lms_class/__init__.py
Normal file
0
lms/lms/doctype/lms_class/__init__.py
Normal file
8
lms/lms/doctype/lms_class/lms_class.js
Normal file
8
lms/lms/doctype/lms_class/lms_class.js
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
// Copyright (c) 2022, Frappe and contributors
|
||||||
|
// For license information, please see license.txt
|
||||||
|
|
||||||
|
frappe.ui.form.on('LMS Class', {
|
||||||
|
// refresh: function(frm) {
|
||||||
|
|
||||||
|
// }
|
||||||
|
});
|
||||||
89
lms/lms/doctype/lms_class/lms_class.json
Normal file
89
lms/lms/doctype/lms_class/lms_class.json
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
{
|
||||||
|
"actions": [],
|
||||||
|
"allow_rename": 1,
|
||||||
|
"autoname": "format: CLS-{#####}",
|
||||||
|
"creation": "2022-11-09 16:14:05.876933",
|
||||||
|
"default_view": "List",
|
||||||
|
"doctype": "DocType",
|
||||||
|
"editable_grid": 1,
|
||||||
|
"engine": "InnoDB",
|
||||||
|
"field_order": [
|
||||||
|
"title",
|
||||||
|
"data_2",
|
||||||
|
"end_date",
|
||||||
|
"column_break_4",
|
||||||
|
"description",
|
||||||
|
"section_break_6",
|
||||||
|
"students",
|
||||||
|
"courses"
|
||||||
|
],
|
||||||
|
"fields": [
|
||||||
|
{
|
||||||
|
"fieldname": "title",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"in_list_view": 1,
|
||||||
|
"label": "Title",
|
||||||
|
"reqd": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "data_2",
|
||||||
|
"fieldtype": "Date",
|
||||||
|
"label": "Start Date"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "end_date",
|
||||||
|
"fieldtype": "Date",
|
||||||
|
"label": "End Date"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "column_break_4",
|
||||||
|
"fieldtype": "Column Break"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "description",
|
||||||
|
"fieldtype": "Small Text",
|
||||||
|
"label": "Description"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "section_break_6",
|
||||||
|
"fieldtype": "Section Break"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "students",
|
||||||
|
"fieldtype": "Table",
|
||||||
|
"label": "Students",
|
||||||
|
"options": "Class Student"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "courses",
|
||||||
|
"fieldtype": "Table",
|
||||||
|
"label": "Courses",
|
||||||
|
"options": "Class Course"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"index_web_pages_for_search": 1,
|
||||||
|
"links": [],
|
||||||
|
"modified": "2022-11-09 16:24:28.502317",
|
||||||
|
"modified_by": "Administrator",
|
||||||
|
"module": "LMS",
|
||||||
|
"name": "LMS Class",
|
||||||
|
"naming_rule": "Expression (old style)",
|
||||||
|
"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",
|
||||||
|
"states": []
|
||||||
|
}
|
||||||
8
lms/lms/doctype/lms_class/lms_class.py
Normal file
8
lms/lms/doctype/lms_class/lms_class.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 LMSClass(Document):
|
||||||
|
pass
|
||||||
9
lms/lms/doctype/lms_class/test_lms_class.py
Normal file
9
lms/lms/doctype/lms_class/test_lms_class.py
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# Copyright (c) 2022, Frappe and Contributors
|
||||||
|
# See license.txt
|
||||||
|
|
||||||
|
# import frappe
|
||||||
|
from frappe.tests.utils import FrappeTestCase
|
||||||
|
|
||||||
|
|
||||||
|
class TestLMSClass(FrappeTestCase):
|
||||||
|
pass
|
||||||
0
lms/www/classes/__init__.py
Normal file
0
lms/www/classes/__init__.py
Normal file
0
lms/www/classes/class.html
Normal file
0
lms/www/classes/class.html
Normal file
0
lms/www/classes/class.py
Normal file
0
lms/www/classes/class.py
Normal file
25
lms/www/classes/index.html
Normal file
25
lms/www/classes/index.html
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
{% extends "templates/base.html" %}
|
||||||
|
{% block title %}
|
||||||
|
{{ _("All Classes") }}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<div class="common-page-style">
|
||||||
|
<div class="container">
|
||||||
|
<a class="btn btn-default btn-sm pull-right" href="/classes/new-class">
|
||||||
|
{{ _("Create Class") }}
|
||||||
|
</a>
|
||||||
|
<div class="course-home-headings"> {{ _("All Classes") }} </div>
|
||||||
|
{% if classes %}
|
||||||
|
{% else %}
|
||||||
|
<div class="empty-state">
|
||||||
|
<img class="icon icon-xl" src="/assets/lms/icons/comment.svg">
|
||||||
|
<div class="empty-state-text">
|
||||||
|
<div class="empty-state-heading">{{ _("No Classes") }}</div>
|
||||||
|
<div class="course-meta">{{ _("There are no classes on this site.") }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
4
lms/www/classes/index.py
Normal file
4
lms/www/classes/index.py
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
import frappe
|
||||||
|
|
||||||
|
def get_context(context):
|
||||||
|
context.no_cache = 1
|
||||||
Reference in New Issue
Block a user