Compare commits
114 Commits
course-doc
...
less
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9deaa182b7 | ||
|
|
4bc05bfda8 | ||
|
|
0cfd6d7634 | ||
|
|
f7434f376f | ||
|
|
905f51ee76 | ||
|
|
e207320721 | ||
|
|
20ccc09869 | ||
|
|
e78c6020e7 | ||
|
|
4874d99e44 | ||
|
|
a022804381 | ||
|
|
7a40b3e7a5 | ||
|
|
0ab4fbb03d | ||
|
|
7b142fd72d | ||
|
|
fc8ff9c7fd | ||
|
|
c6bd47eb62 | ||
|
|
68406762c9 | ||
|
|
89c539a3ed | ||
|
|
8d62b5c504 | ||
|
|
8857b97773 | ||
|
|
46e7a5c0d1 | ||
|
|
d68f1de796 | ||
|
|
ffdc554106 | ||
|
|
424967b03e | ||
|
|
b80663a245 | ||
|
|
44dc42d7dd | ||
|
|
c18916096e | ||
|
|
3b578d750a | ||
|
|
00107134b4 | ||
|
|
153bb925d8 | ||
|
|
22448a8a7b | ||
|
|
54fe2efa07 | ||
|
|
86bd708c34 | ||
|
|
87d67c55e0 | ||
|
|
3405de9394 | ||
|
|
ab3c4c34ce | ||
|
|
b09ec1e29d | ||
|
|
a2fe314420 | ||
|
|
df9b856a91 | ||
|
|
e6248f9e02 | ||
|
|
be93a496cc | ||
|
|
91be957885 | ||
|
|
20e562bfb0 | ||
|
|
6fad78278a | ||
|
|
dfe8b3d4a2 | ||
|
|
e8ff9a5a32 | ||
|
|
88888903ab | ||
|
|
d38c64650e | ||
|
|
0e1002392f | ||
|
|
258ccb1642 | ||
|
|
767aaac913 | ||
|
|
871ad279d1 | ||
|
|
84cf74e25d | ||
|
|
b8b7673985 | ||
|
|
f1508033a3 | ||
|
|
15b8b99ae2 | ||
|
|
3d024a289e | ||
|
|
7658942500 | ||
|
|
b197fd605c | ||
|
|
a3788a0f39 | ||
|
|
06f7698e8f | ||
|
|
175bd19a51 | ||
|
|
6620ecf0c8 | ||
|
|
253c25bf1f | ||
|
|
e42e00f83a | ||
|
|
53af969a2e | ||
|
|
87acbb9f6e | ||
|
|
bf789c1891 | ||
|
|
24bb0f2b2a | ||
|
|
bc4503a636 | ||
|
|
389254b673 | ||
|
|
6433af6613 | ||
|
|
ab5929a4e8 | ||
|
|
7ecfa6b0c3 | ||
|
|
ed0f70e3ed | ||
|
|
280cfb3994 | ||
|
|
dfafab3ccd | ||
|
|
071df674c0 | ||
|
|
03a22bd537 | ||
|
|
f8ba10dfba | ||
|
|
9c485dbd4e | ||
|
|
49e65c9e43 | ||
|
|
599b2cf76c | ||
|
|
562a2189f7 | ||
|
|
faf102bdec | ||
|
|
ce7175040f | ||
|
|
25a0dd02ac | ||
|
|
dca8c9d5db | ||
|
|
fe63ded98c | ||
|
|
31aec86c0b | ||
|
|
5f8de7612b | ||
|
|
4fe91422f4 | ||
|
|
406244ff69 | ||
|
|
936a3fcfff | ||
|
|
deea539c7d | ||
|
|
ff15e7058b | ||
|
|
3583cd084d | ||
|
|
13030b0b9b | ||
|
|
480774755f | ||
|
|
b7602d6d2b | ||
|
|
862878462b | ||
|
|
fc6f60c4d7 | ||
|
|
6c671c0347 | ||
|
|
bfc15cf1a4 | ||
|
|
f96c8c27ed | ||
|
|
c661d141c2 | ||
|
|
ca621e07b7 | ||
|
|
0fcba82030 | ||
|
|
3f04b10b90 | ||
|
|
4b90f2e129 | ||
|
|
8b5cd8e6c6 | ||
|
|
acea59767d | ||
|
|
b4eb9580af | ||
|
|
a4dffca4d7 | ||
|
|
94939bf1e9 |
29
.editorconfig
Normal file
@@ -0,0 +1,29 @@
|
||||
|
||||
# EditorConfig is awesome: https://EditorConfig.org
|
||||
|
||||
# top-most EditorConfig file
|
||||
root = true
|
||||
|
||||
# Unix-style newlines with a newline ending every file
|
||||
[*]
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
charset = utf-8
|
||||
indent_style = space
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
# Python
|
||||
[*.py]
|
||||
indent_size = 4
|
||||
|
||||
# Markdown
|
||||
[*.md]
|
||||
indent_size = 4
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[Makefile]
|
||||
indent_style = tab
|
||||
|
||||
# HTML, CSS, javascript, JSON and YAML
|
||||
[*.{html,css,js,json,yml,yaml}]
|
||||
indent_size = 2
|
||||
38
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: bug
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Desktop (please complete the following information):**
|
||||
- OS: [e.g. iOS]
|
||||
- Browser [e.g. chrome, safari]
|
||||
- Version [e.g. 22]
|
||||
|
||||
**Smartphone (please complete the following information):**
|
||||
- Device: [e.g. iPhone6]
|
||||
- OS: [e.g. iOS8.1]
|
||||
- Browser [e.g. stock browser, safari]
|
||||
- Version [e.g. 22]
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
11
.github/mariadb-frappe.cnf
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
# configuration to force mariadb to use utf8mb4 charecter set, as required by frappe
|
||||
# This file need to be placed at /etc/mysql/conf.d/ in the mariadb container as a volume
|
||||
# See .github/wotkflows/ci.yml to see how it is used
|
||||
|
||||
[mysqld]
|
||||
character-set-client-handshake = FALSE
|
||||
character-set-server = utf8mb4
|
||||
collation-server = utf8mb4_unicode_ci
|
||||
|
||||
[mysql]
|
||||
default-character-set = utf8mb4
|
||||
60
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
name: Run tests
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request: {}
|
||||
jobs:
|
||||
tests:
|
||||
runs-on: ubuntu-20.04
|
||||
services:
|
||||
redis-cache:
|
||||
image: redis:alpine
|
||||
ports:
|
||||
- 13000:6379
|
||||
redis-queue:
|
||||
image: redis:alpine
|
||||
ports:
|
||||
- 11000:6379
|
||||
redis-socketio:
|
||||
image: redis:alpine
|
||||
ports:
|
||||
- 12000:6379
|
||||
mariadb:
|
||||
image: anandology/mariadb-utf8mb4:10.3
|
||||
ports:
|
||||
- 3306:3306
|
||||
env:
|
||||
MYSQL_ROOT_PASSWORD: root
|
||||
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: setup python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.9
|
||||
- name: setup node
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '12'
|
||||
check-latest: true
|
||||
- name: install bench
|
||||
run: pip3 install frappe-bench
|
||||
- name: bench init
|
||||
run: bench init ~/frappe-bench --skip-redis-config-generation
|
||||
- name: add community app to bench
|
||||
working-directory: /home/runner/frappe-bench
|
||||
run: bench get-app community $GITHUB_WORKSPACE
|
||||
- name: create bench site
|
||||
working-directory: /home/runner/frappe-bench
|
||||
run: bench new-site --mariadb-root-password root --admin-password admin frappe.local
|
||||
- name: install community app
|
||||
working-directory: /home/runner/frappe-bench
|
||||
run: bench --site frappe.local install-app community
|
||||
- name: allow tests
|
||||
working-directory: /home/runner/frappe-bench
|
||||
run: bench --site frappe.local set-config allow_tests true
|
||||
- name: run tests
|
||||
working-directory: /home/runner/frappe-bench
|
||||
run: bench --site frappe.local run-tests --app community
|
||||
|
||||
76
README.md
@@ -1,7 +1,79 @@
|
||||
## Community
|
||||
|
||||
Community App
|
||||
This app helps people organize and manage their own communities.
|
||||
|
||||
The App has following components:
|
||||
|
||||
1. Hackathons
|
||||
1. LMS
|
||||
|
||||
Community is built on the [Frappe Framework](https://github.com/frappe/frappe), a full-stack web app framework built with Python & JavaScript.
|
||||
|
||||
## Development Setup
|
||||
|
||||
**Step 1:** Clone the repo
|
||||
|
||||
```
|
||||
$ git clone https://github.com/fossunited/community.git
|
||||
|
||||
$ cd community
|
||||
```
|
||||
|
||||
**Step 2:** Run docker-compose
|
||||
|
||||
```
|
||||
$ docker-compose up
|
||||
```
|
||||
|
||||
**Step 3:** Visit the website at http://localhost:8000/
|
||||
|
||||
You'll have to go through the setup wizard to setup the website for the first time you access it. Login using the following credentiasl to complete the setup wizard.
|
||||
|
||||
```
|
||||
Username: Administrator
|
||||
password: admin
|
||||
```
|
||||
|
||||
TODO: Explain how to load sample data
|
||||
|
||||
## Stopping the server
|
||||
|
||||
Press `ctrl+c` in the terminal to stop the server. You can also run `docker-compose down` in another terminal to stop it.
|
||||
|
||||
To completely reset the instance, do the following:
|
||||
|
||||
```
|
||||
$ docker-compose down --volumes
|
||||
$ docker-compose up
|
||||
```
|
||||
|
||||
## Making Code Changes
|
||||
|
||||
The dev setup is configured to reload whenever any code is changed. Just edit the code and reload the webpage.
|
||||
|
||||
Commit the changes in a branch and send a pull request.
|
||||
|
||||
## Local Setup - The Hard Way
|
||||
|
||||
To setup the repository locally follow the steps mentioned below:
|
||||
|
||||
1. Install bench and setup a frappe-bench directory by following the [Installation Steps](https://frappeframework.com/docs/user/en/installation).
|
||||
1. Start the server by running bench start.
|
||||
1. In a separate terminal window, create a new site by running bench new-site community.test.
|
||||
1. Run bench get-app https://github.com/fossunited/community.
|
||||
1. Run bench --site community.test install-app community.
|
||||
1. Map your site to localhost with the command ```bench --site community.test add-to-hosts```
|
||||
1. Now open the URL http://community.test:8000/docs in your browser, you should see the app running.
|
||||
|
||||
### Contribution Guidelines (for The Hard Way)
|
||||
|
||||
1. Go to the apps/community directory of your installation and execute git pull --unshallow to ensure that you have the full git repository. Also fork the fossunited/community repository on GitHub.
|
||||
1. Check out a working branch in git (e.g. git checkout -b my-new-branch).
|
||||
1. Make your proposed changes to the source
|
||||
1. Run your local version (e.g. bench start in your bench installation). Make sure that your changes work the way you want them to.
|
||||
1. Commit your changes to your branch. Make sure to use a semantic commit message.
|
||||
1. Push your branch to your fork on Github, and issue a pull request.
|
||||
|
||||
#### License
|
||||
|
||||
MIT
|
||||
AGPL
|
||||
|
||||
@@ -3,3 +3,5 @@ from __future__ import unicode_literals
|
||||
|
||||
__version__ = '0.0.1'
|
||||
|
||||
# load the methods from the lms api
|
||||
from .lms import api # noqa
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
// Copyright (c) 2021, Frappe and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Community Course', {
|
||||
});
|
||||
@@ -1,64 +0,0 @@
|
||||
{
|
||||
"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",
|
||||
"is_published"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "title",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Title",
|
||||
"reqd": 1,
|
||||
"unique": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "description",
|
||||
"fieldtype": "Markdown Editor",
|
||||
"label": "Description"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "is_published",
|
||||
"fieldtype": "Check",
|
||||
"label": "Published"
|
||||
}
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"is_published_field": "is_published",
|
||||
"links": [],
|
||||
"modified": "2021-03-02 12:25:25.235975",
|
||||
"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
|
||||
}
|
||||
],
|
||||
"search_fields": "title",
|
||||
"sort_field": "creation",
|
||||
"sort_order": "DESC",
|
||||
"title_field": "title",
|
||||
"track_changes": 1,
|
||||
"track_views": 1
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
{% extends "templates/web.html" %}
|
||||
|
||||
{% block page_content %}
|
||||
|
||||
<ol class="breadcrumb" itemscope="" itemtype="http://schema.org/BreadcrumbList">
|
||||
<li itemprop="itemListElement" itemscope="" itemtype="http://schema.org/ListItem" class="breadcrumb-item">
|
||||
<a itemprop="item" href="/courses">
|
||||
<span itemprop="name">← Courses</span>
|
||||
<meta itemprop="position" content="1">
|
||||
</a>
|
||||
<span itemprop="item">
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
<h1>{{ title }}</h1>
|
||||
|
||||
{{description}}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
<!-- this is a sample default web page template -->
|
||||
@@ -1,7 +0,0 @@
|
||||
<div class="card" style="width: 100%; margin: 5px 0px">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title"><a href="{{doc.route}}">{{doc.title}}</a></h5>
|
||||
<p class="card-text">{{doc.description}}</p>
|
||||
<a href="{{doc.route}}" class="card-link">See more →</a>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright (c) 2021, Frappe and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Community Project Like', {
|
||||
frappe.ui.form.on('Community Course Member', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
@@ -0,0 +1,96 @@
|
||||
{
|
||||
"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",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"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-04-06 11:50:41.551665",
|
||||
"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": "community-course-member",
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
# -*- 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 get_context(self, context):
|
||||
context.abbr = ("").join([ s[0] for s in self.full_name.split() ])
|
||||
return context
|
||||
|
||||
def validate(self):
|
||||
self.validate_user_name()
|
||||
if not self.route:
|
||||
self.route = 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": self.name
|
||||
})
|
||||
user.save(ignore_permissions=True)
|
||||
update_password_link = user.reset_password()
|
||||
return user, update_password_link
|
||||
@@ -0,0 +1,25 @@
|
||||
{% extends "templates/web.html" %}
|
||||
{% block page_content %}
|
||||
<div class="py-20 row">
|
||||
{% if photo %}
|
||||
<div class="col-sm-2 border border-dark">
|
||||
<img src="{{ photo }}" alt="{{ full_name }}">
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="col-sm-2">
|
||||
<div class="standard-image" style="font-size: 30px;">{{ abbr }}</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="col">
|
||||
<h1>{{ full_name }}</h1>
|
||||
{% if short_intro %}
|
||||
<p class="lead"> {{ short_intro }} </p>
|
||||
{% endif %}
|
||||
{% if bio %}
|
||||
<p class="markdown-style"> {{ frappe.utils.md_to_html(bio) }} </p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
<!-- this is a sample default web page template -->
|
||||
@@ -0,0 +1,4 @@
|
||||
<div>
|
||||
<a href="{{ doc.route }}">{{ doc.full_name }}</a>
|
||||
</div>
|
||||
<!-- this is a sample default list template -->
|
||||
@@ -6,5 +6,5 @@ from __future__ import unicode_literals
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
class TestCommunityCourseTopic(unittest.TestCase):
|
||||
class TestCommunityCourseMember(unittest.TestCase):
|
||||
pass
|
||||
@@ -1,8 +0,0 @@
|
||||
// Copyright (c) 2021, Frappe and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Community Course Topic', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
||||
@@ -1,10 +0,0 @@
|
||||
# -*- 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
|
||||
@@ -1,7 +0,0 @@
|
||||
{% extends "templates/web.html" %}
|
||||
|
||||
{% block page_content %}
|
||||
<h1>{{ title }}</h1>
|
||||
{% endblock %}
|
||||
|
||||
<!-- this is a sample default web page template -->
|
||||
@@ -1,17 +1,27 @@
|
||||
{
|
||||
"actions": [],
|
||||
"autoname": "field:full_name",
|
||||
"allow_guest_to_view": 1,
|
||||
"allow_rename": 1,
|
||||
"creation": "2021-02-12 15:47:23.591567",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"enabled",
|
||||
"full_name",
|
||||
"email",
|
||||
"enabled",
|
||||
"column_break_4",
|
||||
"username",
|
||||
"email_preference",
|
||||
"section_break_7",
|
||||
"bio",
|
||||
"section_break_9",
|
||||
"role",
|
||||
"photo",
|
||||
"column_break_12",
|
||||
"short_intro",
|
||||
"bio"
|
||||
"route",
|
||||
"abbr"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
@@ -24,9 +34,9 @@
|
||||
"fieldname": "full_name",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Full Name",
|
||||
"reqd": 1,
|
||||
"unique": 1
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"allow_in_quick_entry": 1,
|
||||
@@ -49,13 +59,63 @@
|
||||
{
|
||||
"allow_in_quick_entry": 1,
|
||||
"fieldname": "bio",
|
||||
"fieldtype": "HTML Editor",
|
||||
"fieldtype": "Markdown Editor",
|
||||
"label": "Bio"
|
||||
},
|
||||
{
|
||||
"fieldname": "route",
|
||||
"fieldtype": "Data",
|
||||
"label": "Route"
|
||||
},
|
||||
{
|
||||
"fieldname": "email",
|
||||
"fieldtype": "Data",
|
||||
"in_standard_filter": 1,
|
||||
"label": "Email",
|
||||
"options": "Email",
|
||||
"reqd": 1,
|
||||
"unique": 1
|
||||
},
|
||||
{
|
||||
"allow_in_quick_entry": 1,
|
||||
"fieldname": "username",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "User Name",
|
||||
"unique": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "email_preference",
|
||||
"fieldtype": "Select",
|
||||
"label": "Email preference",
|
||||
"options": "Email on every Message\nOne Digest Mail per day\nNever"
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_4",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "section_break_7",
|
||||
"fieldtype": "Section Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "section_break_9",
|
||||
"fieldtype": "Section Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_12",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "abbr",
|
||||
"fieldtype": "Data",
|
||||
"label": "Abbr",
|
||||
"read_only": 1
|
||||
}
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2021-02-15 12:16:32.428546",
|
||||
"modified": "2021-04-28 11:22:35.402217",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Community",
|
||||
"name": "Community Member",
|
||||
@@ -87,7 +147,9 @@
|
||||
}
|
||||
],
|
||||
"quick_entry": 1,
|
||||
"search_fields": "full_name",
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"title_field": "full_name",
|
||||
"track_changes": 1
|
||||
}
|
||||
@@ -3,8 +3,62 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
# import frappe
|
||||
import frappe
|
||||
import re
|
||||
from frappe import _
|
||||
from frappe.model.document import Document
|
||||
import random
|
||||
|
||||
class CommunityMember(Document):
|
||||
pass
|
||||
|
||||
def validate(self):
|
||||
self.validate_username()
|
||||
self.abbr = ("").join([ s[0] for s in self.full_name.split() ])
|
||||
if self.route != self.username:
|
||||
self.route = self.username
|
||||
|
||||
def validate_username(self):
|
||||
if not self.username:
|
||||
self.username = create_username_from_email(self.email)
|
||||
|
||||
if self.username:
|
||||
if len(self.username) < 4:
|
||||
frappe.throw(_("Username must be atleast 4 characters long."))
|
||||
if not re.match("^[A-Za-z0-9_]*$", self.username):
|
||||
frappe.throw(_("Username can only contain alphabets, numbers and underscore."))
|
||||
self.username = self.username.lower()
|
||||
|
||||
def __repr__(self):
|
||||
return f"<CommunityMember: {self.email}>"
|
||||
|
||||
def create_member_from_user(doc, method):
|
||||
username = doc.username
|
||||
|
||||
if ( doc.username and username_exists(doc.username)) or not doc.username:
|
||||
username = create_username_from_email(doc.email)
|
||||
|
||||
elif len(doc.username) < 4:
|
||||
username = adjust_username(doc.username)
|
||||
|
||||
if username_exists(username):
|
||||
username = username + str(random.randint(0,9))
|
||||
|
||||
member = frappe.get_doc({
|
||||
"doctype": "Community Member",
|
||||
"full_name": doc.full_name,
|
||||
"username": username,
|
||||
"email": doc.email,
|
||||
"route": doc.username,
|
||||
"owner": doc.email
|
||||
})
|
||||
member.save(ignore_permissions=True)
|
||||
|
||||
def username_exists(username):
|
||||
return frappe.db.exists("Community Member", dict(username=username))
|
||||
|
||||
def create_username_from_email(email):
|
||||
string = email.split("@")[0]
|
||||
return ''.join(e for e in string if e.isalnum())
|
||||
|
||||
def adjust_username(username):
|
||||
return username.ljust(4, str(random.randint(0,9)))
|
||||
@@ -0,0 +1,25 @@
|
||||
{% extends "templates/web.html" %}
|
||||
{% block page_content %}
|
||||
<div class="py-20 row">
|
||||
{% if photo %}
|
||||
<div class="col-sm-2 border border-dark">
|
||||
<img src="{{ photo }}" alt="{{ full_name }}">
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="col-sm-2">
|
||||
<div class="standard-image" style="font-size: 30px;">{{ abbr }}</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="col">
|
||||
<h1>{{ full_name }}</h1>
|
||||
{% if short_intro %}
|
||||
<p class="lead"> {{ short_intro }} </p>
|
||||
{% endif %}
|
||||
{% if bio %}
|
||||
<p class="markdown-style"> {{ frappe.utils.md_to_html(bio) }} </p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
<!-- this is a sample default web page template -->
|
||||
@@ -2,9 +2,91 @@
|
||||
# Copyright (c) 2021, Frappe and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
from community.lms.doctype.lms_course.test_lms_course import new_user
|
||||
import frappe
|
||||
import unittest
|
||||
|
||||
class TestCommunityMember(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@classmethod
|
||||
def setUpClass(self):
|
||||
users = ["test_user@example.com","test_user1@example.com"]
|
||||
|
||||
for user in users:
|
||||
if not frappe.db.exists("User", user):
|
||||
new_user("Test User", user)
|
||||
|
||||
def test_member_created_from_user(self):
|
||||
user = frappe.db.get_value("User","test_user@example.com", ["full_name", "email", "username"], as_dict=True)
|
||||
self.assertTrue(frappe.db.exists("Community Member", {"username":user.username}))
|
||||
|
||||
member = frappe.db.get_value("Community Member",
|
||||
filters={"email": user.email},
|
||||
fieldname=["full_name", "email", "owner", "username", "route"],
|
||||
as_dict=True
|
||||
)
|
||||
|
||||
self.assertEqual(user.full_name, member.full_name)
|
||||
self.assertEqual(member.owner, user.email)
|
||||
self.assertEqual(user.username, member.username)
|
||||
self.assertEqual(member.username, member.route)
|
||||
|
||||
def test_members_with_same_name(self):
|
||||
user1 = frappe.db.get_value("User","test_user@example.com", ["email"], as_dict=True)
|
||||
user2 = frappe.get_doc("User","test_user1@example.com", ["email"], as_dict=True)
|
||||
|
||||
self.assertTrue(frappe.db.exists("Community Member", {"email": user1.email} ))
|
||||
self.assertTrue(frappe.db.exists("Community Member", {"email": user2.email }))
|
||||
|
||||
member1 = frappe.db.get_value("Community Member",
|
||||
filters={"email": user1.email},
|
||||
fieldname=["full_name", "email", "owner", "username", "route"],
|
||||
as_dict=True
|
||||
)
|
||||
member2 = frappe.db.get_value("Community Member",
|
||||
filters={"email": user2.email},
|
||||
fieldname=["full_name", "email", "owner", "username", "route"],
|
||||
as_dict=True
|
||||
)
|
||||
|
||||
self.assertEqual(member1.full_name, member2.full_name)
|
||||
self.assertEqual(member1.email, user1.email)
|
||||
self.assertEqual(member2.email, user2.email)
|
||||
self.assertNotEqual(member1.username, member2.username)
|
||||
|
||||
def test_username_validations(self):
|
||||
user = new_user("Tst", "tst@example.com")
|
||||
self.assertTrue(frappe.db.exists("Community Member", {"email":user.email} ))
|
||||
|
||||
member = frappe.db.get_value("Community Member",
|
||||
filters={"email": user.email},
|
||||
fieldname=["username"],
|
||||
as_dict=True
|
||||
)
|
||||
|
||||
self.assertEqual(len(member.username), 4)
|
||||
frappe.delete_doc("User", user.email)
|
||||
|
||||
def test_user_without_username(self):
|
||||
user = new_user("Test User", "test_user2@example.com")
|
||||
self.assertTrue(frappe.db.exists("Community Member", {"email":user.email} ))
|
||||
|
||||
member = frappe.db.get_value("Community Member",
|
||||
filters={"email": user.email},
|
||||
fieldname=["username"],
|
||||
as_dict=True
|
||||
)
|
||||
|
||||
self.assertTrue(member.username)
|
||||
frappe.delete_doc("User", user.email)
|
||||
|
||||
@classmethod
|
||||
def tearDownClass(self):
|
||||
users = ["test_user@example.com","test_user1@example.com"]
|
||||
|
||||
for user in users:
|
||||
if frappe.db.exists("User", user):
|
||||
frappe.delete_doc("User", user)
|
||||
|
||||
if frappe.db.exists("Community Member", {"email": user}):
|
||||
frappe.delete_doc("Community Member", {"email": user})
|
||||
@@ -6,5 +6,5 @@ from __future__ import unicode_literals
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
class TestCommunityCourse(unittest.TestCase):
|
||||
class TestTShirtSizes(unittest.TestCase):
|
||||
pass
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright (c) 2021, Frappe and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Community Project', {
|
||||
frappe.ui.form.on('TShirt Sizes', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
49
community/community/doctype/tshirt_sizes/tshirt_sizes.json
Normal file
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"actions": [],
|
||||
"creation": "2021-02-25 17:52:49.813558",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"size",
|
||||
"quantity"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "size",
|
||||
"fieldtype": "Select",
|
||||
"label": "Size",
|
||||
"options": "S\nM\nL\nXL\nXXL\nXXXL"
|
||||
},
|
||||
{
|
||||
"fieldname": "quantity",
|
||||
"fieldtype": "Int",
|
||||
"label": "Quantity"
|
||||
}
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2021-02-25 17:52:49.813558",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Community",
|
||||
"name": "TShirt Sizes",
|
||||
"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
|
||||
}
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
# import frappe
|
||||
from frappe.website.website_generator import WebsiteGenerator
|
||||
from frappe.model.document import Document
|
||||
|
||||
class CommunityCourse(WebsiteGenerator):
|
||||
class TShirtSizes(Document):
|
||||
pass
|
||||
@@ -1 +1,16 @@
|
||||
import frappe
|
||||
import frappe
|
||||
|
||||
def create_members_from_users():
|
||||
users = frappe.get_all("User", {"enabled": 1}, ["email"])
|
||||
for user in users:
|
||||
if not frappe.db.get_value("Community Member", {"email": user.email}, "name"):
|
||||
doc = frappe.get_doc("User", {"email": user.email})
|
||||
username = doc.username if doc.username and len(doc.username) > 3 else ("").join([ s for s in doc.full_name.split() ])
|
||||
if not frappe.db.exists("Community Member", username):
|
||||
member = frappe.new_doc("Community Member")
|
||||
member.full_name = doc.full_name
|
||||
member.username = username
|
||||
member.email = doc.email
|
||||
member.route = username
|
||||
member.owner = doc.email
|
||||
member.insert(ignore_permissions=True)
|
||||
@@ -0,0 +1,5 @@
|
||||
frappe.ready(function() {
|
||||
frappe.web_form.after_save = () => {
|
||||
window.location.href = frappe.web_form.get_value("username")
|
||||
}
|
||||
})
|
||||
100
community/community/web_form/update_profile/update_profile.json
Normal file
@@ -0,0 +1,100 @@
|
||||
{
|
||||
"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,
|
||||
"breadcrumbs": "",
|
||||
"button_label": "Save",
|
||||
"creation": "2021-03-09 17:34:03.394301",
|
||||
"doc_type": "Community Member",
|
||||
"docstatus": 0,
|
||||
"doctype": "Web Form",
|
||||
"idx": 0,
|
||||
"is_standard": 1,
|
||||
"login_required": 1,
|
||||
"max_attachment_size": 0,
|
||||
"modified": "2021-03-22 12:04:22.571655",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Community",
|
||||
"name": "update-profile",
|
||||
"owner": "Administrator",
|
||||
"payment_button_label": "Buy Now",
|
||||
"published": 1,
|
||||
"route": "edit-profile",
|
||||
"route_to_success_link": 0,
|
||||
"show_attachments": 0,
|
||||
"show_in_grid": 0,
|
||||
"show_sidebar": 0,
|
||||
"sidebar_items": [],
|
||||
"success_message": "Profile updated successfully.",
|
||||
"success_url": "/",
|
||||
"title": "Update Profile",
|
||||
"web_form_fields": [
|
||||
{
|
||||
"allow_read_on_all_link_options": 0,
|
||||
"fieldname": "full_name",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"label": "Full Name",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"read_only": 0,
|
||||
"reqd": 1,
|
||||
"show_in_filter": 0
|
||||
},
|
||||
{
|
||||
"allow_read_on_all_link_options": 0,
|
||||
"fieldname": "username",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"label": "User Name",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"read_only": 0,
|
||||
"reqd": 1,
|
||||
"show_in_filter": 0
|
||||
},
|
||||
{
|
||||
"allow_read_on_all_link_options": 0,
|
||||
"fieldname": "short_intro",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"label": "Short Intro",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"read_only": 0,
|
||||
"reqd": 0,
|
||||
"show_in_filter": 0
|
||||
},
|
||||
{
|
||||
"allow_read_on_all_link_options": 0,
|
||||
"fieldname": "bio",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"label": "Bio",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"read_only": 0,
|
||||
"reqd": 0,
|
||||
"show_in_filter": 0
|
||||
},
|
||||
{
|
||||
"allow_read_on_all_link_options": 0,
|
||||
"fieldname": "photo",
|
||||
"fieldtype": "Attach Image",
|
||||
"hidden": 0,
|
||||
"label": "Photo",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"read_only": 0,
|
||||
"reqd": 0,
|
||||
"show_in_filter": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
|
||||
def get_context(context):
|
||||
# do your magic here
|
||||
pass
|
||||
@@ -0,0 +1,8 @@
|
||||
// Copyright (c) 2021, FOSS United and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Community Conference', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
||||
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"actions": [],
|
||||
"autoname": "field:conference_name",
|
||||
"creation": "2021-02-25 17:12:51.981534",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"conference_name",
|
||||
"live_stream_url",
|
||||
"conference_details"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "conference_name",
|
||||
"fieldtype": "Data",
|
||||
"label": "Conference Name",
|
||||
"unique": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "live_stream_url",
|
||||
"fieldtype": "Data",
|
||||
"label": "Live Stream URL"
|
||||
},
|
||||
{
|
||||
"fieldname": "conference_details",
|
||||
"fieldtype": "Markdown Editor",
|
||||
"label": "Conference Details"
|
||||
}
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2021-04-06 18:30:18.228083",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Conference",
|
||||
"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
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, FOSS United 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
|
||||
@@ -0,0 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, FOSS United and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
class TestCommunityConference(unittest.TestCase):
|
||||
pass
|
||||
@@ -0,0 +1,8 @@
|
||||
// Copyright (c) 2021, FOSS United and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Community Conference Participant', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
||||
@@ -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-03-04 20:13:42.151103",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Conference",
|
||||
"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
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, FOSS United 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
|
||||
@@ -0,0 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, FOSS United and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
class TestCommunityConferenceParticipant(unittest.TestCase):
|
||||
pass
|
||||
@@ -0,0 +1,8 @@
|
||||
// Copyright (c) 2021, FOSS United and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Community Conference Request', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
||||
@@ -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-03-04 20:13:26.130017",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Conference",
|
||||
"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
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, FOSS United 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
|
||||
@@ -0,0 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, FOSS United and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
class TestCommunityConferenceRequest(unittest.TestCase):
|
||||
pass
|
||||
35
community/hackathon/README.md
Normal file
@@ -0,0 +1,35 @@
|
||||
The Hackathon module allows Community Members to organize and manage hackathons. Community Members can view these hackathons on the portal.
|
||||
|
||||
<img class="screenshot" src="/community/hackathon/images/hackathons-portal.png">
|
||||
|
||||
### 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.
|
||||
|
||||
<img class="screenshot" src="/community/hackathon/images/community-hackathon.png">
|
||||
|
||||
##### 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.
|
||||
|
||||
<img class="screenshot" src="/community/hackathon/images/project-1.png">
|
||||
<img class="screenshot" src="/community/hackathon/images/project-2.png">
|
||||
|
||||
1. Projects are visible on the portal as well.
|
||||
<img class="screenshot" src="/community/hackathon/images/project-portal.png">
|
||||
<img class="screenshot" src="/community/hackathon/images/project-details.png">
|
||||
|
||||
##### 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.
|
||||
<img class="screenshot" src="/community/hackathon/images/project-join-request.png">
|
||||
1. Project owners can review the requests and accept/reject the members.
|
||||
0
community/hackathon/__init__.py
Normal file
0
community/hackathon/doctype/__init__.py
Normal file
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2021, Frappe and contributors
|
||||
// Copyright (c) 2021, FOSS United and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Community Hackathon', {
|
||||
@@ -21,9 +21,9 @@
|
||||
},
|
||||
{
|
||||
"fieldname": "organizer",
|
||||
"fieldtype": "Data",
|
||||
"fieldtype": "Link",
|
||||
"label": "Organizer",
|
||||
"options": "Email"
|
||||
"options": "Community Member"
|
||||
},
|
||||
{
|
||||
"fieldname": "year",
|
||||
@@ -34,9 +34,9 @@
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2021-02-17 12:44:25.198010",
|
||||
"modified": "2021-04-14 11:43:23.515972",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Community",
|
||||
"module": "Hackathon",
|
||||
"name": "Community Hackathon",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
@@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, Frappe and contributors
|
||||
# Copyright (c) 2021, FOSS United and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
@@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, Frappe and Contributors
|
||||
# Copyright (c) 2021, FOSS United and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
// Copyright (c) 2021, FOSS United and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Community Project', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"actions": [],
|
||||
"allow_import": 1,
|
||||
"autoname": "field:project_name",
|
||||
"creation": "2021-02-12 18:28:33.440328",
|
||||
"doctype": "DocType",
|
||||
@@ -7,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"
|
||||
],
|
||||
@@ -58,6 +63,12 @@
|
||||
"fieldtype": "Markdown Editor",
|
||||
"label": "Project Description"
|
||||
},
|
||||
{
|
||||
"fieldname": "hackathon",
|
||||
"fieldtype": "Link",
|
||||
"label": "Hackathon",
|
||||
"options": "Community Hackathon"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "accepting_members",
|
||||
@@ -77,17 +88,27 @@
|
||||
"label": "Project Search"
|
||||
},
|
||||
{
|
||||
"fieldname": "hackathon",
|
||||
"fieldtype": "Link",
|
||||
"label": "Hackathon",
|
||||
"options": "Community Hackathon"
|
||||
"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-02-23 11:21:47.948253",
|
||||
"modified": "2021-04-20 13:22:17.248521",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Community",
|
||||
"module": "Hackathon",
|
||||
"name": "Community Project",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
@@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, Frappe and contributors
|
||||
# Copyright (c) 2021, FOSS United and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
@@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, Frappe and Contributors
|
||||
# Copyright (c) 2021, FOSS United and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2021, Frappe and contributors
|
||||
// Copyright (c) 2021, FOSS United and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Community Project Evaluation', {
|
||||
@@ -123,9 +123,9 @@
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2021-02-12 19:44:57.467599",
|
||||
"modified": "2021-03-04 19:56:53.757808",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Community",
|
||||
"module": "Hackathon",
|
||||
"name": "Community Project Evaluation",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
@@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, Frappe and contributors
|
||||
# Copyright (c) 2021, FOSS United and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
@@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, Frappe and Contributors
|
||||
# Copyright (c) 2021, FOSS United and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
// Copyright (c) 2021, FOSS United and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Community Project Like', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
||||
@@ -17,9 +17,9 @@
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2021-02-12 18:43:24.206708",
|
||||
"modified": "2021-03-04 18:55:51.877522",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Community",
|
||||
"module": "Hackathon",
|
||||
"name": "Community Project Like",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
@@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, Frappe and contributors
|
||||
# Copyright (c) 2021, FOSS United and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
@@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, Frappe and Contributors
|
||||
# Copyright (c) 2021, FOSS United and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2021, Frappe and contributors
|
||||
// Copyright (c) 2021, FOSS United and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Community Project Member', {
|
||||
@@ -42,9 +42,9 @@
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2021-02-16 19:27:30.842282",
|
||||
"modified": "2021-03-04 19:44:09.832170",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Community",
|
||||
"module": "Hackathon",
|
||||
"name": "Community Project Member",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
@@ -1,17 +1,16 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, Frappe and contributors
|
||||
# Copyright (c) 2021, FOSS United and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe import _
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class CommunityProjectMember(Document):
|
||||
|
||||
def validate(self):
|
||||
self.validate_if_already_member()
|
||||
|
||||
def validate_if_already_member(self):
|
||||
if frappe.get_all("Community Project Member", {"owner": self.owner}):
|
||||
frappe.throw(_("You have already applied for the membership of this project."))
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, Frappe and Contributors
|
||||
# Copyright (c) 2021, FOSS United and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2021, Frappe and contributors
|
||||
// Copyright (c) 2021, FOSS United and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Community Project Update', {
|
||||
@@ -27,9 +27,9 @@
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2021-02-12 18:45:56.750969",
|
||||
"modified": "2021-03-04 19:43:10.886773",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Community",
|
||||
"module": "Hackathon",
|
||||
"name": "Community Project Update",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
@@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, Frappe and contributors
|
||||
# Copyright (c) 2021, FOSS United and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
@@ -1,5 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, Frappe and Contributors
|
||||
# Copyright (c) 2021, FOSS United and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
BIN
community/hackathon/images/community-hackathon.png
Normal file
|
After Width: | Height: | Size: 49 KiB |
BIN
community/hackathon/images/hackathons-portal.png
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
community/hackathon/images/project-1.png
Normal file
|
After Width: | Height: | Size: 58 KiB |
BIN
community/hackathon/images/project-2.png
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
community/hackathon/images/project-details.png
Normal file
|
After Width: | Height: | Size: 139 KiB |
BIN
community/hackathon/images/project-join-request.png
Normal file
|
After Width: | Height: | Size: 46 KiB |
BIN
community/hackathon/images/project-portal.png
Normal file
|
After Width: | Height: | Size: 111 KiB |
0
community/hackathon/web_form/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
frappe.ready(function() {
|
||||
// bind events here
|
||||
})
|
||||
64
community/hackathon/web_form/join_request/join_request.json
Normal file
@@ -0,0 +1,64 @@
|
||||
{
|
||||
"accept_payment": 0,
|
||||
"allow_comments": 0,
|
||||
"allow_delete": 0,
|
||||
"allow_edit": 0,
|
||||
"allow_incomplete": 0,
|
||||
"allow_multiple": 0,
|
||||
"allow_print": 0,
|
||||
"amount": 0.0,
|
||||
"amount_based_on_field": 0,
|
||||
"apply_document_permissions": 0,
|
||||
"button_label": "Send Request",
|
||||
"client_script": "$('.page-header h2').html(`Request to Join \"${frappe.utils.get_url_arg('project_name')}\"`);",
|
||||
"creation": "2021-02-17 13:20:08.548735",
|
||||
"doc_type": "Community Project Member",
|
||||
"docstatus": 0,
|
||||
"doctype": "Web Form",
|
||||
"idx": 0,
|
||||
"is_standard": 1,
|
||||
"login_required": 1,
|
||||
"max_attachment_size": 0,
|
||||
"modified": "2021-04-14 13:52:46.135536",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Hackathon",
|
||||
"name": "join-request",
|
||||
"owner": "Administrator",
|
||||
"payment_button_label": "Buy Now",
|
||||
"published": 1,
|
||||
"route": "join-request",
|
||||
"route_to_success_link": 0,
|
||||
"show_attachments": 0,
|
||||
"show_in_grid": 0,
|
||||
"show_sidebar": 0,
|
||||
"sidebar_items": [],
|
||||
"success_url": "/join-request",
|
||||
"title": "Join Request",
|
||||
"web_form_fields": [
|
||||
{
|
||||
"allow_read_on_all_link_options": 0,
|
||||
"fieldname": "project",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"label": "Project",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"options": "Community Project",
|
||||
"read_only": 0,
|
||||
"reqd": 1,
|
||||
"show_in_filter": 0
|
||||
},
|
||||
{
|
||||
"allow_read_on_all_link_options": 0,
|
||||
"fieldname": "intro",
|
||||
"fieldtype": "Small Text",
|
||||
"hidden": 0,
|
||||
"label": "Intro",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"read_only": 0,
|
||||
"reqd": 1,
|
||||
"show_in_filter": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
|
||||
def get_context(context):
|
||||
# do your magic here
|
||||
pass
|
||||
0
community/hackathon/web_form/project/__init__.py
Normal file
3
community/hackathon/web_form/project/project.js
Normal file
@@ -0,0 +1,3 @@
|
||||
frappe.ready(function() {
|
||||
// bind events here
|
||||
})
|
||||
49
community/hackathon/web_form/project/project.json
Normal file
@@ -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": "<div class=\"ql-editor read-mode\"><p>Add details about your project.</p><p><br></p><p><strong>Note:</strong> 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.</p></div>",
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||