From 7783dd5c1fc66224f5375340075b0e5e13e70e12 Mon Sep 17 00:00:00 2001 From: Anand Chitipothu Date: Tue, 2 Mar 2021 06:58:16 +0000 Subject: [PATCH] Added new doctype "Community Course Topic". --- .../community_course_topic/__init__.py | 0 .../community_course_topic.js | 8 +++ .../community_course_topic.json | 70 +++++++++++++++++++ .../community_course_topic.py | 10 +++ .../templates/community_course_lession.html | 7 ++ .../community_course_lession_row.html | 4 ++ .../test_community_course_topic.py | 10 +++ 7 files changed, 109 insertions(+) create mode 100644 community/community/doctype/community_course_topic/__init__.py create mode 100644 community/community/doctype/community_course_topic/community_course_topic.js create mode 100644 community/community/doctype/community_course_topic/community_course_topic.json create mode 100644 community/community/doctype/community_course_topic/community_course_topic.py create mode 100644 community/community/doctype/community_course_topic/templates/community_course_lession.html create mode 100644 community/community/doctype/community_course_topic/templates/community_course_lession_row.html create mode 100644 community/community/doctype/community_course_topic/test_community_course_topic.py diff --git a/community/community/doctype/community_course_topic/__init__.py b/community/community/doctype/community_course_topic/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/community/community/doctype/community_course_topic/community_course_topic.js b/community/community/doctype/community_course_topic/community_course_topic.js new file mode 100644 index 00000000..933ff0d8 --- /dev/null +++ b/community/community/doctype/community_course_topic/community_course_topic.js @@ -0,0 +1,8 @@ +// Copyright (c) 2021, Frappe and contributors +// For license information, please see license.txt + +frappe.ui.form.on('Community Course Topic', { + // refresh: function(frm) { + + // } +}); diff --git a/community/community/doctype/community_course_topic/community_course_topic.json b/community/community/doctype/community_course_topic/community_course_topic.json new file mode 100644 index 00000000..46be90be --- /dev/null +++ b/community/community/doctype/community_course_topic/community_course_topic.json @@ -0,0 +1,70 @@ +{ + "actions": [], + "allow_guest_to_view": 1, + "autoname": "format:{title}", + "creation": "2021-03-02 07:20:41.686573", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "title", + "description", + "course", + "order" + ], + "fields": [ + { + "fieldname": "title", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Title", + "reqd": 1 + }, + { + "fieldname": "description", + "fieldtype": "Markdown Editor", + "label": "Description" + }, + { + "fieldname": "course", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Course", + "options": "Community Course", + "reqd": 1 + }, + { + "fieldname": "order", + "fieldtype": "Int", + "label": "Order" + } + ], + "index_web_pages_for_search": 1, + "links": [], + "modified": "2021-03-02 11:43:47.044344", + "modified_by": "Administrator", + "module": "Community", + "name": "Community Course Topic", + "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": "creation", + "sort_order": "ASC", + "title_field": "title", + "track_changes": 1, + "track_seen": 1, + "track_views": 1 +} \ No newline at end of file diff --git a/community/community/doctype/community_course_topic/community_course_topic.py b/community/community/doctype/community_course_topic/community_course_topic.py new file mode 100644 index 00000000..69c69fab --- /dev/null +++ b/community/community/doctype/community_course_topic/community_course_topic.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2021, Frappe and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +# import frappe +from frappe.website.website_generator import WebsiteGenerator + +class CommunityCourseTopic(WebsiteGenerator): + pass diff --git a/community/community/doctype/community_course_topic/templates/community_course_lession.html b/community/community/doctype/community_course_topic/templates/community_course_lession.html new file mode 100644 index 00000000..db123090 --- /dev/null +++ b/community/community/doctype/community_course_topic/templates/community_course_lession.html @@ -0,0 +1,7 @@ +{% extends "templates/web.html" %} + +{% block page_content %} +

{{ title }}

+{% endblock %} + + \ No newline at end of file diff --git a/community/community/doctype/community_course_topic/templates/community_course_lession_row.html b/community/community/doctype/community_course_topic/templates/community_course_lession_row.html new file mode 100644 index 00000000..d7014b45 --- /dev/null +++ b/community/community/doctype/community_course_topic/templates/community_course_lession_row.html @@ -0,0 +1,4 @@ +
+ {{ doc.title or doc.name }} +
+ diff --git a/community/community/doctype/community_course_topic/test_community_course_topic.py b/community/community/doctype/community_course_topic/test_community_course_topic.py new file mode 100644 index 00000000..dd64ad7e --- /dev/null +++ b/community/community/doctype/community_course_topic/test_community_course_topic.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2021, Frappe and Contributors +# See license.txt +from __future__ import unicode_literals + +# import frappe +import unittest + +class TestCommunityCourseTopic(unittest.TestCase): + pass