diff --git a/community/fixtures/custom_field.json b/community/fixtures/custom_field.json
index d3bb2124..e450d748 100644
--- a/community/fixtures/custom_field.json
+++ b/community/fixtures/custom_field.json
@@ -104,5 +104,270 @@
"translatable": 1,
"unique": 0,
"width": null
+ },
+ {
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "collapsible_depends_on": null,
+ "columns": 0,
+ "default": null,
+ "depends_on": null,
+ "description": null,
+ "docstatus": 0,
+ "doctype": "Custom Field",
+ "dt": "User",
+ "fetch_from": null,
+ "fetch_if_empty": 0,
+ "fieldname": "medium",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "hide_border": 0,
+ "hide_days": 0,
+ "hide_seconds": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_preview": 0,
+ "in_standard_filter": 0,
+ "insert_after": "github",
+ "label": "Medium ID",
+ "length": 0,
+ "mandatory_depends_on": null,
+ "modified": "2021-06-30 14:46:55.834145",
+ "name": "User-medium",
+ "no_copy": 0,
+ "non_negative": 0,
+ "options": null,
+ "parent": null,
+ "parentfield": null,
+ "parenttype": null,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "print_width": null,
+ "read_only": 0,
+ "read_only_depends_on": null,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "translatable": 1,
+ "unique": 0,
+ "width": null
+ },
+ {
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "collapsible_depends_on": null,
+ "columns": 0,
+ "default": null,
+ "depends_on": null,
+ "description": null,
+ "docstatus": 0,
+ "doctype": "Custom Field",
+ "dt": "User",
+ "fetch_from": null,
+ "fetch_if_empty": 0,
+ "fieldname": "city",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "hide_border": 0,
+ "hide_days": 0,
+ "hide_seconds": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_preview": 0,
+ "in_standard_filter": 0,
+ "insert_after": "mute_sounds",
+ "label": "City",
+ "length": 0,
+ "mandatory_depends_on": null,
+ "modified": "2021-06-30 14:46:55.834145",
+ "name": "User-city",
+ "no_copy": 0,
+ "non_negative": 0,
+ "options": null,
+ "parent": null,
+ "parentfield": null,
+ "parenttype": null,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "print_width": null,
+ "read_only": 0,
+ "read_only_depends_on": null,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "translatable": 1,
+ "unique": 0,
+ "width": null
+ },
+ {
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "collapsible_depends_on": null,
+ "columns": 0,
+ "default": null,
+ "depends_on": null,
+ "description": null,
+ "docstatus": 0,
+ "doctype": "Custom Field",
+ "dt": "User",
+ "fetch_from": null,
+ "fetch_if_empty": 0,
+ "fieldname": "college",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "hide_border": 0,
+ "hide_days": 0,
+ "hide_seconds": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_preview": 0,
+ "in_standard_filter": 0,
+ "insert_after": "city",
+ "label": "College Name",
+ "length": 0,
+ "mandatory_depends_on": null,
+ "modified": "2021-06-30 14:46:55.834145",
+ "name": "User-college",
+ "no_copy": 0,
+ "non_negative": 0,
+ "options": null,
+ "parent": null,
+ "parentfield": null,
+ "parenttype": null,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "print_width": null,
+ "read_only": 0,
+ "read_only_depends_on": null,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "translatable": 1,
+ "unique": 0,
+ "width": null
+ },
+ {
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "collapsible_depends_on": null,
+ "columns": 0,
+ "default": null,
+ "depends_on": null,
+ "description": null,
+ "docstatus": 0,
+ "doctype": "Custom Field",
+ "dt": "User",
+ "fetch_from": null,
+ "fetch_if_empty": 0,
+ "fieldname": "branch",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "hide_border": 0,
+ "hide_days": 0,
+ "hide_seconds": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_preview": 0,
+ "in_standard_filter": 0,
+ "insert_after": "college",
+ "label": "Branch",
+ "length": 0,
+ "mandatory_depends_on": null,
+ "modified": "2021-06-30 14:46:55.834145",
+ "name": "User-branch",
+ "no_copy": 0,
+ "non_negative": 0,
+ "options": null,
+ "parent": null,
+ "parentfield": null,
+ "parenttype": null,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "print_width": null,
+ "read_only": 0,
+ "read_only_depends_on": null,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "translatable": 1,
+ "unique": 0,
+ "width": null
+ },
+ {
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "collapsible_depends_on": null,
+ "columns": 0,
+ "default": null,
+ "depends_on": null,
+ "description": null,
+ "docstatus": 0,
+ "doctype": "Custom Field",
+ "dt": "User",
+ "fetch_from": null,
+ "fetch_if_empty": 0,
+ "fieldname": "profession",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "hide_border": 0,
+ "hide_days": 0,
+ "hide_seconds": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_preview": 0,
+ "in_standard_filter": 0,
+ "insert_after": "medium",
+ "label": "Profession",
+ "length": 0,
+ "mandatory_depends_on": null,
+ "modified": "2021-06-30 14:46:55.834145",
+ "name": "User-profession",
+ "no_copy": 0,
+ "non_negative": 0,
+ "options": null,
+ "parent": null,
+ "parentfield": null,
+ "parenttype": null,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "print_width": null,
+ "read_only": 0,
+ "read_only_depends_on": null,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "translatable": 1,
+ "unique": 0,
+ "width": null
}
]
diff --git a/community/hooks.py b/community/hooks.py
index 61b681f5..691d75ee 100644
--- a/community/hooks.py
+++ b/community/hooks.py
@@ -167,7 +167,8 @@ whitelist = [
"/add-a-new-batch",
"/new-sign-up",
"/message",
- "/about"
+ "/about",
+ "/edit-profile"
]
whitelist_rules = [{"from_route": p, "to_route": p[1:]} for p in whitelist]
@@ -178,6 +179,10 @@ profile_rules = [
website_route_rules = primary_rules + whitelist_rules + profile_rules
+website_redirects = [
+ {"source": "/update-profile", "target": "/edit-profile"},
+]
+
update_website_context = 'community.widgets.update_website_context'
## Specify the additional tabs to be included in the user profile page.
diff --git a/community/lms/web_form/profile/profile.js b/community/lms/web_form/profile/profile.js
index 699703c5..027cef49 100644
--- a/community/lms/web_form/profile/profile.js
+++ b/community/lms/web_form/profile/profile.js
@@ -1,3 +1,7 @@
-frappe.ready(function() {
- // bind events here
-})
\ No newline at end of file
+frappe.ready(function () {
+ frappe.web_form.after_load = () => {
+ if (!frappe.utils.get_url_arg("name")) {
+ window.location.href = `/edit-profile?name=${frappe.session.user}`;
+ }
+ }
+})
diff --git a/community/lms/web_form/profile/profile.json b/community/lms/web_form/profile/profile.json
index c4962a94..4c3fcc7d 100644
--- a/community/lms/web_form/profile/profile.json
+++ b/community/lms/web_form/profile/profile.json
@@ -12,6 +12,7 @@
"breadcrumbs": "",
"button_label": "Save",
"creation": "2021-06-30 13:48:13.682851",
+ "custom_css": "[data-doctype=\"Web Form\"] {\n max-width: 720px;\n margin: 6rem auto;\n}",
"doc_type": "User",
"docstatus": 0,
"doctype": "Web Form",
@@ -19,14 +20,14 @@
"is_standard": 1,
"login_required": 1,
"max_attachment_size": 0,
- "modified": "2021-06-30 15:53:20.967466",
+ "modified": "2021-07-14 17:15:15.424855",
"modified_by": "Administrator",
"module": "LMS",
"name": "profile",
"owner": "Administrator",
"payment_button_label": "Buy Now",
"published": 1,
- "route": "profile",
+ "route": "edit-profile",
"route_to_success_link": 0,
"show_attachments": 0,
"show_in_grid": 0,
@@ -84,18 +85,6 @@
"reqd": 0,
"show_in_filter": 0
},
- {
- "allow_read_on_all_link_options": 0,
- "fieldname": "username",
- "fieldtype": "Data",
- "hidden": 0,
- "label": "Username",
- "max_length": 0,
- "max_value": 0,
- "read_only": 0,
- "reqd": 0,
- "show_in_filter": 0
- },
{
"allow_read_on_all_link_options": 0,
"fieldname": "mobile_no",
@@ -120,6 +109,91 @@
"read_only": 0,
"reqd": 0,
"show_in_filter": 0
+ },
+ {
+ "allow_read_on_all_link_options": 0,
+ "fieldname": "linkedin",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "label": "LinkedIn ID",
+ "max_length": 0,
+ "max_value": 0,
+ "read_only": 0,
+ "reqd": 0,
+ "show_in_filter": 0
+ },
+ {
+ "allow_read_on_all_link_options": 0,
+ "fieldname": "github",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "label": "Github ID",
+ "max_length": 0,
+ "max_value": 0,
+ "read_only": 0,
+ "reqd": 0,
+ "show_in_filter": 0
+ },
+ {
+ "allow_read_on_all_link_options": 0,
+ "fieldname": "medium",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "label": "Medium ID",
+ "max_length": 0,
+ "max_value": 0,
+ "read_only": 0,
+ "reqd": 0,
+ "show_in_filter": 0
+ },
+ {
+ "allow_read_on_all_link_options": 0,
+ "fieldname": "city",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "label": "City",
+ "max_length": 0,
+ "max_value": 0,
+ "read_only": 0,
+ "reqd": 0,
+ "show_in_filter": 0
+ },
+ {
+ "allow_read_on_all_link_options": 0,
+ "fieldname": "college",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "label": "College Name",
+ "max_length": 0,
+ "max_value": 0,
+ "read_only": 0,
+ "reqd": 0,
+ "show_in_filter": 0
+ },
+ {
+ "allow_read_on_all_link_options": 0,
+ "depends_on": "college",
+ "fieldname": "branch",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "label": "Branch",
+ "max_length": 0,
+ "max_value": 0,
+ "read_only": 0,
+ "reqd": 0,
+ "show_in_filter": 0
+ },
+ {
+ "allow_read_on_all_link_options": 0,
+ "fieldname": "profession",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "label": "Profession",
+ "max_length": 0,
+ "max_value": 0,
+ "read_only": 0,
+ "reqd": 0,
+ "show_in_filter": 0
}
]
}
\ No newline at end of file
diff --git a/community/lms/widgets/ChapterTeaser.html b/community/lms/widgets/ChapterTeaser.html
index 526e92fb..9f8afba0 100644
--- a/community/lms/widgets/ChapterTeaser.html
+++ b/community/lms/widgets/ChapterTeaser.html
@@ -25,7 +25,7 @@
{{ lesson.title }}
{% if membership %}
-
{% endif %}
diff --git a/community/lms/widgets/CourseCard.html b/community/lms/widgets/CourseCard.html
index b45246bf..ba0250ee 100644
--- a/community/lms/widgets/CourseCard.html
+++ b/community/lms/widgets/CourseCard.html
@@ -29,12 +29,21 @@
{{ course.get_instructor().full_name }}
- {% if course.get_students() | length %}
-
- {{ course.get_students() | length }}
+ {% if course.get_students() | length %}
+
+
+ {{ course.get_students() | length }}
+
+ {% endif %}
+ {% set avg_rating = course.get_average_rating() %}
+ {% if avg_rating %}
+
+
+ {{ avg_rating }}
+
+ {% endif %}
- {% endif %}
{% set membership = course.get_membership(frappe.session.user) %}
@@ -61,3 +70,13 @@
{% endif %}
+
diff --git a/community/lms/widgets/MemberCard.html b/community/lms/widgets/MemberCard.html
index 0ecc2d72..d780eb34 100644
--- a/community/lms/widgets/MemberCard.html
+++ b/community/lms/widgets/MemberCard.html
@@ -1,5 +1,5 @@