diff --git a/community/community/doctype/community_course/__init__.py b/community/community/doctype/community_course/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/community/community/doctype/community_course/community_course.js b/community/community/doctype/community_course/community_course.js new file mode 100644 index 00000000..db678744 --- /dev/null +++ b/community/community/doctype/community_course/community_course.js @@ -0,0 +1,10 @@ +// Copyright (c) 2021, Frappe and contributors +// For license information, please see license.txt + +frappe.ui.form.on('Community Course', { + before_submit: function (form) { + if (!form.doc.route) { + form.doc.route = "/courses/" + form.doc.name + } + } +}); diff --git a/community/community/doctype/community_course/community_course.json b/community/community/doctype/community_course/community_course.json new file mode 100644 index 00000000..3aae8866 --- /dev/null +++ b/community/community/doctype/community_course/community_course.json @@ -0,0 +1,72 @@ +{ + "actions": [], + "allow_guest_to_view": 1, + "allow_rename": 1, + "autoname": "field:title", + "creation": "2021-03-01 16:49:33.622422", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "title", + "description", + "route", + "is_published" + ], + "fields": [ + { + "fieldname": "title", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Title", + "reqd": 1, + "unique": 1 + }, + { + "fieldname": "description", + "fieldtype": "Markdown Editor", + "label": "Description" + }, + { + "fieldname": "route", + "fieldtype": "Data", + "label": "Route" + }, + { + "default": "0", + "fieldname": "is_published", + "fieldtype": "Check", + "label": "Published" + } + ], + "has_web_view": 1, + "index_web_pages_for_search": 1, + "is_published_field": "is_published", + "links": [], + "modified": "2021-03-02 06:40:37.282673", + "modified_by": "Administrator", + "module": "Community", + "name": "Community Course", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + } + ], + "route": "courses", + "search_fields": "title", + "sort_field": "creation", + "sort_order": "DESC", + "title_field": "title", + "track_changes": 1, + "track_views": 1 +} \ No newline at end of file diff --git a/community/community/doctype/community_course/community_course.py b/community/community/doctype/community_course/community_course.py new file mode 100644 index 00000000..0aebc502 --- /dev/null +++ b/community/community/doctype/community_course/community_course.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 CommunityCourse(WebsiteGenerator): + pass diff --git a/community/community/doctype/community_course/templates/community_course.html b/community/community/doctype/community_course/templates/community_course.html new file mode 100644 index 00000000..14cb508c --- /dev/null +++ b/community/community/doctype/community_course/templates/community_course.html @@ -0,0 +1,21 @@ +{% extends "templates/web.html" %} + +{% block page_content %} + +
+ +