diff --git a/.editorconfig b/.editorconfig index dd608df2..0984f25b 100644 --- a/.editorconfig +++ b/.editorconfig @@ -26,4 +26,4 @@ indent_style = tab # HTML, CSS, javascript, JSON and YAML [*.{html,css,js,json,yml,yaml}] -indent_size = 2 +indent_size = 4 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f0546b5a..94e28ca5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,15 +57,15 @@ jobs: mkdir -p ~/bench-cache (cd && tar czf ~/bench-cache/bench.tgz frappe-bench) fi - - name: add school app to bench + - name: add lms app to bench working-directory: /home/runner/frappe-bench - run: bench get-app school $GITHUB_WORKSPACE + run: bench get-app lms $GITHUB_WORKSPACE - name: create bench site working-directory: /home/runner/frappe-bench run: bench new-site --mariadb-root-password root --admin-password admin frappe.local - - name: install school app + - name: install lms app working-directory: /home/runner/frappe-bench - run: bench --site frappe.local install-app school + run: bench --site frappe.local install-app lms - name: setup requirements working-directory: /home/runner/frappe-bench run: bench setup requirements --dev @@ -77,5 +77,5 @@ jobs: run: bench --site frappe.local build - name: run tests working-directory: /home/runner/frappe-bench - run: bench --site frappe.local run-tests --app school + run: bench --site frappe.local run-tests --app lms diff --git a/.github/workflows/semantic.yml b/.github/workflows/semantic.yml new file mode 100644 index 00000000..3978a91f --- /dev/null +++ b/.github/workflows/semantic.yml @@ -0,0 +1,19 @@ +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 diff --git a/.gitignore b/.gitignore index 6b0bb2e7..ba820a93 100644 --- a/.gitignore +++ b/.gitignore @@ -3,8 +3,8 @@ *.egg-info *.swp tags -school/docs/current -school/public/dist +lms/docs/current +lms/public/dist __pycache__/ *.py[cod] *$py.class diff --git a/Contribution.md b/Contribution.md index ce403717..d61d1978 100644 --- a/Contribution.md +++ b/Contribution.md @@ -1,5 +1,5 @@ -1. Go to the apps/school directory of your installation and execute git pull --unshallow to ensure that you have the full git repository. Also fork the frappe/school repository on GitHub. +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. diff --git a/MANIFEST.in b/MANIFEST.in index 75d82839..b85174db 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -4,15 +4,15 @@ include *.json include *.md include *.py include *.txt -recursive-include school *.css -recursive-include school *.csv -recursive-include school *.html -recursive-include school *.ico -recursive-include school *.js -recursive-include school *.json -recursive-include school *.md -recursive-include school *.png -recursive-include school *.py -recursive-include school *.svg -recursive-include school *.txt -recursive-exclude school *.pyc \ No newline at end of file +recursive-include lms *.css +recursive-include lms *.csv +recursive-include lms *.html +recursive-include lms *.ico +recursive-include lms *.js +recursive-include lms *.json +recursive-include lms *.md +recursive-include lms *.png +recursive-include lms *.py +recursive-include lms *.svg +recursive-include lms *.txt +recursive-exclude lms *.pyc diff --git a/README.md b/README.md index 12718f16..37c39ac8 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -## School +## LMS Create online courses without much hassle. -![Course Home](/school/public/images/course-home.png) +![Course Home](/lms/public/images/course-home.png) ## Features diff --git a/bench-installation.md b/bench-installation.md index 25685c35..33b85670 100644 --- a/bench-installation.md +++ b/bench-installation.md @@ -2,9 +2,9 @@ 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 school.test. -1. Fork the school app +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 . -1. Run bench --site school.test install-app school. -1. Map your site to localhost with the command ```bench --site school.test add-to-hosts``` -1. Now open the URL http://school.test:8000/ in your browser, you should see the app running. +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. diff --git a/docker-compose.yml b/docker-compose.yml index c2525759..90e9e0d3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,9 +11,9 @@ services: bench: image: anandology/frappe-bench:2021.10 volumes: - - .:/opt/frappe-bench/apps/school + - .:/opt/frappe-bench/apps/lms environment: - - FRAPPE_APPS=school + - FRAPPE_APPS=lms - FRAPPE_ALLOW_TESTS=true - FRAPPE_SITE_NAME=frappe.localhost depends_on: diff --git a/docker-installation.md b/docker-installation.md index f26d34ce..99a272f1 100644 --- a/docker-installation.md +++ b/docker-installation.md @@ -1,9 +1,9 @@ **Step 1:** Clone the repo ``` -$ git clone https://github.com/frappe/school.git +$ git clone https://github.com/frappe/lms.git -$ cd school +$ cd lms ``` **Step 2:** Run docker-compose diff --git a/school/__init__.py b/lms/__init__.py similarity index 100% rename from school/__init__.py rename to lms/__init__.py diff --git a/school/community/__init__.py b/lms/config/__init__.py similarity index 100% rename from school/community/__init__.py rename to lms/config/__init__.py diff --git a/school/config/desktop.py b/lms/config/desktop.py similarity index 100% rename from school/config/desktop.py rename to lms/config/desktop.py diff --git a/school/config/docs.py b/lms/config/docs.py similarity index 100% rename from school/config/docs.py rename to lms/config/docs.py diff --git a/school/fixtures/custom_field.json b/lms/fixtures/custom_field.json similarity index 99% rename from school/fixtures/custom_field.json rename to lms/fixtures/custom_field.json index 0eb474a6..c48b71f9 100644 --- a/school/fixtures/custom_field.json +++ b/lms/fixtures/custom_field.json @@ -80,10 +80,10 @@ "in_standard_filter": 0, "insert_after": "country", "is_virtual": 0, - "label": "Acceptance for Terms of Use and/or Privacy Policy", + "label": "Acceptance for Terms and/or Policies", "length": 0, "mandatory_depends_on": null, - "modified": "2021-12-31 19:15:34.932910", + "modified": "2021-12-31 19:15:34.932911", "module": null, "name": "User-verify_terms", "no_copy": 0, diff --git a/school/fixtures/function.json b/lms/fixtures/function.json similarity index 100% rename from school/fixtures/function.json rename to lms/fixtures/function.json diff --git a/school/fixtures/industry.json b/lms/fixtures/industry.json similarity index 100% rename from school/fixtures/industry.json rename to lms/fixtures/industry.json diff --git a/school/hooks.py b/lms/hooks.py similarity index 65% rename from school/hooks.py rename to lms/hooks.py index 63c792cb..81783b67 100644 --- a/school/hooks.py +++ b/lms/hooks.py @@ -2,10 +2,10 @@ from __future__ import unicode_literals from . import __version__ as app_version -app_name = "school" -app_title = "School" +app_name = "lms" +app_title = "LMS" app_publisher = "Frappe" -app_description = "School" +app_description = "LMS App" app_icon = "octicon octicon-file-directory" app_color = "grey" app_email = "school@frappe.io" @@ -15,16 +15,16 @@ app_license = "AGPL" # ------------------ # include js, css files in header of desk.html -# app_include_css = "/assets/school/css/school.css" -# app_include_js = "/assets/school/js/school.js" +# app_include_css = "/assets/lms/css/lms.css" +# app_include_js = "/assets/lms/js/lms.js" # include js, css files in header of web template -web_include_css = "school.bundle.css" -# web_include_css = "/assets/school/css/school.css" +web_include_css = "lms.bundle.css" +# web_include_css = "/assets/lms/css/lms.css" web_include_js = "website.bundle.js" # include custom scss in every website theme (without file extension ".scss") -# website_theme_scss = "school/public/scss/website" +# website_theme_scss = "lms/public/scss/website" # include js, css files in header of web form # webform_include_js = {"doctype": "public/js/doctype.js"} @@ -59,14 +59,14 @@ web_include_js = "website.bundle.js" # Installation # ------------ -# before_install = "school.install.before_install" -# after_install = "school.install.after_install" +# before_install = "lms.install.before_install" +# after_install = "lms.install.after_install" # Desk Notifications # ------------------ # See frappe.core.notifications.get_notification_config -# notification_config = "school.notifications.get_notification_config" +# notification_config = "lms.notifications.get_notification_config" # Permissions # ----------- @@ -85,8 +85,8 @@ web_include_js = "website.bundle.js" # Override standard doctype classes override_doctype_class = { - "User": "school.overrides.user.CustomUser", - "Web Template": "school.overrides.web_template.CustomWebTemplate" + "User": "lms.overrides.user.CustomUser", + "Web Template": "lms.overrides.web_template.CustomWebTemplate" } # Document Events @@ -110,20 +110,20 @@ fixtures = ["Custom Field", "Function", "Industry"] # Testing # ------- -# before_tests = "school.install.before_tests" +# before_tests = "lms.install.before_tests" # Overriding Methods # ------------------------------ # # override_whitelisted_methods = { -# "frappe.desk.doctype.event.event.get_events": "school.event.get_events" +# "frappe.desk.doctype.event.event.get_events": "lms.event.get_events" # } # # each overriding function accepts a `data` argument; # generated from the base implementation of the doctype dashboard, # along with any modifications made in other Frappe apps # override_doctype_dashboards = { -# "Task": "school.task.get_dashboard_data" +# "Task": "lms.task.get_dashboard_data" # } # exempt linked doctypes from being automatically cancelled @@ -156,50 +156,54 @@ website_redirects = [ ] update_website_context = [ - 'school.widgets.update_website_context', + 'lms.widgets.update_website_context', ] jinja = { "methods": [ - "school.page_renderers.get_profile_url", - "school.overrides.user.get_authored_courses", - "school.overrides.user.get_palette", - "school.lms.utils.get_membership", - "school.lms.utils.get_lessons", - "school.lms.utils.get_tags", - "school.lms.utils.get_instructors", - "school.lms.utils.get_students", - "school.lms.utils.get_average_rating", - "school.lms.utils.is_certified", - "school.lms.utils.get_lesson_index", - "school.lms.utils.get_lesson_url", - "school.lms.utils.get_chapters", - "school.lms.utils.get_slugified_chapter_title", - "school.lms.utils.get_progress", - "school.lms.utils.render_html", - "school.lms.utils.is_mentor", - "school.lms.utils.is_cohort_staff", - "school.lms.utils.get_mentors", - "school.lms.utils.get_reviews", - "school.lms.utils.is_eligible_to_review", - "school.lms.utils.get_initial_members", - "school.lms.utils.get_sorted_reviews", - "school.lms.utils.is_instructor", - "school.lms.utils.convert_number_to_character" + "lms.page_renderers.get_profile_url", + "lms.overrides.user.get_enrolled_courses", + "lms.overrides.user.get_course_membership", + "lms.overrides.user.get_authored_courses", + "lms.overrides.user.get_palette", + "lms.lms.utils.get_membership", + "lms.lms.utils.get_lessons", + "lms.lms.utils.get_tags", + "lms.lms.utils.get_instructors", + "lms.lms.utils.get_students", + "lms.lms.utils.get_average_rating", + "lms.lms.utils.is_certified", + "lms.lms.utils.get_lesson_index", + "lms.lms.utils.get_lesson_url", + "lms.lms.utils.get_chapters", + "lms.lms.utils.get_slugified_chapter_title", + "lms.lms.utils.get_progress", + "lms.lms.utils.render_html", + "lms.lms.utils.is_mentor", + "lms.lms.utils.is_cohort_staff", + "lms.lms.utils.get_mentors", + "lms.lms.utils.get_reviews", + "lms.lms.utils.is_eligible_to_review", + "lms.lms.utils.get_initial_members", + "lms.lms.utils.get_sorted_reviews", + "lms.lms.utils.is_instructor", + "lms.lms.utils.convert_number_to_character", + "lms.lms.utils.get_signup_optin_checks", + "lms.lms.utils.get_popular_courses" ], "filters": [] } ## Specify the additional tabs to be included in the user profile page. -## Each entry must be a subclass of school.school.plugins.ProfileTab +## Each entry must be a subclass of lms.lms.plugins.ProfileTab # profile_tabs = [] ## Specify the extension to be used to control what scripts and stylesheets ## to be included in lesson pages. The specified value must be be a -## subclass of school.plugins.PageExtension -# school_lesson_page_extension = None +## subclass of lms.plugins.PageExtension +# lms_lesson_page_extension = None -#school_lesson_page_extensions = [ -# "school.plugins.LiveCodeExtension" +#lms_lesson_page_extensions = [ +# "lms.plugins.LiveCodeExtension" #] profile_mandatory_fields = [ @@ -223,23 +227,23 @@ profile_mandatory_fields = [ ] ## Markdown Macros for Lessons -school_markdown_macro_renderers = { - "Exercise": "school.plugins.exercise_renderer", - "Quiz": "school.plugins.quiz_renderer", - "YouTubeVideo": "school.plugins.youtube_video_renderer", - "Video": "school.plugins.video_renderer", - "Assignment": "school.plugins.assignment_renderer" +lms_markdown_macro_renderers = { + "Exercise": "lms.plugins.exercise_renderer", + "Quiz": "lms.plugins.quiz_renderer", + "YouTubeVideo": "lms.plugins.youtube_video_renderer", + "Video": "lms.plugins.video_renderer", + "Assignment": "lms.plugins.assignment_renderer" } # page_renderer to manage profile pages page_renderer = [ - "school.page_renderers.ProfileRedirectPage", - "school.page_renderers.ProfilePage" + "lms.page_renderers.ProfileRedirectPage", + "lms.page_renderers.ProfilePage" ] # set this to "/" to have profiles on the top-level profile_url_prefix = "/users/" -signup_form_template = "school.plugins.show_custom_signup" +signup_form_template = "lms.plugins.show_custom_signup" -on_login = "school.overrides.user.set_country_from_ip" +on_login = "lms.overrides.user.set_country_from_ip" diff --git a/school/community/doctype/__init__.py b/lms/job/__init__.py similarity index 100% rename from school/community/doctype/__init__.py rename to lms/job/__init__.py diff --git a/school/community/doctype/community_event/__init__.py b/lms/job/doctype/__init__.py similarity index 100% rename from school/community/doctype/community_event/__init__.py rename to lms/job/doctype/__init__.py diff --git a/school/community/doctype/community_event_volunteer/__init__.py b/lms/job/doctype/job_opportunity/__init__.py similarity index 100% rename from school/community/doctype/community_event_volunteer/__init__.py rename to lms/job/doctype/job_opportunity/__init__.py diff --git a/school/job/doctype/job_opportunity/job_opportunity.js b/lms/job/doctype/job_opportunity/job_opportunity.js similarity index 100% rename from school/job/doctype/job_opportunity/job_opportunity.js rename to lms/job/doctype/job_opportunity/job_opportunity.js diff --git a/school/job/doctype/job_opportunity/job_opportunity.json b/lms/job/doctype/job_opportunity/job_opportunity.json similarity index 100% rename from school/job/doctype/job_opportunity/job_opportunity.json rename to lms/job/doctype/job_opportunity/job_opportunity.json diff --git a/school/job/doctype/job_opportunity/job_opportunity.py b/lms/job/doctype/job_opportunity/job_opportunity.py similarity index 100% rename from school/job/doctype/job_opportunity/job_opportunity.py rename to lms/job/doctype/job_opportunity/job_opportunity.py diff --git a/school/job/doctype/job_opportunity/test_job_opportunity.py b/lms/job/doctype/job_opportunity/test_job_opportunity.py similarity index 100% rename from school/job/doctype/job_opportunity/test_job_opportunity.py rename to lms/job/doctype/job_opportunity/test_job_opportunity.py diff --git a/school/community/doctype/community_participant/__init__.py b/lms/job/doctype/job_settings/__init__.py similarity index 100% rename from school/community/doctype/community_participant/__init__.py rename to lms/job/doctype/job_settings/__init__.py diff --git a/school/job/doctype/job_settings/job_settings.js b/lms/job/doctype/job_settings/job_settings.js similarity index 100% rename from school/job/doctype/job_settings/job_settings.js rename to lms/job/doctype/job_settings/job_settings.js diff --git a/school/job/doctype/job_settings/job_settings.json b/lms/job/doctype/job_settings/job_settings.json similarity index 100% rename from school/job/doctype/job_settings/job_settings.json rename to lms/job/doctype/job_settings/job_settings.json diff --git a/school/job/doctype/job_settings/job_settings.py b/lms/job/doctype/job_settings/job_settings.py similarity index 100% rename from school/job/doctype/job_settings/job_settings.py rename to lms/job/doctype/job_settings/job_settings.py diff --git a/school/job/doctype/job_settings/test_job_settings.py b/lms/job/doctype/job_settings/test_job_settings.py similarity index 100% rename from school/job/doctype/job_settings/test_job_settings.py rename to lms/job/doctype/job_settings/test_job_settings.py diff --git a/school/community/doctype/community_speaker/__init__.py b/lms/job/notification/__init__.py similarity index 100% rename from school/community/doctype/community_speaker/__init__.py rename to lms/job/notification/__init__.py diff --git a/school/community/doctype/community_sponsor/__init__.py b/lms/job/notification/new_job_alert/__init__.py similarity index 100% rename from school/community/doctype/community_sponsor/__init__.py rename to lms/job/notification/new_job_alert/__init__.py diff --git a/school/job/notification/new_job_alert/new_job_alert.json b/lms/job/notification/new_job_alert/new_job_alert.json similarity index 100% rename from school/job/notification/new_job_alert/new_job_alert.json rename to lms/job/notification/new_job_alert/new_job_alert.json diff --git a/school/job/notification/new_job_alert/new_job_alert.md b/lms/job/notification/new_job_alert/new_job_alert.md similarity index 100% rename from school/job/notification/new_job_alert/new_job_alert.md rename to lms/job/notification/new_job_alert/new_job_alert.md diff --git a/school/job/notification/new_job_alert/new_job_alert.py b/lms/job/notification/new_job_alert/new_job_alert.py similarity index 100% rename from school/job/notification/new_job_alert/new_job_alert.py rename to lms/job/notification/new_job_alert/new_job_alert.py diff --git a/school/community/doctype/community_talk/__init__.py b/lms/job/web_form/__init__.py similarity index 100% rename from school/community/doctype/community_talk/__init__.py rename to lms/job/web_form/__init__.py diff --git a/school/community/doctype/tshirt_sizes/__init__.py b/lms/job/web_form/job_opportunity/__init__.py similarity index 100% rename from school/community/doctype/tshirt_sizes/__init__.py rename to lms/job/web_form/job_opportunity/__init__.py diff --git a/school/job/web_form/job_opportunity/job_opportunity.js b/lms/job/web_form/job_opportunity/job_opportunity.js similarity index 100% rename from school/job/web_form/job_opportunity/job_opportunity.js rename to lms/job/web_form/job_opportunity/job_opportunity.js diff --git a/school/job/web_form/job_opportunity/job_opportunity.json b/lms/job/web_form/job_opportunity/job_opportunity.json similarity index 100% rename from school/job/web_form/job_opportunity/job_opportunity.json rename to lms/job/web_form/job_opportunity/job_opportunity.json diff --git a/school/job/web_form/job_opportunity/job_opportunity.py b/lms/job/web_form/job_opportunity/job_opportunity.py similarity index 100% rename from school/job/web_form/job_opportunity/job_opportunity.py rename to lms/job/web_form/job_opportunity/job_opportunity.py diff --git a/school/community/web_form/__init__.py b/lms/lms/__init__.py similarity index 100% rename from school/community/web_form/__init__.py rename to lms/lms/__init__.py diff --git a/school/lms/api.py b/lms/lms/api.py similarity index 100% rename from school/lms/api.py rename to lms/lms/api.py diff --git a/school/lms/dashboard_chart/course_enrollments/course_enrollments.json b/lms/lms/dashboard_chart/course_enrollments/course_enrollments.json similarity index 100% rename from school/lms/dashboard_chart/course_enrollments/course_enrollments.json rename to lms/lms/dashboard_chart/course_enrollments/course_enrollments.json diff --git a/school/community/web_form/join_request/__init__.py b/lms/lms/doctype/__init__.py similarity index 100% rename from school/community/web_form/join_request/__init__.py rename to lms/lms/doctype/__init__.py diff --git a/school/community/web_form/project_update/__init__.py b/lms/lms/doctype/certification/__init__.py similarity index 100% rename from school/community/web_form/project_update/__init__.py rename to lms/lms/doctype/certification/__init__.py diff --git a/school/lms/doctype/certification/certification.js b/lms/lms/doctype/certification/certification.js similarity index 100% rename from school/lms/doctype/certification/certification.js rename to lms/lms/doctype/certification/certification.js diff --git a/school/lms/doctype/certification/certification.json b/lms/lms/doctype/certification/certification.json similarity index 100% rename from school/lms/doctype/certification/certification.json rename to lms/lms/doctype/certification/certification.json diff --git a/school/lms/doctype/certification/certification.py b/lms/lms/doctype/certification/certification.py similarity index 100% rename from school/lms/doctype/certification/certification.py rename to lms/lms/doctype/certification/certification.py diff --git a/school/lms/doctype/certification/test_certification.py b/lms/lms/doctype/certification/test_certification.py similarity index 100% rename from school/lms/doctype/certification/test_certification.py rename to lms/lms/doctype/certification/test_certification.py diff --git a/school/community/web_template/__init__.py b/lms/lms/doctype/chapter_reference/__init__.py similarity index 100% rename from school/community/web_template/__init__.py rename to lms/lms/doctype/chapter_reference/__init__.py diff --git a/school/lms/doctype/chapter_reference/chapter_reference.json b/lms/lms/doctype/chapter_reference/chapter_reference.json similarity index 84% rename from school/lms/doctype/chapter_reference/chapter_reference.json rename to lms/lms/doctype/chapter_reference/chapter_reference.json index a251b1a4..0c67d748 100644 --- a/school/lms/doctype/chapter_reference/chapter_reference.json +++ b/lms/lms/doctype/chapter_reference/chapter_reference.json @@ -1,5 +1,6 @@ { "actions": [], + "autoname": "hash", "creation": "2021-07-27 16:25:02.903245", "doctype": "DocType", "editable_grid": 1, @@ -20,13 +21,15 @@ "index_web_pages_for_search": 1, "istable": 1, "links": [], - "modified": "2021-09-30 10:35:30.014950", + "modified": "2022-03-15 09:39:41.937565", "modified_by": "Administrator", "module": "LMS", "name": "Chapter Reference", + "naming_rule": "Random", "owner": "Administrator", "permissions": [], "sort_field": "modified", "sort_order": "DESC", + "states": [], "track_changes": 1 } \ No newline at end of file diff --git a/school/lms/doctype/chapter_reference/chapter_reference.py b/lms/lms/doctype/chapter_reference/chapter_reference.py similarity index 100% rename from school/lms/doctype/chapter_reference/chapter_reference.py rename to lms/lms/doctype/chapter_reference/chapter_reference.py diff --git a/school/community/web_template/multiple_testimonials/__init__.py b/lms/lms/doctype/cohort/__init__.py similarity index 100% rename from school/community/web_template/multiple_testimonials/__init__.py rename to lms/lms/doctype/cohort/__init__.py diff --git a/school/lms/doctype/cohort/cohort.js b/lms/lms/doctype/cohort/cohort.js similarity index 100% rename from school/lms/doctype/cohort/cohort.js rename to lms/lms/doctype/cohort/cohort.js diff --git a/school/lms/doctype/cohort/cohort.json b/lms/lms/doctype/cohort/cohort.json similarity index 100% rename from school/lms/doctype/cohort/cohort.json rename to lms/lms/doctype/cohort/cohort.json diff --git a/school/lms/doctype/cohort/cohort.py b/lms/lms/doctype/cohort/cohort.py similarity index 100% rename from school/lms/doctype/cohort/cohort.py rename to lms/lms/doctype/cohort/cohort.py diff --git a/school/lms/doctype/cohort/test_cohort.py b/lms/lms/doctype/cohort/test_cohort.py similarity index 100% rename from school/lms/doctype/cohort/test_cohort.py rename to lms/lms/doctype/cohort/test_cohort.py diff --git a/school/conference/__init__.py b/lms/lms/doctype/cohort_join_request/__init__.py similarity index 100% rename from school/conference/__init__.py rename to lms/lms/doctype/cohort_join_request/__init__.py diff --git a/school/lms/doctype/cohort_join_request/cohort_join_request.js b/lms/lms/doctype/cohort_join_request/cohort_join_request.js similarity index 100% rename from school/lms/doctype/cohort_join_request/cohort_join_request.js rename to lms/lms/doctype/cohort_join_request/cohort_join_request.js diff --git a/school/lms/doctype/cohort_join_request/cohort_join_request.json b/lms/lms/doctype/cohort_join_request/cohort_join_request.json similarity index 100% rename from school/lms/doctype/cohort_join_request/cohort_join_request.json rename to lms/lms/doctype/cohort_join_request/cohort_join_request.json diff --git a/school/lms/doctype/cohort_join_request/cohort_join_request.py b/lms/lms/doctype/cohort_join_request/cohort_join_request.py similarity index 100% rename from school/lms/doctype/cohort_join_request/cohort_join_request.py rename to lms/lms/doctype/cohort_join_request/cohort_join_request.py diff --git a/school/lms/doctype/cohort_join_request/test_cohort_join_request.py b/lms/lms/doctype/cohort_join_request/test_cohort_join_request.py similarity index 100% rename from school/lms/doctype/cohort_join_request/test_cohort_join_request.py rename to lms/lms/doctype/cohort_join_request/test_cohort_join_request.py diff --git a/school/conference/doctype/__init__.py b/lms/lms/doctype/cohort_mentor/__init__.py similarity index 100% rename from school/conference/doctype/__init__.py rename to lms/lms/doctype/cohort_mentor/__init__.py diff --git a/school/lms/doctype/cohort_mentor/cohort_mentor.js b/lms/lms/doctype/cohort_mentor/cohort_mentor.js similarity index 100% rename from school/lms/doctype/cohort_mentor/cohort_mentor.js rename to lms/lms/doctype/cohort_mentor/cohort_mentor.js diff --git a/school/lms/doctype/cohort_mentor/cohort_mentor.json b/lms/lms/doctype/cohort_mentor/cohort_mentor.json similarity index 100% rename from school/lms/doctype/cohort_mentor/cohort_mentor.json rename to lms/lms/doctype/cohort_mentor/cohort_mentor.json diff --git a/school/lms/doctype/cohort_mentor/cohort_mentor.py b/lms/lms/doctype/cohort_mentor/cohort_mentor.py similarity index 100% rename from school/lms/doctype/cohort_mentor/cohort_mentor.py rename to lms/lms/doctype/cohort_mentor/cohort_mentor.py diff --git a/school/lms/doctype/cohort_mentor/test_cohort_mentor.py b/lms/lms/doctype/cohort_mentor/test_cohort_mentor.py similarity index 100% rename from school/lms/doctype/cohort_mentor/test_cohort_mentor.py rename to lms/lms/doctype/cohort_mentor/test_cohort_mentor.py diff --git a/school/conference/doctype/community_conference/__init__.py b/lms/lms/doctype/cohort_staff/__init__.py similarity index 100% rename from school/conference/doctype/community_conference/__init__.py rename to lms/lms/doctype/cohort_staff/__init__.py diff --git a/school/lms/doctype/cohort_staff/cohort_staff.js b/lms/lms/doctype/cohort_staff/cohort_staff.js similarity index 100% rename from school/lms/doctype/cohort_staff/cohort_staff.js rename to lms/lms/doctype/cohort_staff/cohort_staff.js diff --git a/school/lms/doctype/cohort_staff/cohort_staff.json b/lms/lms/doctype/cohort_staff/cohort_staff.json similarity index 100% rename from school/lms/doctype/cohort_staff/cohort_staff.json rename to lms/lms/doctype/cohort_staff/cohort_staff.json diff --git a/school/lms/doctype/cohort_staff/cohort_staff.py b/lms/lms/doctype/cohort_staff/cohort_staff.py similarity index 100% rename from school/lms/doctype/cohort_staff/cohort_staff.py rename to lms/lms/doctype/cohort_staff/cohort_staff.py diff --git a/school/lms/doctype/cohort_staff/test_cohort_staff.py b/lms/lms/doctype/cohort_staff/test_cohort_staff.py similarity index 100% rename from school/lms/doctype/cohort_staff/test_cohort_staff.py rename to lms/lms/doctype/cohort_staff/test_cohort_staff.py diff --git a/school/conference/doctype/community_conference_participant/__init__.py b/lms/lms/doctype/cohort_subgroup/__init__.py similarity index 100% rename from school/conference/doctype/community_conference_participant/__init__.py rename to lms/lms/doctype/cohort_subgroup/__init__.py diff --git a/school/lms/doctype/cohort_subgroup/cohort_subgroup.js b/lms/lms/doctype/cohort_subgroup/cohort_subgroup.js similarity index 100% rename from school/lms/doctype/cohort_subgroup/cohort_subgroup.js rename to lms/lms/doctype/cohort_subgroup/cohort_subgroup.js diff --git a/school/lms/doctype/cohort_subgroup/cohort_subgroup.json b/lms/lms/doctype/cohort_subgroup/cohort_subgroup.json similarity index 100% rename from school/lms/doctype/cohort_subgroup/cohort_subgroup.json rename to lms/lms/doctype/cohort_subgroup/cohort_subgroup.json diff --git a/school/lms/doctype/cohort_subgroup/cohort_subgroup.py b/lms/lms/doctype/cohort_subgroup/cohort_subgroup.py similarity index 100% rename from school/lms/doctype/cohort_subgroup/cohort_subgroup.py rename to lms/lms/doctype/cohort_subgroup/cohort_subgroup.py diff --git a/school/lms/doctype/cohort_subgroup/test_cohort_subgroup.py b/lms/lms/doctype/cohort_subgroup/test_cohort_subgroup.py similarity index 100% rename from school/lms/doctype/cohort_subgroup/test_cohort_subgroup.py rename to lms/lms/doctype/cohort_subgroup/test_cohort_subgroup.py diff --git a/school/conference/doctype/community_conference_request/__init__.py b/lms/lms/doctype/cohort_web_page/__init__.py similarity index 100% rename from school/conference/doctype/community_conference_request/__init__.py rename to lms/lms/doctype/cohort_web_page/__init__.py diff --git a/school/lms/doctype/cohort_web_page/cohort_web_page.json b/lms/lms/doctype/cohort_web_page/cohort_web_page.json similarity index 100% rename from school/lms/doctype/cohort_web_page/cohort_web_page.json rename to lms/lms/doctype/cohort_web_page/cohort_web_page.json diff --git a/school/lms/doctype/cohort_web_page/cohort_web_page.py b/lms/lms/doctype/cohort_web_page/cohort_web_page.py similarity index 100% rename from school/lms/doctype/cohort_web_page/cohort_web_page.py rename to lms/lms/doctype/cohort_web_page/cohort_web_page.py diff --git a/school/config/__init__.py b/lms/lms/doctype/course_chapter/__init__.py similarity index 100% rename from school/config/__init__.py rename to lms/lms/doctype/course_chapter/__init__.py diff --git a/school/lms/doctype/course_chapter/course_chapter.js b/lms/lms/doctype/course_chapter/course_chapter.js similarity index 100% rename from school/lms/doctype/course_chapter/course_chapter.js rename to lms/lms/doctype/course_chapter/course_chapter.js diff --git a/school/lms/doctype/course_chapter/course_chapter.json b/lms/lms/doctype/course_chapter/course_chapter.json similarity index 85% rename from school/lms/doctype/course_chapter/course_chapter.json rename to lms/lms/doctype/course_chapter/course_chapter.json index 7dca741a..ee8544bf 100644 --- a/school/lms/doctype/course_chapter/course_chapter.json +++ b/lms/lms/doctype/course_chapter/course_chapter.json @@ -59,7 +59,7 @@ "link_fieldname": "chapter" } ], - "modified": "2021-09-29 15:33:44.611229", + "modified": "2022-03-14 17:57:00.707416", "modified_by": "Administrator", "module": "LMS", "name": "Course Chapter", @@ -77,11 +77,26 @@ "role": "System Manager", "share": 1, "write": 1 + }, + { + "create": 1, + "email": 1, + "export": 1, + "if_owner": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "All", + "select": 1, + "share": 1, + "write": 1 } ], "search_fields": "title", + "show_title_field_in_link": 1, "sort_field": "modified", "sort_order": "DESC", + "states": [], "title_field": "title", "track_changes": 1 -} +} \ No newline at end of file diff --git a/school/lms/doctype/course_chapter/course_chapter.py b/lms/lms/doctype/course_chapter/course_chapter.py similarity index 100% rename from school/lms/doctype/course_chapter/course_chapter.py rename to lms/lms/doctype/course_chapter/course_chapter.py diff --git a/school/lms/doctype/course_chapter/test_course_chapter.py b/lms/lms/doctype/course_chapter/test_course_chapter.py similarity index 100% rename from school/lms/doctype/course_chapter/test_course_chapter.py rename to lms/lms/doctype/course_chapter/test_course_chapter.py diff --git a/school/event_management/__init__.py b/lms/lms/doctype/course_instructor/__init__.py similarity index 100% rename from school/event_management/__init__.py rename to lms/lms/doctype/course_instructor/__init__.py diff --git a/school/lms/doctype/course_instructor/course_instructor.json b/lms/lms/doctype/course_instructor/course_instructor.json similarity index 100% rename from school/lms/doctype/course_instructor/course_instructor.json rename to lms/lms/doctype/course_instructor/course_instructor.json diff --git a/school/lms/doctype/course_instructor/course_instructor.py b/lms/lms/doctype/course_instructor/course_instructor.py similarity index 100% rename from school/lms/doctype/course_instructor/course_instructor.py rename to lms/lms/doctype/course_instructor/course_instructor.py diff --git a/school/event_management/doctype/__init__.py b/lms/lms/doctype/course_lesson/__init__.py similarity index 100% rename from school/event_management/doctype/__init__.py rename to lms/lms/doctype/course_lesson/__init__.py diff --git a/school/lms/doctype/course_lesson/course_lesson.js b/lms/lms/doctype/course_lesson/course_lesson.js similarity index 100% rename from school/lms/doctype/course_lesson/course_lesson.js rename to lms/lms/doctype/course_lesson/course_lesson.js diff --git a/school/lms/doctype/course_lesson/course_lesson.json b/lms/lms/doctype/course_lesson/course_lesson.json similarity index 78% rename from school/lms/doctype/course_lesson/course_lesson.json rename to lms/lms/doctype/course_lesson/course_lesson.json index d63eb69b..c38059ac 100644 --- a/school/lms/doctype/course_lesson/course_lesson.json +++ b/lms/lms/doctype/course_lesson/course_lesson.json @@ -1,6 +1,6 @@ { "actions": [], - "allow_import": 1, + "allow_events_in_timeline": 1, "allow_rename": 1, "autoname": "format:{####} {title}", "creation": "2021-05-03 06:21:12.995984", @@ -9,6 +9,7 @@ "engine": "InnoDB", "field_order": [ "chapter", + "course", "include_in_preview", "column_break_4", "title", @@ -69,11 +70,20 @@ { "fieldname": "help", "fieldtype": "HTML" + }, + { + "fetch_from": "chapter.course", + "fieldname": "course", + "fieldtype": "Link", + "hidden": 1, + "label": "Course", + "options": "LMS Course", + "read_only": 1 } ], "index_web_pages_for_search": 1, "links": [], - "modified": "2021-10-11 15:07:38.134808", + "modified": "2022-03-14 18:56:31.969801", "modified_by": "Administrator", "module": "LMS", "name": "Course Lesson", @@ -89,11 +99,26 @@ "read": 1, "report": 1, "role": "System Manager", + "select": 1, + "share": 1, + "write": 1 + }, + { + "create": 1, + "email": 1, + "export": 1, + "if_owner": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "All", + "select": 1, "share": 1, "write": 1 } ], "sort_field": "modified", "sort_order": "DESC", + "states": [], "track_changes": 1 -} +} \ No newline at end of file diff --git a/school/lms/doctype/course_lesson/course_lesson.py b/lms/lms/doctype/course_lesson/course_lesson.py similarity index 95% rename from school/lms/doctype/course_lesson/course_lesson.py rename to lms/lms/doctype/course_lesson/course_lesson.py index 38adb6a3..04504d5e 100644 --- a/school/lms/doctype/course_lesson/course_lesson.py +++ b/lms/lms/doctype/course_lesson/course_lesson.py @@ -6,7 +6,7 @@ from __future__ import unicode_literals import frappe from frappe.model.document import Document from ...md import find_macros -from school.lms.utils import get_course_progress +from lms.lms.utils import get_course_progress, get_lesson_url class CourseLesson(Document): def validate(self): @@ -108,3 +108,7 @@ def save_progress(lesson, course, status): progress = get_course_progress(course) frappe.db.set_value("LMS Batch Membership", membership, "progress", progress) return progress + +@frappe.whitelist() +def get_lesson_info(chapter): + return frappe.db.get_value("Course Chapter", chapter, "course") diff --git a/school/lms/doctype/course_lesson/test_course_lesson.py b/lms/lms/doctype/course_lesson/test_course_lesson.py similarity index 100% rename from school/lms/doctype/course_lesson/test_course_lesson.py rename to lms/lms/doctype/course_lesson/test_course_lesson.py diff --git a/school/event_management/doctype/attendee/__init__.py b/lms/lms/doctype/education_detail/__init__.py similarity index 100% rename from school/event_management/doctype/attendee/__init__.py rename to lms/lms/doctype/education_detail/__init__.py diff --git a/school/lms/doctype/education_detail/education_detail.json b/lms/lms/doctype/education_detail/education_detail.json similarity index 100% rename from school/lms/doctype/education_detail/education_detail.json rename to lms/lms/doctype/education_detail/education_detail.json diff --git a/school/lms/doctype/education_detail/education_detail.py b/lms/lms/doctype/education_detail/education_detail.py similarity index 100% rename from school/lms/doctype/education_detail/education_detail.py rename to lms/lms/doctype/education_detail/education_detail.py diff --git a/school/event_management/doctype/event_details/__init__.py b/lms/lms/doctype/exercise/__init__.py similarity index 100% rename from school/event_management/doctype/event_details/__init__.py rename to lms/lms/doctype/exercise/__init__.py diff --git a/school/lms/doctype/exercise/exercise.js b/lms/lms/doctype/exercise/exercise.js similarity index 100% rename from school/lms/doctype/exercise/exercise.js rename to lms/lms/doctype/exercise/exercise.js diff --git a/school/lms/doctype/exercise/exercise.json b/lms/lms/doctype/exercise/exercise.json similarity index 100% rename from school/lms/doctype/exercise/exercise.json rename to lms/lms/doctype/exercise/exercise.json diff --git a/school/lms/doctype/exercise/exercise.py b/lms/lms/doctype/exercise/exercise.py similarity index 97% rename from school/lms/doctype/exercise/exercise.py rename to lms/lms/doctype/exercise/exercise.py index eb6c7bcb..cf4b2667 100644 --- a/school/lms/doctype/exercise/exercise.py +++ b/lms/lms/doctype/exercise/exercise.py @@ -3,7 +3,7 @@ import frappe from frappe.model.document import Document -from school.lms.utils import get_membership +from lms.lms.utils import get_membership class Exercise(Document): def get_user_submission(self): diff --git a/school/lms/doctype/exercise/test_exercise.py b/lms/lms/doctype/exercise/test_exercise.py similarity index 100% rename from school/lms/doctype/exercise/test_exercise.py rename to lms/lms/doctype/exercise/test_exercise.py diff --git a/school/event_management/doctype/event_ticket/__init__.py b/lms/lms/doctype/exercise_latest_submission/__init__.py similarity index 100% rename from school/event_management/doctype/event_ticket/__init__.py rename to lms/lms/doctype/exercise_latest_submission/__init__.py diff --git a/school/lms/doctype/exercise_latest_submission/exercise_latest_submission.js b/lms/lms/doctype/exercise_latest_submission/exercise_latest_submission.js similarity index 100% rename from school/lms/doctype/exercise_latest_submission/exercise_latest_submission.js rename to lms/lms/doctype/exercise_latest_submission/exercise_latest_submission.js diff --git a/school/lms/doctype/exercise_latest_submission/exercise_latest_submission.json b/lms/lms/doctype/exercise_latest_submission/exercise_latest_submission.json similarity index 100% rename from school/lms/doctype/exercise_latest_submission/exercise_latest_submission.json rename to lms/lms/doctype/exercise_latest_submission/exercise_latest_submission.json diff --git a/school/lms/doctype/exercise_latest_submission/exercise_latest_submission.py b/lms/lms/doctype/exercise_latest_submission/exercise_latest_submission.py similarity index 100% rename from school/lms/doctype/exercise_latest_submission/exercise_latest_submission.py rename to lms/lms/doctype/exercise_latest_submission/exercise_latest_submission.py diff --git a/school/lms/doctype/exercise_latest_submission/test_exercise_latest_submission.py b/lms/lms/doctype/exercise_latest_submission/test_exercise_latest_submission.py similarity index 100% rename from school/lms/doctype/exercise_latest_submission/test_exercise_latest_submission.py rename to lms/lms/doctype/exercise_latest_submission/test_exercise_latest_submission.py diff --git a/school/event_management/doctype/exhibitor/__init__.py b/lms/lms/doctype/exercise_submission/__init__.py similarity index 100% rename from school/event_management/doctype/exhibitor/__init__.py rename to lms/lms/doctype/exercise_submission/__init__.py diff --git a/school/lms/doctype/exercise_submission/exercise_submission.js b/lms/lms/doctype/exercise_submission/exercise_submission.js similarity index 100% rename from school/lms/doctype/exercise_submission/exercise_submission.js rename to lms/lms/doctype/exercise_submission/exercise_submission.js diff --git a/school/lms/doctype/exercise_submission/exercise_submission.json b/lms/lms/doctype/exercise_submission/exercise_submission.json similarity index 100% rename from school/lms/doctype/exercise_submission/exercise_submission.json rename to lms/lms/doctype/exercise_submission/exercise_submission.json diff --git a/school/lms/doctype/exercise_submission/exercise_submission.py b/lms/lms/doctype/exercise_submission/exercise_submission.py similarity index 100% rename from school/lms/doctype/exercise_submission/exercise_submission.py rename to lms/lms/doctype/exercise_submission/exercise_submission.py diff --git a/school/lms/doctype/exercise_submission/test_exercise_submission.py b/lms/lms/doctype/exercise_submission/test_exercise_submission.py similarity index 100% rename from school/lms/doctype/exercise_submission/test_exercise_submission.py rename to lms/lms/doctype/exercise_submission/test_exercise_submission.py diff --git a/school/event_management/doctype/host/__init__.py b/lms/lms/doctype/function/__init__.py similarity index 100% rename from school/event_management/doctype/host/__init__.py rename to lms/lms/doctype/function/__init__.py diff --git a/school/lms/doctype/function/function.js b/lms/lms/doctype/function/function.js similarity index 100% rename from school/lms/doctype/function/function.js rename to lms/lms/doctype/function/function.js diff --git a/school/lms/doctype/function/function.json b/lms/lms/doctype/function/function.json similarity index 100% rename from school/lms/doctype/function/function.json rename to lms/lms/doctype/function/function.json diff --git a/school/lms/doctype/function/function.py b/lms/lms/doctype/function/function.py similarity index 100% rename from school/lms/doctype/function/function.py rename to lms/lms/doctype/function/function.py diff --git a/school/lms/doctype/function/test_function.py b/lms/lms/doctype/function/test_function.py similarity index 100% rename from school/lms/doctype/function/test_function.py rename to lms/lms/doctype/function/test_function.py diff --git a/school/event_management/doctype/speaker/__init__.py b/lms/lms/doctype/industry/__init__.py similarity index 100% rename from school/event_management/doctype/speaker/__init__.py rename to lms/lms/doctype/industry/__init__.py diff --git a/school/lms/doctype/industry/industry.js b/lms/lms/doctype/industry/industry.js similarity index 100% rename from school/lms/doctype/industry/industry.js rename to lms/lms/doctype/industry/industry.js diff --git a/school/lms/doctype/industry/industry.json b/lms/lms/doctype/industry/industry.json similarity index 100% rename from school/lms/doctype/industry/industry.json rename to lms/lms/doctype/industry/industry.json diff --git a/school/lms/doctype/industry/industry.py b/lms/lms/doctype/industry/industry.py similarity index 100% rename from school/lms/doctype/industry/industry.py rename to lms/lms/doctype/industry/industry.py diff --git a/school/lms/doctype/industry/test_industry.py b/lms/lms/doctype/industry/test_industry.py similarity index 100% rename from school/lms/doctype/industry/test_industry.py rename to lms/lms/doctype/industry/test_industry.py diff --git a/school/event_management/doctype/talk/__init__.py b/lms/lms/doctype/invite_request/__init__.py similarity index 100% rename from school/event_management/doctype/talk/__init__.py rename to lms/lms/doctype/invite_request/__init__.py diff --git a/school/lms/doctype/invite_request/invite_request.js b/lms/lms/doctype/invite_request/invite_request.js similarity index 100% rename from school/lms/doctype/invite_request/invite_request.js rename to lms/lms/doctype/invite_request/invite_request.js diff --git a/school/lms/doctype/invite_request/invite_request.json b/lms/lms/doctype/invite_request/invite_request.json similarity index 100% rename from school/lms/doctype/invite_request/invite_request.json rename to lms/lms/doctype/invite_request/invite_request.json diff --git a/school/lms/doctype/invite_request/invite_request.py b/lms/lms/doctype/invite_request/invite_request.py similarity index 100% rename from school/lms/doctype/invite_request/invite_request.py rename to lms/lms/doctype/invite_request/invite_request.py diff --git a/school/lms/doctype/invite_request/test_invite_request.py b/lms/lms/doctype/invite_request/test_invite_request.py similarity index 96% rename from school/lms/doctype/invite_request/test_invite_request.py rename to lms/lms/doctype/invite_request/test_invite_request.py index 16888eee..491bac17 100644 --- a/school/lms/doctype/invite_request/test_invite_request.py +++ b/lms/lms/doctype/invite_request/test_invite_request.py @@ -2,7 +2,7 @@ # Copyright (c) 2021, FOSS United and Contributors # See license.txt from __future__ import unicode_literals -from school.lms.doctype.invite_request.invite_request import create_invite_request, update_invite +from lms.lms.doctype.invite_request.invite_request import create_invite_request, update_invite import frappe import unittest diff --git a/school/event_management/web_form/__init__.py b/lms/lms/doctype/lesson_assignment/__init__.py similarity index 100% rename from school/event_management/web_form/__init__.py rename to lms/lms/doctype/lesson_assignment/__init__.py diff --git a/school/lms/doctype/lesson_assignment/lesson_assignment.js b/lms/lms/doctype/lesson_assignment/lesson_assignment.js similarity index 100% rename from school/lms/doctype/lesson_assignment/lesson_assignment.js rename to lms/lms/doctype/lesson_assignment/lesson_assignment.js diff --git a/school/lms/doctype/lesson_assignment/lesson_assignment.json b/lms/lms/doctype/lesson_assignment/lesson_assignment.json similarity index 100% rename from school/lms/doctype/lesson_assignment/lesson_assignment.json rename to lms/lms/doctype/lesson_assignment/lesson_assignment.json diff --git a/school/lms/doctype/lesson_assignment/lesson_assignment.py b/lms/lms/doctype/lesson_assignment/lesson_assignment.py similarity index 100% rename from school/lms/doctype/lesson_assignment/lesson_assignment.py rename to lms/lms/doctype/lesson_assignment/lesson_assignment.py diff --git a/school/lms/doctype/lesson_assignment/test_lesson_assignment.py b/lms/lms/doctype/lesson_assignment/test_lesson_assignment.py similarity index 100% rename from school/lms/doctype/lesson_assignment/test_lesson_assignment.py rename to lms/lms/doctype/lesson_assignment/test_lesson_assignment.py diff --git a/school/event_management/web_form/attendee_registration/__init__.py b/lms/lms/doctype/lesson_reference/__init__.py similarity index 100% rename from school/event_management/web_form/attendee_registration/__init__.py rename to lms/lms/doctype/lesson_reference/__init__.py diff --git a/school/lms/doctype/lesson_reference/lesson_reference.json b/lms/lms/doctype/lesson_reference/lesson_reference.json similarity index 84% rename from school/lms/doctype/lesson_reference/lesson_reference.json rename to lms/lms/doctype/lesson_reference/lesson_reference.json index a3e77ebb..86129694 100644 --- a/school/lms/doctype/lesson_reference/lesson_reference.json +++ b/lms/lms/doctype/lesson_reference/lesson_reference.json @@ -1,5 +1,6 @@ { "actions": [], + "autoname": "hash", "creation": "2021-07-27 16:25:48.269536", "doctype": "DocType", "editable_grid": 1, @@ -20,13 +21,15 @@ "index_web_pages_for_search": 1, "istable": 1, "links": [], - "modified": "2021-09-30 10:35:47.832547", + "modified": "2022-03-15 09:39:29.495991", "modified_by": "Administrator", "module": "LMS", "name": "Lesson Reference", + "naming_rule": "Random", "owner": "Administrator", "permissions": [], "sort_field": "modified", "sort_order": "DESC", + "states": [], "track_changes": 1 } \ No newline at end of file diff --git a/school/lms/doctype/lesson_reference/lesson_reference.py b/lms/lms/doctype/lesson_reference/lesson_reference.py similarity index 100% rename from school/lms/doctype/lesson_reference/lesson_reference.py rename to lms/lms/doctype/lesson_reference/lesson_reference.py diff --git a/school/event_management/web_form/exhibitor_registration/__init__.py b/lms/lms/doctype/lms_batch/__init__.py similarity index 100% rename from school/event_management/web_form/exhibitor_registration/__init__.py rename to lms/lms/doctype/lms_batch/__init__.py diff --git a/school/lms/doctype/lms_batch/lms_batch.js b/lms/lms/doctype/lms_batch/lms_batch.js similarity index 100% rename from school/lms/doctype/lms_batch/lms_batch.js rename to lms/lms/doctype/lms_batch/lms_batch.js diff --git a/school/lms/doctype/lms_batch/lms_batch.json b/lms/lms/doctype/lms_batch/lms_batch.json similarity index 100% rename from school/lms/doctype/lms_batch/lms_batch.json rename to lms/lms/doctype/lms_batch/lms_batch.json diff --git a/school/lms/doctype/lms_batch/lms_batch.py b/lms/lms/doctype/lms_batch/lms_batch.py similarity index 94% rename from school/lms/doctype/lms_batch/lms_batch.py rename to lms/lms/doctype/lms_batch/lms_batch.py index 9643ddf4..183079f0 100644 --- a/school/lms/doctype/lms_batch/lms_batch.py +++ b/lms/lms/doctype/lms_batch/lms_batch.py @@ -6,9 +6,9 @@ from __future__ import unicode_literals import frappe from frappe.model.document import Document from frappe import _ -from school.lms.doctype.lms_batch_membership.lms_batch_membership import create_membership -from school.query import find, find_all -from school.lms.utils import is_mentor +from lms.lms.doctype.lms_batch_membership.lms_batch_membership import create_membership +from lms.query import find, find_all +from lms.lms.utils import is_mentor class LMSBatch(Document): def validate(self): diff --git a/school/lms/doctype/lms_batch/test_lms_batch.py b/lms/lms/doctype/lms_batch/test_lms_batch.py similarity index 100% rename from school/lms/doctype/lms_batch/test_lms_batch.py rename to lms/lms/doctype/lms_batch/test_lms_batch.py diff --git a/school/event_management/web_form/purpose_a_talk/__init__.py b/lms/lms/doctype/lms_batch_membership/__init__.py similarity index 100% rename from school/event_management/web_form/purpose_a_talk/__init__.py rename to lms/lms/doctype/lms_batch_membership/__init__.py diff --git a/school/lms/doctype/lms_batch_membership/lms_batch_membership.js b/lms/lms/doctype/lms_batch_membership/lms_batch_membership.js similarity index 100% rename from school/lms/doctype/lms_batch_membership/lms_batch_membership.js rename to lms/lms/doctype/lms_batch_membership/lms_batch_membership.js diff --git a/school/lms/doctype/lms_batch_membership/lms_batch_membership.json b/lms/lms/doctype/lms_batch_membership/lms_batch_membership.json similarity index 94% rename from school/lms/doctype/lms_batch_membership/lms_batch_membership.json rename to lms/lms/doctype/lms_batch_membership/lms_batch_membership.json index 35f74e35..07061b24 100644 --- a/school/lms/doctype/lms_batch_membership/lms_batch_membership.json +++ b/lms/lms/doctype/lms_batch_membership/lms_batch_membership.json @@ -1,6 +1,6 @@ { "actions": [], - "creation": "2021-03-18 19:52:10.673835", + "creation": "2022-02-07 12:01:40.929633", "doctype": "DocType", "editable_grid": 1, "engine": "InnoDB", @@ -24,8 +24,6 @@ { "fieldname": "batch", "fieldtype": "Link", - "in_list_view": 1, - "in_standard_filter": 1, "label": "Batch", "options": "LMS Batch" }, @@ -117,7 +115,7 @@ ], "index_web_pages_for_search": 1, "links": [], - "modified": "2021-12-16 14:49:25.964853", + "modified": "2022-03-09 15:17:15.386067", "modified_by": "Administrator", "module": "LMS", "name": "LMS Batch Membership", @@ -138,5 +136,6 @@ ], "quick_entry": 1, "sort_field": "modified", - "sort_order": "DESC" + "sort_order": "DESC", + "states": [] } \ No newline at end of file diff --git a/school/lms/doctype/lms_batch_membership/lms_batch_membership.py b/lms/lms/doctype/lms_batch_membership/lms_batch_membership.py similarity index 100% rename from school/lms/doctype/lms_batch_membership/lms_batch_membership.py rename to lms/lms/doctype/lms_batch_membership/lms_batch_membership.py diff --git a/school/lms/doctype/lms_batch_membership/test_lms_batch_membership.py b/lms/lms/doctype/lms_batch_membership/test_lms_batch_membership.py similarity index 100% rename from school/lms/doctype/lms_batch_membership/test_lms_batch_membership.py rename to lms/lms/doctype/lms_batch_membership/test_lms_batch_membership.py diff --git a/school/event_management/web_form/speaker_registration/__init__.py b/lms/lms/doctype/lms_certification/__init__.py similarity index 100% rename from school/event_management/web_form/speaker_registration/__init__.py rename to lms/lms/doctype/lms_certification/__init__.py diff --git a/school/lms/doctype/lms_certification/lms_certification.js b/lms/lms/doctype/lms_certification/lms_certification.js similarity index 100% rename from school/lms/doctype/lms_certification/lms_certification.js rename to lms/lms/doctype/lms_certification/lms_certification.js diff --git a/school/lms/doctype/lms_certification/lms_certification.json b/lms/lms/doctype/lms_certification/lms_certification.json similarity index 100% rename from school/lms/doctype/lms_certification/lms_certification.json rename to lms/lms/doctype/lms_certification/lms_certification.json diff --git a/school/lms/doctype/lms_certification/lms_certification.py b/lms/lms/doctype/lms_certification/lms_certification.py similarity index 97% rename from school/lms/doctype/lms_certification/lms_certification.py rename to lms/lms/doctype/lms_certification/lms_certification.py index d633d13d..1c5d9f51 100644 --- a/school/lms/doctype/lms_certification/lms_certification.py +++ b/lms/lms/doctype/lms_certification/lms_certification.py @@ -6,7 +6,7 @@ from frappe.model.document import Document from frappe.utils import nowdate, add_years from frappe import _ from frappe.utils.pdf import get_pdf -from school.lms.utils import is_certified +from lms.lms.utils import is_certified class LMSCertification(Document): diff --git a/school/lms/doctype/lms_certification/test_lms_certification.py b/lms/lms/doctype/lms_certification/test_lms_certification.py similarity index 82% rename from school/lms/doctype/lms_certification/test_lms_certification.py rename to lms/lms/doctype/lms_certification/test_lms_certification.py index 1585c79f..7a757f01 100644 --- a/school/lms/doctype/lms_certification/test_lms_certification.py +++ b/lms/lms/doctype/lms_certification/test_lms_certification.py @@ -3,8 +3,8 @@ import frappe import unittest -from school.lms.doctype.lms_course.test_lms_course import new_course -from school.lms.doctype.lms_certification.lms_certification import create_certificate +from lms.lms.doctype.lms_course.test_lms_course import new_course +from lms.lms.doctype.lms_certification.lms_certification import create_certificate from frappe.utils import nowdate, add_years, cint class TestLMSCertification(unittest.TestCase): diff --git a/school/event_management/web_template/__init__.py b/lms/lms/doctype/lms_course/__init__.py similarity index 100% rename from school/event_management/web_template/__init__.py rename to lms/lms/doctype/lms_course/__init__.py diff --git a/school/lms/doctype/lms_course/lms_course.js b/lms/lms/doctype/lms_course/lms_course.js similarity index 100% rename from school/lms/doctype/lms_course/lms_course.js rename to lms/lms/doctype/lms_course/lms_course.js diff --git a/school/lms/doctype/lms_course/lms_course.json b/lms/lms/doctype/lms_course/lms_course.json similarity index 81% rename from school/lms/doctype/lms_course/lms_course.json rename to lms/lms/doctype/lms_course/lms_course.json index 84abccb2..b3429c05 100644 --- a/school/lms/doctype/lms_course/lms_course.json +++ b/lms/lms/doctype/lms_course/lms_course.json @@ -1,16 +1,15 @@ { "actions": [ { - "action": "school.lms.doctype.lms_course.lms_course.reindex_exercises", + "action": "lms.lms.doctype.lms_course.lms_course.reindex_exercises", "action_type": "Server Action", "group": "Reindex", "label": "Reindex Exercises" } ], - "allow_guest_to_view": 1, "allow_import": 1, "allow_rename": 1, - "creation": "2022-02-08 16:34:42.721203", + "creation": "2022-02-22 15:28:26.091549", "doctype": "DocType", "editable_grid": 1, "engine": "InnoDB", @@ -21,13 +20,14 @@ "column_break_3", "instructors", "tags", + "status", "section_break_7", "is_published", - "column_break_9", + "column_break_10", "upcoming", - "column_break_11", + "column_break_12", "disable_self_learning", - "section_break_5", + "section_break_18", "short_introduction", "description", "chapters", @@ -43,7 +43,8 @@ "in_list_view": 1, "label": "Title", "reqd": 1, - "unique": 1 + "unique": 1, + "width": "200" }, { "fieldname": "description", @@ -66,10 +67,6 @@ "fieldtype": "Data", "label": "Video Embed Link" }, - { - "fieldname": "section_break_5", - "fieldtype": "Section Break" - }, { "fieldname": "short_introduction", "fieldtype": "Small Text", @@ -109,6 +106,7 @@ "fieldtype": "Table MultiSelect", "in_standard_filter": 1, "label": "Instructors", + "max_height": "50px", "options": "Course Instructor" }, { @@ -116,14 +114,6 @@ "fieldtype": "Section Break", "label": "Course Settings" }, - { - "fieldname": "column_break_9", - "fieldtype": "Column Break" - }, - { - "fieldname": "column_break_11", - "fieldtype": "Column Break" - }, { "fieldname": "certification_section", "fieldtype": "Section Break", @@ -148,9 +138,31 @@ "fieldtype": "Table", "label": "Related Courses", "options": "Related Courses" + }, + { + "default": "In Progress", + "fieldname": "status", + "fieldtype": "Select", + "hidden": 1, + "in_list_view": 1, + "in_standard_filter": 1, + "label": "Status", + "options": "In Progress\nUnder Review\nApproved", + "read_only": 1 + }, + { + "fieldname": "section_break_18", + "fieldtype": "Section Break" + }, + { + "fieldname": "column_break_10", + "fieldtype": "Column Break" + }, + { + "fieldname": "column_break_12", + "fieldtype": "Column Break" } ], - "index_web_pages_for_search": 1, "is_published_field": "is_published", "links": [ { @@ -174,7 +186,7 @@ "link_fieldname": "course" } ], - "modified": "2022-02-16 11:50:20.661085", + "modified": "2022-03-15 10:16:53.796878", "modified_by": "Administrator", "module": "LMS", "name": "LMS Course", @@ -189,6 +201,20 @@ "read": 1, "report": 1, "role": "System Manager", + "select": 1, + "share": 1, + "write": 1 + }, + { + "create": 1, + "email": 1, + "export": 1, + "if_owner": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "All", + "select": 1, "share": 1, "write": 1 } @@ -199,4 +225,4 @@ "states": [], "title_field": "title", "track_changes": 1 -} \ No newline at end of file +} diff --git a/school/lms/doctype/lms_course/lms_course.py b/lms/lms/doctype/lms_course/lms_course.py similarity index 86% rename from school/lms/doctype/lms_course/lms_course.py rename to lms/lms/doctype/lms_course/lms_course.py index 24b2c9c2..f814ce50 100644 --- a/school/lms/doctype/lms_course/lms_course.py +++ b/lms/lms/doctype/lms_course/lms_course.py @@ -6,12 +6,30 @@ import frappe from frappe.model.document import Document import json from ...utils import slugify -from school.query import find, find_all +from lms.query import find, find_all from frappe.utils import flt, cint -from school.lms.utils import get_chapters +from lms.lms.utils import get_chapters class LMSCourse(Document): + def validate(self): + self.validate_instructors() + self.validate_status() + + def validate_instructors(self): + if self.is_new() and not self.instructors: + frappe.get_doc({ + "doctype": "Course Instructor", + "instructor": self.owner, + "parent": self.name, + "parentfield": "instructors", + "parenttype": "LMS Course" + }).save(ignore_permissions=True) + + def validate_status(self): + if self.is_published: + self.status = "Approved" + def on_update(self): if not self.upcoming and self.has_value_changed("upcoming"): self.send_email_to_interested_users() @@ -177,10 +195,18 @@ def search_course(text): """ for course in courses: search_courses.append(frappe.get_doc("LMS Course", course)) """ - """ template = frappe.render_template("school/templates/course_list.html", { + """ template = frappe.render_template("lms/templates/course_list.html", { "title": _("Search Results"), "courses": search_courses, "widgets": Widgets() }) """ return courses + +@frappe.whitelist() +def submit_for_review(course): + chapters = frappe.get_all("Chapter Reference", {"parent": course}) + if not len(chapters): + return "No Chp" + frappe.db.set_value("LMS Course", course, "status", "Under Review") + return "OK" diff --git a/school/lms/doctype/lms_course/test_lms_course.py b/lms/lms/doctype/lms_course/test_lms_course.py similarity index 99% rename from school/lms/doctype/lms_course/test_lms_course.py rename to lms/lms/doctype/lms_course/test_lms_course.py index 64d27695..1dcefab0 100644 --- a/school/lms/doctype/lms_course/test_lms_course.py +++ b/lms/lms/doctype/lms_course/test_lms_course.py @@ -12,8 +12,6 @@ class TestLMSCourse(unittest.TestCase): frappe.db.sql('delete from `tabLMS Course Mentor Mapping`') frappe.db.sql('delete from `tabLMS Course`') - - def test_new_course(self): course = new_course("Test Course") assert course.title == "Test Course" diff --git a/school/event_management/web_template/exhibitor_section/__init__.py b/lms/lms/doctype/lms_course_enrollment/__init__.py similarity index 100% rename from school/event_management/web_template/exhibitor_section/__init__.py rename to lms/lms/doctype/lms_course_enrollment/__init__.py diff --git a/school/lms/doctype/lms_course_enrollment/lms_course_enrollment.js b/lms/lms/doctype/lms_course_enrollment/lms_course_enrollment.js similarity index 100% rename from school/lms/doctype/lms_course_enrollment/lms_course_enrollment.js rename to lms/lms/doctype/lms_course_enrollment/lms_course_enrollment.js diff --git a/school/lms/doctype/lms_course_enrollment/lms_course_enrollment.json b/lms/lms/doctype/lms_course_enrollment/lms_course_enrollment.json similarity index 100% rename from school/lms/doctype/lms_course_enrollment/lms_course_enrollment.json rename to lms/lms/doctype/lms_course_enrollment/lms_course_enrollment.json diff --git a/school/lms/doctype/lms_course_enrollment/lms_course_enrollment.py b/lms/lms/doctype/lms_course_enrollment/lms_course_enrollment.py similarity index 100% rename from school/lms/doctype/lms_course_enrollment/lms_course_enrollment.py rename to lms/lms/doctype/lms_course_enrollment/lms_course_enrollment.py diff --git a/school/lms/doctype/lms_course_enrollment/test_lms_course_enrollment.py b/lms/lms/doctype/lms_course_enrollment/test_lms_course_enrollment.py similarity index 100% rename from school/lms/doctype/lms_course_enrollment/test_lms_course_enrollment.py rename to lms/lms/doctype/lms_course_enrollment/test_lms_course_enrollment.py diff --git a/school/event_management/web_template/host_section/__init__.py b/lms/lms/doctype/lms_course_interest/__init__.py similarity index 100% rename from school/event_management/web_template/host_section/__init__.py rename to lms/lms/doctype/lms_course_interest/__init__.py diff --git a/school/lms/doctype/lms_course_interest/lms_course_interest.js b/lms/lms/doctype/lms_course_interest/lms_course_interest.js similarity index 100% rename from school/lms/doctype/lms_course_interest/lms_course_interest.js rename to lms/lms/doctype/lms_course_interest/lms_course_interest.js diff --git a/school/lms/doctype/lms_course_interest/lms_course_interest.json b/lms/lms/doctype/lms_course_interest/lms_course_interest.json similarity index 100% rename from school/lms/doctype/lms_course_interest/lms_course_interest.json rename to lms/lms/doctype/lms_course_interest/lms_course_interest.json diff --git a/school/lms/doctype/lms_course_interest/lms_course_interest.py b/lms/lms/doctype/lms_course_interest/lms_course_interest.py similarity index 100% rename from school/lms/doctype/lms_course_interest/lms_course_interest.py rename to lms/lms/doctype/lms_course_interest/lms_course_interest.py diff --git a/school/lms/doctype/lms_course_interest/test_lms_course_interest.py b/lms/lms/doctype/lms_course_interest/test_lms_course_interest.py similarity index 100% rename from school/lms/doctype/lms_course_interest/test_lms_course_interest.py rename to lms/lms/doctype/lms_course_interest/test_lms_course_interest.py diff --git a/school/event_management/web_template/speaker_section/__init__.py b/lms/lms/doctype/lms_course_mentor_mapping/__init__.py similarity index 100% rename from school/event_management/web_template/speaker_section/__init__.py rename to lms/lms/doctype/lms_course_mentor_mapping/__init__.py diff --git a/school/lms/doctype/lms_course_mentor_mapping/lms_course_mentor_mapping.js b/lms/lms/doctype/lms_course_mentor_mapping/lms_course_mentor_mapping.js similarity index 100% rename from school/lms/doctype/lms_course_mentor_mapping/lms_course_mentor_mapping.js rename to lms/lms/doctype/lms_course_mentor_mapping/lms_course_mentor_mapping.js diff --git a/school/lms/doctype/lms_course_mentor_mapping/lms_course_mentor_mapping.json b/lms/lms/doctype/lms_course_mentor_mapping/lms_course_mentor_mapping.json similarity index 100% rename from school/lms/doctype/lms_course_mentor_mapping/lms_course_mentor_mapping.json rename to lms/lms/doctype/lms_course_mentor_mapping/lms_course_mentor_mapping.json diff --git a/school/lms/doctype/lms_course_mentor_mapping/lms_course_mentor_mapping.py b/lms/lms/doctype/lms_course_mentor_mapping/lms_course_mentor_mapping.py similarity index 100% rename from school/lms/doctype/lms_course_mentor_mapping/lms_course_mentor_mapping.py rename to lms/lms/doctype/lms_course_mentor_mapping/lms_course_mentor_mapping.py diff --git a/school/lms/doctype/lms_course_mentor_mapping/test_lms_course_mentor_mapping.py b/lms/lms/doctype/lms_course_mentor_mapping/test_lms_course_mentor_mapping.py similarity index 100% rename from school/lms/doctype/lms_course_mentor_mapping/test_lms_course_mentor_mapping.py rename to lms/lms/doctype/lms_course_mentor_mapping/test_lms_course_mentor_mapping.py diff --git a/school/event_management/web_template/talk_section/__init__.py b/lms/lms/doctype/lms_course_progress/__init__.py similarity index 100% rename from school/event_management/web_template/talk_section/__init__.py rename to lms/lms/doctype/lms_course_progress/__init__.py diff --git a/school/lms/doctype/lms_course_progress/lms_course_progress.js b/lms/lms/doctype/lms_course_progress/lms_course_progress.js similarity index 100% rename from school/lms/doctype/lms_course_progress/lms_course_progress.js rename to lms/lms/doctype/lms_course_progress/lms_course_progress.js diff --git a/school/lms/doctype/lms_course_progress/lms_course_progress.json b/lms/lms/doctype/lms_course_progress/lms_course_progress.json similarity index 100% rename from school/lms/doctype/lms_course_progress/lms_course_progress.json rename to lms/lms/doctype/lms_course_progress/lms_course_progress.json diff --git a/school/lms/doctype/lms_course_progress/lms_course_progress.py b/lms/lms/doctype/lms_course_progress/lms_course_progress.py similarity index 100% rename from school/lms/doctype/lms_course_progress/lms_course_progress.py rename to lms/lms/doctype/lms_course_progress/lms_course_progress.py diff --git a/school/lms/doctype/lms_course_progress/test_lms_course_progress.py b/lms/lms/doctype/lms_course_progress/test_lms_course_progress.py similarity index 100% rename from school/lms/doctype/lms_course_progress/test_lms_course_progress.py rename to lms/lms/doctype/lms_course_progress/test_lms_course_progress.py diff --git a/school/hackathon/__init__.py b/lms/lms/doctype/lms_course_review/__init__.py similarity index 100% rename from school/hackathon/__init__.py rename to lms/lms/doctype/lms_course_review/__init__.py diff --git a/school/lms/doctype/lms_course_review/lms_course_review.js b/lms/lms/doctype/lms_course_review/lms_course_review.js similarity index 100% rename from school/lms/doctype/lms_course_review/lms_course_review.js rename to lms/lms/doctype/lms_course_review/lms_course_review.js diff --git a/school/lms/doctype/lms_course_review/lms_course_review.json b/lms/lms/doctype/lms_course_review/lms_course_review.json similarity index 100% rename from school/lms/doctype/lms_course_review/lms_course_review.json rename to lms/lms/doctype/lms_course_review/lms_course_review.json diff --git a/school/lms/doctype/lms_course_review/lms_course_review.py b/lms/lms/doctype/lms_course_review/lms_course_review.py similarity index 100% rename from school/lms/doctype/lms_course_review/lms_course_review.py rename to lms/lms/doctype/lms_course_review/lms_course_review.py diff --git a/school/lms/doctype/lms_course_review/test_lms_course_review.py b/lms/lms/doctype/lms_course_review/test_lms_course_review.py similarity index 100% rename from school/lms/doctype/lms_course_review/test_lms_course_review.py rename to lms/lms/doctype/lms_course_review/test_lms_course_review.py diff --git a/school/hackathon/doctype/__init__.py b/lms/lms/doctype/lms_mentor_request/__init__.py similarity index 100% rename from school/hackathon/doctype/__init__.py rename to lms/lms/doctype/lms_mentor_request/__init__.py diff --git a/school/lms/doctype/lms_mentor_request/lms_mentor_request.js b/lms/lms/doctype/lms_mentor_request/lms_mentor_request.js similarity index 100% rename from school/lms/doctype/lms_mentor_request/lms_mentor_request.js rename to lms/lms/doctype/lms_mentor_request/lms_mentor_request.js diff --git a/school/lms/doctype/lms_mentor_request/lms_mentor_request.json b/lms/lms/doctype/lms_mentor_request/lms_mentor_request.json similarity index 100% rename from school/lms/doctype/lms_mentor_request/lms_mentor_request.json rename to lms/lms/doctype/lms_mentor_request/lms_mentor_request.json diff --git a/school/lms/doctype/lms_mentor_request/lms_mentor_request.py b/lms/lms/doctype/lms_mentor_request/lms_mentor_request.py similarity index 100% rename from school/lms/doctype/lms_mentor_request/lms_mentor_request.py rename to lms/lms/doctype/lms_mentor_request/lms_mentor_request.py diff --git a/school/lms/doctype/lms_mentor_request/test_lms_mentor_request.py b/lms/lms/doctype/lms_mentor_request/test_lms_mentor_request.py similarity index 100% rename from school/lms/doctype/lms_mentor_request/test_lms_mentor_request.py rename to lms/lms/doctype/lms_mentor_request/test_lms_mentor_request.py diff --git a/school/hackathon/doctype/community_hackathon/__init__.py b/lms/lms/doctype/lms_option/__init__.py similarity index 100% rename from school/hackathon/doctype/community_hackathon/__init__.py rename to lms/lms/doctype/lms_option/__init__.py diff --git a/school/lms/doctype/lms_option/lms_option.json b/lms/lms/doctype/lms_option/lms_option.json similarity index 100% rename from school/lms/doctype/lms_option/lms_option.json rename to lms/lms/doctype/lms_option/lms_option.json diff --git a/school/lms/doctype/lms_option/lms_option.py b/lms/lms/doctype/lms_option/lms_option.py similarity index 100% rename from school/lms/doctype/lms_option/lms_option.py rename to lms/lms/doctype/lms_option/lms_option.py diff --git a/school/hackathon/doctype/community_project/__init__.py b/lms/lms/doctype/lms_quiz/__init__.py similarity index 100% rename from school/hackathon/doctype/community_project/__init__.py rename to lms/lms/doctype/lms_quiz/__init__.py diff --git a/school/lms/doctype/lms_quiz/lms_quiz.js b/lms/lms/doctype/lms_quiz/lms_quiz.js similarity index 100% rename from school/lms/doctype/lms_quiz/lms_quiz.js rename to lms/lms/doctype/lms_quiz/lms_quiz.js diff --git a/school/lms/doctype/lms_quiz/lms_quiz.json b/lms/lms/doctype/lms_quiz/lms_quiz.json similarity index 100% rename from school/lms/doctype/lms_quiz/lms_quiz.json rename to lms/lms/doctype/lms_quiz/lms_quiz.json diff --git a/school/lms/doctype/lms_quiz/lms_quiz.py b/lms/lms/doctype/lms_quiz/lms_quiz.py similarity index 100% rename from school/lms/doctype/lms_quiz/lms_quiz.py rename to lms/lms/doctype/lms_quiz/lms_quiz.py diff --git a/school/lms/doctype/lms_quiz/test_lms_quiz.py b/lms/lms/doctype/lms_quiz/test_lms_quiz.py similarity index 100% rename from school/lms/doctype/lms_quiz/test_lms_quiz.py rename to lms/lms/doctype/lms_quiz/test_lms_quiz.py diff --git a/school/hackathon/doctype/community_project_evaluation/__init__.py b/lms/lms/doctype/lms_quiz_question/__init__.py similarity index 100% rename from school/hackathon/doctype/community_project_evaluation/__init__.py rename to lms/lms/doctype/lms_quiz_question/__init__.py diff --git a/school/lms/doctype/lms_quiz_question/lms_quiz_question.json b/lms/lms/doctype/lms_quiz_question/lms_quiz_question.json similarity index 100% rename from school/lms/doctype/lms_quiz_question/lms_quiz_question.json rename to lms/lms/doctype/lms_quiz_question/lms_quiz_question.json diff --git a/school/lms/doctype/lms_quiz_question/lms_quiz_question.py b/lms/lms/doctype/lms_quiz_question/lms_quiz_question.py similarity index 100% rename from school/lms/doctype/lms_quiz_question/lms_quiz_question.py rename to lms/lms/doctype/lms_quiz_question/lms_quiz_question.py diff --git a/school/hackathon/doctype/community_project_like/__init__.py b/lms/lms/doctype/lms_quiz_result/__init__.py similarity index 100% rename from school/hackathon/doctype/community_project_like/__init__.py rename to lms/lms/doctype/lms_quiz_result/__init__.py diff --git a/school/lms/doctype/lms_quiz_result/lms_quiz_result.json b/lms/lms/doctype/lms_quiz_result/lms_quiz_result.json similarity index 100% rename from school/lms/doctype/lms_quiz_result/lms_quiz_result.json rename to lms/lms/doctype/lms_quiz_result/lms_quiz_result.json diff --git a/school/lms/doctype/lms_quiz_result/lms_quiz_result.py b/lms/lms/doctype/lms_quiz_result/lms_quiz_result.py similarity index 100% rename from school/lms/doctype/lms_quiz_result/lms_quiz_result.py rename to lms/lms/doctype/lms_quiz_result/lms_quiz_result.py diff --git a/school/hackathon/doctype/community_project_member/__init__.py b/lms/lms/doctype/lms_quiz_submission/__init__.py similarity index 100% rename from school/hackathon/doctype/community_project_member/__init__.py rename to lms/lms/doctype/lms_quiz_submission/__init__.py diff --git a/school/lms/doctype/lms_quiz_submission/lms_quiz_submission.js b/lms/lms/doctype/lms_quiz_submission/lms_quiz_submission.js similarity index 100% rename from school/lms/doctype/lms_quiz_submission/lms_quiz_submission.js rename to lms/lms/doctype/lms_quiz_submission/lms_quiz_submission.js diff --git a/school/lms/doctype/lms_quiz_submission/lms_quiz_submission.json b/lms/lms/doctype/lms_quiz_submission/lms_quiz_submission.json similarity index 100% rename from school/lms/doctype/lms_quiz_submission/lms_quiz_submission.json rename to lms/lms/doctype/lms_quiz_submission/lms_quiz_submission.json diff --git a/school/lms/doctype/lms_quiz_submission/lms_quiz_submission.py b/lms/lms/doctype/lms_quiz_submission/lms_quiz_submission.py similarity index 100% rename from school/lms/doctype/lms_quiz_submission/lms_quiz_submission.py rename to lms/lms/doctype/lms_quiz_submission/lms_quiz_submission.py diff --git a/school/lms/doctype/lms_quiz_submission/test_lms_quiz_submission.py b/lms/lms/doctype/lms_quiz_submission/test_lms_quiz_submission.py similarity index 100% rename from school/lms/doctype/lms_quiz_submission/test_lms_quiz_submission.py rename to lms/lms/doctype/lms_quiz_submission/test_lms_quiz_submission.py diff --git a/school/lms/doctype/lms_section/lms_section.py b/lms/lms/doctype/lms_section/lms_section.py similarity index 100% rename from school/lms/doctype/lms_section/lms_section.py rename to lms/lms/doctype/lms_section/lms_section.py diff --git a/school/hackathon/doctype/community_project_update/__init__.py b/lms/lms/doctype/lms_settings/__init__.py similarity index 100% rename from school/hackathon/doctype/community_project_update/__init__.py rename to lms/lms/doctype/lms_settings/__init__.py diff --git a/school/lms/doctype/lms_settings/lms_settings.js b/lms/lms/doctype/lms_settings/lms_settings.js similarity index 100% rename from school/lms/doctype/lms_settings/lms_settings.js rename to lms/lms/doctype/lms_settings/lms_settings.js diff --git a/school/lms/doctype/lms_settings/lms_settings.json b/lms/lms/doctype/lms_settings/lms_settings.json similarity index 79% rename from school/lms/doctype/lms_settings/lms_settings.json rename to lms/lms/doctype/lms_settings/lms_settings.json index 35c07925..bcd59c9b 100644 --- a/school/lms/doctype/lms_settings/lms_settings.json +++ b/lms/lms/doctype/lms_settings/lms_settings.json @@ -6,16 +6,20 @@ "engine": "InnoDB", "field_order": [ "show_search", - "search_placeholder", - "column_break_2", + "portal_course_creation", "force_profile_completion", + "column_break_2", + "search_placeholder", "livecode_url", "signup_settings_section", "terms_of_use", "terms_page", - "column_break_12", + "column_break_9", "privacy_policy", "privacy_policy_page", + "column_break_12", + "cookie_policy", + "cookie_policy_page", "mentor_request_section", "mentor_request_creation", "mentor_request_status_update" @@ -96,17 +100,42 @@ "fieldname": "privacy_policy_page", "fieldtype": "Link", "label": "Privacy Policy Page", + "mandatory_depends_on": "privacy_policy", "options": "Web Page" }, { "fieldname": "column_break_12", "fieldtype": "Column Break" + }, + { + "default": "0", + "fieldname": "portal_course_creation", + "fieldtype": "Check", + "label": "Enable Course Creation from Portal" + }, + { + "fieldname": "column_break_9", + "fieldtype": "Column Break" + }, + { + "default": "0", + "fieldname": "cookie_policy", + "fieldtype": "Check", + "label": "Show Cookie Policy on Signup" + }, + { + "depends_on": "cookie_policy", + "fieldname": "cookie_policy_page", + "fieldtype": "Link", + "label": "Cookie Policy Page", + "mandatory_depends_on": "cookie_policy", + "options": "Web Page" } ], "index_web_pages_for_search": 1, "issingle": 1, "links": [], - "modified": "2022-02-23 16:15:28.586903", + "modified": "2022-03-23 16:07:29.491432", "modified_by": "Administrator", "module": "LMS", "name": "LMS Settings", diff --git a/school/lms/doctype/lms_settings/lms_settings.py b/lms/lms/doctype/lms_settings/lms_settings.py similarity index 96% rename from school/lms/doctype/lms_settings/lms_settings.py rename to lms/lms/doctype/lms_settings/lms_settings.py index 0681a991..8d9ef1ed 100644 --- a/school/lms/doctype/lms_settings/lms_settings.py +++ b/lms/lms/doctype/lms_settings/lms_settings.py @@ -5,9 +5,10 @@ from __future__ import unicode_literals import frappe from frappe.model.document import Document +from frappe import _ class LMSSettings(Document): - pass + pass @frappe.whitelist() def check_profile_restriction(): diff --git a/school/lms/doctype/lms_settings/test_lms_settings.py b/lms/lms/doctype/lms_settings/test_lms_settings.py similarity index 100% rename from school/lms/doctype/lms_settings/test_lms_settings.py rename to lms/lms/doctype/lms_settings/test_lms_settings.py diff --git a/school/hackathon/web_form/__init__.py b/lms/lms/doctype/preferred_function/__init__.py similarity index 100% rename from school/hackathon/web_form/__init__.py rename to lms/lms/doctype/preferred_function/__init__.py diff --git a/school/lms/doctype/preferred_function/preferred_function.json b/lms/lms/doctype/preferred_function/preferred_function.json similarity index 100% rename from school/lms/doctype/preferred_function/preferred_function.json rename to lms/lms/doctype/preferred_function/preferred_function.json diff --git a/school/lms/doctype/preferred_function/preferred_function.py b/lms/lms/doctype/preferred_function/preferred_function.py similarity index 100% rename from school/lms/doctype/preferred_function/preferred_function.py rename to lms/lms/doctype/preferred_function/preferred_function.py diff --git a/school/hackathon/web_form/join_request/__init__.py b/lms/lms/doctype/preferred_industry/__init__.py similarity index 100% rename from school/hackathon/web_form/join_request/__init__.py rename to lms/lms/doctype/preferred_industry/__init__.py diff --git a/school/lms/doctype/preferred_industry/preferred_industry.js b/lms/lms/doctype/preferred_industry/preferred_industry.js similarity index 100% rename from school/lms/doctype/preferred_industry/preferred_industry.js rename to lms/lms/doctype/preferred_industry/preferred_industry.js diff --git a/school/lms/doctype/preferred_industry/preferred_industry.json b/lms/lms/doctype/preferred_industry/preferred_industry.json similarity index 100% rename from school/lms/doctype/preferred_industry/preferred_industry.json rename to lms/lms/doctype/preferred_industry/preferred_industry.json diff --git a/school/lms/doctype/preferred_industry/preferred_industry.py b/lms/lms/doctype/preferred_industry/preferred_industry.py similarity index 100% rename from school/lms/doctype/preferred_industry/preferred_industry.py rename to lms/lms/doctype/preferred_industry/preferred_industry.py diff --git a/school/lms/doctype/preferred_industry/test_preferred_industry.py b/lms/lms/doctype/preferred_industry/test_preferred_industry.py similarity index 100% rename from school/lms/doctype/preferred_industry/test_preferred_industry.py rename to lms/lms/doctype/preferred_industry/test_preferred_industry.py diff --git a/school/hackathon/web_form/project/__init__.py b/lms/lms/doctype/related_courses/__init__.py similarity index 100% rename from school/hackathon/web_form/project/__init__.py rename to lms/lms/doctype/related_courses/__init__.py diff --git a/school/lms/doctype/related_courses/related_courses.js b/lms/lms/doctype/related_courses/related_courses.js similarity index 100% rename from school/lms/doctype/related_courses/related_courses.js rename to lms/lms/doctype/related_courses/related_courses.js diff --git a/school/lms/doctype/related_courses/related_courses.json b/lms/lms/doctype/related_courses/related_courses.json similarity index 100% rename from school/lms/doctype/related_courses/related_courses.json rename to lms/lms/doctype/related_courses/related_courses.json diff --git a/school/lms/doctype/related_courses/related_courses.py b/lms/lms/doctype/related_courses/related_courses.py similarity index 100% rename from school/lms/doctype/related_courses/related_courses.py rename to lms/lms/doctype/related_courses/related_courses.py diff --git a/school/lms/doctype/related_courses/test_related_courses.py b/lms/lms/doctype/related_courses/test_related_courses.py similarity index 100% rename from school/lms/doctype/related_courses/test_related_courses.py rename to lms/lms/doctype/related_courses/test_related_courses.py diff --git a/school/hackathon/web_form/project_update/__init__.py b/lms/lms/doctype/skill/__init__.py similarity index 100% rename from school/hackathon/web_form/project_update/__init__.py rename to lms/lms/doctype/skill/__init__.py diff --git a/school/lms/doctype/skill/skill.js b/lms/lms/doctype/skill/skill.js similarity index 100% rename from school/lms/doctype/skill/skill.js rename to lms/lms/doctype/skill/skill.js diff --git a/school/lms/doctype/skill/skill.json b/lms/lms/doctype/skill/skill.json similarity index 100% rename from school/lms/doctype/skill/skill.json rename to lms/lms/doctype/skill/skill.json diff --git a/school/lms/doctype/skill/skill.py b/lms/lms/doctype/skill/skill.py similarity index 100% rename from school/lms/doctype/skill/skill.py rename to lms/lms/doctype/skill/skill.py diff --git a/school/lms/doctype/skill/test_skill.py b/lms/lms/doctype/skill/test_skill.py similarity index 100% rename from school/lms/doctype/skill/test_skill.py rename to lms/lms/doctype/skill/test_skill.py diff --git a/school/job/__init__.py b/lms/lms/doctype/skills/__init__.py similarity index 100% rename from school/job/__init__.py rename to lms/lms/doctype/skills/__init__.py diff --git a/school/lms/doctype/skills/skills.js b/lms/lms/doctype/skills/skills.js similarity index 100% rename from school/lms/doctype/skills/skills.js rename to lms/lms/doctype/skills/skills.js diff --git a/school/lms/doctype/skills/skills.json b/lms/lms/doctype/skills/skills.json similarity index 100% rename from school/lms/doctype/skills/skills.json rename to lms/lms/doctype/skills/skills.json diff --git a/school/lms/doctype/skills/skills.py b/lms/lms/doctype/skills/skills.py similarity index 100% rename from school/lms/doctype/skills/skills.py rename to lms/lms/doctype/skills/skills.py diff --git a/school/lms/doctype/skills/test_skills.py b/lms/lms/doctype/skills/test_skills.py similarity index 100% rename from school/lms/doctype/skills/test_skills.py rename to lms/lms/doctype/skills/test_skills.py diff --git a/school/job/doctype/__init__.py b/lms/lms/doctype/work_experience/__init__.py similarity index 100% rename from school/job/doctype/__init__.py rename to lms/lms/doctype/work_experience/__init__.py diff --git a/school/lms/doctype/work_experience/work_experience.json b/lms/lms/doctype/work_experience/work_experience.json similarity index 100% rename from school/lms/doctype/work_experience/work_experience.json rename to lms/lms/doctype/work_experience/work_experience.json diff --git a/school/lms/doctype/work_experience/work_experience.py b/lms/lms/doctype/work_experience/work_experience.py similarity index 100% rename from school/lms/doctype/work_experience/work_experience.py rename to lms/lms/doctype/work_experience/work_experience.py diff --git a/school/lms/md.py b/lms/lms/md.py similarity index 94% rename from school/lms/md.py rename to lms/lms/md.py index ce410d81..8105c72f 100644 --- a/school/lms/md.py +++ b/lms/lms/md.py @@ -7,7 +7,7 @@ Macros can be added to the markdown text in the following format. These macros will be rendered using a pluggable mechanism. -Apps can provide a hook school_markdown_macro_renderers, a +Apps can provide a hook lms_markdown_macro_renderers, a dictionary mapping the macro name to the function that to render that macro. The function will get the argument passed to the macro as argument. @@ -59,7 +59,7 @@ def _remove_quotes(value): def get_macro_registry(): - d = frappe.get_hooks("school_markdown_macro_renderers") or {} + d = frappe.get_hooks("lms_markdown_macro_renderers") or {} return {name: frappe.get_attr(klass[0]) for name, klass in d.items()} def render_macro(macro_name, macro_argument): @@ -105,7 +105,7 @@ def sanitize_html(html, macro): any broken tags. This makes sures that all those things are fixed before passing to the etree parser. """ - soup = BeautifulSoup(html, features="lxml") + soup = BeautifulSoup(html, features="html5lib") nodes = soup.body.children classname = "" if macro == "YouTubeVideo": diff --git a/school/lms/models.py b/lms/lms/models.py similarity index 100% rename from school/lms/models.py rename to lms/lms/models.py diff --git a/school/job/doctype/job_opportunity/__init__.py b/lms/lms/report/__init__.py similarity index 100% rename from school/job/doctype/job_opportunity/__init__.py rename to lms/lms/report/__init__.py diff --git a/school/job/doctype/job_settings/__init__.py b/lms/lms/report/course_progress_summary/__init__.py similarity index 100% rename from school/job/doctype/job_settings/__init__.py rename to lms/lms/report/course_progress_summary/__init__.py diff --git a/school/lms/report/course_progress_summary/course_progress_summary.js b/lms/lms/report/course_progress_summary/course_progress_summary.js similarity index 100% rename from school/lms/report/course_progress_summary/course_progress_summary.js rename to lms/lms/report/course_progress_summary/course_progress_summary.js diff --git a/school/lms/report/course_progress_summary/course_progress_summary.json b/lms/lms/report/course_progress_summary/course_progress_summary.json similarity index 100% rename from school/lms/report/course_progress_summary/course_progress_summary.json rename to lms/lms/report/course_progress_summary/course_progress_summary.json diff --git a/school/lms/report/course_progress_summary/course_progress_summary.py b/lms/lms/report/course_progress_summary/course_progress_summary.py similarity index 100% rename from school/lms/report/course_progress_summary/course_progress_summary.py rename to lms/lms/report/course_progress_summary/course_progress_summary.py diff --git a/school/lms/test_utils.py b/lms/lms/test_utils.py similarity index 100% rename from school/lms/test_utils.py rename to lms/lms/test_utils.py diff --git a/school/lms/utils.py b/lms/lms/utils.py similarity index 84% rename from school/lms/utils.py rename to lms/lms/utils.py index 1eae98e7..af175462 100644 --- a/school/lms/utils.py +++ b/lms/lms/utils.py @@ -1,8 +1,9 @@ import re import frappe from frappe.utils import flt, cint, cstr -from school.lms.md import markdown_to_html +from lms.lms.md import markdown_to_html, find_macros import string +from frappe import _ RE_SLUG_NOTALLOWED = re.compile("[^a-z0-9]+") @@ -84,6 +85,13 @@ def get_lesson_details(chapter): lesson_details = frappe.db.get_value("Course Lesson", row.lesson, ["name", "title", "include_in_preview", "body", "creation"], as_dict=True) lesson_details.number = flt("{}.{}".format(chapter.idx, row.idx)) + lesson_details.icon = "icon-list" + macros = find_macros(lesson_details.body) + for macro in macros: + if macro[0] == "YouTubeVideo": + lesson_details.icon = "icon-video" + elif macro[0] == "Quiz": + lesson_details.icon = "icon-quiz" lessons.append(lesson_details) return lessons @@ -296,3 +304,43 @@ def is_instructor(course): def convert_number_to_character(number): return string.ascii_uppercase[number] + +def get_signup_optin_checks(): + + mapper = frappe._dict({ + "terms_of_use": { + "page_name": "terms_page", + "title": _("Terms of Use") + }, + "privacy_policy": { + "page_name": "privacy_policy_page", + "title": _("Privacy Policy") + }, + "cookie_policy": { + "page_name": "cookie_policy_page", + "title": _("Cookie Policy") + } + }) + checks = ["terms_of_use", "privacy_policy", "cookie_policy"] + links = [] + + for check in checks: + if frappe.db.get_single_value("LMS Settings", check): + page = frappe.db.get_single_value("LMS Settings", mapper[check].get("page_name")) + route = frappe.db.get_value("Web Page", page, "route") + links.append("" + mapper[check].get("title") + "") + + return (", ").join(links) + +def get_popular_courses(): + courses = frappe.get_all("LMS Course", {"is_published": 1, "upcoming": 0}) + course_membership = [] + + for course in courses: + course_membership.append({ + "course": course.name, + "members": cint(frappe.db.count("LMS Batch Membership", {"course": course.name})) + }) + + course_membership = sorted(course_membership, key = lambda x: x.get("members"), reverse=True) + return course_membership[:3] diff --git a/school/job/notification/__init__.py b/lms/lms/web_form/__init__.py similarity index 100% rename from school/job/notification/__init__.py rename to lms/lms/web_form/__init__.py diff --git a/school/job/notification/new_job_alert/__init__.py b/lms/lms/web_form/add_a_new_batch/__init__.py similarity index 100% rename from school/job/notification/new_job_alert/__init__.py rename to lms/lms/web_form/add_a_new_batch/__init__.py diff --git a/school/lms/web_form/add_a_new_batch/add_a_new_batch.js b/lms/lms/web_form/add_a_new_batch/add_a_new_batch.js similarity index 100% rename from school/lms/web_form/add_a_new_batch/add_a_new_batch.js rename to lms/lms/web_form/add_a_new_batch/add_a_new_batch.js diff --git a/school/lms/web_form/add_a_new_batch/add_a_new_batch.json b/lms/lms/web_form/add_a_new_batch/add_a_new_batch.json similarity index 100% rename from school/lms/web_form/add_a_new_batch/add_a_new_batch.json rename to lms/lms/web_form/add_a_new_batch/add_a_new_batch.json diff --git a/school/lms/web_form/add_a_new_batch/add_a_new_batch.py b/lms/lms/web_form/add_a_new_batch/add_a_new_batch.py similarity index 100% rename from school/lms/web_form/add_a_new_batch/add_a_new_batch.py rename to lms/lms/web_form/add_a_new_batch/add_a_new_batch.py diff --git a/school/job/web_form/__init__.py b/lms/lms/web_form/chapter/__init__.py similarity index 100% rename from school/job/web_form/__init__.py rename to lms/lms/web_form/chapter/__init__.py diff --git a/lms/lms/web_form/chapter/chapter.js b/lms/lms/web_form/chapter/chapter.js new file mode 100644 index 00000000..6d710013 --- /dev/null +++ b/lms/lms/web_form/chapter/chapter.js @@ -0,0 +1,8 @@ +frappe.ready(function() { + frappe.web_form.after_save = () => { + frappe.msgprint(__("Chapter has been saved successfully. Go back to the course and add this chapter to the chapters table.")) + setTimeout(() => { + window.location.href = `/courses/${frappe.web_form.doc.course}`; + }, 3000); + } +}); diff --git a/school/event_management/web_form/exhibitor_registration/exhibitor_registration.json b/lms/lms/web_form/chapter/chapter.json similarity index 57% rename from school/event_management/web_form/exhibitor_registration/exhibitor_registration.json rename to lms/lms/web_form/chapter/chapter.json index cba14dfe..fc2b8afc 100644 --- a/school/event_management/web_form/exhibitor_registration/exhibitor_registration.json +++ b/lms/lms/web_form/chapter/chapter.json @@ -2,68 +2,68 @@ "accept_payment": 0, "allow_comments": 0, "allow_delete": 0, - "allow_edit": 0, + "allow_edit": 1, "allow_incomplete": 0, - "allow_multiple": 0, + "allow_multiple": 1, "allow_print": 0, "amount": 0.0, "amount_based_on_field": 0, - "apply_document_permissions": 0, + "apply_document_permissions": 1, "button_label": "Save", - "creation": "2021-08-16 16:27:06.566564", - "custom_css": "[data-doctype=\"Web Form\"] {\n max-width: 720px;\n margin: 6rem auto;\n}", - "doc_type": "Exhibitor", + "creation": "2022-03-07 18:41:07.058806", + "doc_type": "Course Chapter", "docstatus": 0, "doctype": "Web Form", "idx": 0, + "is_multi_step_form": 0, "is_standard": 1, "login_required": 1, "max_attachment_size": 0, - "modified": "2021-08-23 10:12:24.038572", + "modified": "2022-03-14 18:48:01.704325", "modified_by": "Administrator", - "module": "Event Management", - "name": "exhibitor-registration", + "module": "LMS", + "name": "chapter", "owner": "Administrator", "payment_button_label": "Buy Now", "published": 1, - "route": "exhibitor-registration", + "route": "chapter", "route_to_success_link": 0, "show_attachments": 0, "show_in_grid": 0, "show_sidebar": 0, "sidebar_items": [], - "success_url": "", - "title": "Exhibitor Registration", + "success_url": "/chapter", + "title": "Chapter", "web_form_fields": [ { "allow_read_on_all_link_options": 0, - "fieldname": "user", - "fieldtype": "Data", + "fieldname": "course", + "fieldtype": "Link", "hidden": 0, - "label": "User", + "label": "Course", "max_length": 0, "max_value": 0, - "options": "User", - "read_only": 1, - "reqd": 0, + "options": "LMS Course", + "read_only": 0, + "reqd": 1, "show_in_filter": 0 }, { "allow_read_on_all_link_options": 0, - "fieldname": "company", + "fieldname": "title", "fieldtype": "Data", "hidden": 0, - "label": "Company ", + "label": "Title", "max_length": 0, "max_value": 0, "read_only": 0, - "reqd": 0, + "reqd": 1, "show_in_filter": 0 }, { "allow_read_on_all_link_options": 0, "fieldname": "description", - "fieldtype": "Text Editor", + "fieldtype": "Small Text", "hidden": 0, "label": "Description", "max_length": 0, @@ -71,6 +71,19 @@ "read_only": 0, "reqd": 0, "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "lessons", + "fieldtype": "Table", + "hidden": 0, + "label": "Lessons", + "max_length": 0, + "max_value": 0, + "options": "Lesson Reference", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 } ] } \ No newline at end of file diff --git a/school/event_management/web_form/attendee_registration/attendee_registration.py b/lms/lms/web_form/chapter/chapter.py similarity index 100% rename from school/event_management/web_form/attendee_registration/attendee_registration.py rename to lms/lms/web_form/chapter/chapter.py diff --git a/school/job/web_form/job_opportunity/__init__.py b/lms/lms/web_form/course/__init__.py similarity index 100% rename from school/job/web_form/job_opportunity/__init__.py rename to lms/lms/web_form/course/__init__.py diff --git a/lms/lms/web_form/course/course.js b/lms/lms/web_form/course/course.js new file mode 100644 index 00000000..ff539e0a --- /dev/null +++ b/lms/lms/web_form/course/course.js @@ -0,0 +1,6 @@ +frappe.ready(function() { + frappe.web_form.after_save = () => { + let route = frappe.web_form.doc.name ? `/courses/${frappe.web_form.doc.name}` : `/course`; + window.location.href = route; + } +}); diff --git a/lms/lms/web_form/course/course.json b/lms/lms/web_form/course/course.json new file mode 100644 index 00000000..f12d692e --- /dev/null +++ b/lms/lms/web_form/course/course.json @@ -0,0 +1,147 @@ +{ + "accept_payment": 0, + "allow_comments": 0, + "allow_delete": 0, + "allow_edit": 1, + "allow_incomplete": 0, + "allow_multiple": 1, + "allow_print": 0, + "amount": 0.0, + "amount_based_on_field": 0, + "apply_document_permissions": 1, + "button_label": "Save", + "creation": "2022-03-07 14:40:41.262163", + "custom_css": "", + "doc_type": "LMS Course", + "docstatus": 0, + "doctype": "Web Form", + "idx": 0, + "is_multi_step_form": 0, + "is_standard": 1, + "login_required": 1, + "max_attachment_size": 0, + "modified": "2022-03-11 12:32:22.512115", + "modified_by": "Administrator", + "module": "LMS", + "name": "course", + "owner": "Administrator", + "payment_button_label": "Buy Now", + "published": 1, + "route": "course", + "route_to_success_link": 0, + "show_attachments": 0, + "show_in_grid": 0, + "show_sidebar": 0, + "sidebar_items": [], + "success_url": "/course", + "title": "Course", + "web_form_fields": [ + { + "allow_read_on_all_link_options": 0, + "fieldname": "title", + "fieldtype": "Data", + "hidden": 0, + "label": "Title", + "max_length": 0, + "max_value": 0, + "read_only": 0, + "reqd": 1, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "tags", + "fieldtype": "Data", + "hidden": 0, + "label": "Tags", + "max_length": 0, + "max_value": 0, + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "", + "fieldtype": "Column Break", + "hidden": 0, + "max_length": 0, + "max_value": 0, + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "video_link", + "fieldtype": "Data", + "hidden": 0, + "label": "Video Embed Link", + "max_length": 0, + "max_value": 0, + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "image", + "fieldtype": "Attach Image", + "hidden": 0, + "label": "Preview Image", + "max_length": 0, + "max_value": 0, + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "", + "fieldtype": "Section Break", + "hidden": 0, + "max_length": 0, + "max_value": 0, + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "short_introduction", + "fieldtype": "Small Text", + "hidden": 0, + "label": "Short Introduction", + "max_length": 0, + "max_value": 0, + "read_only": 0, + "reqd": 1, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "description", + "fieldtype": "Text", + "hidden": 0, + "label": "Description", + "max_length": 0, + "max_value": 0, + "read_only": 0, + "reqd": 1, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "chapters", + "fieldtype": "Table", + "hidden": 0, + "label": "Chapters", + "max_length": 0, + "max_value": 0, + "options": "Chapter Reference", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + } + ] +} \ No newline at end of file diff --git a/school/event_management/web_form/exhibitor_registration/exhibitor_registration.py b/lms/lms/web_form/course/course.py similarity index 100% rename from school/event_management/web_form/exhibitor_registration/exhibitor_registration.py rename to lms/lms/web_form/course/course.py diff --git a/school/lms/__init__.py b/lms/lms/web_form/lesson/__init__.py similarity index 100% rename from school/lms/__init__.py rename to lms/lms/web_form/lesson/__init__.py diff --git a/lms/lms/web_form/lesson/lesson.js b/lms/lms/web_form/lesson/lesson.js new file mode 100644 index 00000000..4347f730 --- /dev/null +++ b/lms/lms/web_form/lesson/lesson.js @@ -0,0 +1,16 @@ +frappe.ready(function() { + frappe.web_form.after_save = () => { + frappe.call({ + method: "lms.lms.doctype.course_lesson.course_lesson.get_lesson_info", + args: { + "chapter": frappe.web_form.doc.chapter + }, + callback: (data) => { + frappe.msgprint(__(`Lesson has been saved successfully. Go back to the chapter and add this lesson to the lessons table.`)); + setTimeout(() => { + window.location.href = `/courses/${data.message}`; + }, 3000); + } + }); + }; +}); diff --git a/lms/lms/web_form/lesson/lesson.json b/lms/lms/web_form/lesson/lesson.json new file mode 100644 index 00000000..2c519587 --- /dev/null +++ b/lms/lms/web_form/lesson/lesson.json @@ -0,0 +1,91 @@ +{ + "accept_payment": 0, + "allow_comments": 0, + "allow_delete": 0, + "allow_edit": 1, + "allow_incomplete": 0, + "allow_multiple": 1, + "allow_print": 0, + "amount": 0.0, + "amount_based_on_field": 0, + "apply_document_permissions": 1, + "button_label": "Save", + "creation": "2022-03-07 18:41:42.549831", + "custom_css": "", + "doc_type": "Course Lesson", + "docstatus": 0, + "doctype": "Web Form", + "idx": 0, + "introduction_text": "



Create lessons for your course. You can add some additional content to the lesson using a special syntax. The table below mentions all types of dynamic content that you can add to the lessons and the syntax for the same.


Content TypeSyntax
Video{{ Video(\"url_of_source\") }}
YouTube Video{{ YouTubeVideo(\"unique_embed_id\") }}
Exercise{{ Exercise(\"exercise_name\") }}
Quiz{{ Quiz(\"lms_quiz_name\") }}
Assignment{{ Assignment(\"id-filetype\") }}
", + "is_multi_step_form": 0, + "is_standard": 1, + "login_required": 1, + "max_attachment_size": 0, + "modified": "2022-03-14 18:49:33.526455", + "modified_by": "Administrator", + "module": "LMS", + "name": "lesson", + "owner": "Administrator", + "payment_button_label": "Buy Now", + "published": 1, + "route": "lesson", + "route_to_success_link": 0, + "show_attachments": 0, + "show_in_grid": 0, + "show_sidebar": 0, + "sidebar_items": [], + "success_url": "/lesson", + "title": "Lesson", + "web_form_fields": [ + { + "allow_read_on_all_link_options": 0, + "fieldname": "chapter", + "fieldtype": "Link", + "hidden": 0, + "label": "Course Chapter", + "max_length": 0, + "max_value": 0, + "options": "Course Chapter", + "read_only": 0, + "reqd": 1, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "title", + "fieldtype": "Data", + "hidden": 0, + "label": "Title", + "max_length": 0, + "max_value": 0, + "read_only": 0, + "reqd": 1, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "include_in_preview", + "fieldtype": "Check", + "hidden": 0, + "label": "Include In Preview", + "max_length": 0, + "max_value": 0, + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "body", + "fieldtype": "Text", + "hidden": 0, + "label": "Body", + "max_length": 0, + "max_value": 0, + "read_only": 0, + "reqd": 1, + "show_in_filter": 0 + } + ] +} \ No newline at end of file diff --git a/school/event_management/web_form/purpose_a_talk/purpose_a_talk.py b/lms/lms/web_form/lesson/lesson.py similarity index 100% rename from school/event_management/web_form/purpose_a_talk/purpose_a_talk.py rename to lms/lms/web_form/lesson/lesson.py diff --git a/school/lms/doctype/__init__.py b/lms/lms/web_form/profile/__init__.py similarity index 100% rename from school/lms/doctype/__init__.py rename to lms/lms/web_form/profile/__init__.py diff --git a/school/lms/web_form/profile/profile.js b/lms/lms/web_form/profile/profile.js similarity index 100% rename from school/lms/web_form/profile/profile.js rename to lms/lms/web_form/profile/profile.js diff --git a/school/lms/web_form/profile/profile.json b/lms/lms/web_form/profile/profile.json similarity index 100% rename from school/lms/web_form/profile/profile.json rename to lms/lms/web_form/profile/profile.json diff --git a/school/lms/web_form/profile/profile.py b/lms/lms/web_form/profile/profile.py similarity index 100% rename from school/lms/web_form/profile/profile.py rename to lms/lms/web_form/profile/profile.py diff --git a/school/lms/doctype/certification/__init__.py b/lms/lms/web_template/__init__.py similarity index 100% rename from school/lms/doctype/certification/__init__.py rename to lms/lms/web_template/__init__.py diff --git a/school/lms/doctype/chapter_reference/__init__.py b/lms/lms/web_template/course_cards/__init__.py similarity index 100% rename from school/lms/doctype/chapter_reference/__init__.py rename to lms/lms/web_template/course_cards/__init__.py diff --git a/school/lms/web_template/course_cards/course_cards.html b/lms/lms/web_template/course_cards/course_cards.html similarity index 88% rename from school/lms/web_template/course_cards/course_cards.html rename to lms/lms/web_template/course_cards/course_cards.html index 405697e7..4c5b8a36 100644 --- a/school/lms/web_template/course_cards/course_cards.html +++ b/lms/lms/web_template/course_cards/course_cards.html @@ -9,6 +9,6 @@ {{ _("Explore More") }} - + diff --git a/school/lms/web_template/course_cards/course_cards.json b/lms/lms/web_template/course_cards/course_cards.json similarity index 100% rename from school/lms/web_template/course_cards/course_cards.json rename to lms/lms/web_template/course_cards/course_cards.json diff --git a/school/lms/doctype/cohort/__init__.py b/lms/lms/web_template/courses_enrolled/__init__.py similarity index 100% rename from school/lms/doctype/cohort/__init__.py rename to lms/lms/web_template/courses_enrolled/__init__.py diff --git a/lms/lms/web_template/courses_enrolled/courses_enrolled.html b/lms/lms/web_template/courses_enrolled/courses_enrolled.html new file mode 100644 index 00000000..f254a3ef --- /dev/null +++ b/lms/lms/web_template/courses_enrolled/courses_enrolled.html @@ -0,0 +1,27 @@ +{% set enrolled = get_enrolled_courses().in_progress + get_enrolled_courses().completed %} +{% if enrolled | length %} +
+ {% for course in enrolled %} + {{ widgets.CourseCard(course=course) }} + {% endfor %} +
+{% else %} +{% set site_name = frappe.db.get_single_value("System Settings", "app_name") %} +
+
+
+
{{ _("You haven't enrolled for any courses") }}
+
{{ _("Here are a few courses we recommend for you to get started with {0}").format(site_name) }}
+
+ {% set recommended_courses = get_popular_courses() %} +
+ {% for course in recommended_courses %} + {% if course %} + {% set course_details = frappe.get_doc("LMS Course", course.course) %} + {{ widgets.CourseCard(course=course_details) }} + {% endif %} + {% endfor %} +
+
+
+{% endif %} diff --git a/lms/lms/web_template/courses_enrolled/courses_enrolled.json b/lms/lms/web_template/courses_enrolled/courses_enrolled.json new file mode 100644 index 00000000..cf482cac --- /dev/null +++ b/lms/lms/web_template/courses_enrolled/courses_enrolled.json @@ -0,0 +1,16 @@ +{ + "__unsaved": 1, + "creation": "2021-10-21 11:29:50.424865", + "docstatus": 0, + "doctype": "Web Template", + "fields": [], + "idx": 0, + "modified": "2022-03-14 09:44:28.266320", + "modified_by": "Administrator", + "module": "LMS", + "name": "Courses Enrolled", + "owner": "Administrator", + "standard": 1, + "template": "", + "type": "Section" +} \ No newline at end of file diff --git a/school/lms/doctype/cohort_join_request/__init__.py b/lms/lms/web_template/courses_mentored/__init__.py similarity index 100% rename from school/lms/doctype/cohort_join_request/__init__.py rename to lms/lms/web_template/courses_mentored/__init__.py diff --git a/school/lms/web_template/courses_mentored/courses_mentored.html b/lms/lms/web_template/courses_mentored/courses_mentored.html similarity index 100% rename from school/lms/web_template/courses_mentored/courses_mentored.html rename to lms/lms/web_template/courses_mentored/courses_mentored.html diff --git a/school/lms/web_template/courses_mentored/courses_mentored.json b/lms/lms/web_template/courses_mentored/courses_mentored.json similarity index 100% rename from school/lms/web_template/courses_mentored/courses_mentored.json rename to lms/lms/web_template/courses_mentored/courses_mentored.json diff --git a/school/lms/doctype/cohort_mentor/__init__.py b/lms/lms/web_template/multiple_testimonials/__init__.py similarity index 100% rename from school/lms/doctype/cohort_mentor/__init__.py rename to lms/lms/web_template/multiple_testimonials/__init__.py diff --git a/school/community/web_template/multiple_testimonials/multiple_testimonials.html b/lms/lms/web_template/multiple_testimonials/multiple_testimonials.html similarity index 100% rename from school/community/web_template/multiple_testimonials/multiple_testimonials.html rename to lms/lms/web_template/multiple_testimonials/multiple_testimonials.html diff --git a/school/community/web_template/multiple_testimonials/multiple_testimonials.json b/lms/lms/web_template/multiple_testimonials/multiple_testimonials.json similarity index 76% rename from school/community/web_template/multiple_testimonials/multiple_testimonials.json rename to lms/lms/web_template/multiple_testimonials/multiple_testimonials.json index 5d4db8f0..a0ef204b 100644 --- a/school/community/web_template/multiple_testimonials/multiple_testimonials.json +++ b/lms/lms/web_template/multiple_testimonials/multiple_testimonials.json @@ -5,24 +5,18 @@ "doctype": "Web Template", "fields": [ { - "__islocal": 1, - "__unsaved": 1, "fieldname": "title", "fieldtype": "Data", "label": "Title", "reqd": 0 }, { - "__islocal": 1, - "__unsaved": 1, "fieldname": "testimonials_table", "fieldtype": "Table Break", "label": "Testimonials", "reqd": 0 }, { - "__islocal": 1, - "__unsaved": 1, "fieldname": "testimonials", "fieldtype": "Link", "label": "Testimonials", @@ -30,10 +24,10 @@ "reqd": 0 } ], - "idx": 0, - "modified": "2021-11-16 17:17:49.089989", + "idx": 1, + "modified": "2022-03-21 11:52:27.728610", "modified_by": "Administrator", - "module": "Community", + "module": "LMS", "name": "Multiple Testimonials", "owner": "Administrator", "standard": 1, diff --git a/school/community/widgets/Avatar.html b/lms/lms/widgets/Avatar.html similarity index 100% rename from school/community/widgets/Avatar.html rename to lms/lms/widgets/Avatar.html diff --git a/school/lms/widgets/BreadCrumb.html b/lms/lms/widgets/BreadCrumb.html similarity index 71% rename from school/lms/widgets/BreadCrumb.html rename to lms/lms/widgets/BreadCrumb.html index e9b849b6..ca7a4747 100644 --- a/school/lms/widgets/BreadCrumb.html +++ b/lms/lms/widgets/BreadCrumb.html @@ -1,10 +1,10 @@