feat: claasses

This commit is contained in:
Jannat Patel
2022-11-09 16:36:26 +05:30
parent f1746978b2
commit 1d5d86ef6c
18 changed files with 253 additions and 0 deletions

View File

View 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": []
}

View 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

View 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) {
// }
});

View 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": []
}

View 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

View 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

View File

View 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) {
// }
});

View 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": []
}

View 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

View 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

View File

View File

0
lms/www/classes/class.py Normal file
View File

View 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
View File

@@ -0,0 +1,4 @@
import frappe
def get_context(context):
context.no_cache = 1