diff --git a/community/hackathon/README.md b/community/hackathon/README.md new file mode 100644 index 00000000..561bb47f --- /dev/null +++ b/community/hackathon/README.md @@ -0,0 +1,35 @@ +The Hackathon module allows Community Members to organize and manage hackathons. Community Members can view these hackathons on the portal. + + + +### Key Features: + +##### Organize Hackathons + +1. Hackathons can be created using the **Community Hackathon** doctype. +1. Enter the hackathon name, the organizer, the year and Save. + + + +##### Projects + +1. A Hackathon will have multiple Projects. +1. Projects can be created using the **Community Project** doctype from the desk. +1. Projects can also be created from the Portal using the Projects webform. +1. Enter details like Project Name, Project Short Intro, Project Description. +1. Attach important links like Repository Link, Demo Link, Telegram Id. +1. The checkbox Accepting Members can be used if you are still aceepting members for your project. + + + + +1. Projects are visible on the portal as well. + + + +##### Project Members + +1. Community Members can explore the projects of hackathons and decide if they want to join any project. +1. If the project is accepting members they can apply for the project from the web form available on the portal. + +1. Project owners can review the requests and accept/reject the members. diff --git a/community/hackathon/doctype/community_hackathon/community_hackathon.json b/community/hackathon/doctype/community_hackathon/community_hackathon.json index c9b70e00..f893f9be 100644 --- a/community/hackathon/doctype/community_hackathon/community_hackathon.json +++ b/community/hackathon/doctype/community_hackathon/community_hackathon.json @@ -21,9 +21,9 @@ }, { "fieldname": "organizer", - "fieldtype": "Data", + "fieldtype": "Link", "label": "Organizer", - "options": "Email" + "options": "Community Member" }, { "fieldname": "year", @@ -34,7 +34,7 @@ ], "index_web_pages_for_search": 1, "links": [], - "modified": "2021-03-04 19:57:22.618153", + "modified": "2021-04-14 11:43:23.515972", "modified_by": "Administrator", "module": "Hackathon", "name": "Community Hackathon", diff --git a/community/hackathon/doctype/community_project/community_project.json b/community/hackathon/doctype/community_project/community_project.json index 472bcb21..51978b59 100644 --- a/community/hackathon/doctype/community_project/community_project.json +++ b/community/hackathon/doctype/community_project/community_project.json @@ -8,14 +8,18 @@ "engine": "InnoDB", "field_order": [ "disabled", + "column_break_2", + "accepting_members", + "section_break_4", "project_name", "project_short_intro", + "project_description", + "section_break_8", "repository_link", "video_link", - "telegram_id", - "project_description", + "column_break_11", "hackathon", - "accepting_members", + "telegram_id", "likes", "project_search" ], @@ -41,7 +45,7 @@ }, { "fieldname": "repository_link", - "fieldtype": "Small Text", + "fieldtype": "Data", "label": "Repository Link" }, { @@ -82,11 +86,27 @@ "fieldtype": "Small Text", "hidden": 1, "label": "Project Search" + }, + { + "fieldname": "column_break_2", + "fieldtype": "Column Break" + }, + { + "fieldname": "section_break_4", + "fieldtype": "Section Break" + }, + { + "fieldname": "section_break_8", + "fieldtype": "Section Break" + }, + { + "fieldname": "column_break_11", + "fieldtype": "Column Break" } ], "index_web_pages_for_search": 1, "links": [], - "modified": "2021-03-04 19:59:33.450666", + "modified": "2021-04-14 13:28:03.817061", "modified_by": "Administrator", "module": "Hackathon", "name": "Community Project", diff --git a/community/hackathon/images/community-hackathon.png b/community/hackathon/images/community-hackathon.png new file mode 100644 index 00000000..028089fb Binary files /dev/null and b/community/hackathon/images/community-hackathon.png differ diff --git a/community/hackathon/images/hackathons-portal.png b/community/hackathon/images/hackathons-portal.png new file mode 100644 index 00000000..ce787db5 Binary files /dev/null and b/community/hackathon/images/hackathons-portal.png differ diff --git a/community/hackathon/images/project-1.png b/community/hackathon/images/project-1.png new file mode 100644 index 00000000..49826d18 Binary files /dev/null and b/community/hackathon/images/project-1.png differ diff --git a/community/hackathon/images/project-2.png b/community/hackathon/images/project-2.png new file mode 100644 index 00000000..c36d18ea Binary files /dev/null and b/community/hackathon/images/project-2.png differ diff --git a/community/hackathon/images/project-details.png b/community/hackathon/images/project-details.png new file mode 100644 index 00000000..f0240d89 Binary files /dev/null and b/community/hackathon/images/project-details.png differ diff --git a/community/hackathon/images/project-join-request.png b/community/hackathon/images/project-join-request.png new file mode 100644 index 00000000..320c8ba8 Binary files /dev/null and b/community/hackathon/images/project-join-request.png differ diff --git a/community/hackathon/images/project-portal.png b/community/hackathon/images/project-portal.png new file mode 100644 index 00000000..977f3393 Binary files /dev/null and b/community/hackathon/images/project-portal.png differ diff --git a/community/hackathon/web_form/join_request/join_request.json b/community/hackathon/web_form/join_request/join_request.json index 2d2d916f..dc7f1cb3 100644 --- a/community/hackathon/web_form/join_request/join_request.json +++ b/community/hackathon/web_form/join_request/join_request.json @@ -17,9 +17,9 @@ "doctype": "Web Form", "idx": 0, "is_standard": 1, - "login_required": 0, + "login_required": 1, "max_attachment_size": 0, - "modified": "2021-03-04 19:43:53.697037", + "modified": "2021-04-14 13:52:46.135536", "modified_by": "Administrator", "module": "Hackathon", "name": "join-request", diff --git a/community/hackathon/web_form/project/__init__.py b/community/hackathon/web_form/project/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/community/hackathon/web_form/project/project.js b/community/hackathon/web_form/project/project.js new file mode 100644 index 00000000..699703c5 --- /dev/null +++ b/community/hackathon/web_form/project/project.js @@ -0,0 +1,3 @@ +frappe.ready(function() { + // bind events here +}) \ No newline at end of file diff --git a/community/hackathon/web_form/project/project.json b/community/hackathon/web_form/project/project.json new file mode 100644 index 00000000..2904595f --- /dev/null +++ b/community/hackathon/web_form/project/project.json @@ -0,0 +1,49 @@ +{ + "accept_payment": 0, + "allow_comments": 0, + "allow_delete": 0, + "allow_edit": 1, + "allow_incomplete": 0, + "allow_multiple": 0, + "allow_print": 0, + "amount": 0.0, + "amount_based_on_field": 0, + "apply_document_permissions": 0, + "button_label": "Save", + "creation": "2021-04-14 13:11:50.606310", + "doc_type": "Community Project", + "docstatus": 0, + "doctype": "Web Form", + "idx": 0, + "introduction_text": "

Add details about your project.


Note: If you save this project, you won't be able to join another one. If your teammates have already created the project, join it instead.

", + "is_standard": 1, + "login_required": 1, + "max_attachment_size": 0, + "modified": "2021-04-14 13:11:50.606310", + "modified_by": "Administrator", + "module": "Hackathon", + "name": "project", + "owner": "Administrator", + "payment_button_label": "Buy Now", + "published": 1, + "route": "edit-project", + "route_to_success_link": 0, + "show_attachments": 0, + "show_in_grid": 0, + "show_sidebar": 0, + "sidebar_items": [], + "success_url": "/project", + "title": "Project", + "web_form_fields": [ + { + "allow_read_on_all_link_options": 0, + "fieldtype": "Attach", + "hidden": 0, + "max_length": 0, + "max_value": 0, + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + } + ] +} \ No newline at end of file diff --git a/community/hackathon/web_form/project/project.py b/community/hackathon/web_form/project/project.py new file mode 100644 index 00000000..2334f8b2 --- /dev/null +++ b/community/hackathon/web_form/project/project.py @@ -0,0 +1,7 @@ +from __future__ import unicode_literals + +import frappe + +def get_context(context): + # do your magic here + pass diff --git a/community/hooks.py b/community/hooks.py index 6fef77ca..3c1172ea 100644 --- a/community/hooks.py +++ b/community/hooks.py @@ -150,7 +150,8 @@ whitelist = [ "/admin", "/socket.io", "/hackathons", - "/dashboard" + "/dashboard", + "/join-request" ] whitelist_rules = [{"from_route": p, "to_route": p[1:]} for p in whitelist] diff --git a/community/lms/doctype/lms_course/lms_course.json b/community/lms/doctype/lms_course/lms_course.json index 4a558f78..33c582b7 100644 --- a/community/lms/doctype/lms_course/lms_course.json +++ b/community/lms/doctype/lms_course/lms_course.json @@ -10,11 +10,13 @@ "field_order": [ "title", "slug", - "description", - "section_break_3", "is_published", - "column_break_5", - "short_code" + "column_break_3", + "short_code", + "video_link", + "section_break_5", + "short_introduction", + "description" ], "fields": [ { @@ -41,14 +43,6 @@ "fieldtype": "Data", "label": "Short Code" }, - { - "fieldname": "section_break_3", - "fieldtype": "Section Break" - }, - { - "fieldname": "column_break_5", - "fieldtype": "Column Break" - }, { "description": "The slug of the course. Autogenerated from the title if not specified.", "fieldname": "slug", @@ -56,12 +50,30 @@ "in_list_view": 1, "label": "Slug", "unique": 1 + }, + { + "fieldname": "column_break_3", + "fieldtype": "Column Break" + }, + { + "fieldname": "video_link", + "fieldtype": "Data", + "label": "Video Link" + }, + { + "fieldname": "section_break_5", + "fieldtype": "Section Break" + }, + { + "fieldname": "short_introduction", + "fieldtype": "Small Text", + "label": "Short Introduction" } ], "index_web_pages_for_search": 1, "is_published_field": "is_published", "links": [], - "modified": "2021-04-06 15:33:08.870313", + "modified": "2021-04-14 15:23:39.592341", "modified_by": "Administrator", "module": "LMS", "name": "LMS Course", diff --git a/community/www/profiles/profile.py b/community/www/profiles/profile.py index 65f6d502..427574be 100644 --- a/community/www/profiles/profile.py +++ b/community/www/profiles/profile.py @@ -3,7 +3,16 @@ from ...lms.doctype.lms_sketch.lms_sketch import get_recent_sketches def get_context(context): context.no_cache = 1 - context.username = frappe.form_dict['username'] - context.member = frappe.get_doc("Community Member", {"username":context.username}) - context.abbr = "".join([s[0] for s in context.member.full_name.split()]) - context.sketches = list(filter(lambda x: x.owner == context.member.email, get_recent_sketches())) + context.username = frappe.form_dict["username"] + context.member = get_member(context.username) + if not context.member: + context.template = "www/404.html" + else: + context.abbr = "".join([s[0] for s in context.member.full_name.split()]) + context.sketches = list(filter(lambda x: x.owner == context.member.email, get_recent_sketches())) + +def get_member(username): + try: + frappe.get_doc("Community Member", {"username":username}) + except frappe.DoesNotExistError: + return