diff --git a/community/community/doctype/community_conference/__init__.py b/community/community/doctype/community_conference/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/community/community/doctype/community_conference/community_conference.js b/community/community/doctype/community_conference/community_conference.js new file mode 100644 index 00000000..1c87c1cf --- /dev/null +++ b/community/community/doctype/community_conference/community_conference.js @@ -0,0 +1,8 @@ +// Copyright (c) 2021, Frappe and contributors +// For license information, please see license.txt + +frappe.ui.form.on('Community Conference', { + // refresh: function(frm) { + + // } +}); diff --git a/community/community/doctype/community_conference/community_conference.json b/community/community/doctype/community_conference/community_conference.json new file mode 100644 index 00000000..e6d0c0c6 --- /dev/null +++ b/community/community/doctype/community_conference/community_conference.json @@ -0,0 +1,48 @@ +{ + "actions": [], + "creation": "2021-02-25 17:12:51.981534", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "conference_name", + "live_stream_url" + ], + "fields": [ + { + "fieldname": "conference_name", + "fieldtype": "Data", + "label": "Conference Name" + }, + { + "fieldname": "live_stream_url", + "fieldtype": "Data", + "label": "Live Stream URL" + } + ], + "index_web_pages_for_search": 1, + "links": [], + "modified": "2021-02-25 17:12:51.981534", + "modified_by": "Administrator", + "module": "Community", + "name": "Community Conference", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + } + ], + "quick_entry": 1, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1 +} \ No newline at end of file diff --git a/community/community/doctype/community_conference/community_conference.py b/community/community/doctype/community_conference/community_conference.py new file mode 100644 index 00000000..22a1aa41 --- /dev/null +++ b/community/community/doctype/community_conference/community_conference.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.model.document import Document + +class CommunityConference(Document): + pass diff --git a/community/community/doctype/community_conference/test_community_conference.py b/community/community/doctype/community_conference/test_community_conference.py new file mode 100644 index 00000000..7a6360a3 --- /dev/null +++ b/community/community/doctype/community_conference/test_community_conference.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 TestCommunityConference(unittest.TestCase): + pass diff --git a/community/community/doctype/community_conference_participant/__init__.py b/community/community/doctype/community_conference_participant/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/community/community/doctype/community_conference_participant/community_conference_participant.js b/community/community/doctype/community_conference_participant/community_conference_participant.js new file mode 100644 index 00000000..ad4c54d7 --- /dev/null +++ b/community/community/doctype/community_conference_participant/community_conference_participant.js @@ -0,0 +1,8 @@ +// Copyright (c) 2021, Frappe and contributors +// For license information, please see license.txt + +frappe.ui.form.on('Community Conference Participant', { + // refresh: function(frm) { + + // } +}); diff --git a/community/community/doctype/community_conference_participant/community_conference_participant.json b/community/community/doctype/community_conference_participant/community_conference_participant.json new file mode 100644 index 00000000..b944d44b --- /dev/null +++ b/community/community/doctype/community_conference_participant/community_conference_participant.json @@ -0,0 +1,147 @@ +{ + "actions": [], + "autoname": "CON-.YYYY.-.###", + "creation": "2021-02-25 17:51:23.959033", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "participant_details", + "participant_name", + "participant_designation", + "column_break_4", + "email", + "conference_details", + "year", + "full_conference_tickets", + "user_conference_tickets", + "paid", + "column_break_11", + "tshirt_table", + "tshirt_size", + "currency", + "amount", + "thank_you_email_sent" + ], + "fields": [ + { + "fieldname": "participant_details", + "fieldtype": "Section Break", + "label": "Participant Details" + }, + { + "fieldname": "participant_name", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Participant Name", + "reqd": 1 + }, + { + "fieldname": "participant_designation", + "fieldtype": "Select", + "label": "Participant Designation", + "options": "\nCxO\nAnalyst\nConsultant\nDeveloper\nSystem Administrator\nOther" + }, + { + "fieldname": "column_break_4", + "fieldtype": "Column Break" + }, + { + "fieldname": "email", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Email", + "options": "Email", + "reqd": 1 + }, + { + "fieldname": "conference_details", + "fieldtype": "Section Break", + "label": "Conference Details" + }, + { + "fieldname": "year", + "fieldtype": "Select", + "label": "Year", + "options": "\n2017\n2018\n2019\n2020\n2021\n2022\n2023\n2024\n2025" + }, + { + "fieldname": "full_conference_tickets", + "fieldtype": "Int", + "in_list_view": 1, + "label": "Full Conference Tickets", + "reqd": 1 + }, + { + "fieldname": "user_conference_tickets", + "fieldtype": "Int", + "label": "User Conference Tickets" + }, + { + "default": "0", + "fieldname": "paid", + "fieldtype": "Check", + "label": "Paid" + }, + { + "fieldname": "column_break_11", + "fieldtype": "Column Break" + }, + { + "fieldname": "tshirt_table", + "fieldtype": "Data", + "label": "T-Shirt Sizes" + }, + { + "fieldname": "tshirt_size", + "fieldtype": "Select", + "label": "T-Shirt Size", + "options": "S\nM\nL\nXL\nXXL\nXXXL" + }, + { + "fieldname": "currency", + "fieldtype": "Select", + "in_list_view": 1, + "label": "Currency", + "options": "USD\nINR", + "reqd": 1 + }, + { + "fieldname": "amount", + "fieldtype": "Currency", + "label": "Amount", + "reqd": 1 + }, + { + "default": "0", + "fieldname": "thank_you_email_sent", + "fieldtype": "Check", + "label": "Thank You Email Sent" + } + ], + "index_web_pages_for_search": 1, + "links": [], + "modified": "2021-02-25 17:51:23.959033", + "modified_by": "Administrator", + "module": "Community", + "name": "Community Conference Participant", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + } + ], + "quick_entry": 1, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1 +} \ No newline at end of file diff --git a/community/community/doctype/community_conference_participant/community_conference_participant.py b/community/community/doctype/community_conference_participant/community_conference_participant.py new file mode 100644 index 00000000..7bf3f449 --- /dev/null +++ b/community/community/doctype/community_conference_participant/community_conference_participant.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.model.document import Document + +class CommunityConferenceParticipant(Document): + pass diff --git a/community/community/doctype/community_conference_participant/test_community_conference_participant.py b/community/community/doctype/community_conference_participant/test_community_conference_participant.py new file mode 100644 index 00000000..482021a8 --- /dev/null +++ b/community/community/doctype/community_conference_participant/test_community_conference_participant.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 TestCommunityConferenceParticipant(unittest.TestCase): + pass diff --git a/community/community/doctype/community_conference_request/__init__.py b/community/community/doctype/community_conference_request/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/community/community/doctype/community_conference_request/community_conference_request.js b/community/community/doctype/community_conference_request/community_conference_request.js new file mode 100644 index 00000000..15d4808f --- /dev/null +++ b/community/community/doctype/community_conference_request/community_conference_request.js @@ -0,0 +1,8 @@ +// Copyright (c) 2021, Frappe and contributors +// For license information, please see license.txt + +frappe.ui.form.on('Community Conference Request', { + // refresh: function(frm) { + + // } +}); diff --git a/community/community/doctype/community_conference_request/community_conference_request.json b/community/community/doctype/community_conference_request/community_conference_request.json new file mode 100644 index 00000000..25d8b667 --- /dev/null +++ b/community/community/doctype/community_conference_request/community_conference_request.json @@ -0,0 +1,73 @@ +{ + "actions": [], + "creation": "2021-02-25 17:19:10.378290", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "contact_name", + "contact_number", + "email", + "organization_name", + "request_type", + "message" + ], + "fields": [ + { + "fieldname": "contact_name", + "fieldtype": "Data", + "label": "Contact Name" + }, + { + "fieldname": "contact_number", + "fieldtype": "Data", + "label": "Contact Number" + }, + { + "fieldname": "email", + "fieldtype": "Data", + "label": "Email" + }, + { + "fieldname": "organization_name", + "fieldtype": "Data", + "label": "Organization Name" + }, + { + "fieldname": "request_type", + "fieldtype": "Select", + "label": "Request Type", + "options": "Sponsorship\nExhibit Program" + }, + { + "fieldname": "message", + "fieldtype": "Text Editor", + "label": "Message" + } + ], + "index_web_pages_for_search": 1, + "links": [], + "modified": "2021-02-25 17:19:10.378290", + "modified_by": "Administrator", + "module": "Community", + "name": "Community Conference Request", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + } + ], + "quick_entry": 1, + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1 +} \ No newline at end of file diff --git a/community/community/doctype/community_conference_request/community_conference_request.py b/community/community/doctype/community_conference_request/community_conference_request.py new file mode 100644 index 00000000..b8fb93ef --- /dev/null +++ b/community/community/doctype/community_conference_request/community_conference_request.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.model.document import Document + +class CommunityConferenceRequest(Document): + pass diff --git a/community/community/doctype/community_conference_request/test_community_conference_request.py b/community/community/doctype/community_conference_request/test_community_conference_request.py new file mode 100644 index 00000000..a1a6934b --- /dev/null +++ b/community/community/doctype/community_conference_request/test_community_conference_request.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 TestCommunityConferenceRequest(unittest.TestCase): + pass diff --git a/community/community/doctype/community_course_member/__init__.py b/community/community/doctype/community_course_member/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/community/community/doctype/community_course_member/community_course_member.js b/community/community/doctype/community_course_member/community_course_member.js new file mode 100644 index 00000000..a01a2c7c --- /dev/null +++ b/community/community/doctype/community_course_member/community_course_member.js @@ -0,0 +1,8 @@ +// Copyright (c) 2021, Frappe and contributors +// For license information, please see license.txt + +frappe.ui.form.on('Community Course Member', { + // refresh: function(frm) { + + // } +}); diff --git a/community/community/doctype/community_course_member/community_course_member.json b/community/community/doctype/community_course_member/community_course_member.json new file mode 100644 index 00000000..2306cbb8 --- /dev/null +++ b/community/community/doctype/community_course_member/community_course_member.json @@ -0,0 +1,95 @@ +{ + "actions": [], + "autoname": "field:user_name", + "creation": "2021-03-02 11:24:49.612530", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "enabled", + "full_name", + "user_name", + "email", + "short_intro", + "bio", + "photo", + "route" + ], + "fields": [ + { + "default": "1", + "fieldname": "enabled", + "fieldtype": "Check", + "label": "Enabled" + }, + { + "fieldname": "full_name", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Full Name", + "reqd": 1 + }, + { + "fieldname": "user_name", + "fieldtype": "Data", + "in_list_view": 1, + "label": "User Name", + "reqd": 1, + "unique": 1 + }, + { + "fieldname": "email", + "fieldtype": "Data", + "label": "Email", + "options": "Email" + }, + { + "fieldname": "short_intro", + "fieldtype": "Data", + "label": "Short Intro" + }, + { + "fieldname": "bio", + "fieldtype": "Markdown Editor", + "label": "Bio" + }, + { + "fieldname": "photo", + "fieldtype": "Attach Image", + "label": "Photo" + }, + { + "fieldname": "route", + "fieldtype": "Data", + "label": "Route" + } + ], + "has_web_view": 1, + "index_web_pages_for_search": 1, + "is_published_field": "enabled", + "links": [], + "modified": "2021-03-02 17:53:40.252130", + "modified_by": "Administrator", + "module": "Community", + "name": "Community Course Member", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + } + ], + "quick_entry": 1, + "route": "username", + "sort_field": "modified", + "sort_order": "DESC", + "track_changes": 1 +} \ No newline at end of file diff --git a/community/community/doctype/community_course_member/community_course_member.py b/community/community/doctype/community_course_member/community_course_member.py new file mode 100644 index 00000000..78502c96 --- /dev/null +++ b/community/community/doctype/community_course_member/community_course_member.py @@ -0,0 +1,62 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2021, Frappe and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +import frappe +import re +from frappe.website.website_generator import WebsiteGenerator +from frappe import _ + +class CommunityCourseMember(WebsiteGenerator): + def validate(self): + self.validate_user_name() + if not self.route: + self.route = "username/" + self.user_name + + def validate_user_name(self): + if len(self.user_name) < 4: + frappe.throw(_("Username must be atleast 4 characters long.")) + if not re.match("^[A-Za-z0-9_]*$", self.user_name): + frappe.throw(_("Username can only contain alphabets, numbers, and underscore.")) + self.user_name = self.user_name.lower() + + def after_insert(self): + if frappe.db.exists("User", self.email): + user = frappe.get_doc("User", self.email) + else: + user, update_password_link = self.create_user() + self.send_email(update_password_link) + + def send_email(self, update_password_link): + + args = { + 'update_password_link': update_password_link, + 'full_name': self.full_name, + } + + frappe.sendmail( + recipients=self.email, + sender="Administrator", + subject=_("Set your Password"), + template="community_course_membership", + reference_doctype=self.doctype, + reference_name=self.name, + send_priority=0, + queue_separately=True, + args=args) + + def create_user(self): + user = frappe.get_doc({ + "doctype": "User", + "email": self.email, + "first_name": self.full_name.split(" ")[0], + "full_name": self.full_name, + "username": self.user_name, + "send_welcome_email": 0, + "user_type": 'Website User', + "redirect_url": "username/" + self.name + }) + user.save(ignore_permissions=True) + update_password_link = user.reset_password() + return user, update_password_link diff --git a/community/community/doctype/community_course_member/templates/community_course_member.html b/community/community/doctype/community_course_member/templates/community_course_member.html new file mode 100644 index 00000000..f22d535c --- /dev/null +++ b/community/community/doctype/community_course_member/templates/community_course_member.html @@ -0,0 +1,16 @@ +{% extends "templates/web.html" %} + +{% block page_content %} +
{{ short_intro }}
+{{ frappe.utils.md_to_html(bio) }}
+{{ short_intro }}
+{{ frappe.utils.md_to_html(bio) }}
+Dear {{ full_name }},
+{{ _("") }}
+ +{% if update_password_link %} + +{{_("Please click on the following button to set your new password")}}:
++ +
+ +{% endif %} + +{{_("Regards")}},
+ {{ _("Team Community") }}