diff --git a/lms/lms/doctype/lms_course/lms_course.js b/lms/lms/doctype/lms_course/lms_course.js
index 07bd2d30..71c6be3d 100644
--- a/lms/lms/doctype/lms_course/lms_course.js
+++ b/lms/lms/doctype/lms_course/lms_course.js
@@ -11,14 +11,6 @@ frappe.ui.form.on("LMS Course", {
};
});
- frm.set_query("instructor", "instructors", function () {
- return {
- filters: {
- ignore_user_type: 1,
- },
- };
- });
-
frm.set_query("course", "related_courses", function () {
return {
filters: {
@@ -29,5 +21,12 @@ frappe.ui.form.on("LMS Course", {
},
refresh: (frm) => {
frm.add_web_link(`/courses/${frm.doc.name}`, "See on Website");
+
+ if (!frm.doc.currency)
+ frappe.db
+ .get_single_value("LMS Settings", "default_currency")
+ .then((value) => {
+ frm.set_value("currency", value);
+ });
},
});
diff --git a/lms/lms/doctype/lms_course/lms_course.json b/lms/lms/doctype/lms_course/lms_course.json
index 11e45195..ba362ff7 100644
--- a/lms/lms/doctype/lms_course/lms_course.json
+++ b/lms/lms/doctype/lms_course/lms_course.json
@@ -32,19 +32,18 @@
"description",
"chapters",
"related_courses",
+ "pricing_section",
+ "paid_course",
+ "currency",
+ "course_price",
"certification_section",
"enable_certification",
"expiry",
- "section_break_23",
+ "max_attempts",
+ "column_break_rxww",
"grant_certificate_after",
"evaluator",
- "column_break_26",
- "max_attempts",
- "duration",
- "pricing_section",
- "paid_certificate",
- "currency",
- "price_certificate"
+ "duration"
],
"fields": [
{
@@ -170,13 +169,6 @@
"fieldname": "column_break_12",
"fieldtype": "Column Break"
},
- {
- "default": "0",
- "depends_on": "enable_certification",
- "fieldname": "paid_certificate",
- "fieldtype": "Check",
- "label": "Paid Certificate"
- },
{
"depends_on": "enable_certification",
"fieldname": "grant_certificate_after",
@@ -193,20 +185,12 @@
"options": "Course Evaluator"
},
{
- "depends_on": "eval: doc.grant_certificate_after == \"Evaluation\"",
"fieldname": "pricing_section",
"fieldtype": "Section Break",
"label": "Pricing"
},
{
- "depends_on": "paid_certificate",
- "fieldname": "price_certificate",
- "fieldtype": "Currency",
- "label": "Certificate Price",
- "mandatory_depends_on": "paid_certificate"
- },
- {
- "depends_on": "paid_certificate",
+ "depends_on": "paid_course",
"fieldname": "currency",
"fieldtype": "Link",
"label": "Currency",
@@ -228,11 +212,21 @@
"options": "1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12"
},
{
- "fieldname": "section_break_23",
- "fieldtype": "Section Break"
+ "default": "0",
+ "fieldname": "paid_course",
+ "fieldtype": "Check",
+ "label": "Paid Course"
},
{
- "fieldname": "column_break_26",
+ "depends_on": "paid_course",
+ "fieldname": "course_price",
+ "fieldtype": "Currency",
+ "label": "Course Price",
+ "option": "currency",
+ "mandatory_depends_on": "paid_certificate"
+ },
+ {
+ "fieldname": "column_break_rxww",
"fieldtype": "Column Break"
}
],
@@ -260,39 +254,12 @@
}
],
"make_attachments_public": 1,
- "modified": "2023-05-11 17:08:19.763405",
+ "modified": "2023-08-02 12:07:26.354119",
"modified_by": "Administrator",
"module": "LMS",
"name": "LMS Course",
"owner": "Administrator",
- "permissions": [
- {
- "create": 1,
- "delete": 1,
- "email": 1,
- "export": 1,
- "print": 1,
- "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
- }
- ],
+ "permissions": [],
"search_fields": "title",
"show_title_field_in_link": 1,
"sort_field": "creation",
diff --git a/lms/lms/doctype/lms_settings/lms_settings.json b/lms/lms/doctype/lms_settings/lms_settings.json
index f3ed9073..132cfb5d 100644
--- a/lms/lms/doctype/lms_settings/lms_settings.json
+++ b/lms/lms/doctype/lms_settings/lms_settings.json
@@ -6,16 +6,21 @@
"engine": "InnoDB",
"field_order": [
"default_home",
- "send_calendar_invite_for_evaluations",
- "allow_student_progress",
- "column_break_zdel",
- "is_onboarding_complete",
"force_profile_completion",
- "section_break_szgq",
- "search_placeholder",
- "portal_course_creation",
- "column_break_2",
+ "is_onboarding_complete",
+ "column_break_zdel",
"livecode_url",
+ "course_settings_section",
+ "search_placeholder",
+ "column_break_iqxy",
+ "portal_course_creation",
+ "section_break_szgq",
+ "send_calendar_invite_for_evaluations",
+ "column_break_2",
+ "allow_student_progress",
+ "payment_section",
+ "default_currency",
+ "column_break_cfcv",
"signup_settings_tab",
"signup_settings_section",
"terms_of_use",
@@ -37,6 +42,7 @@
"default": "https://livecode.dev.fossunited.org",
"fieldname": "livecode_url",
"fieldtype": "Data",
+ "hidden": 1,
"label": "LiveCode URL"
},
{
@@ -163,7 +169,8 @@
},
{
"fieldname": "section_break_szgq",
- "fieldtype": "Section Break"
+ "fieldtype": "Section Break",
+ "label": "Class Settings"
},
{
"fieldname": "signup_settings_tab",
@@ -180,12 +187,36 @@
"fieldname": "allow_student_progress",
"fieldtype": "Check",
"label": "Allow students to see each others progress in class"
+ },
+ {
+ "fieldname": "payment_section",
+ "fieldtype": "Section Break",
+ "label": "Payment"
+ },
+ {
+ "fieldname": "default_currency",
+ "fieldtype": "Link",
+ "label": "Default Currency",
+ "options": "Currency"
+ },
+ {
+ "fieldname": "column_break_cfcv",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "course_settings_section",
+ "fieldtype": "Section Break",
+ "label": "Course Settings"
+ },
+ {
+ "fieldname": "column_break_iqxy",
+ "fieldtype": "Column Break"
}
],
"index_web_pages_for_search": 1,
"issingle": 1,
"links": [],
- "modified": "2023-04-17 12:54:44.706101",
+ "modified": "2023-08-02 12:30:50.897156",
"modified_by": "Administrator",
"module": "LMS",
"name": "LMS Settings",
diff --git a/lms/lms/widgets/CourseCard.html b/lms/lms/widgets/CourseCard.html
index 486471c9..e050ec0e 100644
--- a/lms/lms/widgets/CourseCard.html
+++ b/lms/lms/widgets/CourseCard.html
@@ -59,19 +59,12 @@
{{ frappe.utils.flt(avg_rating, frappe.get_system_settings("float_precision") or 3) }}
{% endif %}
-
- {% if course.paid_certificate %}
-
-
-
- {{ format_amount(course.price_certificate, course.currency) }}
-
-
- {% endif %}
- {{ course.title }}
+
+
+ {{ course.title }}
+
+
{{ course.short_introduction }}
@@ -87,7 +80,8 @@
{% endif %}
{% if read_only %}
diff --git a/lms/lms/widgets/NoPreviewModal.html b/lms/lms/widgets/NoPreviewModal.html
index 0d9c5767..c6f06aa5 100644
--- a/lms/lms/widgets/NoPreviewModal.html
+++ b/lms/lms/widgets/NoPreviewModal.html
@@ -30,7 +30,7 @@
{{ _("Notify me when available") }}
{% elif show_start_learing_cta(course, membership) %}
-