Compare commits
341 Commits
learn-page
...
version-13
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f38b1226df | ||
|
|
1f3513db8b | ||
|
|
3eb0f13fb0 | ||
|
|
1277133ec6 | ||
|
|
7337aea0dc | ||
|
|
32b601cf34 | ||
|
|
d4dc901925 | ||
|
|
64e581533b | ||
|
|
0873d704d2 | ||
|
|
8ee57f0254 | ||
|
|
7c5021132d | ||
|
|
740c0d10ca | ||
|
|
a78019ccbc | ||
|
|
66f6c1fd46 | ||
|
|
aaa845a0f8 | ||
|
|
2a56b7ade2 | ||
|
|
cf8be3ca21 | ||
|
|
715a1b5df5 | ||
|
|
0a374a0e78 | ||
|
|
36996a54a5 | ||
|
|
3f687e4c4a | ||
|
|
315d373d2d | ||
|
|
6ae346df44 | ||
|
|
9582a27dc6 | ||
|
|
6195d72c3c | ||
|
|
3f0309c36a | ||
|
|
08ea7401cc | ||
|
|
f3d7f09476 | ||
|
|
36150d5b09 | ||
|
|
e5deb2ddd7 | ||
|
|
d60aa54903 | ||
|
|
2627cee938 | ||
|
|
e7f47a4485 | ||
|
|
5bfe56c091 | ||
|
|
f08586ee12 | ||
|
|
af17270c52 | ||
|
|
06b4062003 | ||
|
|
6cba6972bc | ||
|
|
f7a23e629c | ||
|
|
e67b37be28 | ||
|
|
1fa7dfe41f | ||
|
|
e781071ebf | ||
|
|
1697c5d5b5 | ||
|
|
091fefb601 | ||
|
|
7939e6c619 | ||
|
|
f8788dc32c | ||
|
|
4db51bff79 | ||
|
|
6f96da74c7 | ||
|
|
f1692763d3 | ||
|
|
43311dfb73 | ||
|
|
125b8d61d9 | ||
|
|
27b92607c4 | ||
|
|
c238c6cc05 | ||
|
|
fc8a702f2f | ||
|
|
a01c80794c | ||
|
|
1f6bdfbaa0 | ||
|
|
a650a31990 | ||
|
|
12c00ae6c6 | ||
|
|
857f170034 | ||
|
|
41f7be4ebc | ||
|
|
f95b9b4f00 | ||
|
|
6aa30cc8ba | ||
|
|
1d4037fcc5 | ||
|
|
59e853a012 | ||
|
|
79bca49fb8 | ||
|
|
05b0ca49fa | ||
|
|
8483b7b86b | ||
|
|
050cfa494c | ||
|
|
866829af97 | ||
|
|
0cd52b7220 | ||
|
|
b922af1411 | ||
|
|
ce01e83382 | ||
|
|
60393e048e | ||
|
|
1f7e2cd0cc | ||
|
|
747828b363 | ||
|
|
b722eedb05 | ||
|
|
2f664faea9 | ||
|
|
e9b545c488 | ||
|
|
bb62f626fd | ||
|
|
58fe403bd0 | ||
|
|
5ae5bab76b | ||
|
|
049c374ece | ||
|
|
66e8ac9cae | ||
|
|
f5af07086b | ||
|
|
4d534db63f | ||
|
|
aec69e96cb | ||
|
|
6172b09aa3 | ||
|
|
98c386729c | ||
|
|
91ebcd8253 | ||
|
|
3a51299e8d | ||
|
|
eaa8876f4e | ||
|
|
7d80178b48 | ||
|
|
8090f2f397 | ||
|
|
bf986e26bc | ||
|
|
c95d957d2c | ||
|
|
b1aaddae59 | ||
|
|
8fe9bad2bb | ||
|
|
23dab6312d | ||
|
|
c91b1a7a23 | ||
|
|
d07dbcc50a | ||
|
|
49771a627d | ||
|
|
25ec4ae7c6 | ||
|
|
13022e0bcc | ||
|
|
cdc4b6992d | ||
|
|
f178f3806d | ||
|
|
d84f621813 | ||
|
|
7ba2ac1efd | ||
|
|
658a9e6172 | ||
|
|
0b44e78cc2 | ||
|
|
1c5766d022 | ||
|
|
3bff000cc9 | ||
|
|
30a8750f16 | ||
|
|
f3ad3f6d18 | ||
|
|
65a7dde47b | ||
|
|
38ebab59c7 | ||
|
|
b7f79b4832 | ||
|
|
876a2f562f | ||
|
|
5f4fc2fb59 | ||
|
|
44e8efd39b | ||
|
|
51c625da4d | ||
|
|
a795cd23a8 | ||
|
|
ebc3cf1cbf | ||
|
|
c717b3ba9d | ||
|
|
0ed3c87f79 | ||
|
|
9499700988 | ||
|
|
8366721643 | ||
|
|
66afd0fcdd | ||
|
|
a105a1d3b4 | ||
|
|
5488947922 | ||
|
|
aa466f9fb7 | ||
|
|
b3840e056f | ||
|
|
ddffc8372b | ||
|
|
dc877a9c09 | ||
|
|
04d2384283 | ||
|
|
50938afe77 | ||
|
|
ea6bd1f598 | ||
|
|
fb0f9885c1 | ||
|
|
4248a3af07 | ||
|
|
a3dc2402f7 | ||
|
|
153b439510 | ||
|
|
06b925435d | ||
|
|
93c2c3cc45 | ||
|
|
04a3d58028 | ||
|
|
8551cfa32e | ||
|
|
b19c7f2fac | ||
|
|
d135338088 | ||
|
|
b8fae5cd28 | ||
|
|
29fe75d807 | ||
|
|
1dbbf7c769 | ||
|
|
3be20b5658 | ||
|
|
73b6ddf365 | ||
|
|
64048a8a18 | ||
|
|
e245af57a8 | ||
|
|
0ab708396a | ||
|
|
29855a0cbc | ||
|
|
ff6457171f | ||
|
|
9fd59b5d38 | ||
|
|
c750c62993 | ||
|
|
a0d90ab16b | ||
|
|
af15d978c6 | ||
|
|
f4271e7c0e | ||
|
|
0440e1062d | ||
|
|
2bc30d696a | ||
|
|
6dcd210031 | ||
|
|
c78c4c92b7 | ||
|
|
6a2c749a86 | ||
|
|
56d738474a | ||
|
|
7721f31342 | ||
|
|
90e268ff2f | ||
|
|
69bdb75625 | ||
|
|
a0b77f5d08 | ||
|
|
77c4b53b71 | ||
|
|
035a674cff | ||
|
|
b9736cc6d6 | ||
|
|
f52e5067b6 | ||
|
|
d657525359 | ||
|
|
3a2ebd42a7 | ||
|
|
916e64d607 | ||
|
|
e0b25c1e6e | ||
|
|
13b968e18c | ||
|
|
9e1daf5062 | ||
|
|
941a34784c | ||
|
|
cd4ffa2eff | ||
|
|
17a7af74f2 | ||
|
|
ff22eaa606 | ||
|
|
417436d7b6 | ||
|
|
f228489173 | ||
|
|
a49563e23f | ||
|
|
b3403b78ee | ||
|
|
7a9039090d | ||
|
|
289195e6c9 | ||
|
|
e6502784ea | ||
|
|
54f301e8eb | ||
|
|
ed91801769 | ||
|
|
6965148e4e | ||
|
|
b5481e1dd5 | ||
|
|
4ec9b56366 | ||
|
|
530fcf9a39 | ||
|
|
ff1363b437 | ||
|
|
952e3a9906 | ||
|
|
9d530e35fb | ||
|
|
2c2ad78eb7 | ||
|
|
f61c5a2fa1 | ||
|
|
3e24ff9678 | ||
|
|
b0280c3be4 | ||
|
|
b10eb5c979 | ||
|
|
e2072c72da | ||
|
|
84a43912db | ||
|
|
841819436a | ||
|
|
14a984c75f | ||
|
|
445de61ce4 | ||
|
|
f83007788d | ||
|
|
aefee791ca | ||
|
|
00154d80df | ||
|
|
a1e12d29ac | ||
|
|
5069832165 | ||
|
|
e2cb003935 | ||
|
|
b83a10c282 | ||
|
|
c6fc0a22d2 | ||
|
|
c6d3994383 | ||
|
|
07f9721aeb | ||
|
|
dba956e473 | ||
|
|
2894a5e479 | ||
|
|
ad0913500c | ||
|
|
79a765b725 | ||
|
|
eaec991f47 | ||
|
|
e31b189045 | ||
|
|
eb58b1c149 | ||
|
|
af9760f944 | ||
|
|
21b2412362 | ||
|
|
7e5e167eec | ||
|
|
7bf254319b | ||
|
|
d7e1745c09 | ||
|
|
ef238c1b25 | ||
|
|
cb60d97bb7 | ||
|
|
7c3189e273 | ||
|
|
ace74febc7 | ||
|
|
8dbdabd52c | ||
|
|
f0ee8d7b88 | ||
|
|
7e5203f058 | ||
|
|
a3672e9d91 | ||
|
|
7017382451 | ||
|
|
6c9d49bf8c | ||
|
|
2de058246b | ||
|
|
798ea30382 | ||
|
|
3e2c6b3343 | ||
|
|
5ea744de5c | ||
|
|
aedb3d3d45 | ||
|
|
83a2f42df9 | ||
|
|
66aace247c | ||
|
|
bc3db06960 | ||
|
|
ddaa063587 | ||
|
|
f9b4fe468e | ||
|
|
6cbca8d1bb | ||
|
|
d5067a4bcd | ||
|
|
04d44510de | ||
|
|
844fcc9bca | ||
|
|
145b5efab0 | ||
|
|
4079ed97b9 | ||
|
|
63d70fc037 | ||
|
|
ce86b5deda | ||
|
|
037e946bbe | ||
|
|
a51c8de1eb | ||
|
|
53dc517180 | ||
|
|
44ca940c6b | ||
|
|
c0b688c720 | ||
|
|
861d5f231d | ||
|
|
d14b4f55a6 | ||
|
|
db9a6c3eda | ||
|
|
a667643681 | ||
|
|
f278e4b6a5 | ||
|
|
33a12c2dec | ||
|
|
508f90f459 | ||
|
|
709f0c2274 | ||
|
|
be47700e7c | ||
|
|
40842830a4 | ||
|
|
11d070fa0d | ||
|
|
dd2f830a33 | ||
|
|
5431fcb450 | ||
|
|
324033e9ee | ||
|
|
86596d0cfe | ||
|
|
9323cfd748 | ||
|
|
d125b02cec | ||
|
|
282c4c5351 | ||
|
|
276d64a66a | ||
|
|
79eb381a41 | ||
|
|
44f9c0dfd3 | ||
|
|
0ca4cd724e | ||
|
|
8a3e31f021 | ||
|
|
9be8a1af0b | ||
|
|
b9cac20613 | ||
|
|
e6d5e6d37b | ||
|
|
0abfcac7da | ||
|
|
b70e8b9acc | ||
|
|
3b1e1aa3c3 | ||
|
|
8f74c74d50 | ||
|
|
d2f435016c | ||
|
|
389b35802b | ||
|
|
a9192a74f9 | ||
|
|
1366c7cf75 | ||
|
|
eaa9e8e3ea | ||
|
|
5ecae0df61 | ||
|
|
4891be1d8c | ||
|
|
ec852fc255 | ||
|
|
47f2d3cb7b | ||
|
|
37820c1e19 | ||
|
|
230fab3bb2 | ||
|
|
d292d2d093 | ||
|
|
51d5db01e9 | ||
|
|
0fd760df81 | ||
|
|
71d0a89968 | ||
|
|
d939a63412 | ||
|
|
daaa2d2fe2 | ||
|
|
6dd7cb19df | ||
|
|
b1de2481a8 | ||
|
|
27c01b3b0c | ||
|
|
b7aa9aff51 | ||
|
|
524a041fb9 | ||
|
|
9de0203914 | ||
|
|
0ed5309b97 | ||
|
|
68fd32d536 | ||
|
|
5ea3b25d21 | ||
|
|
2c24412633 | ||
|
|
1b8a45ba4a | ||
|
|
3dd4adbc1f | ||
|
|
0c52c9c4bc | ||
|
|
9caf44cdbd | ||
|
|
45d88bdc08 | ||
|
|
94b3ccd3d9 | ||
|
|
ee8273fd30 | ||
|
|
60c1449f40 | ||
|
|
67708325ae | ||
|
|
3e99577401 | ||
|
|
5e916dc2c8 | ||
|
|
0c64d46e99 | ||
|
|
3aa974f8bd | ||
|
|
621d01d502 | ||
|
|
aa20136223 | ||
|
|
9bc5408a44 | ||
|
|
5a7afb3092 | ||
|
|
f8948ac2ef |
19
.github/workflows/ci.yml
vendored
@@ -6,7 +6,7 @@ on:
|
||||
pull_request: {}
|
||||
jobs:
|
||||
tests:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-latest
|
||||
services:
|
||||
redis-cache:
|
||||
image: redis:alpine
|
||||
@@ -32,7 +32,7 @@ jobs:
|
||||
- name: setup python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: 3.9
|
||||
python-version: '3.9'
|
||||
- name: setup node
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
@@ -53,19 +53,22 @@ jobs:
|
||||
then
|
||||
(cd && tar xzf ~/bench-cache/bench.tgz)
|
||||
else
|
||||
bench init ~/frappe-bench --skip-redis-config-generation
|
||||
bench init ~/frappe-bench --skip-redis-config-generation --skip-assets --python "$(which python)"
|
||||
mkdir -p ~/bench-cache
|
||||
(cd && tar czf ~/bench-cache/bench.tgz frappe-bench)
|
||||
fi
|
||||
- name: add community app to bench
|
||||
- name: add lms app to bench
|
||||
working-directory: /home/runner/frappe-bench
|
||||
run: bench get-app community $GITHUB_WORKSPACE
|
||||
run: bench get-app lms $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
|
||||
- name: install lms app
|
||||
working-directory: /home/runner/frappe-bench
|
||||
run: bench --verbose --site frappe.local install-app community
|
||||
run: bench --verbose --site frappe.local install-app lms
|
||||
- name: setup requirements
|
||||
working-directory: /home/runner/frappe-bench
|
||||
run: bench setup requirements --dev
|
||||
- name: allow tests
|
||||
working-directory: /home/runner/frappe-bench
|
||||
run: bench --site frappe.local set-config allow_tests true
|
||||
@@ -74,5 +77,5 @@ jobs:
|
||||
run: bench --site frappe.local build
|
||||
- name: run tests
|
||||
working-directory: /home/runner/frappe-bench
|
||||
run: bench --site frappe.local run-tests --app community
|
||||
run: bench --site frappe.local run-tests --app lms
|
||||
|
||||
|
||||
7
.gitignore
vendored
@@ -3,5 +3,8 @@
|
||||
*.egg-info
|
||||
*.swp
|
||||
tags
|
||||
community/docs/current
|
||||
community/public/dist
|
||||
lms/docs/current
|
||||
lms/public/dist
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
|
||||
7
Contribution.md
Normal file
@@ -0,0 +1,7 @@
|
||||
|
||||
1. Go to the apps/lms directory of your installation and execute git pull --unshallow to ensure that you have the full git repository. Also fork the frappe/lms 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.
|
||||
24
MANIFEST.in
@@ -4,15 +4,15 @@ include *.json
|
||||
include *.md
|
||||
include *.py
|
||||
include *.txt
|
||||
recursive-include community *.css
|
||||
recursive-include community *.csv
|
||||
recursive-include community *.html
|
||||
recursive-include community *.ico
|
||||
recursive-include community *.js
|
||||
recursive-include community *.json
|
||||
recursive-include community *.md
|
||||
recursive-include community *.png
|
||||
recursive-include community *.py
|
||||
recursive-include community *.svg
|
||||
recursive-include community *.txt
|
||||
recursive-exclude community *.pyc
|
||||
recursive-include lms *.css
|
||||
recursive-include lms *.csv
|
||||
recursive-include lms *.html
|
||||
recursive-include lms *.ico
|
||||
recursive-include lms *.js
|
||||
recursive-include lms *.json
|
||||
recursive-include lms *.md
|
||||
recursive-include lms *.png
|
||||
recursive-include lms *.py
|
||||
recursive-include lms *.svg
|
||||
recursive-include lms *.txt
|
||||
recursive-exclude lms *.pyc
|
||||
|
||||
80
README.md
@@ -1,79 +1,25 @@
|
||||
## Community
|
||||
## LMS
|
||||
|
||||
This app helps people organize and manage their own communities.
|
||||
Create online courses without much hassle.
|
||||
|
||||
The App has following components:
|
||||

|
||||
|
||||
1. Hackathons
|
||||
1. LMS
|
||||
## Features
|
||||
|
||||
Community is built on the [Frappe Framework](https://github.com/frappe/frappe), a full-stack web app framework built with Python & JavaScript.
|
||||
1. Simple Backend Forms.
|
||||
1. The UI is clean and minimal.
|
||||
1. Lessons can be in the form of texts, videos, quizzes or a combination of all of these.
|
||||
|
||||
## Development Setup
|
||||
|
||||
**Step 1:** Clone the repo
|
||||
1. [Through Docker](docker-installation.md)
|
||||
1. [Direct install through bench](bench-installation.md)
|
||||
|
||||
```
|
||||
$ git clone https://github.com/fossunited/community.git
|
||||
|
||||
$ cd community
|
||||
```
|
||||
### Contributing
|
||||
|
||||
**Step 2:** Run docker-compose
|
||||
1. [Contribution Guidelines](Contribution.md)
|
||||
|
||||
```
|
||||
$ docker-compose up
|
||||
```
|
||||
## License
|
||||
|
||||
**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
|
||||
|
||||
AGPL
|
||||
[GNU AFFERO GENERAL PUBLIC LICENSE](license.txt)
|
||||
|
||||
10
bench-installation.md
Normal file
@@ -0,0 +1,10 @@
|
||||
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 lms.test.
|
||||
1. Fork the lms app
|
||||
1. Run bench get-app <url-of-your-form>.
|
||||
1. Run bench --site lms.test install-app lms.
|
||||
1. Map your site to localhost with the command ```bench --site lms.test add-to-hosts```
|
||||
1. Now open the URL http://lms.test:8000/ in your browser, you should see the app running.
|
||||
@@ -1,8 +0,0 @@
|
||||
// Copyright (c) 2021, Frappe and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Community Event', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
||||
@@ -1,58 +0,0 @@
|
||||
{
|
||||
"actions": [],
|
||||
"autoname": "Prompt",
|
||||
"creation": "2021-02-12 17:54:52.300451",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"year",
|
||||
"is_hackathon",
|
||||
"volunteers"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "year",
|
||||
"fieldtype": "Select",
|
||||
"label": "Year",
|
||||
"options": "\n2021\n2022\n2023\n2024\n2025"
|
||||
},
|
||||
{
|
||||
"fieldname": "volunteers",
|
||||
"fieldtype": "Table",
|
||||
"label": "Volunteers",
|
||||
"options": "Community Event Volunteer"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "is_hackathon",
|
||||
"fieldtype": "Check",
|
||||
"label": "Is Hackathon"
|
||||
}
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2021-02-15 18:29:26.828720",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Community",
|
||||
"name": "Community Event",
|
||||
"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
|
||||
}
|
||||
@@ -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.model.document import Document
|
||||
|
||||
class CommunityEvent(Document):
|
||||
pass
|
||||
@@ -1,10 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, Frappe and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
class TestCommunityEvent(unittest.TestCase):
|
||||
pass
|
||||
@@ -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.model.document import Document
|
||||
|
||||
class CommunityEventVolunteer(Document):
|
||||
pass
|
||||
@@ -1,8 +0,0 @@
|
||||
// Copyright (c) 2021, Frappe and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Community Participant', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
||||
@@ -1,74 +0,0 @@
|
||||
{
|
||||
"actions": [],
|
||||
"creation": "2021-02-15 11:04:02.748879",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"first_name",
|
||||
"last_name",
|
||||
"email",
|
||||
"student",
|
||||
"organization_college"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "first_name",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "First Name",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "last_name",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Last Name",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "email",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Email",
|
||||
"options": "Email",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "student",
|
||||
"fieldtype": "Check",
|
||||
"label": "Student"
|
||||
},
|
||||
{
|
||||
"fieldname": "organization_college",
|
||||
"fieldtype": "Data",
|
||||
"label": "Organization/College"
|
||||
}
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2021-02-15 11:04:02.748879",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Community",
|
||||
"name": "Community 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
|
||||
}
|
||||
@@ -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.model.document import Document
|
||||
|
||||
class CommunityParticipant(Document):
|
||||
pass
|
||||
@@ -1,10 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, Frappe and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
class TestCommunityParticipant(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 Speaker', {
|
||||
// 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.model.document import Document
|
||||
|
||||
class CommunitySpeaker(Document):
|
||||
pass
|
||||
@@ -1,10 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, Frappe and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
class TestCommunitySpeaker(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 Sponsor', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
||||
@@ -1,82 +0,0 @@
|
||||
{
|
||||
"actions": [],
|
||||
"autoname": "field:sponsor",
|
||||
"creation": "2021-02-15 10:46:16.271104",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"sponsor",
|
||||
"website",
|
||||
"image",
|
||||
"speaker",
|
||||
"timeslot",
|
||||
"short_intro",
|
||||
"pitch"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "sponsor",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Sponsor",
|
||||
"reqd": 1,
|
||||
"unique": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "website",
|
||||
"fieldtype": "Data",
|
||||
"label": "Website"
|
||||
},
|
||||
{
|
||||
"fieldname": "image",
|
||||
"fieldtype": "Attach Image",
|
||||
"label": "Image"
|
||||
},
|
||||
{
|
||||
"fieldname": "speaker",
|
||||
"fieldtype": "Data",
|
||||
"label": "Speaker"
|
||||
},
|
||||
{
|
||||
"fieldname": "timeslot",
|
||||
"fieldtype": "Datetime",
|
||||
"label": "Timeslot"
|
||||
},
|
||||
{
|
||||
"fieldname": "short_intro",
|
||||
"fieldtype": "Small Text",
|
||||
"label": "Short Intro"
|
||||
},
|
||||
{
|
||||
"fieldname": "pitch",
|
||||
"fieldtype": "Markdown Editor",
|
||||
"label": "Pitch"
|
||||
}
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2021-02-15 10:46:16.271104",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Community",
|
||||
"name": "Community Sponsor",
|
||||
"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
|
||||
}
|
||||
@@ -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.model.document import Document
|
||||
|
||||
class CommunitySponsor(Document):
|
||||
pass
|
||||
@@ -1,10 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, Frappe and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
class TestCommunitySponsor(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 Talk', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
||||
@@ -1,80 +0,0 @@
|
||||
{
|
||||
"actions": [],
|
||||
"autoname": "field:topic",
|
||||
"creation": "2021-02-18 16:06:59.882799",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"speaker",
|
||||
"topic",
|
||||
"video_link",
|
||||
"date_and_time",
|
||||
"event_type",
|
||||
"event"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "speaker",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Speaker",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "topic",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Topic",
|
||||
"reqd": 1,
|
||||
"unique": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "video_link",
|
||||
"fieldtype": "Data",
|
||||
"label": "Video Link"
|
||||
},
|
||||
{
|
||||
"fieldname": "date_and_time",
|
||||
"fieldtype": "Datetime",
|
||||
"label": "Date and Time"
|
||||
},
|
||||
{
|
||||
"fieldname": "event_type",
|
||||
"fieldtype": "Link",
|
||||
"label": "Event Type",
|
||||
"options": "DocType"
|
||||
},
|
||||
{
|
||||
"fieldname": "event",
|
||||
"fieldtype": "Dynamic Link",
|
||||
"label": "Event",
|
||||
"options": "event_type"
|
||||
}
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2021-02-18 16:56:41.526184",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Community",
|
||||
"name": "Community Talk",
|
||||
"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
|
||||
}
|
||||
@@ -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.model.document import Document
|
||||
|
||||
class CommunityTalk(Document):
|
||||
pass
|
||||
@@ -1,10 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, Frappe and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
class TestCommunityTalk(unittest.TestCase):
|
||||
pass
|
||||
@@ -1,10 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, Frappe and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
class TestTShirtSizes(unittest.TestCase):
|
||||
pass
|
||||
@@ -1,8 +0,0 @@
|
||||
// Copyright (c) 2021, Frappe and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('TShirt Sizes', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
||||
@@ -1,49 +0,0 @@
|
||||
{
|
||||
"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
|
||||
}
|
||||
@@ -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.model.document import Document
|
||||
|
||||
class TShirtSizes(Document):
|
||||
pass
|
||||
@@ -1 +0,0 @@
|
||||
import frappe
|
||||
@@ -1,3 +0,0 @@
|
||||
frappe.ready(function() {
|
||||
// bind events here
|
||||
})
|
||||
@@ -1,64 +0,0 @@
|
||||
{
|
||||
"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": 0,
|
||||
"max_attachment_size": 0,
|
||||
"modified": "2021-02-17 13:50:35.153793",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Community",
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
frappe.ready(function () {
|
||||
// bind events here
|
||||
frappe.web_form.success_url = `hackathons/project?project=${frappe.utils.get_url_arg('project')}&hackathon=${frappe.utils.get_url_arg('hackathon')}`;
|
||||
|
||||
$('.breadcrumb-container')
|
||||
.html(`<a href="${frappe.web_form.success_url}">Back to my project</a>`)
|
||||
.addClass('py-4');
|
||||
})
|
||||
@@ -1,63 +0,0 @@
|
||||
{
|
||||
"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": "Submit",
|
||||
"creation": "2021-02-18 13:15:09.464515",
|
||||
"doc_type": "Community Project Update",
|
||||
"docstatus": 0,
|
||||
"doctype": "Web Form",
|
||||
"idx": 0,
|
||||
"is_standard": 1,
|
||||
"login_required": 1,
|
||||
"max_attachment_size": 0,
|
||||
"modified": "2021-02-18 13:23:41.023545",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Community",
|
||||
"name": "project-update",
|
||||
"owner": "Administrator",
|
||||
"payment_button_label": "Buy Now",
|
||||
"published": 1,
|
||||
"route": "project-update",
|
||||
"route_to_success_link": 0,
|
||||
"show_attachments": 0,
|
||||
"show_in_grid": 0,
|
||||
"show_sidebar": 0,
|
||||
"sidebar_items": [],
|
||||
"success_url": "/project-update",
|
||||
"title": "Project Update",
|
||||
"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": "update",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"label": "Update",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"read_only": 0,
|
||||
"reqd": 1,
|
||||
"show_in_filter": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
|
||||
def get_context(context):
|
||||
# do your magic here
|
||||
pass
|
||||
@@ -1,8 +0,0 @@
|
||||
// Copyright (c) 2021, FOSS United and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Community Conference', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
||||
@@ -1,56 +0,0 @@
|
||||
{
|
||||
"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
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
# -*- 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
|
||||
@@ -1,8 +0,0 @@
|
||||
// Copyright (c) 2021, FOSS United and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Community Conference Participant', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
||||
@@ -1,147 +0,0 @@
|
||||
{
|
||||
"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
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
# -*- 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
|
||||
@@ -1,10 +0,0 @@
|
||||
# -*- 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
|
||||
@@ -1,8 +0,0 @@
|
||||
// Copyright (c) 2021, FOSS United and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Community Conference Request', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
||||
@@ -1,73 +0,0 @@
|
||||
{
|
||||
"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
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
# -*- 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
|
||||
@@ -1,10 +0,0 @@
|
||||
# -*- 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
|
||||
@@ -1,35 +0,0 @@
|
||||
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.
|
||||
@@ -1,8 +0,0 @@
|
||||
// Copyright (c) 2021, FOSS United and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Community Hackathon', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
||||
@@ -1,10 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, FOSS United and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
class TestCommunityHackathon(unittest.TestCase):
|
||||
pass
|
||||
@@ -1,144 +0,0 @@
|
||||
{
|
||||
"actions": [],
|
||||
"allow_import": 1,
|
||||
"autoname": "field:project_name",
|
||||
"creation": "2021-02-12 18:28:33.440328",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"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",
|
||||
"column_break_11",
|
||||
"hackathon",
|
||||
"telegram_id",
|
||||
"likes",
|
||||
"project_search"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "disabled",
|
||||
"fieldtype": "Check",
|
||||
"label": "Disabled"
|
||||
},
|
||||
{
|
||||
"fieldname": "project_name",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Project Name",
|
||||
"reqd": 1,
|
||||
"unique": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "project_short_intro",
|
||||
"fieldtype": "Small Text",
|
||||
"label": "Project Short Intro"
|
||||
},
|
||||
{
|
||||
"fieldname": "repository_link",
|
||||
"fieldtype": "Small Text",
|
||||
"label": "Repository Link"
|
||||
},
|
||||
{
|
||||
"fieldname": "video_link",
|
||||
"fieldtype": "Data",
|
||||
"label": "Video Link"
|
||||
},
|
||||
{
|
||||
"fieldname": "telegram_id",
|
||||
"fieldtype": "Data",
|
||||
"label": "Telegram Id"
|
||||
},
|
||||
{
|
||||
"fieldname": "project_description",
|
||||
"fieldtype": "Markdown Editor",
|
||||
"label": "Project Description"
|
||||
},
|
||||
{
|
||||
"fieldname": "hackathon",
|
||||
"fieldtype": "Link",
|
||||
"label": "Hackathon",
|
||||
"options": "Community Hackathon"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "accepting_members",
|
||||
"fieldtype": "Check",
|
||||
"label": "Accepting Members"
|
||||
},
|
||||
{
|
||||
"fieldname": "likes",
|
||||
"fieldtype": "Int",
|
||||
"label": "Likes",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "project_search",
|
||||
"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-04-20 13:22:17.248521",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Hackathon",
|
||||
"name": "Community Project",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "System Manager",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Participant",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"quick_entry": 1,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, FOSS United and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
class TestCommunityProject(unittest.TestCase):
|
||||
pass
|
||||
@@ -1,8 +0,0 @@
|
||||
// Copyright (c) 2021, FOSS United and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Community Project Evaluation', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
||||
@@ -1,169 +0,0 @@
|
||||
{
|
||||
"actions": [],
|
||||
"autoname": "format:EVAL-{#####}",
|
||||
"creation": "2021-02-12 19:44:57.467599",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"project",
|
||||
"status",
|
||||
"evaluated_by",
|
||||
"telegram_id",
|
||||
"column_break_5",
|
||||
"update",
|
||||
"section_break_7",
|
||||
"evaluation_comment",
|
||||
"overall_rating",
|
||||
"section_break_10",
|
||||
"impact_of_project",
|
||||
"completion",
|
||||
"quality_of_code",
|
||||
"quality_of_",
|
||||
"column_break_15",
|
||||
"difficulty",
|
||||
"future_viability",
|
||||
"total_score"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "project",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
"label": "Project",
|
||||
"options": "Community Project",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "status",
|
||||
"fieldtype": "Select",
|
||||
"label": "Status",
|
||||
"options": "\nPending\nPreliminary\nComplete"
|
||||
},
|
||||
{
|
||||
"fieldname": "evaluated_by",
|
||||
"fieldtype": "Link",
|
||||
"label": "Evaluated By",
|
||||
"options": "User"
|
||||
},
|
||||
{
|
||||
"fieldname": "telegram_id",
|
||||
"fieldtype": "Small Text",
|
||||
"label": "Telegram Id"
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_5",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "update",
|
||||
"fieldtype": "Small Text",
|
||||
"in_list_view": 1,
|
||||
"label": "Update",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "section_break_7",
|
||||
"fieldtype": "Section Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "evaluation_comment",
|
||||
"fieldtype": "Small Text",
|
||||
"label": "Evaluation Comment"
|
||||
},
|
||||
{
|
||||
"fieldname": "overall_rating",
|
||||
"fieldtype": "Int",
|
||||
"label": "Overall Rating"
|
||||
},
|
||||
{
|
||||
"fieldname": "section_break_10",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Score"
|
||||
},
|
||||
{
|
||||
"fieldname": "impact_of_project",
|
||||
"fieldtype": "Int",
|
||||
"label": "Impact of Project"
|
||||
},
|
||||
{
|
||||
"fieldname": "completion",
|
||||
"fieldtype": "Int",
|
||||
"label": "Completion"
|
||||
},
|
||||
{
|
||||
"fieldname": "quality_of_code",
|
||||
"fieldtype": "Int",
|
||||
"label": "Quality of Code"
|
||||
},
|
||||
{
|
||||
"fieldname": "quality_of_",
|
||||
"fieldtype": "Int",
|
||||
"label": "Quality of Presentation"
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_15",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "difficulty",
|
||||
"fieldtype": "Int",
|
||||
"label": "Difficulty"
|
||||
},
|
||||
{
|
||||
"fieldname": "future_viability",
|
||||
"fieldtype": "Int",
|
||||
"label": "Future Viability"
|
||||
},
|
||||
{
|
||||
"fieldname": "total_score",
|
||||
"fieldtype": "Int",
|
||||
"label": "Total Score"
|
||||
}
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2021-03-04 19:56:53.757808",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Hackathon",
|
||||
"name": "Community Project Evaluation",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "System Manager",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Participant",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
},
|
||||
{
|
||||
"create": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Evaluator",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
# -*- 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 CommunityProjectEvaluation(Document):
|
||||
pass
|
||||
@@ -1,10 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, FOSS United and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
class TestCommunityProjectEvaluation(unittest.TestCase):
|
||||
pass
|
||||
@@ -1,8 +0,0 @@
|
||||
// Copyright (c) 2021, FOSS United and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Community Project Like', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
||||
@@ -1,43 +0,0 @@
|
||||
{
|
||||
"actions": [],
|
||||
"creation": "2021-02-12 18:43:24.206708",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"project"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "project",
|
||||
"fieldtype": "Link",
|
||||
"label": "Project",
|
||||
"options": "Community Project"
|
||||
}
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2021-03-04 18:55:51.877522",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Hackathon",
|
||||
"name": "Community Project Like",
|
||||
"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
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, FOSS United and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
class TestCommunityProjectLike(unittest.TestCase):
|
||||
pass
|
||||
@@ -1,8 +0,0 @@
|
||||
// Copyright (c) 2021, FOSS United and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Community Project Member', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
||||
@@ -1,77 +0,0 @@
|
||||
{
|
||||
"actions": [],
|
||||
"creation": "2021-02-12 18:36:08.324156",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"project",
|
||||
"intro",
|
||||
"status",
|
||||
"project_owner"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "project",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
"label": "Project",
|
||||
"options": "Community Project",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "intro",
|
||||
"fieldtype": "Small Text",
|
||||
"in_list_view": 1,
|
||||
"label": "Intro",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"default": "Pending",
|
||||
"fieldname": "status",
|
||||
"fieldtype": "Select",
|
||||
"label": "Status",
|
||||
"options": "Pending\nAccepted\nRejected"
|
||||
},
|
||||
{
|
||||
"fieldname": "project_owner",
|
||||
"fieldtype": "Data",
|
||||
"label": "Project Owner",
|
||||
"options": "Email"
|
||||
}
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2021-03-04 19:44:09.832170",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Hackathon",
|
||||
"name": "Community Project 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
|
||||
},
|
||||
{
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "Participant",
|
||||
"share": 1
|
||||
}
|
||||
],
|
||||
"quick_entry": 1,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
# -*- 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
|
||||
from frappe import _
|
||||
|
||||
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,10 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, FOSS United and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
class TestCommunityProjectMember(unittest.TestCase):
|
||||
pass
|
||||
@@ -1,8 +0,0 @@
|
||||
// Copyright (c) 2021, FOSS United and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Community Project Update', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
||||
@@ -1,10 +0,0 @@
|
||||
# -*- 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 CommunityProjectUpdate(Document):
|
||||
pass
|
||||
@@ -1,10 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, FOSS United and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
class TestCommunityProjectUpdate(unittest.TestCase):
|
||||
pass
|
||||
|
Before Width: | Height: | Size: 49 KiB |
|
Before Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 34 KiB |
|
Before Width: | Height: | Size: 139 KiB |
|
Before Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 111 KiB |
@@ -1,3 +0,0 @@
|
||||
frappe.ready(function() {
|
||||
// bind events here
|
||||
})
|
||||
@@ -1,64 +0,0 @@
|
||||
{
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
|
||||
def get_context(context):
|
||||
# do your magic here
|
||||
pass
|
||||
@@ -1,3 +0,0 @@
|
||||
frappe.ready(function() {
|
||||
// bind events here
|
||||
})
|
||||
@@ -1,49 +0,0 @@
|
||||
{
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
|
||||
def get_context(context):
|
||||
# do your magic here
|
||||
pass
|
||||
@@ -1,3 +0,0 @@
|
||||
frappe.ready(function() {
|
||||
// bind events here
|
||||
})
|
||||
@@ -1,63 +0,0 @@
|
||||
{
|
||||
"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": "Submit",
|
||||
"creation": "2021-02-18 13:15:09.464515",
|
||||
"doc_type": "Community Project Update",
|
||||
"docstatus": 0,
|
||||
"doctype": "Web Form",
|
||||
"idx": 0,
|
||||
"is_standard": 1,
|
||||
"login_required": 1,
|
||||
"max_attachment_size": 0,
|
||||
"modified": "2021-03-04 19:43:28.957577",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Hackathon",
|
||||
"name": "project-update",
|
||||
"owner": "Administrator",
|
||||
"payment_button_label": "Buy Now",
|
||||
"published": 1,
|
||||
"route": "project-update",
|
||||
"route_to_success_link": 0,
|
||||
"show_attachments": 0,
|
||||
"show_in_grid": 0,
|
||||
"show_sidebar": 0,
|
||||
"sidebar_items": [],
|
||||
"success_url": "/project-update",
|
||||
"title": "Project Update",
|
||||
"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": "update",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"label": "Update",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"read_only": 0,
|
||||
"reqd": 1,
|
||||
"show_in_filter": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
|
||||
def get_context(context):
|
||||
# do your magic here
|
||||
pass
|
||||
@@ -1,195 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
from . import __version__ as app_version
|
||||
|
||||
app_name = "community"
|
||||
app_title = "Community"
|
||||
app_publisher = "FOSS United"
|
||||
app_description = "Community App"
|
||||
app_icon = "octicon octicon-file-directory"
|
||||
app_color = "grey"
|
||||
app_email = "jannat@erpnext.com"
|
||||
app_license = "AGPL"
|
||||
|
||||
# Includes in <head>
|
||||
# ------------------
|
||||
|
||||
# include js, css files in header of desk.html
|
||||
# app_include_css = "/assets/community/css/community.css"
|
||||
# app_include_js = "/assets/community/js/community.js"
|
||||
|
||||
# include js, css files in header of web template
|
||||
web_include_css = "community.bundle.css"
|
||||
# web_include_css = "/assets/community/css/community.css"
|
||||
# web_include_js = "/assets/community/js/community.js"
|
||||
|
||||
# include custom scss in every website theme (without file extension ".scss")
|
||||
# website_theme_scss = "community/public/scss/website"
|
||||
|
||||
# include js, css files in header of web form
|
||||
# webform_include_js = {"doctype": "public/js/doctype.js"}
|
||||
# webform_include_css = {"doctype": "public/css/doctype.css"}
|
||||
|
||||
# include js in page
|
||||
# page_js = {"page" : "public/js/file.js"}
|
||||
|
||||
# include js in doctype views
|
||||
# doctype_js = {"doctype" : "public/js/doctype.js"}
|
||||
# doctype_list_js = {"doctype" : "public/js/doctype_list.js"}
|
||||
# doctype_tree_js = {"doctype" : "public/js/doctype_tree.js"}
|
||||
# doctype_calendar_js = {"doctype" : "public/js/doctype_calendar.js"}
|
||||
|
||||
# Home Pages
|
||||
# ----------
|
||||
|
||||
# application home page (will override Website Settings)
|
||||
# home_page = "login"
|
||||
|
||||
# website user home page (by Role)
|
||||
# role_home_page = {
|
||||
# "Role": "home_page"
|
||||
# }
|
||||
|
||||
# Generators
|
||||
# ----------
|
||||
|
||||
# automatically create page for each record of this doctype
|
||||
# website_generators = ["Web Page"]
|
||||
|
||||
# Installation
|
||||
# ------------
|
||||
|
||||
# before_install = "community.install.before_install"
|
||||
# after_install = "community.install.after_install"
|
||||
|
||||
# Desk Notifications
|
||||
# ------------------
|
||||
# See frappe.core.notifications.get_notification_config
|
||||
|
||||
# notification_config = "community.notifications.get_notification_config"
|
||||
|
||||
# Permissions
|
||||
# -----------
|
||||
# Permissions evaluated in scripted ways
|
||||
|
||||
# permission_query_conditions = {
|
||||
# "Event": "frappe.desk.doctype.event.event.get_permission_query_conditions",
|
||||
# }
|
||||
#
|
||||
# has_permission = {
|
||||
# "Event": "frappe.desk.doctype.event.event.has_permission",
|
||||
# }
|
||||
|
||||
# DocType Class
|
||||
# ---------------
|
||||
# Override standard doctype classes
|
||||
|
||||
override_doctype_class = {
|
||||
"User": "community.overrides.user.CustomUser"
|
||||
}
|
||||
|
||||
# Document Events
|
||||
# ---------------
|
||||
# Hook on document methods and events
|
||||
|
||||
doc_events = {
|
||||
|
||||
}
|
||||
|
||||
# Scheduled Tasks
|
||||
# ---------------
|
||||
#scheduler_events = {
|
||||
# "daily": [
|
||||
# "erpnext.stock.reorder_item.reorder_item"
|
||||
# ]
|
||||
#}
|
||||
|
||||
# Testing
|
||||
# -------
|
||||
|
||||
# before_tests = "community.install.before_tests"
|
||||
|
||||
# Overriding Methods
|
||||
# ------------------------------
|
||||
#
|
||||
# override_whitelisted_methods = {
|
||||
# "frappe.desk.doctype.event.event.get_events": "community.event.get_events"
|
||||
# }
|
||||
#
|
||||
# each overriding function accepts a `data` argument;
|
||||
# generated from the base implementation of the doctype dashboard,
|
||||
# along with any modifications made in other Frappe apps
|
||||
# override_doctype_dashboards = {
|
||||
# "Task": "community.task.get_dashboard_data"
|
||||
# }
|
||||
|
||||
# exempt linked doctypes from being automatically cancelled
|
||||
#
|
||||
# auto_cancel_exempted_doctypes = ["Auto Repeat"]
|
||||
|
||||
# Add all simple route rules here
|
||||
primary_rules = [
|
||||
{"from_route": "/sketches/<sketch>", "to_route": "sketches/sketch"},
|
||||
{"from_route": "/courses/<course>", "to_route": "courses/course"},
|
||||
{"from_route": "/courses/<course>/<topic>", "to_route": "courses/topic"},
|
||||
{"from_route": "/hackathons/<hackathon>", "to_route": "hackathons/hackathon"},
|
||||
{"from_route": "/hackathons/<hackathon>/<project>", "to_route": "hackathons/project"},
|
||||
{"from_route": "/dashboard", "to_route": ""},
|
||||
{"from_route": "/add-a-new-batch", "to_route": "add-a-new-batch"},
|
||||
{"from_route": "/courses/<course>/home", "to_route": "batch/home"},
|
||||
{"from_route": "/courses/<course>/learn", "to_route": "batch/learn"},
|
||||
{"from_route": "/courses/<course>/learn/<int:chapter>.<int:lesson>", "to_route": "batch/learn"},
|
||||
{"from_route": "/courses/<course>/schedule", "to_route": "batch/schedule"},
|
||||
{"from_route": "/courses/<course>/members", "to_route": "batch/members"},
|
||||
{"from_route": "/courses/<course>/discuss", "to_route": "batch/discuss"},
|
||||
{"from_route": "/courses/<course>/about", "to_route": "batch/about"},
|
||||
{"from_route": "/courses/<course>/progress", "to_route": "batch/progress"},
|
||||
{"from_route": "/courses/<course>/join", "to_route": "batch/join"}
|
||||
]
|
||||
|
||||
# Any frappe default URL is blocked by profile-rules, add it here to unblock it
|
||||
whitelist = [
|
||||
"/home",
|
||||
"/login",
|
||||
"/update-password",
|
||||
"/update-profile",
|
||||
"/third-party-apps",
|
||||
"/website_script.js",
|
||||
"/courses",
|
||||
"/sketches",
|
||||
"/admin",
|
||||
"/socket.io",
|
||||
"/hackathons",
|
||||
"/dashboard",
|
||||
"/join-request",
|
||||
"/add-a-new-batch",
|
||||
"/new-sign-up",
|
||||
"/message",
|
||||
"/about"
|
||||
]
|
||||
whitelist_rules = [{"from_route": p, "to_route": p[1:]} for p in whitelist]
|
||||
|
||||
# regex rule to match all profiles
|
||||
profile_rules = [
|
||||
{"from_route": "/<string(minlength=4):username>", "to_route": "profiles/profile"},
|
||||
]
|
||||
|
||||
website_route_rules = primary_rules + whitelist_rules + profile_rules
|
||||
|
||||
update_website_context = 'community.widgets.update_website_context'
|
||||
|
||||
## Specify the additional tabs to be included in the user profile page.
|
||||
## Each entry must be a subclass of community.community.plugins.ProfileTab
|
||||
# profile_tabs = []
|
||||
|
||||
## Specify the extension to be used to control what scripts and stylesheets
|
||||
## to be included in lesson pages. The specified value must be be a
|
||||
## subclass of community.community.plugins.PageExtension
|
||||
# community_lesson_page_extension = None
|
||||
|
||||
## Markdown Macros for Lessons
|
||||
community_markdown_macro_renderers = {
|
||||
"Exercise": "community.plugins.exercise_renderer",
|
||||
"Quiz": "community.plugins.quiz_renderer",
|
||||
"YouTubeVideo": "community.plugins.youtube_video_renderer",
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
// Copyright (c) 2021, FOSS United and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Chapter', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
||||
@@ -1,15 +0,0 @@
|
||||
# -*- 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 Chapter(Document):
|
||||
def get_lessons(self):
|
||||
rows = frappe.db.get_all("Lesson",
|
||||
filters={"chapter": self.name},
|
||||
fields='name',
|
||||
order_by="index_")
|
||||
return [frappe.get_doc('Lesson', row['name']) for row in rows]
|
||||
@@ -1,13 +0,0 @@
|
||||
# Copyright (c) 2021, FOSS United and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
import frappe
|
||||
from frappe.model.document import Document
|
||||
from ..lesson.lesson import update_progress
|
||||
|
||||
class ExerciseSubmission(Document):
|
||||
|
||||
def after_insert(self):
|
||||
course_details = frappe.get_doc("LMS Course", self.course)
|
||||
if not (course_details.is_mentor(frappe.session.user) or frappe.flags.in_test):
|
||||
update_progress(self.lesson)
|
||||
@@ -1,8 +0,0 @@
|
||||
// Copyright (c) 2021, FOSS United and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('LMS Course', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
||||
@@ -1,302 +0,0 @@
|
||||
# -*- 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
|
||||
import json
|
||||
from ...utils import slugify
|
||||
from community.query import find, find_all
|
||||
from frappe.utils import flt
|
||||
|
||||
class LMSCourse(Document):
|
||||
@staticmethod
|
||||
def find(name):
|
||||
"""Returns the course with specified name.
|
||||
"""
|
||||
return find("LMS Course", is_published=True, name=name)
|
||||
|
||||
def autoname(self):
|
||||
if not self.name:
|
||||
self.name = self.generate_slug(title=self.title)
|
||||
|
||||
@staticmethod
|
||||
def find_all():
|
||||
"""Returns all published courses.
|
||||
"""
|
||||
return find_all("LMS Course", is_published=True)
|
||||
|
||||
def generate_slug(self, title):
|
||||
result = frappe.get_all(
|
||||
'LMS Course',
|
||||
fields=['name'])
|
||||
slugs = set([row['name'] for row in result])
|
||||
return slugify(title, used_slugs=slugs)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<Course#{self.name}>"
|
||||
|
||||
def has_mentor(self, email):
|
||||
"""Checks if this course has a mentor with given email.
|
||||
"""
|
||||
if not email or email == "Guest":
|
||||
return False
|
||||
|
||||
mapping = frappe.get_all("LMS Course Mentor Mapping", {"course": self.name, "mentor": email})
|
||||
return mapping != []
|
||||
|
||||
def add_mentor(self, email):
|
||||
"""Adds a new mentor to the course.
|
||||
"""
|
||||
if not email:
|
||||
raise ValueError("Invalid email")
|
||||
if email == "Guest":
|
||||
raise ValueError("Guest user can not be added as a mentor")
|
||||
|
||||
# given user is already a mentor
|
||||
if self.has_mentor(email):
|
||||
return
|
||||
|
||||
doc = frappe.get_doc({
|
||||
"doctype": "LMS Course Mentor Mapping",
|
||||
"course": self.name,
|
||||
"mentor": email
|
||||
})
|
||||
doc.insert()
|
||||
|
||||
def get_mentors(self):
|
||||
"""Returns the list of all mentors for this course.
|
||||
"""
|
||||
course_mentors = []
|
||||
mentors = frappe.get_all("LMS Course Mentor Mapping", {"course": self.name}, ["mentor"])
|
||||
for mentor in mentors:
|
||||
member = frappe.get_doc("User", mentor.mentor)
|
||||
# TODO: change this to count query
|
||||
member.batch_count = len(frappe.get_all("LMS Batch Membership", {"member": member.name, "member_type": "Mentor"}))
|
||||
course_mentors.append(member)
|
||||
return course_mentors
|
||||
|
||||
def is_mentor(self, email):
|
||||
"""Checks if given user is a mentor for this course.
|
||||
"""
|
||||
if not email:
|
||||
return False
|
||||
return frappe.db.count("LMS Course Mentor Mapping",
|
||||
{
|
||||
"course": self.name,
|
||||
"mentor": email
|
||||
})
|
||||
|
||||
def get_student_batch(self, email):
|
||||
"""Returns the batch the given student is part of.
|
||||
|
||||
Returns None if the student is not part of any batch.
|
||||
"""
|
||||
if not email:
|
||||
return
|
||||
|
||||
batch_name = frappe.get_value(
|
||||
doctype="LMS Batch Membership",
|
||||
filters={
|
||||
"course": self.name,
|
||||
"member_type": "Student",
|
||||
"member": email
|
||||
},
|
||||
fieldname="batch")
|
||||
return batch_name and frappe.get_doc("LMS Batch", batch_name)
|
||||
|
||||
def get_instructor(self):
|
||||
return frappe.get_doc("User", self.owner)
|
||||
|
||||
def get_chapters(self):
|
||||
"""Returns all chapters of this course.
|
||||
"""
|
||||
# TODO: chapters should have a way to specify the order
|
||||
return find_all("Chapter", course=self.name, order_by="index_")
|
||||
|
||||
def get_batch(self, batch_name):
|
||||
return find("LMS Batch", name=batch_name, course=self.name)
|
||||
|
||||
def get_batches(self, mentor=None):
|
||||
batches = find_all("LMS Batch", course=self.name)
|
||||
if mentor:
|
||||
# TODO: optimize this
|
||||
memberships = frappe.db.get_all(
|
||||
"LMS Batch Membership",
|
||||
{"member": mentor},
|
||||
["batch"])
|
||||
batch_names = {m.batch for m in memberships}
|
||||
return [b for b in batches if b.name in batch_names]
|
||||
|
||||
def get_upcoming_batches(self):
|
||||
now = frappe.utils.nowdate()
|
||||
batches = find_all("LMS Batch",
|
||||
course=self.name,
|
||||
start_date=[">", now],
|
||||
status="Active",
|
||||
visibility="Public")
|
||||
return batches
|
||||
|
||||
def get_chapter(self, index):
|
||||
return find("Chapter", course=self.name, index_=index)
|
||||
|
||||
def get_lesson(self, chapter_index, lesson_index):
|
||||
chapter_name = frappe.get_value(
|
||||
"Chapter",
|
||||
{"course": self.name, "index_": chapter_index},
|
||||
"name")
|
||||
lesson_name = chapter_name and frappe.get_value(
|
||||
"Lesson",
|
||||
{"chapter": chapter_name, "index_": lesson_index},
|
||||
"name")
|
||||
return lesson_name and frappe.get_doc("Lesson", lesson_name)
|
||||
|
||||
def get_lesson_index(self, lesson_name):
|
||||
"""Returns the {chapter_index}.{lesson_index} for the lesson.
|
||||
"""
|
||||
lesson = frappe.get_doc("Lesson", lesson_name)
|
||||
chapter = frappe.get_doc("Chapter", lesson.chapter)
|
||||
return f"{chapter.index_}.{lesson.index_}"
|
||||
|
||||
def reindex_lessons(self):
|
||||
for i, c in enumerate(self.get_chapters(), start=1):
|
||||
c.index_ = i
|
||||
c.save()
|
||||
self._reindex_lessons_in_chapter(c)
|
||||
|
||||
def _reindex_lessons_in_chapter(self, c):
|
||||
for i, lesson in enumerate(c.get_lessons(), start=1):
|
||||
lesson.index = i
|
||||
lesson.index_label = f"{c.index_}.{i}"
|
||||
lesson.save()
|
||||
|
||||
def reindex_exercises(self):
|
||||
for i, c in enumerate(self.get_chapters(), start=1):
|
||||
if c.index_ != i:
|
||||
c.index_ = i
|
||||
c.save()
|
||||
self._reindex_exercises_in_chapter(c)
|
||||
|
||||
def _reindex_exercises_in_chapter(self, c):
|
||||
i = 1
|
||||
for lesson in c.get_lessons():
|
||||
for exercise in lesson.get_exercises():
|
||||
exercise.index_ = i
|
||||
exercise.index_label = f"{c.index_}.{i}"
|
||||
exercise.save()
|
||||
i += 1
|
||||
|
||||
def get_learn_url(self, lesson_number):
|
||||
if not lesson_number:
|
||||
return
|
||||
return f"/courses/{self.name}/learn/{lesson_number}"
|
||||
|
||||
def get_membership(self, member, batch=None):
|
||||
filters = {
|
||||
"member": member,
|
||||
"course": self.name
|
||||
}
|
||||
if batch:
|
||||
filters["batch"] = batch
|
||||
membership = frappe.db.get_value("LMS Batch Membership", filters, ["name","batch", "current_lesson"], as_dict=True)
|
||||
if membership and membership.batch:
|
||||
membership.batch_title = frappe.db.get_value("LMS Batch", membership.batch, "title")
|
||||
return membership
|
||||
|
||||
def get_all_memberships(self, member):
|
||||
all_memberships = frappe.get_all("LMS Batch Membership", {"member": member, "course": self.name}, ["batch"])
|
||||
for membership in all_memberships:
|
||||
membership.batch_title = frappe.db.get_value("LMS Batch", membership.batch, "title")
|
||||
return all_memberships
|
||||
|
||||
def get_mentors(self, batch=None):
|
||||
filters = {
|
||||
"course": self.name,
|
||||
"member_type": "Mentor"
|
||||
}
|
||||
if batch:
|
||||
filters["batch"] = batch
|
||||
|
||||
memberships = frappe.get_all(
|
||||
"LMS Batch Membership",
|
||||
filters,
|
||||
["member"])
|
||||
member_names = [m['member'] for m in memberships]
|
||||
return find_all("User", name=["IN", member_names])
|
||||
|
||||
def get_students(self, batch=None):
|
||||
"""Returns (email, full_name, username) of all the students of this batch as a list of dict.
|
||||
"""
|
||||
filters = {
|
||||
"course": self.name,
|
||||
"member_type": "Student"
|
||||
}
|
||||
if batch:
|
||||
filters["batch"] = batch
|
||||
memberships = frappe.get_all(
|
||||
"LMS Batch Membership",
|
||||
filters,
|
||||
["member"])
|
||||
member_names = [m['member'] for m in memberships]
|
||||
return find_all("User", name=["IN", member_names])
|
||||
|
||||
def get_outline(self):
|
||||
return CourseOutline(self)
|
||||
|
||||
class CourseOutline:
|
||||
def __init__(self, course):
|
||||
self.course = course
|
||||
self.chapters = self.get_chapters()
|
||||
self.lessons = self.get_lessons()
|
||||
|
||||
def get_next(self, current):
|
||||
current = flt(current)
|
||||
numbers = sorted(lesson['number'] for lesson in self.lessons)
|
||||
try:
|
||||
index = numbers.index(current)
|
||||
return numbers[index+1]
|
||||
except IndexError:
|
||||
return None
|
||||
|
||||
def get_prev(self, current):
|
||||
current = flt(current)
|
||||
numbers = sorted(lesson['number'] for lesson in self.lessons)
|
||||
try:
|
||||
index = numbers.index(current)
|
||||
if index == 0:
|
||||
return None
|
||||
return numbers[index-1]
|
||||
except IndexError:
|
||||
return None
|
||||
|
||||
def get_chapters(self):
|
||||
return frappe.db.get_all("Chapter",
|
||||
filters={"course": self.course.name},
|
||||
fields=["name", "title", "index_"],
|
||||
order_by="index_")
|
||||
|
||||
def get_lessons(self):
|
||||
chapters = [c['name'] for c in self.chapters]
|
||||
lessons = frappe.db.get_all("Lesson",
|
||||
filters={"chapter": ["IN", chapters]},
|
||||
fields=["name", "title", "chapter", "index_"])
|
||||
|
||||
chapter_numbers = {c['name']: c['index_'] for c in self.chapters}
|
||||
for lesson in lessons:
|
||||
lesson['number'] = flt("{}.{}".format(chapter_numbers[lesson['chapter']], lesson['index_']))
|
||||
return lessons
|
||||
|
||||
@frappe.whitelist()
|
||||
def reindex_lessons(doc):
|
||||
course_data = json.loads(doc)
|
||||
course = frappe.get_doc("LMS Course", course_data['name'])
|
||||
course.reindex_lessons()
|
||||
frappe.msgprint("All lessons in this course have been re-indexed.")
|
||||
|
||||
@frappe.whitelist()
|
||||
def reindex_exercises(doc):
|
||||
course_data = json.loads(doc)
|
||||
course = frappe.get_doc("LMS Course", course_data['name'])
|
||||
course.reindex_exercises()
|
||||
frappe.msgprint("All exercises in this course have been re-indexed.")
|
||||
@@ -1,8 +0,0 @@
|
||||
// Copyright (c) 2021, FOSS United and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('LMS Message', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
||||
@@ -1,85 +0,0 @@
|
||||
{
|
||||
"actions": [],
|
||||
"creation": "2021-03-19 12:19:32.355307",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"author",
|
||||
"batch",
|
||||
"column_break_3",
|
||||
"author_name",
|
||||
"pin",
|
||||
"section_break_6",
|
||||
"message"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "batch",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
"label": "Batch",
|
||||
"options": "LMS Batch"
|
||||
},
|
||||
{
|
||||
"fieldname": "author",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
"label": "Author",
|
||||
"options": "User"
|
||||
},
|
||||
{
|
||||
"fieldname": "message",
|
||||
"fieldtype": "Markdown Editor",
|
||||
"in_list_view": 1,
|
||||
"label": "Message"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "pin",
|
||||
"fieldtype": "Check",
|
||||
"label": "Pin"
|
||||
},
|
||||
{
|
||||
"fetch_from": "author.full_name",
|
||||
"fieldname": "author_name",
|
||||
"fieldtype": "Data",
|
||||
"label": "Author Name",
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_3",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "section_break_6",
|
||||
"fieldtype": "Section Break"
|
||||
}
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2021-05-21 11:49:34.911479",
|
||||
"modified_by": "Administrator",
|
||||
"module": "LMS",
|
||||
"name": "LMS Message",
|
||||
"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",
|
||||
"title_field": "author",
|
||||
"track_changes": 1
|
||||
}
|
||||
@@ -1,110 +0,0 @@
|
||||
# -*- 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
|
||||
from frappe import _
|
||||
from frappe.utils import add_days, nowdate
|
||||
|
||||
class LMSMessage(Document):
|
||||
def after_insert(self):
|
||||
self.publish_message()
|
||||
#Todo: Adding email preference field for users
|
||||
#self.send_email()
|
||||
|
||||
def publish_message(self):
|
||||
template = self.get_message_template()
|
||||
message = frappe._dict({
|
||||
"author_name": self.author_name,
|
||||
"message_time": frappe.utils.format_datetime(self.creation, "dd-mm-yyyy HH:mm"),
|
||||
"message": frappe.utils.md_to_html(self.message)
|
||||
})
|
||||
|
||||
js = """
|
||||
$(".msger-input").val("");
|
||||
var template = `{0}`;
|
||||
var message = {1};
|
||||
var session_user = ("{2}" == frappe.session.user) ? true : false;
|
||||
message.author_name = session_user ? "You" : message.author_name
|
||||
message.is_author = session_user;
|
||||
template = frappe.render_template(template, {{
|
||||
"message": message
|
||||
}})
|
||||
$(".messages").append(template);
|
||||
var message_element = document.getElementsByClassName("messages")[0]
|
||||
message_element.scrollTo(0, message_element.scrollHeight);
|
||||
""".format(template, message, self.owner)
|
||||
|
||||
frappe.publish_realtime(event="eval_js", message=js, after_commit=True)
|
||||
|
||||
def get_message_template(self):
|
||||
return """
|
||||
<li class="{% if message.is_author %} ours {% endif %}">
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="font-weight-bold">
|
||||
{{ message.author_name }}
|
||||
</div>
|
||||
<small class="">
|
||||
{{ message.message_time }}
|
||||
</small>
|
||||
</div>
|
||||
<div class="message-para">
|
||||
{{ message.message }}
|
||||
</div>
|
||||
</li>
|
||||
"""
|
||||
|
||||
def send_email(self):
|
||||
membership = frappe.get_all("LMS Batch Membership", {"batch": self.batch}, ["member"])
|
||||
for entry in membership:
|
||||
member = frappe.get_doc("User", entry.member)
|
||||
if member.name != self.author:
|
||||
#Todo: wrap sendmail in frappe.enqueue, else messages takes long to display.
|
||||
frappe.sendmail(
|
||||
recipients = member.email,
|
||||
subject = _("New Message on ") + self.batch,
|
||||
header = _("New Message on ") + self.batch,
|
||||
template = "lms_message",
|
||||
args = {
|
||||
"author": self.author,
|
||||
"message": frappe.utils.md_to_html(self.message),
|
||||
"creation": frappe.utils.format_datetime(self.creation, "medium"),
|
||||
"course": frappe.db.get_value("LMS Batch", self.batch, ["course"])
|
||||
}
|
||||
)
|
||||
|
||||
def send_daily_digest():
|
||||
#Todo: Optimize this
|
||||
emails = frappe._dict()
|
||||
messages = frappe.get_all("LMS Message", {"creation": [">=", add_days(nowdate(), -1)]}, ["message", "batch", "author", "creation"])
|
||||
for message in messages:
|
||||
membership = frappe.get_all("LMS Batch Membership", {"batch": message.batch}, ["member"])
|
||||
for entry in membership:
|
||||
member = frappe.db.get_value("User", entry.member, ["name", "email"], as_dict=1)
|
||||
if member.name != message.author:
|
||||
if member.name in emails.keys():
|
||||
emails[member.name]["messages"].append(message)
|
||||
else:
|
||||
emails[member.name] = frappe._dict({
|
||||
"email": member.email,
|
||||
"messages": [message]
|
||||
})
|
||||
for email in emails:
|
||||
group_by_batch = frappe._dict()
|
||||
for message in emails[email]["messages"]:
|
||||
if message.batch in group_by_batch.keys():
|
||||
group_by_batch[message.batch].append(message)
|
||||
else:
|
||||
group_by_batch[message.batch] = [message]
|
||||
frappe.sendmail(
|
||||
recipients = frappe.db.get_value("User", email, "email"),
|
||||
subject = _("Message Digest"),
|
||||
header = _("Message Digest"),
|
||||
template = "lms_daily_digest",
|
||||
args = {
|
||||
"batches": group_by_batch
|
||||
},
|
||||
delayed = False
|
||||
)
|
||||
@@ -1,10 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, FOSS United and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
class TestLMSMessage(unittest.TestCase):
|
||||
pass
|
||||
@@ -1,126 +0,0 @@
|
||||
"""Utilities to work with livecode service.
|
||||
"""
|
||||
import websocket
|
||||
import json
|
||||
from .svg import SVG
|
||||
import frappe
|
||||
from urllib.parse import urlparse
|
||||
|
||||
# Files to pass to livecode server
|
||||
# The same code is part of livecode-canvas.js
|
||||
# TODO: generate livecode-canvas.js from this file
|
||||
START = '''
|
||||
import sketch
|
||||
code = open("main.py").read()
|
||||
env = dict(sketch.__dict__)
|
||||
exec(code, env)
|
||||
'''
|
||||
|
||||
SKETCH = '''
|
||||
import json
|
||||
|
||||
def sendmsg(msgtype, function, args):
|
||||
"""Sends a message to the frontend.
|
||||
|
||||
The frontend will receive the specified message whenever
|
||||
this function is called. The frontend can decide to some
|
||||
action on each of these messages.
|
||||
"""
|
||||
msg = dict(msgtype=msgtype, function=function, args=args)
|
||||
print("--MSG--", json.dumps(msg))
|
||||
|
||||
def _draw(func, **kwargs):
|
||||
sendmsg(msgtype="draw", function=func, args=kwargs)
|
||||
|
||||
def circle(x, y, d):
|
||||
"""Draws a circle of diameter d with center (x, y).
|
||||
"""
|
||||
_draw("circle", x=x, y=y, d=d)
|
||||
|
||||
def line(x1, y1, x2, y2):
|
||||
"""Draws a line from point (x1, y1) to point (x2, y2).
|
||||
"""
|
||||
_draw("line", x1=x1, y1=y1, x2=x2, y2=y2)
|
||||
|
||||
def rect(x, y, w, h):
|
||||
"""Draws a rectangle on the canvas.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
x: x coordinate of the top-left corner of the rectangle
|
||||
y: y coordinate of the top-left corner of the rectangle
|
||||
w: width of the rectangle
|
||||
h: height of the rectangle
|
||||
"""
|
||||
_draw("rect", x=x, y=y, w=w, h=h)
|
||||
|
||||
def clear():
|
||||
_draw("clear")
|
||||
|
||||
# clear the canvas on start
|
||||
clear()
|
||||
'''
|
||||
|
||||
def get_livecode_url():
|
||||
doc = frappe.get_cached_doc("LMS Settings")
|
||||
return doc.livecode_url
|
||||
|
||||
def get_livecode_ws_url():
|
||||
url = urlparse(get_livecode_url())
|
||||
protocol = "wss" if url.scheme == "https" else "ws"
|
||||
return protocol + "://" + url.netloc + "/livecode"
|
||||
|
||||
def livecode_to_svg(livecode_ws_url, code, *, timeout=3):
|
||||
"""Renders the code as svg.
|
||||
"""
|
||||
if livecode_ws_url is None:
|
||||
livecode_ws_url = get_livecode_ws_url()
|
||||
|
||||
try:
|
||||
ws = websocket.WebSocket()
|
||||
ws.settimeout(timeout)
|
||||
ws.connect(livecode_ws_url)
|
||||
|
||||
msg = {
|
||||
"msgtype": "exec",
|
||||
"runtime": "python",
|
||||
"code": code,
|
||||
"files": [
|
||||
{"filename": "start.py", "contents": START},
|
||||
{"filename": "sketch.py", "contents": SKETCH},
|
||||
],
|
||||
"command": ["python", "start.py"]
|
||||
}
|
||||
ws.send(json.dumps(msg))
|
||||
|
||||
messages = _read_messages(ws)
|
||||
commands = [m for m in messages if m['msgtype'] == 'draw']
|
||||
img = draw_image(commands)
|
||||
return img.tostring()
|
||||
except websocket.WebSocketException as e:
|
||||
frappe.log_error(frappe.get_traceback(), 'livecode_to_svg failed')
|
||||
|
||||
def _read_messages(ws):
|
||||
messages = []
|
||||
try:
|
||||
while True:
|
||||
msg = ws.recv()
|
||||
if not msg:
|
||||
break
|
||||
messages.append(json.loads(msg))
|
||||
except websocket.WebSocketTimeoutException as e:
|
||||
print("Error:", e)
|
||||
pass
|
||||
return messages
|
||||
|
||||
def draw_image(commands):
|
||||
img = SVG(width=300, height=300, viewBox="0 0 300 300", fill='none', stroke='black')
|
||||
for c in commands:
|
||||
args = c['args']
|
||||
if c['function'] == 'circle':
|
||||
img.circle(cx=args['x'], cy=args['y'], r=args['d']/2)
|
||||
elif c['function'] == 'line':
|
||||
img.line(x1=args['x1'], y1=args['y1'], x2=args['x2'], y2=args['y2'])
|
||||
elif c['function'] == 'rect':
|
||||
img.rect(x=args['x'], y=args['y'], width=args['w'], height=args['h'])
|
||||
return img
|
||||
@@ -1,8 +0,0 @@
|
||||
// Copyright (c) 2021, FOSS United and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('LMS Sketch', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
||||
@@ -1,62 +0,0 @@
|
||||
{
|
||||
"actions": [],
|
||||
"autoname": "format:SKETCH-{#}",
|
||||
"creation": "2021-03-09 16:31:50.523524",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"title",
|
||||
"runtime",
|
||||
"code",
|
||||
"svg"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "title",
|
||||
"fieldtype": "Data",
|
||||
"label": "Title"
|
||||
},
|
||||
{
|
||||
"fieldname": "runtime",
|
||||
"fieldtype": "Data",
|
||||
"label": "Runtime"
|
||||
},
|
||||
{
|
||||
"fieldname": "code",
|
||||
"fieldtype": "Code",
|
||||
"label": "Code"
|
||||
},
|
||||
{
|
||||
"fieldname": "svg",
|
||||
"fieldtype": "Code",
|
||||
"label": "SVG",
|
||||
"read_only": 1
|
||||
}
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2021-03-12 08:42:56.671658",
|
||||
"modified_by": "Administrator",
|
||||
"module": "LMS",
|
||||
"name": "LMS Sketch",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "System Manager",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1,
|
||||
"track_views": 1
|
||||
}
|
||||
@@ -1,105 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, FOSS United and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import hashlib
|
||||
from urllib.parse import urlparse
|
||||
import frappe
|
||||
from frappe.model.document import Document
|
||||
from . import livecode
|
||||
|
||||
DEFAULT_IMAGE = """
|
||||
<svg viewBox="0 0 300 300" width="300" xmlns="http://www.w3.org/2000/svg">
|
||||
</svg>
|
||||
"""
|
||||
|
||||
class LMSSketch(Document):
|
||||
@property
|
||||
def sketch_id(self):
|
||||
"""Returns the numeric part of the name.
|
||||
|
||||
For example, the skech_id will be "123" for sketch with name "SKETCH-123".
|
||||
"""
|
||||
return self.name.replace("SKETCH-", "")
|
||||
|
||||
def get_owner(self):
|
||||
"""Returns the owner of this sketch as a document.
|
||||
"""
|
||||
return frappe.get_doc("User", self.owner)
|
||||
|
||||
def get_owner_name(self):
|
||||
return self.get_owner().full_name
|
||||
|
||||
def get_livecode_url(self):
|
||||
doc = frappe.get_cached_doc("LMS Settings")
|
||||
return doc.livecode_url
|
||||
|
||||
def get_livecode_ws_url(self):
|
||||
url = urlparse(self.get_livecode_url())
|
||||
protocol = "wss" if url.scheme == "https" else "ws"
|
||||
return protocol + "://" + url.netloc + "/livecode"
|
||||
|
||||
def to_svg(self):
|
||||
return self.svg or self.render_svg()
|
||||
|
||||
def render_svg(self):
|
||||
h = hashlib.md5(self.code.encode('utf-8')).hexdigest()
|
||||
cache = frappe.cache()
|
||||
key = "sketch-" + h
|
||||
value = cache.get(key)
|
||||
if value:
|
||||
value = value.decode('utf-8')
|
||||
else:
|
||||
ws_url = self.get_livecode_ws_url()
|
||||
value = livecode.livecode_to_svg(ws_url, self.code)
|
||||
if value:
|
||||
cache.set(key, value)
|
||||
return value or DEFAULT_IMAGE
|
||||
|
||||
@staticmethod
|
||||
def get_recent_sketches(limit=100, owner=None):
|
||||
"""Returns the recent sketches.
|
||||
"""
|
||||
filters = {}
|
||||
if owner:
|
||||
filters = {"owner": owner}
|
||||
sketches = frappe.get_all(
|
||||
"LMS Sketch",
|
||||
filters=filters,
|
||||
fields='*',
|
||||
order_by='modified desc',
|
||||
page_length=limit
|
||||
)
|
||||
return [frappe.get_doc(doctype='LMS Sketch', **doc) for doc in sketches]
|
||||
|
||||
def __repr__(self):
|
||||
return f"<LMSSketch {self.name}>"
|
||||
|
||||
@frappe.whitelist()
|
||||
def save_sketch(name, title, code):
|
||||
if not name or name == "new":
|
||||
doc = frappe.new_doc('LMS Sketch')
|
||||
doc.title = title
|
||||
doc.code = code
|
||||
doc.runtime = 'python-canvas'
|
||||
doc.insert(ignore_permissions=True)
|
||||
status = "created"
|
||||
else:
|
||||
doc = frappe.get_doc("LMS Sketch", name)
|
||||
|
||||
if doc.owner != frappe.session.user:
|
||||
return {
|
||||
"ok": False,
|
||||
"error": "Permission Denied"
|
||||
}
|
||||
doc.title = title
|
||||
doc.code = code
|
||||
doc.svg = ''
|
||||
doc.save()
|
||||
status = "updated"
|
||||
return {
|
||||
"ok": True,
|
||||
"status": status,
|
||||
"name": doc.name,
|
||||
}
|
||||