Compare commits

..

210 Commits

Author SHA1 Message Date
Anand Chitipothu
c77835b81f feat: added page to see progress of a batch 2021-05-21 13:13:34 +05:30
Anand Chitipothu
e04bbb633d refactor: moved courses/*/index pages to batch/* 2021-05-21 13:12:52 +05:30
Anand Chitipothu
a2b856aaf8 feat: added image to exercise submission 2021-05-21 13:10:54 +05:30
Anand Chitipothu
632693c9f8 fix: show submitted solution in the exercise 2021-05-20 21:03:24 +05:30
Anand Chitipothu
463aec01f8 fix: permission issue when a student submits an exercise 2021-05-20 21:02:54 +05:30
Anand Chitipothu
e7d116f31c chore: removed obsolete doctype LMS Topic
It has been replaced by Chapter and Lesson.
Moved the section_parser from lms_topic directory to the lms.
2021-05-20 16:52:51 +05:30
Anand Chitipothu
f1b3ee19b6 Merge pull request #93 from fossunited/exercises
Added Exercise and Exercise Submission doctypes
2021-05-20 16:43:29 +05:30
Anand Chitipothu
9cb9fad05c fix: fixed failing tests 2021-05-20 16:24:41 +05:30
Anand Chitipothu
0859afdf34 style: fixed the styles of the sidebar 2021-05-20 15:08:12 +05:30
Anand Chitipothu
6407b24324 feat: added course, batch and lesson to exercise submission
Useful to find all the submissions for a batch/lesson.
2021-05-20 15:07:14 +05:30
Anand Chitipothu
34e993cf86 refactor: added lesson to exercise
usualy to know which lesson an exercise is part of by looking at the
exercise.
2021-05-20 13:27:30 +05:30
Anand Chitipothu
8c889ffb92 chore: switched to new build system for css.
- added community.bundle.less file to create css bundle
- removed the obsolete build.json in favor of new build system
- updated the paths in the books
- removed the imported urls from css files (the new build system doesn't support that)
- removed obsolete lms.css
2021-05-20 13:15:08 +05:30
Anand Chitipothu
a67ad67be1 feat: show image for the exercise
generate the image from the answer and display it along with
description. The image is geneated when the exercise is saved.
2021-05-20 12:09:12 +05:30
Anand Chitipothu
646a7b723f fix: fix broken pagination links 2021-05-19 20:12:35 +05:30
Anand Chitipothu
6f7011ca58 feat: integrated exercises into lessons
- an exercise can now be added to a lesson
- it is rendered using livecode editor with submit button
- remembers the submitted code and shows the submission time

Issue #90
2021-05-19 20:06:20 +05:30
Anand Chitipothu
d61acb552a feat: added Exercise and Exercise Submission doctypes
Also:
- added methods to submit an exercise and get the submission for a user
- added test cases

Issue #90
2021-05-19 20:01:17 +05:30
Jannat Patel
265c78e76e Merge pull request #88 from fossunited/minor-fixes
fix: removed slug field ref from courses page
2021-05-19 13:59:43 +05:30
pateljannat
7d180e141c fix: removed print statememt 2021-05-19 13:19:34 +05:30
pateljannat
29f9141ad8 fix: removed slug field ref from courses page 2021-05-19 13:16:46 +05:30
Anand Chitipothu
e6f58f56e0 Merge pull request #87 from fossunited/remove-branding
refactor: removed the branding and customization for mon school
2021-05-19 10:41:45 +05:30
Anand Chitipothu
9e0476fd00 chore: upgraded node to v14 in github actions
- the new changes to frappe required node v14
- also added a build setup before runing tests to make sure the assets are built
2021-05-19 10:05:59 +05:30
Anand Chitipothu
d9ea02667d refactor: removed the branding and customization for mon school
They have been moved to a new mon_school app
2021-05-18 21:25:29 +05:30
Anand Chitipothu
bdabf32124 Merge pull request #86 from fossunited/learn
Implemented learning section for batches
2021-05-14 15:36:44 +05:30
Anand Chitipothu
8b657f2f40 feat: added next/prev links to learn pages 2021-05-14 15:29:44 +05:30
Anand Chitipothu
49b41749e8 feat: added learn page
- added sections to the lesson to handle multiple sesions like examples and exercises
- added livecode integration to lesson pages
- autosave and submiting the answers is not done yet
2021-05-14 12:11:45 +05:30
Anand Chitipothu
1cf57c4823 feat: redirect the course page to learn page when the visitor is a student of a batch 2021-05-14 12:06:37 +05:30
Anand Chitipothu
5cfb72a731 style: tweaks
- made hero h1 black
- fixed the styles of lesson teasers
2021-05-08 13:44:34 +05:30
Anand Chitipothu
49d5ca4292 fix: added index to lesson doctype to fix the display order 2021-05-08 13:44:34 +05:30
Anand Chitipothu
a3e53efcc1 fix: fixed course description on the course page
The small intro was being shown in its place.
2021-05-08 13:44:34 +05:30
Anand Chitipothu
be7814b4fe Merge pull request #81 from fossunited/flow-fixes
fix: username and email validations
2021-05-07 18:53:58 +05:30
Anand Chitipothu
c40ab9a726 style: style tweaks 2021-05-07 18:32:35 +05:30
Anand Chitipothu
64cf14ed92 fix: fail gracefully when livecode_to_svg crashes
That seems to be happening in some cases and couldn't really figure out
the reason. Handling the error to gracefully to show an empty image in
those cases.
2021-05-07 18:32:34 +05:30
Anand Chitipothu
dbaa896fcc fix: fixed the issue of users unable to save sketches
Inserting new sketches is failing because the web user role doesn't have
permission to create sketches. Fixed it by adding
ignore_permission=True.
2021-05-07 18:32:34 +05:30
pateljannat
911c85bfc8 fix: redirect after login 2021-05-07 18:27:18 +05:30
pateljannat
5edceb2562 fix: photo from user 2021-05-07 17:14:33 +05:30
Anand Chitipothu
5d14dce320 Merge pull request #80 from fossunited/add-new-batch-form-enhancements
fix: Add new batch form enhancements
2021-05-07 16:53:21 +05:30
Anand Chitipothu
eec9e57dd2 fix: fixed thumbnail generation from livecode
Due to the recent changes to livecode, the code to generate svg from
code got broken. Fixed that now.
2021-05-07 16:48:52 +05:30
Anand Chitipothu
503b922074 style: improved the sketch page 2021-05-07 16:48:25 +05:30
pateljannat
d4c19932d5 fix: replaced slug with name and removed whitelist 2021-05-07 16:28:12 +05:30
Anand Chitipothu
3c8cffc5ad fix: fixed the issue of unable to create sketches.
The livecode API has been generalized and there was some
backwackward-incompatible changes in that proces. Added
livecode-canvas.js with the required options to fix the issue.
2021-05-07 13:59:38 +05:30
pateljannat
b3c67a3f34 fix: username and email validations 2021-05-07 13:47:33 +05:30
Anand Chitipothu
84b4833fed style: tweaked the styles of profile page 2021-05-07 12:33:43 +05:30
pateljannat
28ef7e5def fix: conflicts 2021-05-07 12:08:51 +05:30
pateljannat
9981baa13b fix: add new batch form enhancements 2021-05-07 12:04:11 +05:30
Anand Chitipothu
c764aa6c20 fix: fixed the error in saving a new course 2021-05-07 05:18:06 +05:30
Anand Chitipothu
bc11730697 style: showing the message as alert elements on the course page 2021-05-06 21:05:36 +05:30
Anand Chitipothu
92c4a86e8b refactor: fixed the accidentally removed code in RequestInvite 2021-05-06 21:05:08 +05:30
Anand Chitipothu
358724bf1c style: fixed the hero section on mobile
The email textbox was becoming too small.
2021-05-06 20:53:14 +05:30
Anand Chitipothu
bb80d988d7 refactor: using SketchTeaser widget to show sketch in the profile page 2021-05-06 20:43:04 +05:30
Anand Chitipothu
0ad03a3fb5 style: made the avatar and name of the person a link 2021-05-06 20:41:52 +05:30
Anand Chitipothu
3382de0ecb refactor: removed slug from course page. 2021-05-06 15:47:47 +05:30
Anand Chitipothu
08bb7b4490 Merge pull request #73 from fossunited/mentor-request-email-templates
fix: mentor request flow and emails #30, #69, #70
2021-05-06 15:39:58 +05:30
Anand Chitipothu
15203f6bcc Merge branch 'main' into mentor-request-email-templates 2021-05-06 15:38:53 +05:30
Anand Chitipothu
cbfb0d6761 Merge pull request #76 from fossunited/course-page
Refactored the course page
2021-05-06 13:55:42 +05:30
Anand Chitipothu
343aa50f78 Merge branch 'main' into course-page 2021-05-06 13:50:12 +05:30
Anand Chitipothu
5a70687067 refactor: removed the slug using the course name as part of url 2021-05-06 13:42:45 +05:30
Anand Chitipothu
a0921f7380 Merge pull request #77 from fossunited/widget-avatar
feat: Widget avatar
2021-05-06 13:26:49 +05:30
pateljannat
11cc03849d fix: displaying course name in mentor email 2021-05-06 13:23:22 +05:30
pateljannat
413aeaccb1 feat: avatar widget 2021-05-06 12:17:28 +05:30
Anand Chitipothu
88457a82ac refactor: learn page 2021-05-06 07:05:27 +05:30
Anand Chitipothu
761f36519e refactor: refactored the about page 2021-05-06 07:05:17 +05:30
Anand Chitipothu
dc5b637ada refactor: fixed the course page 2021-05-06 06:47:09 +05:30
pateljannat
5e5395658e Merge branch 'main' of https://github.com/frappe/community into mentor-request-email-templates 2021-05-05 16:32:37 +05:30
pateljannat
69b3f366f4 feat: widget file added 2021-05-05 16:32:21 +05:30
Anand Chitipothu
da902d23f7 Merge pull request #71 from fossunited/footer
Fix footer
2021-05-05 16:30:45 +05:30
Anand Chitipothu
c2be23a902 fix: fixed the pickle error on installing community 2021-05-05 15:58:28 +05:30
Anand Chitipothu
da771d7830 [actions] added action to ache bench 2021-05-05 15:57:41 +05:30
pateljannat
8a242a69fb fix: mentor request flow and emails #30, #69, #70 2021-05-05 15:45:20 +05:30
Anand Chitipothu
041bed7e9d Added sketches to the nav-bar on install 2021-05-05 12:56:27 +05:30
Anand Chitipothu
e330f45adc style: fixed the footer 2021-05-05 12:53:24 +05:30
Anand Chitipothu
370d3a321b Merge pull request #68 from fossunited/invite-flow-fixes
fix: invite flow issues
2021-05-04 23:23:40 +05:30
Anand Chitipothu
138fba66ae Merge branch 'main' of git://github.com/khalby786/community into khalby786-main 2021-05-04 23:21:21 +05:30
Anand Chitipothu
82faaed15d feat: set app name and logo on install and disable signup
- set app_name and app_logo_url on install
- disabled signup
2021-05-04 23:19:50 +05:30
Anand Chitipothu
b58a685e7a Merge pull request #64 from fossunited/miscellaneous-fixes
fix: Miscellaneous fixes
2021-05-04 19:18:17 +05:30
pateljannat
45ec16d9e4 fix: reverted error message 2021-05-04 17:43:09 +05:30
pateljannat
18c0fb0da5 fix: #65 and #66 2021-05-04 17:41:54 +05:30
pateljannat
b7d93c1b50 fix: get_mentors in batch 2021-05-04 16:50:39 +05:30
pateljannat
e931ead270 fix: miscellaneous 2021-05-04 12:47:45 +05:30
pateljannat
8933ca9ac9 Merge branch 'main' of https://github.com/frappe/community into miscellaneous-fixes 2021-05-03 16:57:58 +05:30
Anand Chitipothu
1a06e2c0aa Merge pull request #61 from fossunited/issue-56
doctypes for chapter and lesson
2021-05-03 16:51:01 +05:30
Anand Chitipothu
491b5c46ae Merge branch 'main' into issue-56 2021-05-03 16:03:30 +05:30
pateljannat
2139bddf01 fix: removed unused form add messages, changed url for new batch form in course.html, changed get_recent_sketch to have an owner filter 2021-05-03 15:57:00 +05:30
pateljannat
cf68d3127c fix: conflicts 2021-05-03 15:51:06 +05:30
pateljannat
f13bb494ef fix: converted tabs to spaces 2021-05-03 15:50:14 +05:30
Jannat Patel
5e18cd2ef4 Merge pull request #52 from fossunited/invite-flow
fix: invite flow and add new batch form enhancements
2021-05-03 15:47:09 +05:30
pateljannat
5fdecb708e fix: tabs to space, moved js to widget, removed unrelated changes 2021-05-03 15:14:11 +05:30
pateljannat
0144ab60de fix: logout issue, liscence.txt change 2021-05-03 15:05:23 +05:30
pateljannat
565787eeb6 feat: new-sign-up-form, request invite widget, request invite tests, get_sketches with owner 2021-05-03 12:33:31 +05:30
Anand Chitipothu
b9d94df4d8 refactor: refactored the course page
- simplified the portal page for course
- added mentods to LMS Course and Community Member to reduce custom code
  in portal pages
- included lessons in the ChapterTeaser
2021-05-03 12:05:17 +05:30
Anand Chitipothu
9e103af8b5 refactor: added auto name to chapter and lesson doctypes 2021-05-03 06:52:22 +05:30
Anand Chitipothu
5728714d71 feat: added lesson doctype 2021-05-03 06:50:23 +05:30
Anand Chitipothu
62cfc0fb24 feat: Added ChapterTeaser widget 2021-05-03 06:50:07 +05:30
Anand Chitipothu
a52a01ef7f feat: Added chapter doctype
Also linked it from the LMS Course doctype.

Issue #56
2021-05-03 06:06:35 +05:30
pateljannat
cd1d2067ad Merge branch 'main' of https://github.com/frappe/community into invite-flow 2021-05-02 11:05:35 +05:30
Khaleel Gibran
67d3ec75c8 feat: design homepage based on figma design 2021-05-01 18:51:44 +05:30
pateljannat
52f16131af fix: add new batch form enhancements (#43) invite request doctype and flow (#42) 2021-05-01 14:37:57 +05:30
Anand Chitipothu
59dba7730f refactor: switched to less for css (#49)
- Added build setup to include styles.less in building community.css
- The old styles are still in style.css. Those styles will be slowly moved to style.less.
- Move all the new styles to style.less
2021-04-29 16:53:16 +05:30
Anand Chitipothu
4bc05bfda8 Merge pull request #46 from fossunited/docker-compose
feat: dev-instance using docker-compose
2021-04-29 15:25:31 +05:30
Anand Chitipothu
0cfd6d7634 feat: dev-instance using docker-compose 2021-04-29 14:13:01 +05:30
Anand Chitipothu
f7434f376f Merge pull request #41 from fossunited/home-page
Home page
2021-04-29 13:59:54 +05:30
Anand Chitipothu
905f51ee76 fix: styles on home page 2021-04-29 12:16:48 +05:30
Anand Chitipothu
e207320721 feat: added home page
- Refactored the lms_course page and added find_all method to find courses
- Added CourseTeaser widget
- Added /home as a portal page
2021-04-29 10:57:29 +05:30
Anand Chitipothu
20ccc09869 refactor: sketches page
- Added new widget SketchTeaser
- Moved get_recent_sketches as static method in LMSSketch
- Added `models.py` to make it easy to import Course and Sketch class
- Updated the sketches template to use the SketchTeaser widget
2021-04-29 10:55:21 +05:30
Anand Chitipothu
e78c6020e7 Merge pull request #37 from fossunited/batch-discussions
fix: Batch discussions and Community Member fixes
2021-04-29 10:53:20 +05:30
Anand Chitipothu
4874d99e44 feat: widgets interface
Widgets are reusable jinja templates which can be used in other
themplates. Widgets are written in widgets/ directory in every frappe
module and can be accessed as `{{ widgets.WidgetName(...) }}` from any
template.
2021-04-29 10:49:37 +05:30
pateljannat
a022804381 test: users with same name, username validations, users without username 2021-04-28 22:04:42 +05:30
pateljannat
7a40b3e7a5 fix: test for community member and lms course 2021-04-28 17:52:12 +05:30
Anand Chitipothu
0ab4fbb03d [mockups] added sketches page 2021-04-28 15:17:13 +05:30
pateljannat
7b142fd72d test: member creation from user 2021-04-28 13:50:40 +05:30
pateljannat
fc8ff9c7fd Merge branch 'main' of https://github.com/frappe/community into batch-discussions 2021-04-28 13:08:23 +05:30
pateljannat
c6bd47eb62 fix: user validaton and community member name issue 2021-04-28 13:08:09 +05:30
Anand Chitipothu
68406762c9 Merge pull request #33 from fossunited/testable
Setup CI using github actions
2021-04-28 06:42:30 +05:30
Anand Chitipothu
89c539a3ed [mockups] added navbar 2021-04-27 21:09:09 +05:30
Anand Chitipothu
8d62b5c504 chore: Added CI using github actions 2021-04-27 19:49:56 +05:30
Anand Chitipothu
8857b97773 refactor: added methods to access mentors from course with test cases 2021-04-27 19:49:02 +05:30
Anand Chitipothu
46e7a5c0d1 Added mockups 2021-04-27 19:17:48 +05:30
pateljannat
d68f1de796 feat: #27 discussion message publish realtime 2021-04-27 16:32:34 +05:30
pateljannat
ffdc554106 Merge branch 'main' of https://github.com/frappe/community into main 2021-04-27 10:34:00 +05:30
pateljannat
424967b03e feat: #28 info page, #27 discussion page initial structure, add batch webform change 2021-04-27 10:33:49 +05:30
Anand Chitipothu
b80663a245 Added bug tag to Bug issue template 2021-04-26 16:43:53 +05:30
pateljannat
44dc42d7dd feat: batch folders, redirects, members page 2021-04-26 10:16:53 +05:30
pateljannat
c18916096e fix: conflicts 2021-04-22 14:43:53 +05:30
pateljannat
3b578d750a fix: validations for new batch form 2021-04-22 14:43:04 +05:30
Anand Chitipothu
00107134b4 feat: add new design and improved the layout of the course page 2021-04-22 10:28:50 +05:30
Anand Chitipothu
153bb925d8 fix: show mentors section even when there are no mentors
Previously, the mentors heading was not shown when there were no
mentors, but the link to apply to become mentor was shown and that
appears in the Instructors section.

Fixed it by showing a message to indicate that there are no mentors for
this course.
2021-04-21 15:48:01 +05:30
Anand Chitipothu
22448a8a7b added links to lms_course and lms_batch dooctypes.
This makes it possible to the number of batches for a course, the number
of mentors for a course etc.
2021-04-21 15:13:16 +05:30
pateljannat
54fe2efa07 fix: label changes for mentor request in lms settings 2021-04-21 13:29:36 +05:30
pateljannat
86bd708c34 fix: apply as mentor even if email template not found 2021-04-21 13:17:07 +05:30
pateljannat
87d67c55e0 Merge branch 'main' of https://github.com/frappe/community into main 2021-04-21 12:58:27 +05:30
pateljannat
3405de9394 fix: course page created by administrator 2021-04-21 12:58:17 +05:30
Anand Chitipothu
ab3c4c34ce Created Bug Report template 2021-04-21 12:28:02 +05:30
pateljannat
b09ec1e29d feat: add new batch and mentor course mapping 2021-04-21 10:47:10 +05:30
pateljannat
a2fe314420 Merge branch 'main' of https://github.com/frappe/community into main 2021-04-20 13:22:50 +05:30
pateljannat
df9b856a91 fix: change repository link field to small text 2021-04-20 13:22:45 +05:30
pateljannat
e6248f9e02 feat: course page redesign 2021-04-20 13:21:01 +05:30
Anand Chitipothu
be93a496cc fix: not permitted error when code is edited
This was caused by auto-save when the user is not logged in. Fixed it by
disabling auto-save for guest users.
2021-04-20 12:20:34 +05:30
pateljannat
91be957885 Merge branch 'main' of https://github.com/frappe/community into main 2021-04-15 09:33:24 +05:30
pateljannat
20e562bfb0 docs: hackathon 2021-04-15 09:33:17 +05:30
Anand Chitipothu
6fad78278a feat: added code_revision doctype for saving code snippets.
This was supposed to be part of revision f15080, but that got missed out.
2021-04-14 11:30:41 +05:30
pateljannat
dfe8b3d4a2 fix: style 2021-04-14 11:29:32 +05:30
pateljannat
e8ff9a5a32 feat: profile page 2021-04-14 11:19:02 +05:30
Anand Chitipothu
88888903ab fix: discussion tab when there are no messages
- fixed the issue of not showing discussion tab when there are no messages
- fixed the error when the course page is visited by a guest user
2021-04-14 06:43:48 +05:30
pateljannat
d38c64650e fix: patch to update name of member 2021-04-12 18:05:43 +05:30
pateljannat
0e1002392f fix: styling for dashboard 2021-04-12 14:59:49 +05:30
pateljannat
258ccb1642 feat: dashboard 2021-04-12 14:05:02 +05:30
pateljannat
767aaac913 docs: ReadMe update 2021-04-08 14:40:02 +05:30
pateljannat
871ad279d1 Merge branch 'main' of https://github.com/frappe/community into main 2021-04-07 19:53:08 +05:30
pateljannat
84cf74e25d fix: clean urls for hackathons and correcting slug parameter for discussions 2021-04-07 19:53:03 +05:30
Anand Chitipothu
b8b7673985 fix: added a work-around to the issue of regex converter not loaded.
frappe app doesn't load all python modules of all the apps on startup. It
loads the hooks.py only if it is not already cached. Because of this the code
to install the regex coverter to not running, causing errors.

Fixed it by replacing the regex route with a string route. The issue is it
also matches the paths like `socket.io` and `website_script.js` etc. Handled
that by whitelisting those routes.
2021-04-07 12:41:17 +05:30
Anand Chitipothu
f1508033a3 feat: implemented autosave for sections
Now the changes made to the code in each section will be autosaved and loaded
back on next page load.
2021-04-07 01:40:13 +05:30
Anand Chitipothu
15b8b99ae2 fix: fixed the issue with dynamic routes.
- The code to install regex controller was not always executed. Forced the
  exection of that by adding it to community/__init__.py
- Renoved the that code from hooks.py
2021-04-07 01:40:13 +05:30
pateljannat
3d024a289e fix: conflicts 2021-04-06 18:53:34 +05:30
pateljannat
7658942500 fix: email patch and conference portal 2021-04-06 18:51:40 +05:30
Anand Chitipothu
b197fd605c Merge pull request #12 from fossunited/nice-urls
Implemented nice urls for courses, topics, sketches and profiles
2021-04-06 18:39:07 +05:30
Anand Chitipothu
a3788a0f39 refactor: added nice urls for sketches.
- Sketches will be available at `/sketches/<sketch-id>`
2021-04-06 18:36:07 +05:30
Anand Chitipothu
06f7698e8f refactor: added custom routing for profiles
- installed a regex conveter to werkzeug to support regular expresions in routes
- added a website route rule to match all profiles
2021-04-06 18:07:05 +05:30
Anand Chitipothu
175bd19a51 refactor: added slugs to course and topics to make nice urls
- the slug is autogenerated from the title
- the slug of a topic is unique among all the topics of that course
2021-04-06 18:07:05 +05:30
Anand Chitipothu
6620ecf0c8 refactor: added utility to convert title into slug 2021-04-06 18:07:05 +05:30
Anand Chitipothu
253c25bf1f Show 404 page when the topic is not found.
Earlier it was failing with internal error.
2021-04-06 18:07:05 +05:30
Anand Chitipothu
e42e00f83a Added nice urls to sketch pages.
The URL of a sketch will be `/skectes/<sketch-name>`. That would still be like
`/skectes/SKETCH-123`. It would interesting to try to make it `/sketches/123`.
2021-04-06 18:07:05 +05:30
Anand Chitipothu
53af969a2e Added nice URLs to course and topic pages.
The URL of a course will be `/courses/<course-name>` and a topic will be
`/courses/<course-name>/<topic-name>`.

Implemented this by adding entries to `website_route_rules`.
2021-04-06 18:07:05 +05:30
pateljannat
87acbb9f6e Merge branch 'main' of https://github.com/frappe/community into main 2021-03-31 10:48:28 +05:30
pateljannat
bf789c1891 feat: emails on messages 2021-03-31 10:48:23 +05:30
Anand Chitipothu
24bb0f2b2a Implemented a better inline editor for livecode.
- It shows the code like a textarea and the canvas will to the right
- It will take only the amount of height required for the code
- The existing LiveCodeEditor was renamed as LiveCodeEditorLarge and still
  used or sketches
2021-03-29 18:56:48 +00:00
pateljannat
bc4503a636 feat: script to create community members 2021-03-23 20:09:10 +05:30
pateljannat
389254b673 fix: message from course page 2021-03-23 19:26:31 +05:30
pateljannat
6433af6613 Merge branch 'main' of https://github.com/frappe/community into main 2021-03-23 15:29:18 +05:30
pateljannat
ab5929a4e8 feat: discussions tab and web form for messages 2021-03-23 15:29:12 +05:30
Anand Chitipothu
7ecfa6b0c3 tweaks to make the svg rendering work as expected.
Set the viewBox and fixed the args to line function.
2021-03-23 07:22:13 +00:00
Anand Chitipothu
ed0f70e3ed Replaced drawSvg library with custom svg library.
Even after so many attempts to fix drawSvg, couldn't get it to work with
top-left corner as the origin. Replaced it with a custom library.
2021-03-23 07:12:11 +00:00
Anand Chitipothu
280cfb3994 Fixed an error in rendering a line.
Used the wrong arguments to line functions, fixed now.
2021-03-23 06:06:25 +00:00
Anand Chitipothu
dfafab3ccd Fixed the orientation issue with rendering sketch as svg.
The sketches were flipped vertically when displayed as svg. It was due to the
defaults in the drawSvg library that was using bottom-left corner as the
origin by default. Fixed it by specifying the top-right as the origin.
2021-03-23 04:26:24 +00:00
Anand Chitipothu
071df674c0 Removed the debug text in rendering topic pages. 2021-03-23 04:23:52 +00:00
Anand Chitipothu
03a22bd537 Switched to using frappe.utils.md_to_html for rendering markdown.
The `markdown` filter doesn't convert to html if there is any html tag in the
input.
2021-03-23 04:20:54 +00:00
Anand Chitipothu
f8ba10dfba Include sketch title the sketch listing page. 2021-03-17 11:40:59 +00:00
Anand Chitipothu
9c485dbd4e Added support for line and rect in the preview of sketches 2021-03-17 11:40:59 +00:00
pateljannat
49e65c9e43 feat: email as name field for community member 2021-03-15 10:43:06 +05:30
pateljannat
599b2cf76c Merge branch 'main' of https://github.com/frappe/community into main 2021-03-15 10:42:44 +05:30
pateljannat
562a2189f7 feat: email as name field for community member 2021-03-15 10:42:28 +05:30
Anand Chitipothu
faf102bdec Added support to split the topic description into sections.
We are using special markup to split the description into sections.

Each section is marked as:

    {{ section(type="example", id="foo") }}
    ...
    {{ end }}

This is the first-cut implementation and requires cleanup.
2021-03-12 12:33:41 +00:00
pateljannat
ce7175040f Merge branch 'main' of https://github.com/frappe/community into main 2021-03-12 12:22:19 +05:30
pateljannat
25a0dd02ac feat: community member for profile and edit profile form 2021-03-12 12:22:12 +05:30
Anand Chitipothu
dca8c9d5db Added thumbnails to the recent sketches page.
- Added an svg field to store the thumbnail
- The thumbnail is computed and cached in redis
2021-03-12 05:37:24 +00:00
Anand Chitipothu
fe63ded98c Added svg field to the sketch to store the image of the sketch. 2021-03-12 05:02:57 +00:00
Anand Chitipothu
31aec86c0b Fixed broken html in LiveCodeEditor macro. 2021-03-11 11:54:43 +00:00
Anand Chitipothu
5f8de7612b Using the user fullname when rendering a sketch.
Also refactored the portal page for sketches and moved the common code
to the lms_sketch doctype module.
2021-03-11 11:53:06 +00:00
Anand Chitipothu
4fe91422f4 Fixed an error in finding if the sketch is editable 2021-03-10 12:35:31 +00:00
Anand Chitipothu
406244ff69 Added the ability to save sketches
Implemented by exposing an RPC method to save the sketch and calling
from JS using `frappe.call`. Any logged-in user can create new sketches
and the owner can edit his/her own sketches.
2021-03-10 12:25:14 +00:00
Anand Chitipothu
936a3fcfff Added partial support for new sketches.
New Sketches can't be saved yet.
2021-03-09 12:53:11 +00:00
Anand Chitipothu
deea539c7d Added sketch pages. 2021-03-09 12:36:55 +00:00
Anand Chitipothu
ff15e7058b Added sketch doctype. 2021-03-09 12:36:41 +00:00
Anand Chitipothu
3583cd084d Fixed error on topic pages
The macro was imported wihout "with context" flag.
2021-03-09 12:34:48 +00:00
Anand Chitipothu
13030b0b9b Cleanup: moved LiveCodeEditor into a macro 2021-03-09 11:51:09 +00:00
Anand Chitipothu
480774755f Moved the css to assets 2021-03-09 11:50:45 +00:00
Anand Chitipothu
b7602d6d2b Added codemirror integration to LMS topic pages 2021-03-09 09:37:17 +00:00
Anand Chitipothu
862878462b Added LMS Settings.
The `livecode_url` is now part of LMS settings and not hardcoded in the code.
2021-03-09 09:04:39 +00:00
Anand Chitipothu
fc6f60c4d7 Integrated topic page with livecode. 2021-03-08 11:11:48 +00:00
Anand Chitipothu
6c671c0347 Added LMS Section doctype 2021-03-08 11:11:28 +00:00
Anand Chitipothu
bfc15cf1a4 Added preview and sections fields to LMS Topic
- The preview is used to show the details of the topic in the course page
- the sections are used to show the different part of the topic, each could be of a different type

Issue #8
2021-03-05 17:20:02 +00:00
Anand Chitipothu
f96c8c27ed Renamed thr LMS doctypes in the portal pages
Issue #7
2021-03-05 17:13:01 +00:00
Anand Chitipothu
c661d141c2 Added editorconfig
Closes #9
2021-03-05 08:07:38 +00:00
Anand Chitipothu
ca621e07b7 Renamed the doctypes in LMS.
The prefix has been changed from "Community" to "LMS".

Issue #7
2021-03-05 07:39:50 +00:00
Anand Chitipothu
0fcba82030 Fixed indent 2021-03-05 07:37:37 +00:00
pateljannat
3f04b10b90 refactor: seperate module LMS 2021-03-05 11:07:28 +05:30
pateljannat
4b90f2e129 refactor: new module for conference 2021-03-04 20:19:53 +05:30
pateljannat
8b5cd8e6c6 refactor: seperate module for hackathon 2021-03-04 20:11:18 +05:30
pateljannat
acea59767d feat: course enrollment and my courses page 2021-03-03 17:44:46 +05:30
pateljannat
b4eb9580af Merge branch 'main' of https://github.com/frappe/community into main 2021-03-02 18:54:45 +05:30
pateljannat
a4dffca4d7 feat: basic doctypes for conference and user profile flow for courses 2021-03-02 18:54:37 +05:30
Jannat Patel
94939bf1e9 Merge pull request #5 from fossunited/course-doctype-v1
First cut at the course doctype.
2021-03-02 18:52:45 +05:30
289 changed files with 8692 additions and 477 deletions

29
.editorconfig Normal file
View File

@@ -0,0 +1,29 @@
# EditorConfig is awesome: https://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
trim_trailing_whitespace = true
# Python
[*.py]
indent_size = 4
# Markdown
[*.md]
indent_size = 4
trim_trailing_whitespace = false
[Makefile]
indent_style = tab
# HTML, CSS, javascript, JSON and YAML
[*.{html,css,js,json,yml,yaml}]
indent_size = 2

38
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.

11
.github/mariadb-frappe.cnf vendored Normal file
View File

@@ -0,0 +1,11 @@
# configuration to force mariadb to use utf8mb4 charecter set, as required by frappe
# This file need to be placed at /etc/mysql/conf.d/ in the mariadb container as a volume
# See .github/wotkflows/ci.yml to see how it is used
[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
[mysql]
default-character-set = utf8mb4

78
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,78 @@
name: Run tests
on:
push:
branches:
- main
pull_request: {}
jobs:
tests:
runs-on: ubuntu-20.04
services:
redis-cache:
image: redis:alpine
ports:
- 13000:6379
redis-queue:
image: redis:alpine
ports:
- 11000:6379
redis-socketio:
image: redis:alpine
ports:
- 12000:6379
mariadb:
image: anandology/mariadb-utf8mb4:10.3
ports:
- 3306:3306
env:
MYSQL_ROOT_PASSWORD: root
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
steps:
- uses: actions/checkout@v2
- name: setup python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: setup node
uses: actions/setup-node@v2
with:
node-version: '14'
check-latest: true
- name: setup cache for bench
uses: actions/cache@v2
with:
path: ~/bench-cache
key: ${{ runner.os }}
- name: install bench
run: |
pip3 install frappe-bench
which bench
- name: bench init
run: |
if [ -d ~/bench-cache/bench.tgz ]
then
(cd && tar xzf ~/bench-cache/bench.tgz)
else
bench init ~/frappe-bench --skip-redis-config-generation
mkdir -p ~/bench-cache
(cd && tar czf ~/bench-cache/bench.tgz frappe-bench)
fi
- name: add community app to bench
working-directory: /home/runner/frappe-bench
run: bench get-app community $GITHUB_WORKSPACE
- name: create bench site
working-directory: /home/runner/frappe-bench
run: bench new-site --mariadb-root-password root --admin-password admin frappe.local
- name: install community app
working-directory: /home/runner/frappe-bench
run: bench --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
- name: bench build
working-directory: /home/runner/frappe-bench
run: bench --site frappe.local build
- name: run tests
working-directory: /home/runner/frappe-bench
run: bench --site frappe.local run-tests --app community

View File

@@ -1,7 +1,79 @@
## Community
Community App
This app helps people organize and manage their own communities.
The App has following components:
1. Hackathons
1. LMS
Community is built on the [Frappe Framework](https://github.com/frappe/frappe), a full-stack web app framework built with Python & JavaScript.
## Development Setup
**Step 1:** Clone the repo
```
$ git clone https://github.com/fossunited/community.git
$ cd community
```
**Step 2:** Run docker-compose
```
$ docker-compose up
```
**Step 3:** Visit the website at http://localhost:8000/
You'll have to go through the setup wizard to setup the website for the first time you access it. Login using the following credentiasl to complete the setup wizard.
```
Username: Administrator
password: admin
```
TODO: Explain how to load sample data
## Stopping the server
Press `ctrl+c` in the terminal to stop the server. You can also run `docker-compose down` in another terminal to stop it.
To completely reset the instance, do the following:
```
$ docker-compose down --volumes
$ docker-compose up
```
## Making Code Changes
The dev setup is configured to reload whenever any code is changed. Just edit the code and reload the webpage.
Commit the changes in a branch and send a pull request.
## Local Setup - The Hard Way
To setup the repository locally follow the steps mentioned below:
1. Install bench and setup a frappe-bench directory by following the [Installation Steps](https://frappeframework.com/docs/user/en/installation).
1. Start the server by running bench start.
1. In a separate terminal window, create a new site by running bench new-site community.test.
1. Run bench get-app https://github.com/fossunited/community.
1. Run bench --site community.test install-app community.
1. Map your site to localhost with the command ```bench --site community.test add-to-hosts```
1. Now open the URL http://community.test:8000/docs in your browser, you should see the app running.
### Contribution Guidelines (for The Hard Way)
1. Go to the apps/community directory of your installation and execute git pull --unshallow to ensure that you have the full git repository. Also fork the fossunited/community repository on GitHub.
1. Check out a working branch in git (e.g. git checkout -b my-new-branch).
1. Make your proposed changes to the source
1. Run your local version (e.g. bench start in your bench installation). Make sure that your changes work the way you want them to.
1. Commit your changes to your branch. Make sure to use a semantic commit message.
1. Push your branch to your fork on Github, and issue a pull request.
#### License
MIT
AGPL

View File

@@ -3,3 +3,5 @@ from __future__ import unicode_literals
__version__ = '0.0.1'
# load the methods from the lms api
from .lms import api # noqa

View File

@@ -1,5 +0,0 @@
// Copyright (c) 2021, Frappe and contributors
// For license information, please see license.txt
frappe.ui.form.on('Community Course', {
});

View File

@@ -1,64 +0,0 @@
{
"actions": [],
"allow_guest_to_view": 1,
"allow_rename": 1,
"autoname": "field:title",
"creation": "2021-03-01 16:49:33.622422",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"title",
"description",
"is_published"
],
"fields": [
{
"fieldname": "title",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Title",
"reqd": 1,
"unique": 1
},
{
"fieldname": "description",
"fieldtype": "Markdown Editor",
"label": "Description"
},
{
"default": "0",
"fieldname": "is_published",
"fieldtype": "Check",
"label": "Published"
}
],
"index_web_pages_for_search": 1,
"is_published_field": "is_published",
"links": [],
"modified": "2021-03-02 12:25:25.235975",
"modified_by": "Administrator",
"module": "Community",
"name": "Community Course",
"owner": "Administrator",
"permissions": [
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"share": 1,
"write": 1
}
],
"search_fields": "title",
"sort_field": "creation",
"sort_order": "DESC",
"title_field": "title",
"track_changes": 1,
"track_views": 1
}

View File

@@ -1,21 +0,0 @@
{% extends "templates/web.html" %}
{% block page_content %}
<ol class="breadcrumb" itemscope="" itemtype="http://schema.org/BreadcrumbList">
<li itemprop="itemListElement" itemscope="" itemtype="http://schema.org/ListItem" class="breadcrumb-item">
<a itemprop="item" href="/courses">
<span itemprop="name">&larr; Courses</span>
<meta itemprop="position" content="1">
</a>
<span itemprop="item">
</li>
</ol>
<h1>{{ title }}</h1>
{{description}}
{% endblock %}
<!-- this is a sample default web page template -->

View File

@@ -1,7 +0,0 @@
<div class="card" style="width: 100%; margin: 5px 0px">
<div class="card-body">
<h5 class="card-title"><a href="{{doc.route}}">{{doc.title}}</a></h5>
<p class="card-text">{{doc.description}}</p>
<a href="{{doc.route}}" class="card-link">See more &rarr;</a>
</div>
</div>

View File

@@ -1,7 +1,7 @@
// Copyright (c) 2021, Frappe and contributors
// For license information, please see license.txt
frappe.ui.form.on('Community Project Like', {
frappe.ui.form.on('Community Course Member', {
// refresh: function(frm) {
// }

View File

@@ -0,0 +1,96 @@
{
"actions": [],
"autoname": "field:user_name",
"creation": "2021-03-02 11:24:49.612530",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"enabled",
"full_name",
"user_name",
"email",
"short_intro",
"bio",
"photo",
"route"
],
"fields": [
{
"default": "1",
"fieldname": "enabled",
"fieldtype": "Check",
"label": "Enabled"
},
{
"fieldname": "full_name",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Full Name",
"reqd": 1
},
{
"fieldname": "user_name",
"fieldtype": "Data",
"in_list_view": 1,
"label": "User Name",
"reqd": 1,
"unique": 1
},
{
"fieldname": "email",
"fieldtype": "Data",
"label": "Email",
"options": "Email",
"reqd": 1
},
{
"fieldname": "short_intro",
"fieldtype": "Data",
"label": "Short Intro"
},
{
"fieldname": "bio",
"fieldtype": "Markdown Editor",
"label": "Bio"
},
{
"fieldname": "photo",
"fieldtype": "Attach Image",
"label": "Photo"
},
{
"fieldname": "route",
"fieldtype": "Data",
"label": "Route"
}
],
"has_web_view": 1,
"index_web_pages_for_search": 1,
"is_published_field": "enabled",
"links": [],
"modified": "2021-04-06 11:50:41.551665",
"modified_by": "Administrator",
"module": "Community",
"name": "Community Course Member",
"owner": "Administrator",
"permissions": [
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"share": 1,
"write": 1
}
],
"quick_entry": 1,
"route": "community-course-member",
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 1
}

View File

@@ -0,0 +1,52 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2021, Frappe and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
import re
from frappe.website.website_generator import WebsiteGenerator
from frappe import _
class CommunityCourseMember(WebsiteGenerator):
def get_context(self, context):
context.abbr = ("").join([ s[0] for s in self.full_name.split() ])
return context
def validate(self):
self.validate_user_name()
if not self.route:
self.route = self.user_name
def validate_user_name(self):
if len(self.user_name) < 4:
frappe.throw(_("Username must be atleast 4 characters long."))
if not re.match("^[A-Za-z0-9_]*$", self.user_name):
frappe.throw(_("Username can only contain alphabets, numbers, and underscore."))
self.user_name = self.user_name.lower()
def after_insert(self):
if frappe.db.exists("User", self.email):
user = frappe.get_doc("User", self.email)
else:
user, update_password_link = self.create_user()
self.send_email(update_password_link)
def send_email(self, update_password_link):
args = {
'update_password_link': update_password_link,
'full_name': self.full_name,
}
frappe.sendmail(
recipients=self.email,
sender="Administrator",
subject=_("Set your Password"),
template="community_course_membership",
reference_doctype=self.doctype,
reference_name=self.name,
send_priority=0,
queue_separately=True,
args=args)

View File

@@ -0,0 +1,25 @@
{% extends "templates/web.html" %}
{% block page_content %}
<div class="py-20 row">
{% if photo %}
<div class="col-sm-2 border border-dark">
<img src="{{ photo }}" alt="{{ full_name }}">
</div>
{% else %}
<div class="col-sm-2">
<div class="standard-image" style="font-size: 30px;">{{ abbr }}</div>
</div>
{% endif %}
<div class="col">
<h1>{{ full_name }}</h1>
{% if short_intro %}
<p class="lead"> {{ short_intro }} </p>
{% endif %}
{% if bio %}
<p class="markdown-style"> {{ frappe.utils.md_to_html(bio) }} </p>
{% endif %}
</div>
</div>
{% endblock %}
<!-- this is a sample default web page template -->

View File

@@ -0,0 +1,4 @@
<div>
<a href="{{ doc.route }}">{{ doc.full_name }}</a>
</div>
<!-- this is a sample default list template -->

View File

@@ -6,5 +6,5 @@ from __future__ import unicode_literals
# import frappe
import unittest
class TestCommunityCourseTopic(unittest.TestCase):
class TestCommunityCourseMember(unittest.TestCase):
pass

View File

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

View File

@@ -1,10 +0,0 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2021, Frappe and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
# import frappe
from frappe.website.website_generator import WebsiteGenerator
class CommunityCourseTopic(WebsiteGenerator):
pass

View File

@@ -1,7 +0,0 @@
{% extends "templates/web.html" %}
{% block page_content %}
<h1>{{ title }}</h1>
{% endblock %}
<!-- this is a sample default web page template -->

View File

@@ -1,17 +1,27 @@
{
"actions": [],
"autoname": "field:full_name",
"allow_guest_to_view": 1,
"allow_rename": 1,
"creation": "2021-02-12 15:47:23.591567",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"enabled",
"full_name",
"email",
"enabled",
"column_break_4",
"username",
"email_preference",
"section_break_7",
"bio",
"section_break_9",
"role",
"photo",
"column_break_12",
"short_intro",
"bio"
"route",
"abbr"
],
"fields": [
{
@@ -24,9 +34,9 @@
"fieldname": "full_name",
"fieldtype": "Data",
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Full Name",
"reqd": 1,
"unique": 1
"reqd": 1
},
{
"allow_in_quick_entry": 1,
@@ -49,13 +59,63 @@
{
"allow_in_quick_entry": 1,
"fieldname": "bio",
"fieldtype": "HTML Editor",
"fieldtype": "Markdown Editor",
"label": "Bio"
},
{
"fieldname": "route",
"fieldtype": "Data",
"label": "Route"
},
{
"fieldname": "email",
"fieldtype": "Data",
"in_standard_filter": 1,
"label": "Email",
"options": "Email",
"reqd": 1,
"unique": 1
},
{
"allow_in_quick_entry": 1,
"fieldname": "username",
"fieldtype": "Data",
"in_list_view": 1,
"label": "User Name",
"unique": 1
},
{
"fieldname": "email_preference",
"fieldtype": "Select",
"label": "Email preference",
"options": "Email on every Message\nOne Digest Mail per day\nNever"
},
{
"fieldname": "column_break_4",
"fieldtype": "Column Break"
},
{
"fieldname": "section_break_7",
"fieldtype": "Section Break"
},
{
"fieldname": "section_break_9",
"fieldtype": "Section Break"
},
{
"fieldname": "column_break_12",
"fieldtype": "Column Break"
},
{
"fieldname": "abbr",
"fieldtype": "Data",
"label": "Abbr",
"read_only": 1
}
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2021-02-15 12:16:32.428546",
"modified": "2021-04-28 11:22:35.402217",
"modified_by": "Administrator",
"module": "Community",
"name": "Community Member",
@@ -87,7 +147,9 @@
}
],
"quick_entry": 1,
"search_fields": "full_name",
"sort_field": "modified",
"sort_order": "DESC",
"title_field": "full_name",
"track_changes": 1
}

View File

@@ -3,8 +3,102 @@
# For license information, please see license.txt
from __future__ import unicode_literals
# import frappe
import frappe
import re
from frappe import _
from frappe.model.document import Document
import random
from frappe.utils import cint
import hashlib
class CommunityMember(Document):
pass
def validate(self):
self.validate_username()
self.abbr = ("").join([ s[0] for s in self.full_name.split() ])
if self.route != self.username:
self.route = self.username
def validate_username(self):
if not self.username:
self.username = create_username_from_email(self.email)
if self.username:
if len(self.username) < 4:
frappe.throw(_("Username must be atleast 4 characters long."))
if not re.match("^[A-Za-z0-9_]*$", self.username):
frappe.throw(_("Username can only contain alphabets, numbers and underscore."))
self.username = self.username.lower()
def get_course_count(self) -> int:
"""Returns the number of courses authored by this user.
"""
return frappe.db.count(
'LMS Course', {
'owner': self.email
})
def get_batch_count(self) -> int:
"""Returns the number of batches authored by this user.
"""
return frappe.db.count(
'LMS Batch Membership', {
'member': self.name,
'member_type': 'Mentor'
})
def get_photo_url(self):
return frappe.db.get_value("User", self.email, ["user_image"])
def get_palette(self):
palette = [
['--orange-avatar-bg', '--orange-avatar-color'],
['--pink-avatar-bg', '--pink-avatar-color'],
['--blue-avatar-bg', '--blue-avatar-color'],
['--green-avatar-bg', '--green-avatar-color'],
['--dark-green-avatar-bg', '--dark-green-avatar-color'],
['--red-avatar-bg', '--red-avatar-color'],
['--yellow-avatar-bg', '--yellow-avatar-color'],
['--purple-avatar-bg', '--purple-avatar-color'],
['--gray-avatar-bg', '--gray-avatar-color0']
]
encoded_name = str(self.full_name).encode("utf-8")
hash_name = hashlib.md5(encoded_name).hexdigest()
idx = cint((int(hash_name[4:6], 16) + 1) / 5.33)
return palette[idx % 8]
def __repr__(self):
return f"<CommunityMember: {self.email}>"
def create_member_from_user(doc, method):
username = doc.username
if ( doc.username and username_exists(doc.username)) or not doc.username:
username = create_username_from_email(doc.email)
elif len(doc.username) < 4 and doc.send_welcome_email == 1:
username = adjust_username(doc.username)
if username_exists(username):
username = username + str(random.randint(0,9))
member = frappe.get_doc({
"doctype": "Community Member",
"full_name": doc.full_name,
"username": username,
"email": doc.email,
"route": doc.username,
"owner": doc.email
})
member.save(ignore_permissions=True)
def username_exists(username):
return frappe.db.exists("Community Member", dict(username=username))
def create_username_from_email(email):
string = email.split("@")[0]
return ''.join(e for e in string if e.isalnum())
def adjust_username(username):
return username.ljust(4, str(random.randint(0,9)))

View File

@@ -0,0 +1,25 @@
{% extends "templates/web.html" %}
{% block page_content %}
<div class="py-20 row">
{% if photo %}
<div class="col-sm-2 border border-dark">
<img src="{{ photo }}" alt="{{ full_name }}">
</div>
{% else %}
<div class="col-sm-2">
<div class="standard-image" style="font-size: 30px;">{{ abbr }}</div>
</div>
{% endif %}
<div class="col">
<h1>{{ full_name }}</h1>
{% if short_intro %}
<p class="lead"> {{ short_intro }} </p>
{% endif %}
{% if bio %}
<p class="markdown-style"> {{ frappe.utils.md_to_html(bio) }} </p>
{% endif %}
</div>
</div>
{% endblock %}
<!-- this is a sample default web page template -->

View File

@@ -2,9 +2,91 @@
# Copyright (c) 2021, Frappe and Contributors
# See license.txt
from __future__ import unicode_literals
# import frappe
from community.lms.doctype.lms_course.test_lms_course import new_user
import frappe
import unittest
class TestCommunityMember(unittest.TestCase):
pass
@classmethod
def setUpClass(self):
users = ["test_user@example.com","test_user1@example.com"]
for user in users:
if not frappe.db.exists("User", user):
new_user("Test User", user)
def test_member_created_from_user(self):
user = frappe.db.get_value("User","test_user@example.com", ["full_name", "email", "username"], as_dict=True)
self.assertTrue(frappe.db.exists("Community Member", {"username":user.username}))
member = frappe.db.get_value("Community Member",
filters={"email": user.email},
fieldname=["full_name", "email", "owner", "username", "route"],
as_dict=True
)
self.assertEqual(user.full_name, member.full_name)
self.assertEqual(member.owner, user.email)
self.assertEqual(user.username, member.username)
self.assertEqual(member.username, member.route)
def test_members_with_same_name(self):
user1 = frappe.db.get_value("User","test_user@example.com", ["email"], as_dict=True)
user2 = frappe.get_doc("User","test_user1@example.com", ["email"], as_dict=True)
self.assertTrue(frappe.db.exists("Community Member", {"email": user1.email} ))
self.assertTrue(frappe.db.exists("Community Member", {"email": user2.email }))
member1 = frappe.db.get_value("Community Member",
filters={"email": user1.email},
fieldname=["full_name", "email", "owner", "username", "route"],
as_dict=True
)
member2 = frappe.db.get_value("Community Member",
filters={"email": user2.email},
fieldname=["full_name", "email", "owner", "username", "route"],
as_dict=True
)
self.assertEqual(member1.full_name, member2.full_name)
self.assertEqual(member1.email, user1.email)
self.assertEqual(member2.email, user2.email)
self.assertNotEqual(member1.username, member2.username)
def test_username_validations(self):
user = new_user("Tst", "tst@example.com")
self.assertTrue(frappe.db.exists("Community Member", {"email":user.email} ))
member = frappe.db.get_value("Community Member",
filters={"email": user.email},
fieldname=["username"],
as_dict=True
)
self.assertEqual(len(member.username), 4)
frappe.delete_doc("User", user.email)
def test_user_without_username(self):
user = new_user("Test User", "test_user2@example.com")
self.assertTrue(frappe.db.exists("Community Member", {"email":user.email} ))
member = frappe.db.get_value("Community Member",
filters={"email": user.email},
fieldname=["username"],
as_dict=True
)
self.assertTrue(member.username)
frappe.delete_doc("User", user.email)
@classmethod
def tearDownClass(self):
users = ["test_user@example.com","test_user1@example.com"]
for user in users:
if frappe.db.exists("User", user):
frappe.delete_doc("User", user)
if frappe.db.exists("Community Member", {"email": user}):
frappe.delete_doc("Community Member", {"email": user})

View File

@@ -6,5 +6,5 @@ from __future__ import unicode_literals
# import frappe
import unittest
class TestCommunityCourse(unittest.TestCase):
class TestTShirtSizes(unittest.TestCase):
pass

View File

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

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

View File

@@ -4,7 +4,7 @@
from __future__ import unicode_literals
# import frappe
from frappe.website.website_generator import WebsiteGenerator
from frappe.model.document import Document
class CommunityCourse(WebsiteGenerator):
class TShirtSizes(Document):
pass

View File

@@ -1 +1,16 @@
import frappe
import frappe
def create_members_from_users():
users = frappe.get_all("User", {"enabled": 1}, ["email"])
for user in users:
if not frappe.db.get_value("Community Member", {"email": user.email}, "name"):
doc = frappe.get_doc("User", {"email": user.email})
username = doc.username if doc.username and len(doc.username) > 3 else ("").join([ s for s in doc.full_name.split() ])
if not frappe.db.exists("Community Member", username):
member = frappe.new_doc("Community Member")
member.full_name = doc.full_name
member.username = username
member.email = doc.email
member.route = username
member.owner = doc.email
member.insert(ignore_permissions=True)

View File

@@ -0,0 +1,5 @@
frappe.ready(function() {
frappe.web_form.after_save = () => {
window.location.href = frappe.web_form.get_value("username")
}
})

View File

@@ -0,0 +1,100 @@
{
"accept_payment": 0,
"allow_comments": 0,
"allow_delete": 0,
"allow_edit": 1,
"allow_incomplete": 0,
"allow_multiple": 0,
"allow_print": 0,
"amount": 0.0,
"amount_based_on_field": 0,
"apply_document_permissions": 0,
"breadcrumbs": "",
"button_label": "Save",
"creation": "2021-03-09 17:34:03.394301",
"doc_type": "Community Member",
"docstatus": 0,
"doctype": "Web Form",
"idx": 0,
"is_standard": 1,
"login_required": 1,
"max_attachment_size": 0,
"modified": "2021-03-22 12:04:22.571655",
"modified_by": "Administrator",
"module": "Community",
"name": "update-profile",
"owner": "Administrator",
"payment_button_label": "Buy Now",
"published": 1,
"route": "edit-profile",
"route_to_success_link": 0,
"show_attachments": 0,
"show_in_grid": 0,
"show_sidebar": 0,
"sidebar_items": [],
"success_message": "Profile updated successfully.",
"success_url": "/",
"title": "Update Profile",
"web_form_fields": [
{
"allow_read_on_all_link_options": 0,
"fieldname": "full_name",
"fieldtype": "Data",
"hidden": 0,
"label": "Full Name",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 1,
"show_in_filter": 0
},
{
"allow_read_on_all_link_options": 0,
"fieldname": "username",
"fieldtype": "Data",
"hidden": 0,
"label": "User Name",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 1,
"show_in_filter": 0
},
{
"allow_read_on_all_link_options": 0,
"fieldname": "short_intro",
"fieldtype": "Data",
"hidden": 0,
"label": "Short Intro",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 0,
"show_in_filter": 0
},
{
"allow_read_on_all_link_options": 0,
"fieldname": "bio",
"fieldtype": "Data",
"hidden": 0,
"label": "Bio",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 0,
"show_in_filter": 0
},
{
"allow_read_on_all_link_options": 0,
"fieldname": "photo",
"fieldtype": "Attach Image",
"hidden": 0,
"label": "Photo",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 0,
"show_in_filter": 0
}
]
}

View File

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

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.get_photo_url() %}
<img class="avatar-frame standard-image" src="{{ member.get_photo_url() }}" 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]}});">
{{ member.abbr }}
</span>
{% endif %}
</a>
</span>

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

View File

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021, Frappe and contributors
// Copyright (c) 2021, FOSS United and contributors
// For license information, please see license.txt
frappe.ui.form.on('Community Hackathon', {

View File

@@ -21,9 +21,9 @@
},
{
"fieldname": "organizer",
"fieldtype": "Data",
"fieldtype": "Link",
"label": "Organizer",
"options": "Email"
"options": "Community Member"
},
{
"fieldname": "year",
@@ -34,9 +34,9 @@
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2021-02-17 12:44:25.198010",
"modified": "2021-04-14 11:43:23.515972",
"modified_by": "Administrator",
"module": "Community",
"module": "Hackathon",
"name": "Community Hackathon",
"owner": "Administrator",
"permissions": [

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2021, Frappe and contributors
# Copyright (c) 2021, FOSS United and contributors
# For license information, please see license.txt
from __future__ import unicode_literals

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2021, Frappe and Contributors
# Copyright (c) 2021, FOSS United and Contributors
# See license.txt
from __future__ import unicode_literals

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 Project', {
// refresh: function(frm) {
// }
});

View File

@@ -1,5 +1,6 @@
{
"actions": [],
"allow_import": 1,
"autoname": "field:project_name",
"creation": "2021-02-12 18:28:33.440328",
"doctype": "DocType",
@@ -7,14 +8,18 @@
"engine": "InnoDB",
"field_order": [
"disabled",
"column_break_2",
"accepting_members",
"section_break_4",
"project_name",
"project_short_intro",
"project_description",
"section_break_8",
"repository_link",
"video_link",
"telegram_id",
"project_description",
"column_break_11",
"hackathon",
"accepting_members",
"telegram_id",
"likes",
"project_search"
],
@@ -58,6 +63,12 @@
"fieldtype": "Markdown Editor",
"label": "Project Description"
},
{
"fieldname": "hackathon",
"fieldtype": "Link",
"label": "Hackathon",
"options": "Community Hackathon"
},
{
"default": "0",
"fieldname": "accepting_members",
@@ -77,17 +88,27 @@
"label": "Project Search"
},
{
"fieldname": "hackathon",
"fieldtype": "Link",
"label": "Hackathon",
"options": "Community Hackathon"
"fieldname": "column_break_2",
"fieldtype": "Column Break"
},
{
"fieldname": "section_break_4",
"fieldtype": "Section Break"
},
{
"fieldname": "section_break_8",
"fieldtype": "Section Break"
},
{
"fieldname": "column_break_11",
"fieldtype": "Column Break"
}
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2021-02-23 11:21:47.948253",
"modified": "2021-04-20 13:22:17.248521",
"modified_by": "Administrator",
"module": "Community",
"module": "Hackathon",
"name": "Community Project",
"owner": "Administrator",
"permissions": [

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2021, Frappe and contributors
# Copyright (c) 2021, FOSS United and contributors
# For license information, please see license.txt
from __future__ import unicode_literals

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2021, Frappe and Contributors
# Copyright (c) 2021, FOSS United and Contributors
# See license.txt
from __future__ import unicode_literals

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021, Frappe and contributors
// Copyright (c) 2021, FOSS United and contributors
// For license information, please see license.txt
frappe.ui.form.on('Community Project Evaluation', {

View File

@@ -123,9 +123,9 @@
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2021-02-12 19:44:57.467599",
"modified": "2021-03-04 19:56:53.757808",
"modified_by": "Administrator",
"module": "Community",
"module": "Hackathon",
"name": "Community Project Evaluation",
"owner": "Administrator",
"permissions": [

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2021, Frappe and contributors
# Copyright (c) 2021, FOSS United and contributors
# For license information, please see license.txt
from __future__ import unicode_literals

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2021, Frappe and Contributors
# Copyright (c) 2021, FOSS United and Contributors
# See license.txt
from __future__ import unicode_literals

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 Project Like', {
// refresh: function(frm) {
// }
});

View File

@@ -17,9 +17,9 @@
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2021-02-12 18:43:24.206708",
"modified": "2021-03-04 18:55:51.877522",
"modified_by": "Administrator",
"module": "Community",
"module": "Hackathon",
"name": "Community Project Like",
"owner": "Administrator",
"permissions": [

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2021, Frappe and contributors
# Copyright (c) 2021, FOSS United and contributors
# For license information, please see license.txt
from __future__ import unicode_literals

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2021, Frappe and Contributors
# Copyright (c) 2021, FOSS United and Contributors
# See license.txt
from __future__ import unicode_literals

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021, Frappe and contributors
// Copyright (c) 2021, FOSS United and contributors
// For license information, please see license.txt
frappe.ui.form.on('Community Project Member', {

View File

@@ -42,9 +42,9 @@
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2021-02-16 19:27:30.842282",
"modified": "2021-03-04 19:44:09.832170",
"modified_by": "Administrator",
"module": "Community",
"module": "Hackathon",
"name": "Community Project Member",
"owner": "Administrator",
"permissions": [

View File

@@ -1,17 +1,16 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2021, Frappe and contributors
# Copyright (c) 2021, FOSS United and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
# import frappe
from frappe.model.document import Document
class CommunityProjectMember(Document):
def validate(self):
self.validate_if_already_member()
def validate_if_already_member(self):
if frappe.get_all("Community Project Member", {"owner": self.owner}):
frappe.throw(_("You have already applied for the membership of this project."))

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2021, Frappe and Contributors
# Copyright (c) 2021, FOSS United and Contributors
# See license.txt
from __future__ import unicode_literals

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2021, Frappe and contributors
// Copyright (c) 2021, FOSS United and contributors
// For license information, please see license.txt
frappe.ui.form.on('Community Project Update', {

View File

@@ -27,9 +27,9 @@
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2021-02-12 18:45:56.750969",
"modified": "2021-03-04 19:43:10.886773",
"modified_by": "Administrator",
"module": "Community",
"module": "Hackathon",
"name": "Community Project Update",
"owner": "Administrator",
"permissions": [

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2021, Frappe and contributors
# Copyright (c) 2021, FOSS United and contributors
# For license information, please see license.txt
from __future__ import unicode_literals

View File

@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2021, Frappe and Contributors
# Copyright (c) 2021, FOSS United and Contributors
# See license.txt
from __future__ import unicode_literals

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

View File

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": 1,
"max_attachment_size": 0,
"modified": "2021-04-14 13:52:46.135536",
"modified_by": "Administrator",
"module": "Hackathon",
"name": "join-request",
"owner": "Administrator",
"payment_button_label": "Buy Now",
"published": 1,
"route": "join-request",
"route_to_success_link": 0,
"show_attachments": 0,
"show_in_grid": 0,
"show_sidebar": 0,
"sidebar_items": [],
"success_url": "/join-request",
"title": "Join Request",
"web_form_fields": [
{
"allow_read_on_all_link_options": 0,
"fieldname": "project",
"fieldtype": "Link",
"hidden": 0,
"label": "Project",
"max_length": 0,
"max_value": 0,
"options": "Community Project",
"read_only": 0,
"reqd": 1,
"show_in_filter": 0
},
{
"allow_read_on_all_link_options": 0,
"fieldname": "intro",
"fieldtype": "Small Text",
"hidden": 0,
"label": "Intro",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 1,
"show_in_filter": 0
}
]
}

View File

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

View File

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

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