diff --git a/lms/fixtures/custom_field.json b/lms/fixtures/custom_field.json index e457f8cc..cdb50dba 100644 --- a/lms/fixtures/custom_field.json +++ b/lms/fixtures/custom_field.json @@ -609,13 +609,13 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "profession", + "insert_after": "hide_private", "is_system_generated": 1, "is_virtual": 0, "label": "Education Details", "length": 0, "mandatory_depends_on": null, - "modified": "2021-12-31 11:57:55.170625", + "modified": "2021-12-31 11:57:55.170620", "module": null, "name": "User-education_details", "no_copy": 0, @@ -662,7 +662,7 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "hide_private", + "insert_after": "bio", "is_system_generated": 1, "is_virtual": 0, "label": "Profile Complete", @@ -721,7 +721,7 @@ "label": "Hide my Private Information from others", "length": 0, "mandatory_depends_on": null, - "modified": "2021-12-31 11:57:47.942968", + "modified": "2021-12-31 11:57:47.942969", "module": null, "name": "User-hide_my_private_information_from_others", "no_copy": 0, @@ -768,13 +768,13 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "profile_complete", + "insert_after": "user_category", "is_system_generated": 1, "is_virtual": 0, "label": "Cover Image", "length": 0, "mandatory_depends_on": null, - "modified": "2021-12-31 10:59:52.682112", + "modified": "2021-12-31 10:59:52.682115", "module": null, "name": "User-cover_image", "no_copy": 0, @@ -821,13 +821,13 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "cover_image", + "insert_after": "interest", "is_system_generated": 1, "is_virtual": 0, "label": "I am looking for a job", "length": 0, "mandatory_depends_on": null, - "modified": "2021-12-31 12:56:32.110403", + "modified": "2021-12-31 12:56:32.110405", "module": null, "name": "User-looking_for_job", "no_copy": 0, diff --git a/lms/hooks.py b/lms/hooks.py index d6b93393..b3b065dd 100644 --- a/lms/hooks.py +++ b/lms/hooks.py @@ -179,6 +179,7 @@ website_route_rules = [ website_redirects = [ {"source": "/update-profile", "target": "/edit-profile"}, {"source": "/dashboard", "target": "/courses"}, + {"source": "/community", "target": "/people"}, ] update_website_context = [ diff --git a/lms/lms/web_form/profile/profile.json b/lms/lms/web_form/profile/profile.json index f0e5ab81..739d5159 100644 --- a/lms/lms/web_form/profile/profile.json +++ b/lms/lms/web_form/profile/profile.json @@ -13,7 +13,7 @@ "button_label": "Save", "client_script": "", "creation": "2021-06-30 13:48:13.682851", - "custom_css": "[data-doctype=\"Web Form\"] {\n max-width: 720px;\n margin: 6rem auto;\n}", + "custom_css": "", "doc_type": "User", "docstatus": 0, "doctype": "Web Form", @@ -22,7 +22,7 @@ "list_columns": [], "login_required": 1, "max_attachment_size": 0, - "modified": "2022-09-05 13:08:40.071348", + "modified": "2023-01-09 15:45:11.411692", "modified_by": "Administrator", "module": "LMS", "name": "profile", @@ -100,22 +100,10 @@ }, { "allow_read_on_all_link_options": 0, - "fieldname": "headline", + "fieldname": "city", "fieldtype": "Data", "hidden": 0, - "label": "Headline", - "max_length": 0, - "max_value": 0, - "read_only": 0, - "reqd": 0, - "show_in_filter": 0 - }, - { - "allow_read_on_all_link_options": 0, - "fieldname": "bio", - "fieldtype": "Small Text", - "hidden": 0, - "label": "Bio", + "label": "City", "max_length": 0, "max_value": 0, "read_only": 0, @@ -135,6 +123,31 @@ "reqd": 0, "show_in_filter": 0 }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "", + "fieldtype": "Column Break", + "hidden": 0, + "label": "", + "max_length": 0, + "max_value": 0, + "options": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "headline", + "fieldtype": "Data", + "hidden": 0, + "label": "Headline", + "max_length": 0, + "max_value": 0, + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, { "allow_read_on_all_link_options": 0, "fieldname": "linkedin", @@ -173,10 +186,10 @@ }, { "allow_read_on_all_link_options": 0, - "fieldname": "city", - "fieldtype": "Data", + "fieldname": "looking_for_job", + "fieldtype": "Check", "hidden": 0, - "label": "City", + "label": "I am looking for a job", "max_length": 0, "max_value": 0, "read_only": 0, @@ -185,16 +198,42 @@ }, { "allow_read_on_all_link_options": 0, - "fieldname": "education_details", - "fieldtype": "Section Break", + "fieldname": "bio", + "fieldtype": "Small Text", "hidden": 0, - "label": "Education Details", + "label": "Bio", "max_length": 0, "max_value": 0, "read_only": 0, "reqd": 0, "show_in_filter": 0 }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "", + "fieldtype": "Page Break", + "hidden": 0, + "label": "", + "max_length": 0, + "max_value": 0, + "options": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "", + "fieldtype": "Section Break", + "hidden": 0, + "label": "", + "max_length": 0, + "max_value": 0, + "options": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, { "allow_read_on_all_link_options": 0, "fieldname": "education", @@ -297,187 +336,6 @@ "read_only": 0, "reqd": 0, "show_in_filter": 0 - }, - { - "allow_read_on_all_link_options": 0, - "fieldname": "carrer_preference_details", - "fieldtype": "Section Break", - "hidden": 0, - "label": "Career Preference", - "max_length": 0, - "max_value": 0, - "options": "", - "read_only": 0, - "reqd": 0, - "show_in_filter": 0 - }, - { - "allow_read_on_all_link_options": 0, - "fieldname": "preferred_functions", - "fieldtype": "Table", - "hidden": 0, - "label": "Preferred Functions", - "max_length": 0, - "max_value": 0, - "options": "Preferred Function", - "read_only": 0, - "reqd": 0, - "show_in_filter": 0 - }, - { - "allow_read_on_all_link_options": 0, - "fieldname": "preferred_industries", - "fieldtype": "Table", - "hidden": 0, - "label": "Preferred Industries", - "max_length": 0, - "max_value": 0, - "options": "Preferred Industry", - "read_only": 0, - "reqd": 0, - "show_in_filter": 0 - }, - { - "allow_read_on_all_link_options": 0, - "fieldname": "preferred_location", - "fieldtype": "Data", - "hidden": 0, - "label": "Preferred Locations", - "max_length": 0, - "max_value": 0, - "options": "", - "read_only": 0, - "reqd": 0, - "show_in_filter": 0 - }, - { - "allow_read_on_all_link_options": 0, - "fieldname": "dream_companies", - "fieldtype": "Data", - "hidden": 0, - "label": "Dream Companies", - "max_length": 0, - "max_value": 0, - "options": "", - "read_only": 0, - "reqd": 0, - "show_in_filter": 0 - }, - { - "allow_read_on_all_link_options": 0, - "fieldname": "work_environment", - "fieldtype": "Section Break", - "hidden": 0, - "label": "Work Environment", - "max_length": 0, - "max_value": 0, - "options": "", - "read_only": 0, - "reqd": 0, - "show_in_filter": 0 - }, - { - "allow_read_on_all_link_options": 0, - "fieldname": "attire", - "fieldtype": "Select", - "hidden": 0, - "label": "Attire Preference", - "max_length": 0, - "max_value": 0, - "options": "Casual Wear\nFormal Wear", - "read_only": 0, - "reqd": 0, - "show_in_filter": 0 - }, - { - "allow_read_on_all_link_options": 0, - "fieldname": "collaboration", - "fieldtype": "Select", - "hidden": 0, - "label": "Collaboration Preference", - "max_length": 0, - "max_value": 0, - "options": "Individual Work\nTeam Work\nBoth Individual and Team Work", - "read_only": 0, - "reqd": 0, - "show_in_filter": 0 - }, - { - "allow_read_on_all_link_options": 0, - "fieldname": "role", - "fieldtype": "Select", - "hidden": 0, - "label": "Role Preference", - "max_length": 0, - "max_value": 0, - "options": "Clearly Defined Role\nUnstructured Role", - "read_only": 0, - "reqd": 0, - "show_in_filter": 0 - }, - { - "allow_read_on_all_link_options": 0, - "fieldname": "location_preference", - "fieldtype": "Select", - "hidden": 0, - "label": "Location Preference", - "max_length": 0, - "max_value": 0, - "options": "Travel\nOffice close to Home", - "read_only": 0, - "reqd": 0, - "show_in_filter": 0 - }, - { - "allow_read_on_all_link_options": 0, - "fieldname": "time", - "fieldtype": "Select", - "hidden": 0, - "label": "Time Preference", - "max_length": 0, - "max_value": 0, - "options": "Flexible Time\nFixed 9-5", - "read_only": 0, - "reqd": 0, - "show_in_filter": 0 - }, - { - "allow_read_on_all_link_options": 0, - "fieldname": "company_type", - "fieldtype": "Select", - "hidden": 0, - "label": "Company Type", - "max_length": 0, - "max_value": 0, - "options": "Corporate Organization\nStartup Organization", - "read_only": 0, - "reqd": 0, - "show_in_filter": 0 - }, - { - "allow_read_on_all_link_options": 0, - "fieldname": "looking_for_job", - "fieldtype": "Check", - "hidden": 0, - "label": "I am looking for a job", - "max_length": 0, - "max_value": 0, - "read_only": 0, - "reqd": 0, - "show_in_filter": 0 - }, - { - "allow_read_on_all_link_options": 0, - "description": "Private Information includes your Mobile Number, Email Address, Grade Type, Grade and Work Environment Preferences", - "fieldname": "hide_private", - "fieldtype": "Check", - "hidden": 0, - "label": "Hide my Private Information from others", - "max_length": 0, - "max_value": 0, - "read_only": 0, - "reqd": 0, - "show_in_filter": 0 } ] } \ No newline at end of file diff --git a/lms/lms/widgets/MemberCard.html b/lms/lms/widgets/MemberCard.html index 70906eb3..5d8fdd36 100644 --- a/lms/lms/widgets/MemberCard.html +++ b/lms/lms/widgets/MemberCard.html @@ -1,19 +1,31 @@ +{% set color = get_palette(member.full_name) %}
- {{ widgets.Avatar(member=member, avatar_class=avatar_class) }} -
- {{ member.full_name }} -
+
+ {{ widgets.Avatar(member=member, avatar_class=avatar_class) }} - {% if member.headline %} -
{{ member.headline }}
- {% endif %} +
+
+ {{ member.full_name }} +
+ + {% if member.headline %} +
{{ member.headline }}
+ {% endif %} + + {% if member.looking_for_job %} +
{{ _("Open Network") }}
+ {% endif %} + + {% set course_count = get_authored_courses(member.name, True) | length %} + {% set suffix = "Courses" if course_count > 1 else "Course" %} + + {% if show_course_count and course_count > 0 %} +
+ Created {{ course_count }} {{ suffix }} +
+ {% endif %} +
+ +
- {% set course_count = get_authored_courses(member.name, True) | length %} - {% if show_course_count and course_count > 0 %} - {% set suffix = "Courses" if course_count > 1 else "Course" %} -
- Created {{ course_count }} {{ suffix }} -
- {% endif %} -
diff --git a/lms/overrides/user.py b/lms/overrides/user.py index 8b948237..1f2a7c2a 100644 --- a/lms/overrides/user.py +++ b/lms/overrides/user.py @@ -345,7 +345,7 @@ def get_user_details(users): details = frappe.db.get_value( "User", user, - ["name", "username", "full_name", "user_image", "headline"], + ["name", "username", "full_name", "user_image", "headline", "looking_for_job"], as_dict=True, ) user_details.append(Widgets().MemberCard(member=details, avatar_class="avatar-large")) diff --git a/lms/patches.txt b/lms/patches.txt index 473d1f7b..b33979c2 100644 --- a/lms/patches.txt +++ b/lms/patches.txt @@ -45,3 +45,4 @@ lms.patches.v0_0.change_course_creation_settings #12-12-2022 lms.patches.v0_0.check_onboarding_status #21-12-2022 lms.patches.v0_0.assignment_file_type lms.patches.v0_0.user_singles_issue #23-11-2022 +lms.patches.v0_0.rename_community_to_users #06-01-2023 diff --git a/lms/patches/v0_0/rename_community_to_users.py b/lms/patches/v0_0/rename_community_to_users.py new file mode 100644 index 00000000..3eb12324 --- /dev/null +++ b/lms/patches/v0_0/rename_community_to_users.py @@ -0,0 +1,7 @@ +import frappe + + +def execute(): + doc = frappe.db.exists("Top Bar Item", {"url": "/community"}) + if doc: + frappe.db.set_value("Top Bar Item", doc, {"url": "/people", "label": "People"}) diff --git a/lms/public/css/style.css b/lms/public/css/style.css index 5448cd2c..eca5c053 100644 --- a/lms/public/css/style.css +++ b/lms/public/css/style.css @@ -443,10 +443,10 @@ input[type=checkbox] { } .member-card { - display: flex; - flex-direction: column; - align-items: center; - padding: 2rem 1rem; + display: flex; + flex-direction: column; + padding: 1rem; + font-size: var(--text-base); } .break { @@ -1952,3 +1952,8 @@ select { padding: 0 !important; margin: 0 !important; } + +.member-card-title { + color: var(--gray-900); + font-weight: 500; +} diff --git a/lms/www/community/__init__.py b/lms/www/people/__init__.py similarity index 100% rename from lms/www/community/__init__.py rename to lms/www/people/__init__.py diff --git a/lms/www/community/index.html b/lms/www/people/index.html similarity index 96% rename from lms/www/community/index.html rename to lms/www/people/index.html index 3c30bffc..0bbb80bc 100644 --- a/lms/www/community/index.html +++ b/lms/www/people/index.html @@ -32,7 +32,7 @@ {% endfor %} - {% if user_count > user_details | length %} + {% if user_count > users | length %}
{{ _("Load More") }} diff --git a/lms/www/community/index.js b/lms/www/people/index.js similarity index 100% rename from lms/www/community/index.js rename to lms/www/people/index.js diff --git a/lms/www/community/index.py b/lms/www/people/index.py similarity index 92% rename from lms/www/community/index.py rename to lms/www/people/index.py index 1000378e..4fcefd8c 100644 --- a/lms/www/community/index.py +++ b/lms/www/people/index.py @@ -6,7 +6,7 @@ def get_context(context): context.users = frappe.get_all( "User", filters={"enabled": True}, - fields=["name", "username", "full_name", "user_image", "headline"], + fields=["name", "username", "full_name", "user_image", "headline", "looking_for_job"], start=0, page_length=24, order_by="creation desc",