Compare commits
1 Commits
version-13
...
event-mana
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4c55f1f71c |
19
.github/workflows/ci.yml
vendored
19
.github/workflows/ci.yml
vendored
@@ -6,7 +6,7 @@ on:
|
||||
pull_request: {}
|
||||
jobs:
|
||||
tests:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-20.04
|
||||
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,22 +53,19 @@ jobs:
|
||||
then
|
||||
(cd && tar xzf ~/bench-cache/bench.tgz)
|
||||
else
|
||||
bench init ~/frappe-bench --skip-redis-config-generation --skip-assets --python "$(which python)"
|
||||
bench init ~/frappe-bench --skip-redis-config-generation
|
||||
mkdir -p ~/bench-cache
|
||||
(cd && tar czf ~/bench-cache/bench.tgz frappe-bench)
|
||||
fi
|
||||
- name: add lms app to bench
|
||||
- name: add community app to bench
|
||||
working-directory: /home/runner/frappe-bench
|
||||
run: bench get-app lms $GITHUB_WORKSPACE
|
||||
run: bench get-app community $GITHUB_WORKSPACE
|
||||
- name: create bench site
|
||||
working-directory: /home/runner/frappe-bench
|
||||
run: bench new-site --mariadb-root-password root --admin-password admin frappe.local
|
||||
- name: install lms app
|
||||
- name: install community app
|
||||
working-directory: /home/runner/frappe-bench
|
||||
run: bench --verbose --site frappe.local install-app lms
|
||||
- name: setup requirements
|
||||
working-directory: /home/runner/frappe-bench
|
||||
run: bench setup requirements --dev
|
||||
run: bench --verbose --site frappe.local install-app community
|
||||
- name: allow tests
|
||||
working-directory: /home/runner/frappe-bench
|
||||
run: bench --site frappe.local set-config allow_tests true
|
||||
@@ -77,5 +74,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 lms
|
||||
run: bench --site frappe.local run-tests --app community
|
||||
|
||||
|
||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -3,8 +3,8 @@
|
||||
*.egg-info
|
||||
*.swp
|
||||
tags
|
||||
lms/docs/current
|
||||
lms/public/dist
|
||||
community/docs/current
|
||||
community/public/dist
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
|
||||
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
24
MANIFEST.in
@@ -4,15 +4,15 @@ include *.json
|
||||
include *.md
|
||||
include *.py
|
||||
include *.txt
|
||||
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
|
||||
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
|
||||
80
README.md
80
README.md
@@ -1,25 +1,79 @@
|
||||
## LMS
|
||||
## Community
|
||||
|
||||
Create online courses without much hassle.
|
||||
This app helps people organize and manage their own communities.
|
||||
|
||||

|
||||
The App has following components:
|
||||
|
||||
## Features
|
||||
1. Hackathons
|
||||
1. LMS
|
||||
|
||||
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.
|
||||
Community is built on the [Frappe Framework](https://github.com/frappe/frappe), a full-stack web app framework built with Python & JavaScript.
|
||||
|
||||
## Development Setup
|
||||
|
||||
1. [Through Docker](docker-installation.md)
|
||||
1. [Direct install through bench](bench-installation.md)
|
||||
**Step 1:** Clone the repo
|
||||
|
||||
```
|
||||
$ git clone https://github.com/fossunited/community.git
|
||||
|
||||
### Contributing
|
||||
$ cd community
|
||||
```
|
||||
|
||||
1. [Contribution Guidelines](Contribution.md)
|
||||
**Step 2:** Run docker-compose
|
||||
|
||||
## License
|
||||
```
|
||||
$ docker-compose up
|
||||
```
|
||||
|
||||
[GNU AFFERO GENERAL PUBLIC LICENSE](license.txt)
|
||||
**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
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
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.
|
||||
@@ -0,0 +1,8 @@
|
||||
// Copyright (c) 2021, Frappe and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Community Event', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
||||
@@ -0,0 +1,58 @@
|
||||
{
|
||||
"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
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, Frappe and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class CommunityEvent(Document):
|
||||
pass
|
||||
@@ -0,0 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, Frappe and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
class TestCommunityEvent(unittest.TestCase):
|
||||
pass
|
||||
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"actions": [],
|
||||
"creation": "2021-02-12 15:55:58.252902",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"member"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "member",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
"label": "Member",
|
||||
"options": "User"
|
||||
}
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"istable": 1,
|
||||
"links": [],
|
||||
"modified": "2021-05-21 12:15:51.286478",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Community",
|
||||
"name": "Community Event Volunteer",
|
||||
"owner": "Administrator",
|
||||
"permissions": [],
|
||||
"quick_entry": 1,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, Frappe and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class CommunityEventVolunteer(Document):
|
||||
pass
|
||||
@@ -0,0 +1,8 @@
|
||||
// Copyright (c) 2021, Frappe and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Community Participant', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
||||
@@ -0,0 +1,74 @@
|
||||
{
|
||||
"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
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, Frappe and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class CommunityParticipant(Document):
|
||||
pass
|
||||
@@ -0,0 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, Frappe and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
class TestCommunityParticipant(unittest.TestCase):
|
||||
pass
|
||||
@@ -0,0 +1,8 @@
|
||||
// Copyright (c) 2021, Frappe and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Community Speaker', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
||||
@@ -0,0 +1,72 @@
|
||||
{
|
||||
"actions": [],
|
||||
"creation": "2021-02-15 10:56:59.876454",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"full_name",
|
||||
"enabled",
|
||||
"avatar",
|
||||
"column_break_3",
|
||||
"short_bio",
|
||||
"bio"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "full_name",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Full Name"
|
||||
},
|
||||
{
|
||||
"fieldname": "avatar",
|
||||
"fieldtype": "Attach Image",
|
||||
"label": "Avatar"
|
||||
},
|
||||
{
|
||||
"fieldname": "short_bio",
|
||||
"fieldtype": "Data",
|
||||
"label": "Short Bio"
|
||||
},
|
||||
{
|
||||
"fieldname": "bio",
|
||||
"fieldtype": "Small Text",
|
||||
"label": "Bio"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "enabled",
|
||||
"fieldtype": "Check",
|
||||
"label": "Enabled"
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_3",
|
||||
"fieldtype": "Column Break"
|
||||
}
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2021-02-15 11:01:02.010360",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Community",
|
||||
"name": "Community Speaker",
|
||||
"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
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, Frappe and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class CommunitySpeaker(Document):
|
||||
pass
|
||||
@@ -0,0 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, Frappe and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
class TestCommunitySpeaker(unittest.TestCase):
|
||||
pass
|
||||
@@ -0,0 +1,8 @@
|
||||
// Copyright (c) 2021, Frappe and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Community Sponsor', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
||||
@@ -0,0 +1,82 @@
|
||||
{
|
||||
"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
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, Frappe and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class CommunitySponsor(Document):
|
||||
pass
|
||||
@@ -0,0 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, Frappe and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
class TestCommunitySponsor(unittest.TestCase):
|
||||
pass
|
||||
@@ -0,0 +1,8 @@
|
||||
// Copyright (c) 2021, Frappe and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Community Talk', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
||||
@@ -0,0 +1,80 @@
|
||||
{
|
||||
"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
|
||||
}
|
||||
10
community/community/doctype/community_talk/community_talk.py
Normal file
10
community/community/doctype/community_talk/community_talk.py
Normal file
@@ -0,0 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, Frappe and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class CommunityTalk(Document):
|
||||
pass
|
||||
@@ -0,0 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, Frappe and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
class TestCommunityTalk(unittest.TestCase):
|
||||
pass
|
||||
@@ -0,0 +1,8 @@
|
||||
// Copyright (c) 2021, FOSS United and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Discussion Message', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
||||
@@ -1,54 +1,53 @@
|
||||
{
|
||||
"actions": [],
|
||||
"creation": "2021-08-16 15:47:19.494055",
|
||||
"creation": "2021-08-11 10:59:38.597046",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"student",
|
||||
"issue_date",
|
||||
"column_break_3",
|
||||
"course",
|
||||
"expiry_date"
|
||||
"thread",
|
||||
"column_break_2",
|
||||
"parent_message",
|
||||
"section_break_4",
|
||||
"message"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "student",
|
||||
"fieldname": "message",
|
||||
"fieldtype": "Long Text",
|
||||
"in_list_view": 1,
|
||||
"label": "Message"
|
||||
},
|
||||
{
|
||||
"fieldname": "thread",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Student",
|
||||
"options": "User"
|
||||
"label": "Thread",
|
||||
"options": "Discussion Thread"
|
||||
},
|
||||
{
|
||||
"fieldname": "issue_date",
|
||||
"fieldtype": "Date",
|
||||
"label": "Issue Date"
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_3",
|
||||
"fieldname": "column_break_2",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "course",
|
||||
"fieldname": "parent_message",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
"in_standard_filter": 1,
|
||||
"label": "Course",
|
||||
"options": "LMS Course"
|
||||
"label": "Parent Message",
|
||||
"options": "Discussion Message"
|
||||
},
|
||||
{
|
||||
"fieldname": "expiry_date",
|
||||
"fieldtype": "Date",
|
||||
"label": "Expiry Date"
|
||||
"fieldname": "section_break_4",
|
||||
"fieldtype": "Section Break"
|
||||
}
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2021-08-16 15:47:19.494055",
|
||||
"modified": "2021-08-12 15:59:04.811286",
|
||||
"modified_by": "Administrator",
|
||||
"module": "LMS",
|
||||
"name": "LMS Certification",
|
||||
"module": "Community",
|
||||
"name": "Discussion Message",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
@@ -0,0 +1,22 @@
|
||||
# Copyright (c) 2021, FOSS United and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
import frappe
|
||||
from frappe.model.document import Document
|
||||
from community.widgets import Widget, Widgets
|
||||
|
||||
class DiscussionMessage(Document):
|
||||
def after_insert(self):
|
||||
data = {
|
||||
"message": self,
|
||||
"widgets": Widgets()
|
||||
}
|
||||
template = frappe.render_template("community/templates/message_card.html", data)
|
||||
thread_info = frappe.db.get_value("Discussion Thread", self.thread, ["reference_doctype", "reference_docname"], as_dict=True)
|
||||
frappe.publish_realtime(event="publish_message",
|
||||
message = {
|
||||
"thread": self.thread,
|
||||
"template": template,
|
||||
"thread_info": thread_info
|
||||
},
|
||||
after_commit=True)
|
||||
@@ -0,0 +1,8 @@
|
||||
# Copyright (c) 2021, FOSS United and Contributors
|
||||
# See license.txt
|
||||
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
class TestDiscussionMessage(unittest.TestCase):
|
||||
pass
|
||||
@@ -0,0 +1,8 @@
|
||||
// Copyright (c) 2021, FOSS United and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Discussion Thread', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
||||
@@ -0,0 +1,57 @@
|
||||
{
|
||||
"actions": [],
|
||||
"creation": "2021-08-11 10:55:29.341674",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"title",
|
||||
"reference_doctype",
|
||||
"reference_docname"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "title",
|
||||
"fieldtype": "Data",
|
||||
"label": "Title"
|
||||
},
|
||||
{
|
||||
"fieldname": "reference_doctype",
|
||||
"fieldtype": "Link",
|
||||
"label": "Reference Doctype",
|
||||
"options": "DocType"
|
||||
},
|
||||
{
|
||||
"fieldname": "reference_docname",
|
||||
"fieldtype": "Dynamic Link",
|
||||
"label": "Reference Docname",
|
||||
"options": "reference_doctype"
|
||||
}
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2021-08-11 12:29:43.564123",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Community",
|
||||
"name": "Discussion Thread",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "System Manager",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"search_fields": "title",
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"title_field": "title",
|
||||
"track_changes": 1
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
# Copyright (c) 2021, FOSS United and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class DiscussionThread(Document):
|
||||
pass
|
||||
|
||||
@frappe.whitelist()
|
||||
def submit_discussion(doctype, docname, message, title=None, thread_name=None):
|
||||
thread = []
|
||||
filters = {}
|
||||
if doctype and docname:
|
||||
filters = {
|
||||
"reference_doctype": doctype,
|
||||
"reference_docname": docname
|
||||
}
|
||||
|
||||
elif thread_name:
|
||||
filters = {
|
||||
"name": thread_name
|
||||
}
|
||||
|
||||
if filters:
|
||||
thread = frappe.get_all("Discussion Thread",filters)
|
||||
if len(thread):
|
||||
thread = thread[0]
|
||||
save_message(message, thread)
|
||||
|
||||
else:
|
||||
thread = frappe.get_doc({
|
||||
"doctype": "Discussion Thread",
|
||||
"title": title,
|
||||
"reference_doctype": doctype,
|
||||
"reference_docname": docname
|
||||
})
|
||||
thread.save(ignore_permissions=True)
|
||||
save_message(message, thread)
|
||||
|
||||
return thread.name
|
||||
|
||||
def save_message(message, thread):
|
||||
frappe.get_doc({
|
||||
"doctype": "Discussion Message",
|
||||
"message": message,
|
||||
"thread": thread.name
|
||||
}).save(ignore_permissions=True)
|
||||
@@ -4,5 +4,5 @@
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
class TestLMSCertification(unittest.TestCase):
|
||||
class TestDiscussionThread(unittest.TestCase):
|
||||
pass
|
||||
@@ -0,0 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, Frappe and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
class TestTShirtSizes(unittest.TestCase):
|
||||
pass
|
||||
8
community/community/doctype/tshirt_sizes/tshirt_sizes.js
Normal file
8
community/community/doctype/tshirt_sizes/tshirt_sizes.js
Normal file
@@ -0,0 +1,8 @@
|
||||
// Copyright (c) 2021, Frappe and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('TShirt Sizes', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
||||
49
community/community/doctype/tshirt_sizes/tshirt_sizes.json
Normal file
49
community/community/doctype/tshirt_sizes/tshirt_sizes.json
Normal file
@@ -0,0 +1,49 @@
|
||||
{
|
||||
"actions": [],
|
||||
"creation": "2021-02-25 17:52:49.813558",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"size",
|
||||
"quantity"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "size",
|
||||
"fieldtype": "Select",
|
||||
"label": "Size",
|
||||
"options": "S\nM\nL\nXL\nXXL\nXXXL"
|
||||
},
|
||||
{
|
||||
"fieldname": "quantity",
|
||||
"fieldtype": "Int",
|
||||
"label": "Quantity"
|
||||
}
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2021-02-25 17:52:49.813558",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Community",
|
||||
"name": "TShirt Sizes",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "System Manager",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"quick_entry": 1,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1
|
||||
}
|
||||
10
community/community/doctype/tshirt_sizes/tshirt_sizes.py
Normal file
10
community/community/doctype/tshirt_sizes/tshirt_sizes.py
Normal file
@@ -0,0 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, Frappe and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class TShirtSizes(Document):
|
||||
pass
|
||||
1
community/community/utils.py
Normal file
1
community/community/utils.py
Normal file
@@ -0,0 +1 @@
|
||||
import frappe
|
||||
@@ -0,0 +1,3 @@
|
||||
frappe.ready(function() {
|
||||
// bind events here
|
||||
})
|
||||
64
community/community/web_form/join_request/join_request.json
Normal file
64
community/community/web_form/join_request/join_request.json
Normal file
@@ -0,0 +1,64 @@
|
||||
{
|
||||
"accept_payment": 0,
|
||||
"allow_comments": 0,
|
||||
"allow_delete": 0,
|
||||
"allow_edit": 0,
|
||||
"allow_incomplete": 0,
|
||||
"allow_multiple": 0,
|
||||
"allow_print": 0,
|
||||
"amount": 0.0,
|
||||
"amount_based_on_field": 0,
|
||||
"apply_document_permissions": 0,
|
||||
"button_label": "Send Request",
|
||||
"client_script": "$('.page-header h2').html(`Request to Join \"${frappe.utils.get_url_arg('project_name')}\"`);",
|
||||
"creation": "2021-02-17 13:20:08.548735",
|
||||
"doc_type": "Community Project Member",
|
||||
"docstatus": 0,
|
||||
"doctype": "Web Form",
|
||||
"idx": 0,
|
||||
"is_standard": 1,
|
||||
"login_required": 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
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
|
||||
def get_context(context):
|
||||
# do your magic here
|
||||
pass
|
||||
@@ -0,0 +1,8 @@
|
||||
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');
|
||||
})
|
||||
@@ -0,0 +1,63 @@
|
||||
{
|
||||
"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
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
|
||||
def get_context(context):
|
||||
# do your magic here
|
||||
pass
|
||||
@@ -1,5 +1,5 @@
|
||||
{% set color = member.get_palette() %}
|
||||
<a class="button-links" href="{{ member.get_profile_url() }}">
|
||||
<a class="button-links" href="/{{member.username}}">
|
||||
<span class="avatar {{ avatar_class }}" title="{{ member.full_name }}">
|
||||
{% if member.user_image %}
|
||||
<img class="avatar-frame standard-image" style="object-fit: cover;" src="{{ member.user_image }}" title="{{ member.full_name }}">
|
||||
70
community/community/widgets/DiscussionComment.html
Normal file
70
community/community/widgets/DiscussionComment.html
Normal file
@@ -0,0 +1,70 @@
|
||||
<div class="discussions">
|
||||
|
||||
<form class="discussion-form {% if doctype or thread %} discussion-on-page {% endif %}" id="discussion-form">
|
||||
|
||||
|
||||
<div class="form-group" {% if title or thread %} style="display: none;" {% endif %}>
|
||||
<div class="control-input-wrapper">
|
||||
<div class="control-input">
|
||||
<input type="text" autocomplete="off" class="input-with-feedback form-control thread-title"
|
||||
data-fieldtype="Data" data-fieldname="feedback_comments" placeholder="Title" spellcheck="false" {% if title
|
||||
%} value="{{ title }}" {% endif %}></input>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="control-input-wrapper">
|
||||
<div class="control-input">
|
||||
<textarea type="text" autocomplete="off" class="input-with-feedback form-control comment-field"
|
||||
data-fieldtype="Text" data-fieldname="feedback_comments" placeholder="Enter a comment..."
|
||||
spellcheck="false"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="comment-footer">
|
||||
<div class="button is-secondary pull-right" id="submit-discussion"
|
||||
{% if doctype %} data-doctype="{{ doctype | urlencode}}" {% endif %}
|
||||
{% if docname %} data-docname="{{ docname | urlencode}}" {% endif %}
|
||||
{% if thread %} data-thread="{{ thread }}" {% endif %}>
|
||||
Post</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
frappe.ready(() => {
|
||||
$("#submit-discussion").click((e) => {
|
||||
submit_discussion(e);
|
||||
})
|
||||
})
|
||||
|
||||
var submit_discussion = (e) => {
|
||||
var message = $(".comment-field").val().trim();
|
||||
|
||||
if (message) {
|
||||
var doctype = $(e.currentTarget).attr("data-doctype");
|
||||
doctype = doctype ? decodeURIComponent(doctype) : doctype;
|
||||
|
||||
var docname = $(e.currentTarget).attr("data-docname");
|
||||
docname = docname ? decodeURIComponent(docname) : docname;
|
||||
|
||||
frappe.call({
|
||||
method: "community.community.doctype.discussion_thread.discussion_thread.submit_discussion",
|
||||
args: {
|
||||
"doctype": doctype ? doctype : "",
|
||||
"docname": docname ? docname : "",
|
||||
"message": $(".comment-field").val(),
|
||||
"title": $(".thread-title").val(),
|
||||
"thread_name": $(e.currentTarget).attr("data-thread")
|
||||
},
|
||||
callback: (data) => {
|
||||
if (! $(".discussion-on-page").length) {
|
||||
$("#discussion-modal").modal("hide");
|
||||
window.location.href = `/discussions/${data.message}`;
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
80
community/community/widgets/DiscussionMessage.html
Normal file
80
community/community/widgets/DiscussionMessage.html
Normal file
@@ -0,0 +1,80 @@
|
||||
{% if doctype and docname and not thread %}
|
||||
|
||||
{% set thread_info = frappe.get_all("Discussion Thread", {"reference_doctype": doctype, "reference_docname": docname},
|
||||
["name"]) %}
|
||||
|
||||
{% if thread_info | length %}
|
||||
{% set thread = thread_info[0].name %}
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% if thread %}
|
||||
{% set messages = frappe.get_all("Discussion Message", {"thread": thread}, ["name", "message", "owner", "creation"],
|
||||
order_by="creation") %}
|
||||
{% endif %}
|
||||
|
||||
{% if doctype %}
|
||||
<div class="course-home-headings mt-5"> Discussions </div>
|
||||
{% endif %}
|
||||
|
||||
<div class="messages mt-5">
|
||||
{% for message in messages %}
|
||||
{% include "community/templates/message_card.html" %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
{% if frappe.session.user == "Guest" or (condition is defined and not condition) %}
|
||||
<div class="d-flex flex-column align-items-center font-weight-bold">
|
||||
Want to join the discussion?
|
||||
{% if frappe.session.user == "Guest" %}
|
||||
<div class="button is-primary" id="login-from-discussion">Log In</div>
|
||||
{% elif not condition %}
|
||||
<div class="button is-primary" id="login-from-discussion" data-redirect="{{ redirect_to }}">{{ button_name }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% else %}
|
||||
{{ widgets.DiscussionComment(doctype=doctype, docname=docname, title=title, thread=thread ) }}
|
||||
{% endif %}
|
||||
|
||||
<script>
|
||||
frappe.ready(() => {
|
||||
setup_socket_io();
|
||||
|
||||
$("#login-from-discussion").click((e) => {
|
||||
login_from_discussion(e);
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
var setup_socket_io = () => {
|
||||
const assets = [
|
||||
"/assets/frappe/js/lib/socket.io.min.js",
|
||||
"/assets/frappe/js/frappe/socketio_client.js",
|
||||
]
|
||||
frappe.require(assets, () => {
|
||||
|
||||
if (window.dev_server) {
|
||||
frappe.boot.socketio_port = "9000";
|
||||
}
|
||||
|
||||
frappe.socketio.init(9000);
|
||||
var target = $("#submit-discussion");
|
||||
|
||||
frappe.socketio.socket.on("publish_message", (data) => {
|
||||
if (target.attr("data-thread") == data.thread
|
||||
|| (decodeURIComponent(target.attr("data-doctype")) == data.thread_info.reference_doctype
|
||||
&& decodeURIComponent(target.attr("data-docname")) == data.thread_info.reference_docname)) {
|
||||
$(".comment-field").val("");
|
||||
$(".messages").append(data.template);
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
var login_from_discussion = (e) => {
|
||||
var redirect = $(e.currentTarget).attr("data-redirect") || window.location.href;
|
||||
window.location.href = `/login?redirect-to=${redirect}`;
|
||||
}
|
||||
|
||||
</script>
|
||||
@@ -0,0 +1,8 @@
|
||||
// Copyright (c) 2021, FOSS United and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Community Conference', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
||||
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"actions": [],
|
||||
"autoname": "field:conference_name",
|
||||
"creation": "2021-02-25 17:12:51.981534",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"conference_name",
|
||||
"live_stream_url",
|
||||
"conference_details"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "conference_name",
|
||||
"fieldtype": "Data",
|
||||
"label": "Conference Name",
|
||||
"unique": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "live_stream_url",
|
||||
"fieldtype": "Data",
|
||||
"label": "Live Stream URL"
|
||||
},
|
||||
{
|
||||
"fieldname": "conference_details",
|
||||
"fieldtype": "Markdown Editor",
|
||||
"label": "Conference Details"
|
||||
}
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2021-04-06 18:30:18.228083",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Conference",
|
||||
"name": "Community Conference",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "System Manager",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"quick_entry": 1,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, FOSS United and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class CommunityConference(Document):
|
||||
pass
|
||||
@@ -0,0 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, FOSS United and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
class TestCommunityConference(unittest.TestCase):
|
||||
pass
|
||||
@@ -0,0 +1,8 @@
|
||||
// Copyright (c) 2021, FOSS United and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Community Conference Participant', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
||||
@@ -0,0 +1,147 @@
|
||||
{
|
||||
"actions": [],
|
||||
"autoname": "CON-.YYYY.-.###",
|
||||
"creation": "2021-02-25 17:51:23.959033",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"participant_details",
|
||||
"participant_name",
|
||||
"participant_designation",
|
||||
"column_break_4",
|
||||
"email",
|
||||
"conference_details",
|
||||
"year",
|
||||
"full_conference_tickets",
|
||||
"user_conference_tickets",
|
||||
"paid",
|
||||
"column_break_11",
|
||||
"tshirt_table",
|
||||
"tshirt_size",
|
||||
"currency",
|
||||
"amount",
|
||||
"thank_you_email_sent"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "participant_details",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Participant Details"
|
||||
},
|
||||
{
|
||||
"fieldname": "participant_name",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Participant Name",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "participant_designation",
|
||||
"fieldtype": "Select",
|
||||
"label": "Participant Designation",
|
||||
"options": "\nCxO\nAnalyst\nConsultant\nDeveloper\nSystem Administrator\nOther"
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_4",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "email",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Email",
|
||||
"options": "Email",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "conference_details",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Conference Details"
|
||||
},
|
||||
{
|
||||
"fieldname": "year",
|
||||
"fieldtype": "Select",
|
||||
"label": "Year",
|
||||
"options": "\n2017\n2018\n2019\n2020\n2021\n2022\n2023\n2024\n2025"
|
||||
},
|
||||
{
|
||||
"fieldname": "full_conference_tickets",
|
||||
"fieldtype": "Int",
|
||||
"in_list_view": 1,
|
||||
"label": "Full Conference Tickets",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "user_conference_tickets",
|
||||
"fieldtype": "Int",
|
||||
"label": "User Conference Tickets"
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "paid",
|
||||
"fieldtype": "Check",
|
||||
"label": "Paid"
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break_11",
|
||||
"fieldtype": "Column Break"
|
||||
},
|
||||
{
|
||||
"fieldname": "tshirt_table",
|
||||
"fieldtype": "Data",
|
||||
"label": "T-Shirt Sizes"
|
||||
},
|
||||
{
|
||||
"fieldname": "tshirt_size",
|
||||
"fieldtype": "Select",
|
||||
"label": "T-Shirt Size",
|
||||
"options": "S\nM\nL\nXL\nXXL\nXXXL"
|
||||
},
|
||||
{
|
||||
"fieldname": "currency",
|
||||
"fieldtype": "Select",
|
||||
"in_list_view": 1,
|
||||
"label": "Currency",
|
||||
"options": "USD\nINR",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "amount",
|
||||
"fieldtype": "Currency",
|
||||
"label": "Amount",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "thank_you_email_sent",
|
||||
"fieldtype": "Check",
|
||||
"label": "Thank You Email Sent"
|
||||
}
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2021-03-04 20:13:42.151103",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Conference",
|
||||
"name": "Community Conference Participant",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "System Manager",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"quick_entry": 1,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, FOSS United and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class CommunityConferenceParticipant(Document):
|
||||
pass
|
||||
@@ -0,0 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, FOSS United and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
class TestCommunityConferenceParticipant(unittest.TestCase):
|
||||
pass
|
||||
@@ -0,0 +1,8 @@
|
||||
// Copyright (c) 2021, FOSS United and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Community Conference Request', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
||||
@@ -0,0 +1,73 @@
|
||||
{
|
||||
"actions": [],
|
||||
"creation": "2021-02-25 17:19:10.378290",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"contact_name",
|
||||
"contact_number",
|
||||
"email",
|
||||
"organization_name",
|
||||
"request_type",
|
||||
"message"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "contact_name",
|
||||
"fieldtype": "Data",
|
||||
"label": "Contact Name"
|
||||
},
|
||||
{
|
||||
"fieldname": "contact_number",
|
||||
"fieldtype": "Data",
|
||||
"label": "Contact Number"
|
||||
},
|
||||
{
|
||||
"fieldname": "email",
|
||||
"fieldtype": "Data",
|
||||
"label": "Email"
|
||||
},
|
||||
{
|
||||
"fieldname": "organization_name",
|
||||
"fieldtype": "Data",
|
||||
"label": "Organization Name"
|
||||
},
|
||||
{
|
||||
"fieldname": "request_type",
|
||||
"fieldtype": "Select",
|
||||
"label": "Request Type",
|
||||
"options": "Sponsorship\nExhibit Program"
|
||||
},
|
||||
{
|
||||
"fieldname": "message",
|
||||
"fieldtype": "Text Editor",
|
||||
"label": "Message"
|
||||
}
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2021-03-04 20:13:26.130017",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Conference",
|
||||
"name": "Community Conference Request",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
"export": 1,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
"report": 1,
|
||||
"role": "System Manager",
|
||||
"share": 1,
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
"quick_entry": 1,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 1
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, FOSS United and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class CommunityConferenceRequest(Document):
|
||||
pass
|
||||
@@ -0,0 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2021, FOSS United and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
class TestCommunityConferenceRequest(unittest.TestCase):
|
||||
pass
|
||||
@@ -0,0 +1,8 @@
|
||||
// Copyright (c) 2021, FOSS United and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Attendee Registration', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
||||
@@ -0,0 +1,77 @@
|
||||
{
|
||||
"actions": [],
|
||||
"creation": "2021-08-11 10:07:53.262504",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"attendee_info_section",
|
||||
"name1",
|
||||
"email",
|
||||
"phone_number",
|
||||
"occupation",
|
||||
"company",
|
||||
"what_are_you_hoping_to_learn"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "attendee_info_section",
|
||||
"fieldtype": "Section Break",
|
||||
"label": "Attendee Info"
|
||||
},
|
||||
{
|
||||
"fieldname": "name1",
|
||||
"fieldtype": "Data",
|
||||
"label": "Name"
|
||||
},
|
||||
{
|
||||
"fieldname": "email",
|
||||
"fieldtype": "Data",
|
||||
"label": "Email"
|
||||
},
|
||||
{
|
||||
"fieldname": "phone_number",
|
||||
"fieldtype": "Data",
|
||||
"label": "Phone Number"
|
||||
},
|
||||
{
|
||||
"fieldname": "occupation",
|
||||
"fieldtype": "Data",
|
||||
"label": "Occupation"
|
||||
},
|
||||
{
|
||||
"fieldname": "company",
|
||||
"fieldtype": "Data",
|
||||
"label": "Company"
|
||||
},
|
||||
{
|
||||
"fieldname": "what_are_you_hoping_to_learn",
|
||||
"fieldtype": "Text",
|
||||
"label": "What are you hoping to learn"
|
||||
}
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2021-08-11 10:07:53.262504",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Event Management",
|
||||
"name": "Attendee Registration",
|
||||
"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
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
# Copyright (c) 2021, FOSS United and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class AttendeeRegistration(Document):
|
||||
pass
|
||||
@@ -0,0 +1,8 @@
|
||||
# Copyright (c) 2021, FOSS United and Contributors
|
||||
# See license.txt
|
||||
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
class TestAttendeeRegistration(unittest.TestCase):
|
||||
pass
|
||||
@@ -0,0 +1,8 @@
|
||||
// Copyright (c) 2021, FOSS United and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Event Details', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
||||
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"actions": [],
|
||||
"autoname": "field:event_name",
|
||||
"creation": "2021-08-11 10:05:41.072432",
|
||||
"doctype": "DocType",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"event_name",
|
||||
"start_date",
|
||||
"end_date",
|
||||
"event_description"
|
||||
],
|
||||
"fields": [
|
||||
{
|
||||
"fieldname": "event_name",
|
||||
"fieldtype": "Data",
|
||||
"in_list_view": 1,
|
||||
"label": "Event Name",
|
||||
"reqd": 1,
|
||||
"unique": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "start_date",
|
||||
"fieldtype": "Date",
|
||||
"in_list_view": 1,
|
||||
"label": "Start Date",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "end_date",
|
||||
"fieldtype": "Date",
|
||||
"in_list_view": 1,
|
||||
"label": "End Date",
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "event_description",
|
||||
"fieldtype": "Markdown Editor",
|
||||
"in_list_view": 1,
|
||||
"label": "Event Description"
|
||||
}
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"links": [],
|
||||
"modified": "2021-08-18 23:51:30.432691",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Event Management",
|
||||
"name": "Event Details",
|
||||
"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
|
||||
}
|
||||
@@ -4,5 +4,5 @@
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class CourseChapter(Document):
|
||||
class EventDetails(Document):
|
||||
pass
|
||||
@@ -4,5 +4,5 @@
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
class TestCourseLesson(unittest.TestCase):
|
||||
class TestEventDetails(unittest.TestCase):
|
||||
pass
|
||||
@@ -0,0 +1,8 @@
|
||||
// Copyright (c) 2021, FOSS United and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Event Ticket', {
|
||||
// refresh: function(frm) {
|
||||
|
||||
// }
|
||||
});
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user