Merge branch 'develop' of https://github.com/frappe/lms into payments

This commit is contained in:
Jannat Patel
2024-09-24 14:14:49 +05:30
24 changed files with 5242 additions and 2197 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,51 @@
[
{
"category": "Web Development",
"docstatus": 0,
"doctype": "LMS Category",
"modified": "2024-09-20 12:58:16.841571",
"name": "Web Development"
},
{
"category": "Business",
"docstatus": 0,
"doctype": "LMS Category",
"modified": "2024-09-20 12:58:32.304850",
"name": "Business"
},
{
"category": "Design",
"docstatus": 0,
"doctype": "LMS Category",
"modified": "2024-09-20 12:59:12.621022",
"name": "Design"
},
{
"category": "Personal Development",
"docstatus": 0,
"doctype": "LMS Category",
"modified": "2024-09-20 12:59:19.287404",
"name": "Personal Development"
},
{
"category": "Finance",
"docstatus": 0,
"doctype": "LMS Category",
"modified": "2024-09-20 12:58:28.579714",
"name": "Finance"
},
{
"category": "Frontend",
"docstatus": 0,
"doctype": "LMS Category",
"modified": "2024-05-08 14:05:16.979275",
"name": "Frontend"
},
{
"category": "Framework",
"docstatus": 0,
"doctype": "LMS Category",
"modified": "2023-06-15 18:01:41.598282",
"name": "Framework"
}
]

View File

@@ -115,7 +115,7 @@ scheduler_events = {
"daily": ["lms.job.doctype.job_opportunity.job_opportunity.update_job_openings"],
}
fixtures = ["Custom Field", "Function", "Industry"]
fixtures = ["Custom Field", "Function", "Industry", "LMS Category"]
# Testing
# -------

View File

@@ -15,12 +15,13 @@
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Category",
"reqd": 1,
"unique": 1
}
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2023-06-15 15:14:11.341961",
"modified": "2024-09-23 19:33:49.593950",
"modified_by": "Administrator",
"module": "LMS",
"name": "LMS Category",
@@ -55,5 +56,6 @@
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"title_field": "category"
"title_field": "category",
"track_changes": 1
}

View File

@@ -13,6 +13,7 @@ from frappe.utils import (
get_datetime,
nowtime,
get_time,
get_fullname,
)
from lms.lms.utils import get_evaluator
import json
@@ -32,6 +33,7 @@ class LMSCertificateRequest(Document):
def set_evaluator(self):
if not self.evaluator:
self.evaluator = get_evaluator(self.course, self.batch_name)
self.evaluator_name = get_fullname(self.evaluator)
def validate_unavailability(self):
if self.evaluator:

View File

@@ -16,10 +16,12 @@
"field_order": [
"title",
"video_link",
"image",
"column_break_3",
"instructors",
"tags",
"column_break_htgn",
"image",
"category",
"status",
"section_break_7",
"published",
@@ -237,6 +239,16 @@
"fieldname": "certification_tab",
"fieldtype": "Tab Break",
"label": "Certification"
},
{
"fieldname": "column_break_htgn",
"fieldtype": "Column Break"
},
{
"fieldname": "category",
"fieldtype": "Link",
"label": "Category",
"options": "LMS Category"
}
],
"is_published_field": "published",
@@ -263,7 +275,7 @@
}
],
"make_attachments_public": 1,
"modified": "2024-07-12 13:54:40.474097",
"modified": "2024-09-21 10:23:58.633912",
"modified_by": "Administrator",
"module": "LMS",
"name": "LMS Course",

View File

@@ -23,15 +23,9 @@
"show_emails",
"signup_settings_tab",
"signup_settings_section",
"terms_of_use",
"terms_page",
"user_category",
"column_break_9",
"privacy_policy",
"privacy_policy_page",
"column_break_12",
"cookie_policy",
"cookie_policy_page",
"custom_signup_content",
"user_category",
"sidebar_tab",
"items_in_sidebar_section",
"courses",
@@ -92,60 +86,14 @@
"fieldtype": "Column Break",
"label": "Show Tab in Batch"
},
{
"default": "0",
"fieldname": "terms_of_use",
"fieldtype": "Check",
"label": "Show Terms of Use on Signup"
},
{
"depends_on": "terms_of_use",
"fieldname": "terms_page",
"fieldtype": "Link",
"label": "Terms of Use Page",
"mandatory_depends_on": "terms_of_use",
"options": "Web Page"
},
{
"fieldname": "signup_settings_section",
"fieldtype": "Section Break"
},
{
"default": "0",
"fieldname": "privacy_policy",
"fieldtype": "Check",
"label": "Show Privacy Policy on Signup"
},
{
"depends_on": "privacy_policy",
"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"
},
{
"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"
},
{
"default": "0",
"fieldname": "user_category",
@@ -378,12 +326,17 @@
"fieldtype": "Table",
"label": "Sidebar Items",
"options": "LMS Sidebar Item"
},
{
"fieldname": "custom_signup_content",
"fieldtype": "HTML Editor",
"label": "Custom Signup Content"
}
],
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
"modified": "2024-08-13 19:02:58.714080",
"modified": "2024-09-23 17:57:01.350020",
"modified_by": "Administrator",
"module": "LMS",
"name": "LMS Settings",

View File

@@ -722,17 +722,6 @@ def get_lesson_count(course):
return lesson_count
def get_restriction_details():
user = frappe.db.get_value(
"User", frappe.session.user, ["profile_complete", "username"], as_dict=True
)
return {
"restrict": not user.profile_complete,
"username": user.username,
"prefix": frappe.get_hooks("profile_url_prefix")[0] or "/users/",
}
def get_all_memberships(member):
return frappe.get_all(
"LMS Enrollment",
@@ -1220,6 +1209,7 @@ def get_course_details(course):
"featured",
"disable_self_learning",
"published_on",
"category",
"status",
"paid_course",
"course_price",

View File

@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Frappe LMS VERSION\n"
"Report-Msgid-Bugs-To: jannat@frappe.io\n"
"POT-Creation-Date: 2024-09-13 16:04+0000\n"
"PO-Revision-Date: 2024-09-13 16:04+0000\n"
"POT-Creation-Date: 2024-09-20 16:04+0000\n"
"PO-Revision-Date: 2024-09-20 16:04+0000\n"
"Last-Translator: jannat@frappe.io\n"
"Language-Team: jannat@frappe.io\n"
"MIME-Version: 1.0\n"
@@ -212,7 +212,7 @@ msgstr ""
msgid "Assessment Type"
msgstr ""
#: lms/doctype/lms_batch/lms_batch.py:71
#: lms/doctype/lms_batch/lms_batch.py:66
msgid "Assessment {0} has already been added to this batch."
msgstr ""
@@ -387,7 +387,7 @@ msgstr ""
msgid "Batch Updated"
msgstr ""
#: lms/doctype/lms_batch/lms_batch.py:42
#: lms/doctype/lms_batch/lms_batch.py:37
msgid "Batch end date cannot be before the batch start date"
msgstr ""
@@ -948,11 +948,11 @@ msgstr ""
msgid "Course Title"
msgstr ""
#: lms/doctype/lms_batch/lms_batch.py:327
#: lms/doctype/lms_batch/lms_batch.py:324
msgid "Course already added to the batch."
msgstr ""
#: lms/doctype/lms_batch/lms_batch.py:60
#: lms/doctype/lms_batch/lms_batch.py:55
msgid "Course {0} has already been added to this batch."
msgstr ""
@@ -1248,7 +1248,7 @@ msgstr ""
msgid "Enrolled successfully"
msgstr ""
#: lms/doctype/lms_batch/lms_batch.py:92
#: lms/doctype/lms_batch/lms_batch.py:89
msgid "Enrollment Confirmation for the Next Training Batch"
msgstr ""
@@ -1297,7 +1297,7 @@ msgstr ""
msgid "Evaluation Request"
msgstr ""
#: lms/doctype/lms_batch/lms_batch.py:89
#: lms/doctype/lms_batch/lms_batch.py:73
msgid "Evaluation end date cannot be less than the batch end date."
msgstr ""
@@ -2788,7 +2788,7 @@ msgstr ""
msgid "Please click on the following button to set your new password"
msgstr ""
#: lms/doctype/lms_batch/lms_batch.py:238
#: lms/doctype/lms_batch/lms_batch.py:235
msgid "Please enable Zoom Settings to use this feature."
msgstr ""
@@ -3165,19 +3165,19 @@ msgstr ""
msgid "Route"
msgstr ""
#: lms/doctype/lms_batch/lms_batch.py:167
#: lms/doctype/lms_batch/lms_batch.py:164
msgid "Row #{0} Date cannot be outside the batch duration."
msgstr ""
#: lms/doctype/lms_batch/lms_batch.py:162
#: lms/doctype/lms_batch/lms_batch.py:159
msgid "Row #{0} End time cannot be outside the batch duration."
msgstr ""
#: lms/doctype/lms_batch/lms_batch.py:144
#: lms/doctype/lms_batch/lms_batch.py:141
msgid "Row #{0} Start time cannot be greater than or equal to end time."
msgstr ""
#: lms/doctype/lms_batch/lms_batch.py:153
#: lms/doctype/lms_batch/lms_batch.py:150
msgid "Row #{0} Start time cannot be outside the batch duration."
msgstr ""
@@ -3524,7 +3524,7 @@ msgstr ""
msgid "Student Name"
msgstr ""
#: lms/doctype/lms_batch/lms_batch.py:49
#: lms/doctype/lms_batch/lms_batch.py:44
msgid "Student {0} has already been added to this batch."
msgstr ""
@@ -3697,7 +3697,7 @@ msgstr ""
msgid "The course {0} is now available on {1}."
msgstr ""
#: lms/doctype/lms_certificate_request/lms_certificate_request.py:51
#: lms/doctype/lms_certificate_request/lms_certificate_request.py:53
msgid "The evaluator of this course is unavailable from {0} to {1}. Please select a date after {1}"
msgstr ""
@@ -3705,7 +3705,7 @@ msgstr ""
msgid "The quiz has a time limit. For each question you will be given {0} seconds."
msgstr ""
#: lms/doctype/lms_certificate_request/lms_certificate_request.py:69
#: lms/doctype/lms_certificate_request/lms_certificate_request.py:71
msgid "The slot is already booked by another participant."
msgstr ""
@@ -3713,7 +3713,7 @@ msgstr ""
msgid "The status of your application has changed."
msgstr ""
#: lms/doctype/lms_batch/lms_batch.py:135
#: lms/doctype/lms_batch/lms_batch.py:132
msgid "There are no seats available in this batch."
msgstr ""
@@ -4106,7 +4106,7 @@ msgstr ""
msgid "Write a review"
msgstr ""
#: lms/doctype/lms_certificate_request/lms_certificate_request.py:93
#: lms/doctype/lms_certificate_request/lms_certificate_request.py:95
msgid "You already have an evaluation on {0} at {1} for the course {2}."
msgstr ""
@@ -4139,11 +4139,11 @@ msgstr ""
msgid "You can find their resume attached to this email."
msgstr ""
#: lms/doctype/lms_certificate_request/lms_certificate_request.py:113
#: lms/doctype/lms_certificate_request/lms_certificate_request.py:115
msgid "You cannot schedule evaluations after {0}."
msgstr ""
#: lms/doctype/lms_certificate_request/lms_certificate_request.py:102
#: lms/doctype/lms_certificate_request/lms_certificate_request.py:104
msgid "You cannot schedule evaluations for past slots."
msgstr ""
@@ -4208,7 +4208,7 @@ msgstr ""
msgid "Your evaluation for the course {0} has been scheduled on {1} at {2} {3}."
msgstr ""
#: lms/doctype/lms_certificate_request/lms_certificate_request.py:123
#: lms/doctype/lms_certificate_request/lms_certificate_request.py:125
msgid "Your evaluation slot has been booked"
msgstr ""

View File

@@ -90,4 +90,4 @@ lms.patches.v1_0.set_published_on
lms.patches.v2_0.fix_progress_percentage
lms.patches.v2_0.add_discussion_topic_titles
lms.patches.v2_0.sidebar_settings
lms.patches.v2_0.delete_certificate_request_notification
lms.patches.v2_0.delete_certificate_request_notification #18-09-2024

View File

@@ -2,4 +2,10 @@ import frappe
def execute():
frappe.db.delete("Notification", "Certificate Request Creation")
delete_notification("Certificate Request Creation")
delete_notification("Certificate Request Reminder")
def delete_notification(notification_name):
if frappe.db.exists("Notification", notification_name):
frappe.db.delete("Notification", notification_name)

View File

@@ -227,8 +227,7 @@ def assignment_renderer(detail):
def show_custom_signup():
if frappe.db.get_single_value(
"LMS Settings", "terms_of_use"
) or frappe.db.get_single_value("LMS Settings", "privacy_policy"):
settings = frappe.get_single("LMS Settings")
if settings.custom_signup_content or settings.user_category:
return "lms/templates/signup-form.html"
return "frappe/templates/signup.html"

View File

@@ -1,3 +1,4 @@
{% set custom_signup_content = frappe.db.get_single_value("LMS Settings", "custom_signup_content") %}
<form class="signup-form" role="form">
<div class="page-card-body">
<div class="form-group">
@@ -31,6 +32,7 @@
</div>
{% endif %}
{% if custom_signup_content %}
<div class="form-group">
<div class="checkbox">
<label>
@@ -39,11 +41,12 @@
data-fieldtype="Check" data-fieldname="terms" id="signup-terms" required>
</span>
<span class="label-area">
{{ _("I have read and agree to your {0}").format(get_signup_optin_checks()) }}
{{ custom_signup_content }}
</span>
</label>
</div>
</div>
{% endif %}
</div>
<div class="page-card-actions">
<button class="btn btn-sm btn-primary btn-block btn-signup"