diff --git a/community/fixtures/custom_field.json b/community/fixtures/custom_field.json new file mode 100644 index 00000000..d3bb2124 --- /dev/null +++ b/community/fixtures/custom_field.json @@ -0,0 +1,108 @@ +[ + { + "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": "linkedin", + "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": "mobile_no", + "label": "LinkedIn ID", + "length": 0, + "mandatory_depends_on": null, + "modified": "2021-06-30 14:46:55.834145", + "name": "User-linkedin", + "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": "github", + "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": "linkedin", + "label": "Github ID", + "length": 0, + "mandatory_depends_on": null, + "modified": "2021-06-30 14:46:55.834145", + "name": "User-github", + "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 dbf8f2a2..f6a8b4ab 100644 --- a/community/hooks.py +++ b/community/hooks.py @@ -104,6 +104,8 @@ doc_events = { # ] #} +fixtures = ["Custom Field"] + # Testing # ------- @@ -166,7 +168,7 @@ whitelist = [ "/new-sign-up", "/message", "/about", - "/lms-course-review" + "/review" ] whitelist_rules = [{"from_route": p, "to_route": p[1:]} for p in whitelist] diff --git a/community/lms/web_form/profile/__init__.py b/community/lms/web_form/profile/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/community/lms/web_form/profile/profile.js b/community/lms/web_form/profile/profile.js new file mode 100644 index 00000000..699703c5 --- /dev/null +++ b/community/lms/web_form/profile/profile.js @@ -0,0 +1,3 @@ +frappe.ready(function() { + // bind events here +}) \ No newline at end of file diff --git a/community/lms/web_form/profile/profile.json b/community/lms/web_form/profile/profile.json new file mode 100644 index 00000000..c4962a94 --- /dev/null +++ b/community/lms/web_form/profile/profile.json @@ -0,0 +1,125 @@ +{ + "accept_payment": 0, + "allow_comments": 0, + "allow_delete": 0, + "allow_edit": 1, + "allow_incomplete": 0, + "allow_multiple": 0, + "allow_print": 0, + "amount": 0.0, + "amount_based_on_field": 0, + "apply_document_permissions": 0, + "breadcrumbs": "", + "button_label": "Save", + "creation": "2021-06-30 13:48:13.682851", + "doc_type": "User", + "docstatus": 0, + "doctype": "Web Form", + "idx": 0, + "is_standard": 1, + "login_required": 1, + "max_attachment_size": 0, + "modified": "2021-06-30 15:53:20.967466", + "modified_by": "Administrator", + "module": "LMS", + "name": "profile", + "owner": "Administrator", + "payment_button_label": "Buy Now", + "published": 1, + "route": "profile", + "route_to_success_link": 0, + "show_attachments": 0, + "show_in_grid": 0, + "show_sidebar": 0, + "sidebar_items": [], + "success_url": "/profile", + "title": "Profile", + "web_form_fields": [ + { + "allow_read_on_all_link_options": 0, + "fieldname": "first_name", + "fieldtype": "Data", + "hidden": 0, + "label": "First Name", + "max_length": 0, + "max_value": 0, + "read_only": 0, + "reqd": 1, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "middle_name", + "fieldtype": "Data", + "hidden": 0, + "label": "Middle Name (Optional)", + "max_length": 0, + "max_value": 0, + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "last_name", + "fieldtype": "Data", + "hidden": 0, + "label": "Last Name", + "max_length": 0, + "max_value": 0, + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "description": "Get your globally recognized avatar from Gravatar.com", + "fieldname": "user_image", + "fieldtype": "Attach Image", + "hidden": 0, + "label": "User Image", + "max_length": 0, + "max_value": 0, + "read_only": 0, + "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", + "fieldtype": "Data", + "hidden": 0, + "label": "Mobile No", + "max_length": 0, + "max_value": 0, + "options": "Phone", + "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", + "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/web_form/profile/profile.py b/community/lms/web_form/profile/profile.py new file mode 100644 index 00000000..e1ada619 --- /dev/null +++ b/community/lms/web_form/profile/profile.py @@ -0,0 +1,5 @@ +import frappe + +def get_context(context): + # do your magic here + pass diff --git a/community/lms/widgets/Reviews.html b/community/lms/widgets/Reviews.html index 9e0cf18b..962ad6fb 100644 --- a/community/lms/widgets/Reviews.html +++ b/community/lms/widgets/Reviews.html @@ -7,7 +7,7 @@ {% endif %} -
+
{% for review in course.get_reviews() %}
{{ review.review }}
@@ -19,7 +19,7 @@ {{ course.get_instructor().full_name }}
-
+
{% for i in [1, 2, 3, 4, 5] %} diff --git a/community/public/css/style.css b/community/public/css/style.css index 89efd067..06bc5b21 100644 --- a/community/public/css/style.css +++ b/community/public/css/style.css @@ -297,6 +297,7 @@ input[type=checkbox] { background: #FFFFFF; border-radius: 8px; box-shadow: 0px 5px 10px rgb(0 0 0 / 10%); + position: relative; } .course-card { @@ -375,7 +376,7 @@ input[type=checkbox] { color: var(--text-color); } -.course-cards-parent { +.cards-parent { display: flex; flex-wrap: wrap; } @@ -386,13 +387,8 @@ input[type=checkbox] { } } -.course-divider { - border: 1px solid #E2E6E9; - margin: 16px 0px 30px; -} - .courses-header { - padding: 50px 0px 20px; + padding: 50px 30px 20px; color: var(--text-color); font-weight: 600; font-size: 22px; @@ -448,8 +444,8 @@ input[type=checkbox] { } .review-card { - width: 300px; - height: 200px; + width: 100%; + height: fit-content; margin: 0px 16px 32px; padding: 16px; } @@ -457,7 +453,6 @@ input[type=checkbox] { .review-card-footer { width: 100%; display: flex; - justify-content: space-between; } .review-content { diff --git a/community/www/courses/index.html b/community/www/courses/index.html index f10c0b1f..63ec84e1 100644 --- a/community/www/courses/index.html +++ b/community/www/courses/index.html @@ -15,8 +15,7 @@
{{ 'All Courses' }}
-
-
+
{% for course in courses %} {{ course_card(course) }} {% endfor %} @@ -66,18 +65,17 @@ {% endif %}
- - {% if course.get_membership(frappe.session.user) %} - - {% else %} - - {% endif %} - + {% if course.get_membership(frappe.session.user) %} + + {% else %} + + {% endif %}
+
{% endmacro %}