Compare commits

..

1 Commits

Author SHA1 Message Date
pateljannat
05f28430b9 feat: quiz doctypes 2021-05-31 10:16:21 +05:30
1023 changed files with 8811 additions and 149518 deletions

View File

@@ -9,7 +9,7 @@ root = true
end_of_line = lf end_of_line = lf
insert_final_newline = true insert_final_newline = true
charset = utf-8 charset = utf-8
indent_style = tab indent_style = space
trim_trailing_whitespace = true trim_trailing_whitespace = true
# Python # Python
@@ -26,4 +26,4 @@ indent_style = tab
# HTML, CSS, javascript, JSON and YAML # HTML, CSS, javascript, JSON and YAML
[*.{html,css,js,json,yml,yaml}] [*.{html,css,js,json,yml,yaml}]
indent_size = 4 indent_size = 2

37
.flake8
View File

@@ -1,37 +0,0 @@
[flake8]
ignore =
E121,
E126,
E127,
E128,
E203,
E225,
E226,
E231,
E241,
E251,
E261,
E265,
E302,
E303,
E305,
E402,
E501,
E741,
W291,
W292,
W293,
W391,
W503,
W504,
F403,
B007,
B950,
W191,
E124, # closing bracket, irritating while writing QB code
E131, # continuation line unaligned for hanging indent
E123, # closing bracket does not match indentation of opening bracket's line
E101, # ensured by use of black
max-line-length = 200
exclude=.github/helper/semgrep_rules

View File

@@ -1,74 +0,0 @@
[flake8]
ignore =
B001,
B007,
B009,
B010,
B950,
E101,
E111,
E114,
E116,
E117,
E121,
E122,
E123,
E124,
E125,
E126,
E127,
E128,
E131,
E201,
E202,
E203,
E211,
E221,
E222,
E223,
E224,
E225,
E226,
E228,
E231,
E241,
E242,
E251,
E261,
E262,
E265,
E266,
E271,
E272,
E273,
E274,
E301,
E302,
E303,
E305,
E306,
E402,
E501,
E502,
E701,
E702,
E703,
E741,
F401,
F403,
F405,
W191,
W291,
W292,
W293,
W391,
W503,
W504,
E711,
E129,
F841,
E713,
E712,
max-line-length = 200

View File

@@ -1,46 +0,0 @@
#!/bin/bash
set -e
cd ~ || exit
echo "Setting Up Bench..."
pip install frappe-bench
bench -v init frappe-bench --skip-assets --python "$(which python)"
cd ./frappe-bench || exit
bench -v setup requirements
echo "Setting Up LMS App..."
bench get-app lms "${GITHUB_WORKSPACE}"
echo "Setting Up Sites & Database..."
mkdir ~/frappe-bench/sites/lms.test
cp "${GITHUB_WORKSPACE}/.github/helper/site_config.json" ~/frappe-bench/sites/lms.test/site_config.json
mariadb --host 127.0.0.1 --port 3306 -u root -p123 -e "SET GLOBAL character_set_server = 'utf8mb4'";
mariadb --host 127.0.0.1 --port 3306 -u root -p123 -e "SET GLOBAL collation_server = 'utf8mb4_unicode_ci'";
mariadb --host 127.0.0.1 --port 3306 -u root -p123 -e "CREATE DATABASE test_lms";
mariadb --host 127.0.0.1 --port 3306 -u root -p123 -e "CREATE USER 'test_lms'@'localhost' IDENTIFIED BY 'test_lms'";
mariadb --host 127.0.0.1 --port 3306 -u root -p123 -e "GRANT ALL PRIVILEGES ON \`test_lms\`.* TO 'test_lms'@'localhost'";
mariadb --host 127.0.0.1 --port 3306 -u root -p123 -e "FLUSH PRIVILEGES";
echo "Setting Up Procfile..."
sed -i 's/^watch:/# watch:/g' Procfile
sed -i 's/^schedule:/# schedule:/g' Procfile
echo "Starting Bench..."
bench start &> bench_start.log &
CI=Yes bench build &
build_pid=$!
bench --site lms.test reinstall --yes
bench --site lms.test install-app lms
wait $build_pid

View File

@@ -1,14 +0,0 @@
#!/bin/bash
set -e
echo "Setting Up System Dependencies..."
sudo apt update
sudo apt remove mysql-server mysql-client
sudo apt install libcups2-dev redis-server mariadb-client-10.6
install_wkhtmltopdf() {
wget -q https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb
sudo apt install ./wkhtmltox_0.12.6-1.focal_amd64.deb
}
install_wkhtmltopdf &

View File

@@ -1,20 +0,0 @@
{
"db_host": "127.0.0.1",
"db_port": 3306,
"db_name": "test_lms",
"db_password": "test_lms",
"allow_tests": true,
"enable_ui_tests": true,
"db_type": "mariadb",
"auto_email_id": "test@example.com",
"mail_server": "smtp.example.com",
"mail_login": "test@example.com",
"mail_password": "test",
"admin_password": "admin",
"root_login": "root",
"root_password": "123",
"host_name": "http://lms.test:8000",
"monitor": 1,
"server_script_enabled": true,
"mute_emails": true
}

View File

@@ -1,40 +0,0 @@
#!/bin/bash
set -e
cd ~ || exit
echo "Setting Up Bench..."
pip install frappe-bench
bench -v init frappe-bench --skip-assets --skip-redis-config-generation --python "$(which python)" --frappe-branch "${BASE_BRANCH}"
cd ./frappe-bench || exit
echo "Get LMS..."
bench get-app --skip-assets lms "${GITHUB_WORKSPACE}"
echo "Generating POT file..."
bench generate-pot-file --app lms
cd ./apps/lms || exit
echo "Configuring git user..."
git config user.email "developers@erpnext.com"
git config user.name "frappe-pr-bot"
echo "Setting the correct git remote..."
# Here, the git remote is a local file path by default. Let's change it to the upstream repo.
git remote set-url upstream https://github.com/frappe/lms.git
echo "Creating a new branch..."
isodate=$(date -u +"%Y-%m-%d")
branch_name="pot_${BASE_BRANCH}_${isodate}"
git checkout -b "${branch_name}"
echo "Commiting changes..."
git add lms/locale/main.pot
git commit -m "chore: update POT file"
gh auth setup-git
git push -u upstream "${branch_name}"
echo "Creating a PR..."
gh pr create --fill --base "${BASE_BRANCH}" --head "${branch_name}" -R frappe/lms

View File

@@ -1,32 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="4 2 193 52">
<g filter="url(#filter0_dd)">
<rect x="4" y="2" width="193" height="52" rx="6" fill="#2490EF"/>
<path d="M28 22.2891H32.8786V35.5H36.2088V22.2891H41.0874V19.5H28V22.2891Z" fill="white"/>
<path d="M41.6982 35.5H45.0129V28.7109C45.0129 27.2344 46.0866 26.2188 47.5494 26.2188C48.0085 26.2188 48.6388 26.2969 48.95 26.3984V23.4453C48.6543 23.375 48.2419 23.3281 47.9074 23.3281C46.5691 23.3281 45.472 24.1094 45.0362 25.5938H44.9117V23.5H41.6982V35.5Z" fill="white"/>
<path d="M52.8331 40C55.2996 40 56.6068 38.7344 57.2837 36.7969L61.9289 23.5156L58.4197 23.5L55.9221 32.3125H55.7976L53.3233 23.5H49.8374L54.1247 35.8437L53.9302 36.3516C53.4944 37.4766 52.6619 37.5312 51.4947 37.1719L50.7478 39.6562C51.2224 39.8594 51.9927 40 52.8331 40Z" fill="white"/>
<path d="M73.6142 35.7344C77.2401 35.7344 79.4966 33.2422 79.4966 29.5469C79.4966 25.8281 77.2401 23.3438 73.6142 23.3438C69.9883 23.3438 67.7319 25.8281 67.7319 29.5469C67.7319 33.2422 69.9883 35.7344 73.6142 35.7344ZM73.6298 33.1562C71.9569 33.1562 71.101 31.6171 71.101 29.5233C71.101 27.4296 71.9569 25.8827 73.6298 25.8827C75.2715 25.8827 76.1274 27.4296 76.1274 29.5233C76.1274 31.6171 75.2715 33.1562 73.6298 33.1562Z" fill="white"/>
<path d="M84.7253 28.5625C84.7331 27.0156 85.6512 26.1094 86.9895 26.1094C88.3201 26.1094 89.1215 26.9844 89.1137 28.4531V35.5H92.4284V27.8594C92.4284 25.0625 90.7945 23.3438 88.3046 23.3438C86.5306 23.3438 85.2466 24.2187 84.7097 25.6172H84.5697V23.5H81.4106V35.5H84.7253V28.5625Z" fill="white"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M102.429 19.5H113.429V22.3141H102.429V19.5ZM102.429 35.5V26.6794H112.699V29.4982H105.94V35.5H102.429Z" fill="white"/>
<path d="M131.584 24.9625C131.09 21.5057 128.345 19.5 124.785 19.5C120.589 19.5 117.429 22.463 117.429 27.4924C117.429 32.5142 120.55 35.4848 124.785 35.4848C128.604 35.4848 131.137 33.0916 131.584 30.1211L128.651 30.1059C128.282 31.9293 126.745 32.9549 124.824 32.9549C122.22 32.9549 120.354 31.0632 120.354 27.4924C120.354 23.9824 122.204 22.0299 124.832 22.0299C126.784 22.0299 128.314 23.1011 128.651 24.9625H131.584Z" fill="white"/>
<path d="M136.409 19.7124H133.571V35.2718H136.409V19.7124Z" fill="white"/>
<path d="M144.031 35.5001C147.56 35.5001 149.803 33.0917 149.803 29.483C149.803 25.8667 147.56 23.4507 144.031 23.4507C140.502 23.4507 138.259 25.8667 138.259 29.483C138.259 33.0917 140.502 35.5001 144.031 35.5001ZM144.047 33.2969C142.094 33.2969 141.137 31.6103 141.137 29.4754C141.137 27.3406 142.094 25.6312 144.047 25.6312C145.968 25.6312 146.925 27.3406 146.925 29.4754C146.925 31.6103 145.968 33.2969 144.047 33.2969Z" fill="white"/>
<path d="M159.338 30.3641C159.338 32.1419 158.028 33.0232 156.773 33.0232C155.409 33.0232 154.499 32.0887 154.499 30.6072V23.6025H151.66V31.0327C151.66 33.8361 153.307 35.4239 155.675 35.4239C157.479 35.4239 158.749 34.5046 159.298 33.1979H159.424V35.272H162.176V23.6025H159.338V30.3641Z" fill="white"/>
<path d="M169.014 35.4769C171.084 35.4769 172.017 34.2841 172.464 33.4332H172.637V35.2718H175.429V19.7124H172.582V25.532H172.464C172.033 24.6887 171.147 23.4503 169.022 23.4503C166.238 23.4503 164.05 25.5624 164.05 29.4522C164.05 33.2965 166.175 35.4769 169.014 35.4769ZM169.806 33.2205C167.931 33.2205 166.943 31.6251 166.943 29.437C166.943 27.2642 167.916 25.7067 169.806 25.7067C171.633 25.7067 172.637 27.173 172.637 29.437C172.637 31.701 171.617 33.2205 169.806 33.2205Z" fill="white"/>
</g>
<defs>
<filter id="filter0_dd" x="0" y="0" width="201" height="60" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset/>
<feGaussianBlur stdDeviation="0.25"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dy="2"/>
<feGaussianBlur stdDeviation="2"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.13 0"/>
<feBlend mode="normal" in2="effect1_dropShadow" result="effect2_dropShadow"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect2_dropShadow" result="shape"/>
</filter>
</defs>
</svg>

Before

Width:  |  Height:  |  Size: 4.3 KiB

View File

@@ -1,4 +1,4 @@
name: Server Tests name: Run tests
on: on:
push: push:
branches: branches:
@@ -6,7 +6,7 @@ on:
pull_request: {} pull_request: {}
jobs: jobs:
tests: tests:
runs-on: ubuntu-latest runs-on: ubuntu-20.04
services: services:
redis-cache: redis-cache:
image: redis:alpine image: redis:alpine
@@ -32,11 +32,11 @@ jobs:
- name: setup python - name: setup python
uses: actions/setup-python@v2 uses: actions/setup-python@v2
with: with:
python-version: '3.10' python-version: 3.9
- name: setup node - name: setup node
uses: actions/setup-node@v2 uses: actions/setup-node@v2
with: with:
node-version: '18' node-version: '14'
check-latest: true check-latest: true
- name: setup cache for bench - name: setup cache for bench
uses: actions/cache@v2 uses: actions/cache@v2
@@ -53,22 +53,19 @@ jobs:
then then
(cd && tar xzf ~/bench-cache/bench.tgz) (cd && tar xzf ~/bench-cache/bench.tgz)
else 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 mkdir -p ~/bench-cache
(cd && tar czf ~/bench-cache/bench.tgz frappe-bench) (cd && tar czf ~/bench-cache/bench.tgz frappe-bench)
fi fi
- name: add lms app to bench - name: add community app to bench
working-directory: /home/runner/frappe-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 - name: create bench site
working-directory: /home/runner/frappe-bench working-directory: /home/runner/frappe-bench
run: bench new-site --mariadb-root-password root --admin-password admin frappe.local 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 working-directory: /home/runner/frappe-bench
run: bench --site frappe.local install-app lms run: bench --verbose --site frappe.local install-app community
- name: setup requirements
working-directory: /home/runner/frappe-bench
run: bench setup requirements --dev
- name: allow tests - name: allow tests
working-directory: /home/runner/frappe-bench working-directory: /home/runner/frappe-bench
run: bench --site frappe.local set-config allow_tests true run: bench --site frappe.local set-config allow_tests true
@@ -77,4 +74,5 @@ jobs:
run: bench --site frappe.local build run: bench --site frappe.local build
- name: run tests - name: run tests
working-directory: /home/runner/frappe-bench working-directory: /home/runner/frappe-bench
run: bench --site frappe.local run-tests --app lms run: bench --site frappe.local run-tests --app community

View File

@@ -1,34 +0,0 @@
name: Regenerate POT file (translatable strings)
on:
schedule:
- cron: "00 16 * * 5"
workflow_dispatch:
jobs:
regenerate-pot-file:
name: Release
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
branch: ["develop"]
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Run script to update POT file
run: |
bash ${GITHUB_WORKSPACE}/.github/helper/update_pot_file.sh
env:
GH_TOKEN: ${{ secrets.RELEASE_TOKEN }}
BASE_BRANCH: ${{ matrix.branch }}

View File

@@ -1,33 +0,0 @@
name: Linters
on:
pull_request:
workflow_dispatch:
push:
branches: [ main ]
jobs:
linters:
name: Semantic Commits
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install and Run Pre-commit
uses: pre-commit/action@v2.0.3
- name: Download Semgrep rules
run: git clone --depth 1 https://github.com/frappe/semgrep-rules.git frappe-semgrep-rules
- name: Download semgrep
run: pip install semgrep
- name: Run Semgrep rules
run: semgrep ci --config ./frappe-semgrep-rules/rules

View File

@@ -1,27 +0,0 @@
name: Create weekly release
on:
schedule:
# 13:00 UTC -> 7pm IST on every Wednesday
- cron: '30 4 * * 3'
workflow_dispatch:
jobs:
release:
name: Release
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: octokit/request-action@v2.x
with:
route: POST /repos/{owner}/{repo}/pulls
owner: frappe
repo: lms
title: |-
"chore: merge 'develop' into 'main'"
body: "Automated weekly release"
base: main
head: develop
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}

View File

@@ -1,32 +0,0 @@
name: Generate Semantic Release
on:
workflow_dispatch:
push:
branches:
- main
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Entire Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Setup dependencies
run: |
npm install @semantic-release/git @semantic-release/exec --no-save
- name: Create Release
env:
GH_TOKEN: ${{ secrets.RELEASE_TOKEN }}
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
GIT_AUTHOR_NAME: "Frappe PR Bot"
GIT_AUTHOR_EMAIL: "developers@frappe.io"
GIT_COMMITTER_NAME: "Frappe PR Bot"
GIT_COMMITTER_EMAIL: "developers@frappe.io"
run: npx semantic-release

View File

@@ -1,39 +0,0 @@
# This action:
#
# 1. Generates release notes using github API.
# 2. Strips unnecessary info like chore/style etc from notes.
# 3. Updates release info.
name: 'Release Notes'
on:
workflow_dispatch:
inputs:
tag_name:
description: 'Tag of release like v2.0.0'
required: true
type: string
release:
types: [released]
permissions:
contents: read
jobs:
regen-notes:
name: 'Regenerate release notes'
runs-on: ubuntu-latest
steps:
- name: Update notes
run: |
NEW_NOTES=$(gh api --method POST -H "Accept: application/vnd.github+json" /repos/frappe/lms/releases/generate-notes -f tag_name=$RELEASE_TAG \
| jq -r '.body' \
| sed -E '/^\* (chore|ci|test|docs|style)/d' \
| sed -E 's/by @mergify //'
)
RELEASE_ID=$(gh api -H "Accept: application/vnd.github+json" /repos/frappe/lms/releases/tags/$RELEASE_TAG | jq -r '.id')
gh api --method PATCH -H "Accept: application/vnd.github+json" /repos/frappe/lms/releases/$RELEASE_ID -f body="$NEW_NOTES"
env:
GH_TOKEN: ${{ secrets.RELEASE_TOKEN }}
RELEASE_TAG: ${{ github.event.inputs.tag_name || github.event.release.tag_name }}

View File

@@ -1,19 +0,0 @@
name: Semantic Pull Request
on:
push:
branches: [ main ]
pull_request: {}
jobs:
# This workflow contains a single job called "build"
semantic:
name: Validate PR title
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: zeke/semantic-pull-requests@main

View File

@@ -1,122 +0,0 @@
name: UI
on:
pull_request:
workflow_dispatch:
push:
branches: [ main ]
permissions:
# Do not change this as GITHUB_TOKEN is being used by roulette
contents: read
jobs:
test:
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'frappe' }}
timeout-minutes: 60
strategy:
fail-fast: false
name: UI Tests (Cypress)
services:
mariadb:
image: mariadb:10.6
env:
MARIADB_ROOT_PASSWORD: 123
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
steps:
- name: Clone
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Check for valid Python & Merge Conflicts
run: |
python -m compileall -q -f "${GITHUB_WORKSPACE}"
if grep -lr --exclude-dir=node_modules "^<<<<<<< " "${GITHUB_WORKSPACE}"
then echo "Found merge conflicts"
exit 1
fi
- uses: actions/setup-node@v3
with:
node-version: 18
check-latest: true
- name: Add to Hosts
run: |
echo "127.0.0.1 lms.test" | sudo tee -a /etc/hosts
- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements.txt', '**/pyproject.toml', '**/setup.py') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-ui-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-ui-
- name: Cache cypress binary
uses: actions/cache@v3
with:
path: ~/.cache/Cypress
key: ${{ runner.os }}-cypress
- name: Install Dependencies
run: |
bash ${GITHUB_WORKSPACE}/.github/helper/install_dependencies.sh
bash ${GITHUB_WORKSPACE}/.github/helper/install.sh
env:
BEFORE: ${{ env.GITHUB_EVENT_PATH.before }}
AFTER: ${{ env.GITHUB_EVENT_PATH.after }}
TYPE: ui
DB: mariadb
- name: Site Setup
run: |
cd ~/frappe-bench/
bench --site lms.test execute frappe.utils.install.complete_setup_wizard
bench --site lms.test execute frappe.tests.ui_test_helpers.create_test_user
bench --site lms.test set-password frappe@example.com admin
- name: cypress pre-requisites
run: |
cd ~/frappe-bench/apps/lms
yarn add cypress@^10 --no-lockfile
- name: UI Tests
run: cd ~/frappe-bench/ && bench --site lms.test run-ui-tests lms --headless
env:
CYPRESS_BASE_URL: http://lms.test:8000
CYPRESS_RECORD_KEY: 095366ec-7b9f-41bd-aeec-03bb76d627fe
- name: Stop server and wait for coverage file
run: |
ps -ef | grep "[f]rappe serve" | awk '{print $2}' | xargs kill -s SIGINT
sleep 5
- name: Show bench output
if: ${{ always() }}
run: cat ~/frappe-bench/bench_start.log || true

12
.gitignore vendored
View File

@@ -3,13 +3,5 @@
*.egg-info *.egg-info
*.swp *.swp
tags tags
lms/docs/current community/docs/current
lms/public/dist community/public/dist
__pycache__/
*.py[cod]
*$py.class
node_modules
package-lock.json
lms/public/frontend
lms/www/lms.html
frappe-ui

3
.gitmodules vendored
View File

@@ -1,3 +0,0 @@
[submodule "frappe-ui"]
path = frappe-ui
url = https://github.com/frappe/frappe-ui

View File

@@ -1,57 +0,0 @@
exclude: 'node_modules|.git'
default_stages: [commit]
fail_fast: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: trailing-whitespace
files: "lms.*"
exclude: ".*json$|.*txt$|.*csv|.*md|.*svg"
- id: check-yaml
- id: check-merge-conflict
- id: check-ast
- id: check-json
- id: check-toml
- id: debug-statements
- repo: https://github.com/asottile/pyupgrade
rev: v2.34.0
hooks:
- id: pyupgrade
args: ['--py310-plus']
- repo: https://github.com/adityahase/black
rev: 9cb0a69f4d0030cdf687eddf314468b39ed54119
hooks:
- id: black
additional_dependencies: ['click==8.0.4']
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
hooks:
- id: prettier
types_or: [javascript, vue]
# Ignore any files that might contain jinja / bundles
exclude: |
(?x)^(
lms/public/dist/.*|
.*node_modules.*|
.*boilerplate.*|
lms/www/website_script.js|
lms/templates/includes/.*|
lms/public/js/lib/.*
)$
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
hooks:
- id: flake8
additional_dependencies: ['flake8-bugbear',]
args: ['--config', '.github/helper/flake8.conf']
ci:
autoupdate_schedule: weekly
skip: []
submodules: false

View File

@@ -1,21 +0,0 @@
{
"branches": ["develop"],
"plugins": [
"@semantic-release/commit-analyzer", {
"preset": "angular"
},
"@semantic-release/release-notes-generator",
[
"@semantic-release/exec", {
"prepareCmd": 'sed -ir "s/[0-9]*\.[0-9]*\.[0-9]*/${nextRelease.version}/" lms/__init__.py'
}
],
[
"@semantic-release/git", {
"assets": ["lms/__init__.py"],
"message": "chore(release): Bumped to Version ${nextRelease.version}"
}
],
"@semantic-release/github"
]
}

View File

@@ -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.

View File

@@ -4,15 +4,15 @@ include *.json
include *.md include *.md
include *.py include *.py
include *.txt include *.txt
recursive-include lms *.css recursive-include community *.css
recursive-include lms *.csv recursive-include community *.csv
recursive-include lms *.html recursive-include community *.html
recursive-include lms *.ico recursive-include community *.ico
recursive-include lms *.js recursive-include community *.js
recursive-include lms *.json recursive-include community *.json
recursive-include lms *.md recursive-include community *.md
recursive-include lms *.png recursive-include community *.png
recursive-include lms *.py recursive-include community *.py
recursive-include lms *.svg recursive-include community *.svg
recursive-include lms *.txt recursive-include community *.txt
recursive-exclude lms *.pyc recursive-exclude community *.pyc

144
README.md
View File

@@ -1,115 +1,79 @@
<p align="center"> ## Community
<a href="https://www.frappelms.com/">
<img src="https://frappe.io/files/lms.png" alt="Frappe LMS" width="50px" height="50px">
</a>
<p align="center">Easy to use, open source, learning management system.</p>
</p>
This app helps people organize and manage their own communities.
&nbsp; The App has following components:
<p align="center"> 1. Hackathons
<a href="https://www.producthunt.com/posts/frappe-lms?utm_source=badge-top-post-topic-badge&utm_medium=badge&utm_souce=badge-frappe&#0045;lms" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/top-post-topic-badge.svg?post_id=396079&theme=dark&period=weekly&topic_id=204" alt="Frappe&#0032;LMS - Easy&#0032;to&#0032;use&#0044;&#0032;100&#0037;&#0032;open&#0032;source&#0032;learning&#0032;management&#0032;system | Product Hunt" style="width: 250px; height: 54px;" width="250" height="54" /></a> 1. LMS
</p>
Community is built on the [Frappe Framework](https://github.com/frappe/frappe), a full-stack web app framework built with Python & JavaScript.
<div align="center" style="max-height: 40px;"> ## Development Setup
<a href="https://frappecloud.com/lms/signup">
<img src=".github/try-on-f-cloud.svg" height="40">
</a>
</div>
&nbsp; **Step 1:** Clone the repo
<p align="center">
<a href="https://dashboard.cypress.io/projects/vandxn/runs">
<img alt="cypress" src="https://img.shields.io/endpoint?url=https://dashboard.cypress.io/badge/simple/vandxn/main&style=flat&logo=cypress">
</a>
<a href="https://github.com/frappe/lms/blob/main/LICENSE">
<img alt="license" src="https://img.shields.io/badge/license-AGPLv3-blue">
</a>
</p>
<img width="1402" alt="Lesson" src="https://frappelms.com/files/banner.png">
<details>
<summary>Show more screenshots</summary>
<img width="1520" alt="ss1" src="https://user-images.githubusercontent.com/31363128/210056046-584bc8aa-d28c-4514-b031-73817012837d.png">
<img width="830" alt="ss2" src="https://user-images.githubusercontent.com/31363128/210056097-36849182-6db0-43a2-8c62-5333cd2aedf4.png">
<img width="941" alt="ss3" src="https://user-images.githubusercontent.com/31363128/210056134-01a7c429-1ef4-434e-9d43-128dda35d7e5.png">
</details>
Frappe LMS is an easy-to-use, open-source learning management system. You can use it to create and share online courses. The app has a clear UI that helps students focus only on what's important and assists in distraction-free learning.
You can create courses and lessons through simple forms. Lessons can be in the form of text, videos, quizzes or a combination of all these. You can keep your students engaged with quizzes to help revise and test the concepts learned. Course Instructors and Students can reach out to each other through the discussions section available for each lesson and get queries resolved.
## Features
- Create online courses. 📚
- Add detailed descriptions and preview videos to the course. 🎬
- Add videos, quizzes, and assignments to your lessons and make them interesting and interactive 📝
- Discussions section below each lesson where instructors and students can interact with each other. 💬
- Create batches to group your students based on courses and track their progress 🏛
- Statistics dashboard that provides all important numbers at a glimpse. 📈
- Job Board where users can post and look for jobs. 💼
- People directory with each person's profile page 👨‍👩‍👧‍👦
- Set cover image, profile photo, short bio, and other professional information. 🦹🏼‍♀️
- Simple layout that optimizes readability 🤓
- Delightful user experience in overall usage ✨
## Tech Stack
Frappe LMS is built on [Frappe Framework](https://frappeframework.com) which is a batteries-included python web framework.
These are some of the tools it's built on:
- [Python](https://www.python.org)
- [Redis](https://redis.io/)
- [MariaDB](https://mariadb.org/)
- [Socket.io](https://socket.io/)
## Local Setup
### Docker
You need Docker, docker-compose, and git setup on your machine. Refer to [Docker documentation](https://docs.docker.com/). After that, run the following commands:
``` ```
git clone https://github.com/frappe/lms $ git clone https://github.com/fossunited/community.git
cd apps/lms/docker
docker-compose up $ cd community
``` ```
Wait for some time until the setup script creates a site. After that, you can access `http://localhost:8000` in your browser and the app's login screen should appear. **Step 2:** Run docker-compose
You'll have to go through the setup wizard to set up the website the first time you access it. Log in using the following credentials to complete the setup wizard.
```
$ docker-compose up
```
**Step 3:** Visit the website at http://localhost:8000/
You'll have to go through the setup wizard to setup the website for the first time you access it. Login using the following credentiasl to complete the setup wizard.
``` ```
Username: Administrator Username: Administrator
password: admin password: admin
``` ```
### Frappe Bench TODO: Explain how to load sample data
Currently, this app depends on the `develop` branch of [frappe](https://github.com/frappe/frappe). ## Stopping the server
1. Setup frappe-bench by following [this guide](https://frappeframework.com/docs/v14/user/en/installation) Press `ctrl+c` in the terminal to stop the server. You can also run `docker-compose down` in another terminal to stop it.
1. In the frappe-bench directory, run `bench start` and keep it running. Open a new terminal session and cd into the `frappe-bench` directory.
1. Run the following commands:
```sh
bench new-site lms.test
bench get-app lms
bench --site lms.test install-app lms
bench --site lms.test add-to-hosts
1. Now, you can access the site at `http://lms.test:8000` To completely reset the instance, do the following:
```
$ docker-compose down --volumes
$ docker-compose up
```
## Deployment ## Making Code Changes
Frappe LMS is an app built on top of the Frappe Framework. So, you can follow any deployment guide for hosting a Frappe Framework-based site.
### Managed Hosting The dev setup is configured to reload whenever any code is changed. Just edit the code and reload the webpage.
Frappe LMS can be deployed in a few clicks on [Frappe Cloud](https://frappecloud.com/marketplace/apps/lms).
### Self-hosting Commit the changes in a branch and send a pull request.
If you want to self-host, you can follow official [Frappe Bench Installation](https://github.com/frappe/bench#installation) instructions.
## Bugs and Feature Requests ## Local Setup - The Hard Way
If you find any bugs or have a feature idea for the app, feel free to report them here on [GitHub Issues](https://github.com/frappe/lms/issues). Make sure you share enough information (app screenshots, browser console screenshots, stack traces, etc) for project maintainers.
## License To setup the repository locally follow the steps mentioned below:
Distributed under [GNU AFFERO GENERAL PUBLIC LICENSE](license.txt)
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

View File

@@ -1,5 +0,0 @@
# Security Policy
The Frappe team and community take security issues seriously. To report a security issue, please go through the information mentioned [here](https://frappe.io/security).
We appreciate your efforts to responsibly disclose your findings. We'll endeavor to respond quickly and will keep you updated throughout the process.

View File

@@ -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.

7
community/__init__.py Normal file
View File

@@ -0,0 +1,7 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
__version__ = '0.0.1'
# load the methods from the lms api
from .lms import api # noqa

View File

@@ -1,7 +1,8 @@
// Copyright (c) 2021, Frappe and contributors // Copyright (c) 2021, Frappe and contributors
// For license information, please see license.txt // For license information, please see license.txt
frappe.ui.form.on("Certification", { frappe.ui.form.on('Community Event', {
// refresh: function(frm) { // refresh: function(frm) {
// } // }
}); });

View File

@@ -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
}

View File

@@ -1,9 +1,10 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2021, Frappe and contributors # Copyright (c) 2021, Frappe and contributors
# For license information, please see license.txt # For license information, please see license.txt
from __future__ import unicode_literals
# import frappe # import frappe
from frappe.model.document import Document from frappe.model.document import Document
class CommunityEvent(Document):
class ExerciseLatestSubmission(Document):
pass pass

View File

@@ -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

View File

@@ -1,32 +1,32 @@
{ {
"actions": [], "actions": [],
"allow_rename": 1, "creation": "2021-02-12 15:55:58.252902",
"creation": "2022-02-07 11:39:59.998762",
"doctype": "DocType", "doctype": "DocType",
"editable_grid": 1, "editable_grid": 1,
"engine": "InnoDB", "engine": "InnoDB",
"field_order": [ "field_order": [
"instructor" "member"
], ],
"fields": [ "fields": [
{ {
"fieldname": "instructor", "fieldname": "member",
"fieldtype": "Link", "fieldtype": "Link",
"in_list_view": 1, "in_list_view": 1,
"label": "Instructor", "label": "Member",
"options": "User" "options": "User"
} }
], ],
"index_web_pages_for_search": 1, "index_web_pages_for_search": 1,
"istable": 1, "istable": 1,
"links": [], "links": [],
"modified": "2022-02-07 11:41:42.943250", "modified": "2021-05-21 12:15:51.286478",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "LMS", "module": "Community",
"name": "Course Instructor", "name": "Community Event Volunteer",
"owner": "Administrator", "owner": "Administrator",
"permissions": [], "permissions": [],
"quick_entry": 1,
"sort_field": "modified", "sort_field": "modified",
"sort_order": "DESC", "sort_order": "DESC",
"states": [] "track_changes": 1
} }

View 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 CommunityEventVolunteer(Document):
pass

View File

@@ -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) {
// }
});

View File

@@ -1,57 +1,57 @@
{ {
"actions": [], "actions": [],
"allow_rename": 1, "creation": "2021-02-15 11:04:02.748879",
"creation": "2021-11-19 15:31:47.129156",
"doctype": "DocType", "doctype": "DocType",
"editable_grid": 1, "editable_grid": 1,
"engine": "InnoDB", "engine": "InnoDB",
"field_order": [ "field_order": [
"cohort", "first_name",
"last_name",
"email", "email",
"subgroup", "student",
"course" "organization_college"
], ],
"fields": [ "fields": [
{ {
"fieldname": "cohort", "fieldname": "first_name",
"fieldtype": "Link", "fieldtype": "Data",
"in_list_view": 1, "in_list_view": 1,
"in_standard_filter": 1, "label": "First Name",
"label": "Cohort", "reqd": 1
"options": "Cohort", },
{
"fieldname": "last_name",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Last Name",
"reqd": 1 "reqd": 1
}, },
{ {
"fieldname": "email", "fieldname": "email",
"fieldtype": "Link", "fieldtype": "Data",
"in_list_view": 1, "in_list_view": 1,
"label": "E-mail", "label": "Email",
"options": "User", "options": "Email",
"reqd": 1 "reqd": 1
}, },
{ {
"fieldname": "subgroup", "default": "0",
"fieldtype": "Link", "fieldname": "student",
"in_list_view": 1, "fieldtype": "Check",
"label": "Primary Subgroup", "label": "Student"
"options": "Cohort Subgroup",
"reqd": 1
}, },
{ {
"fetch_from": "cohort.course", "fieldname": "organization_college",
"fieldname": "course", "fieldtype": "Data",
"fieldtype": "Link", "label": "Organization/College"
"label": "Course",
"options": "LMS Course",
"read_only": 1
} }
], ],
"index_web_pages_for_search": 1, "index_web_pages_for_search": 1,
"links": [], "links": [],
"modified": "2021-11-29 16:32:33.235281", "modified": "2021-02-15 11:04:02.748879",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "LMS", "module": "Community",
"name": "Cohort Mentor", "name": "Community Participant",
"owner": "Administrator", "owner": "Administrator",
"permissions": [ "permissions": [
{ {
@@ -67,6 +67,7 @@
"write": 1 "write": 1
} }
], ],
"quick_entry": 1,
"sort_field": "modified", "sort_field": "modified",
"sort_order": "DESC", "sort_order": "DESC",
"track_changes": 1 "track_changes": 1

View 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 CommunityParticipant(Document):
pass

View File

@@ -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

View File

@@ -1,7 +1,8 @@
// Copyright (c) 2021, Frappe and contributors // Copyright (c) 2021, Frappe and contributors
// For license information, please see license.txt // For license information, please see license.txt
frappe.ui.form.on("Preferred Industry", { frappe.ui.form.on('Community Speaker', {
// refresh: function(frm) { // refresh: function(frm) {
// } // }
}); });

View File

@@ -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
}

View File

@@ -1,9 +1,10 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2021, Frappe and contributors # Copyright (c) 2021, Frappe and contributors
# For license information, please see license.txt # For license information, please see license.txt
from __future__ import unicode_literals
# import frappe # import frappe
from frappe.model.document import Document from frappe.model.document import Document
class CommunitySpeaker(Document):
class Certification(Document):
pass pass

View File

@@ -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

View File

@@ -1,7 +1,8 @@
// Copyright (c) 2021, Frappe and contributors // Copyright (c) 2021, Frappe and contributors
// For license information, please see license.txt // For license information, please see license.txt
frappe.ui.form.on("Industry", { frappe.ui.form.on('Community Sponsor', {
// refresh: function(frm) { // refresh: function(frm) {
// } // }
}); });

View File

@@ -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
}

View 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 CommunitySponsor(Document):
pass

View File

@@ -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

View File

@@ -1,7 +1,8 @@
// Copyright (c) 2021, Frappe and contributors // Copyright (c) 2021, Frappe and contributors
// For license information, please see license.txt // For license information, please see license.txt
frappe.ui.form.on("Function", { frappe.ui.form.on('Community Talk', {
// refresh: function(frm) { // refresh: function(frm) {
// } // }
}); });

View File

@@ -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
}

View File

@@ -1,9 +1,10 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2021, Frappe and contributors # Copyright (c) 2021, Frappe and contributors
# For license information, please see license.txt # For license information, please see license.txt
from __future__ import unicode_literals
# import frappe # import frappe
from frappe.model.document import Document from frappe.model.document import Document
class CommunityTalk(Document):
class EducationDetail(Document):
pass pass

View File

@@ -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

View File

@@ -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

View File

@@ -1,7 +1,8 @@
// Copyright (c) 2021, Frappe and contributors // Copyright (c) 2021, Frappe and contributors
// For license information, please see license.txt // For license information, please see license.txt
frappe.ui.form.on("Skills", { frappe.ui.form.on('TShirt Sizes', {
// refresh: function(frm) { // refresh: function(frm) {
// } // }
}); });

View File

@@ -1,29 +1,32 @@
{ {
"actions": [], "actions": [],
"allow_rename": 1, "creation": "2021-02-25 17:52:49.813558",
"autoname": "field:skill",
"creation": "2021-12-08 15:31:29.292544",
"doctype": "DocType", "doctype": "DocType",
"editable_grid": 1, "editable_grid": 1,
"engine": "InnoDB", "engine": "InnoDB",
"field_order": [ "field_order": [
"skill" "size",
"quantity"
], ],
"fields": [ "fields": [
{ {
"fieldname": "skill", "fieldname": "size",
"fieldtype": "Data", "fieldtype": "Select",
"label": "Skill", "label": "Size",
"unique": 1 "options": "S\nM\nL\nXL\nXXL\nXXXL"
},
{
"fieldname": "quantity",
"fieldtype": "Int",
"label": "Quantity"
} }
], ],
"index_web_pages_for_search": 1, "index_web_pages_for_search": 1,
"links": [], "links": [],
"modified": "2023-09-29 17:05:50.502696", "modified": "2021-02-25 17:52:49.813558",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "LMS", "module": "Community",
"name": "User Skill", "name": "TShirt Sizes",
"naming_rule": "By fieldname",
"owner": "Administrator", "owner": "Administrator",
"permissions": [ "permissions": [
{ {
@@ -37,19 +40,10 @@
"role": "System Manager", "role": "System Manager",
"share": 1, "share": 1,
"write": 1 "write": 1
},
{
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "LMS Student",
"select": 1,
"share": 1
} }
], ],
"quick_entry": 1,
"sort_field": "modified", "sort_field": "modified",
"sort_order": "DESC", "sort_order": "DESC",
"states": [] "track_changes": 1
} }

View File

@@ -1,9 +1,10 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2021, Frappe and contributors # Copyright (c) 2021, Frappe and contributors
# For license information, please see license.txt # For license information, please see license.txt
from __future__ import unicode_literals
# import frappe # import frappe
from frappe.model.document import Document from frappe.model.document import Document
class TShirtSizes(Document):
class Function(Document):
pass pass

View File

@@ -0,0 +1 @@
import frappe

View File

@@ -0,0 +1,3 @@
frappe.ready(function() {
// bind events here
})

View 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
}
]
}

View File

@@ -1,5 +1,6 @@
import frappe from __future__ import unicode_literals
import frappe
def get_context(context): def get_context(context):
# do your magic here # do your magic here

View File

@@ -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');
})

View File

@@ -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
}
]
}

View File

@@ -1,5 +1,6 @@
import frappe from __future__ import unicode_literals
import frappe
def get_context(context): def get_context(context):
# do your magic here # do your magic here

View File

@@ -0,0 +1,14 @@
{% set color = member.get_palette() %}
<a 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 }}">
</img>
{% else %}
<span class="avatar-frame standard-image" title="{{ member.full_name }}"
style="background-color: var({{color[0]}}); color: var({{color[1]}});">
{{ frappe.utils.get_abbr(member.full_name) }}
</span>
{% endif %}
</span>
</a>

View File

@@ -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) {
// }
});

View File

@@ -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
}

View File

@@ -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

View File

@@ -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

View File

@@ -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) {
// }
});

View File

@@ -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
}

View File

@@ -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

View File

@@ -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

View File

@@ -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) {
// }
});

View File

@@ -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
}

View File

@@ -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

View File

@@ -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

View File

@@ -0,0 +1,14 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from frappe import _
def get_data():
return [
{
"module_name": "Community",
"color": "grey",
"icon": "octicon octicon-file-directory",
"type": "module",
"label": _("Community")
}
]

11
community/config/docs.py Normal file
View File

@@ -0,0 +1,11 @@
"""
Configuration for docs
"""
# source_link = "https://github.com/[org_name]/community"
# docs_base_url = "https://[org_name].github.io/community"
# headline = "App that does everything"
# sub_heading = "Yes, you got that right the first time, everything"
def get_context(context):
context.brand_html = "Community"

View File

@@ -0,0 +1,35 @@
The Hackathon module allows Community Members to organize and manage hackathons. Community Members can view these hackathons on the portal.
<img class="screenshot" src="/community/hackathon/images/hackathons-portal.png">
### Key Features:
##### Organize Hackathons
1. Hackathons can be created using the **Community Hackathon** doctype.
1. Enter the hackathon name, the organizer, the year and Save.
<img class="screenshot" src="/community/hackathon/images/community-hackathon.png">
##### Projects
1. A Hackathon will have multiple Projects.
1. Projects can be created using the **Community Project** doctype from the desk.
1. Projects can also be created from the Portal using the Projects webform.
1. Enter details like Project Name, Project Short Intro, Project Description.
1. Attach important links like Repository Link, Demo Link, Telegram Id.
1. The checkbox Accepting Members can be used if you are still aceepting members for your project.
<img class="screenshot" src="/community/hackathon/images/project-1.png">
<img class="screenshot" src="/community/hackathon/images/project-2.png">
1. Projects are visible on the portal as well.
<img class="screenshot" src="/community/hackathon/images/project-portal.png">
<img class="screenshot" src="/community/hackathon/images/project-details.png">
##### Project Members
1. Community Members can explore the projects of hackathons and decide if they want to join any project.
1. If the project is accepting members they can apply for the project from the web form available on the portal.
<img class="screenshot" src="/community/hackathon/images/project-join-request.png">
1. Project owners can review the requests and accept/reject the members.

View File

@@ -1,7 +1,8 @@
// Copyright (c) 2021, FOSS United and contributors // Copyright (c) 2021, FOSS United and contributors
// For license information, please see license.txt // For license information, please see license.txt
frappe.ui.form.on("Cohort Join Request", { frappe.ui.form.on('Community Hackathon', {
// refresh: function(frm) { // refresh: function(frm) {
// } // }
}); });

View File

@@ -1,31 +1,43 @@
{ {
"actions": [], "actions": [],
"allow_rename": 1, "autoname": "field:hackathon_name",
"autoname": "field:category", "creation": "2021-02-17 12:40:25.604012",
"creation": "2023-06-15 12:40:36.484165",
"doctype": "DocType", "doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB", "engine": "InnoDB",
"field_order": [ "field_order": [
"category" "hackathon_name",
"organizer",
"year"
], ],
"fields": [ "fields": [
{ {
"fieldname": "category", "fieldname": "hackathon_name",
"fieldtype": "Data", "fieldtype": "Data",
"in_list_view": 1, "in_list_view": 1,
"in_standard_filter": 1, "label": "Hackathon Name",
"label": "Category",
"reqd": 1, "reqd": 1,
"unique": 1 "unique": 1
},
{
"fieldname": "organizer",
"fieldtype": "Link",
"label": "Organizer",
"options": "User"
},
{
"fieldname": "year",
"fieldtype": "Select",
"label": "Year",
"options": "\n2021\n2022\n2023\n2024\n2025"
} }
], ],
"index_web_pages_for_search": 1, "index_web_pages_for_search": 1,
"links": [], "links": [],
"modified": "2024-09-23 19:33:49.593950", "modified": "2021-05-21 12:22:26.619776",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "LMS", "module": "Hackathon",
"name": "LMS Category", "name": "Community Hackathon",
"naming_rule": "By fieldname",
"owner": "Administrator", "owner": "Administrator",
"permissions": [ "permissions": [
{ {
@@ -39,23 +51,10 @@
"role": "System Manager", "role": "System Manager",
"share": 1, "share": 1,
"write": 1 "write": 1
},
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "Moderator",
"share": 1,
"write": 1
} }
], ],
"quick_entry": 1,
"sort_field": "modified", "sort_field": "modified",
"sort_order": "DESC", "sort_order": "DESC",
"states": [],
"title_field": "category",
"track_changes": 1 "track_changes": 1
} }

View File

@@ -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 CommunityHackathon(Document):
pass

Some files were not shown because too many files have changed in this diff Show More