From f08586ee124e1ed3b026176b279d181d5594e57d Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Tue, 16 Nov 2021 19:32:05 +0530 Subject: [PATCH 1/5] feat: testimonials template --- .../multiple_testimonials/__init__.py | 0 .../multiple_testimonials.html | 17 ++++++++ .../multiple_testimonials.json | 42 +++++++++++++++++++ .../lms_course_review/lms_course_review.json | 4 +- school/public/css/style.css | 15 +++++++ .../public/dist/js/website.bundle.HL5DXFIV.js | 10 ----- .../dist/js/website.bundle.HL5DXFIV.js.map | 7 ---- 7 files changed, 77 insertions(+), 18 deletions(-) create mode 100644 school/community/web_template/multiple_testimonials/__init__.py create mode 100644 school/community/web_template/multiple_testimonials/multiple_testimonials.html create mode 100644 school/community/web_template/multiple_testimonials/multiple_testimonials.json delete mode 100644 school/public/dist/js/website.bundle.HL5DXFIV.js delete mode 100644 school/public/dist/js/website.bundle.HL5DXFIV.js.map diff --git a/school/community/web_template/multiple_testimonials/__init__.py b/school/community/web_template/multiple_testimonials/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/school/community/web_template/multiple_testimonials/multiple_testimonials.html b/school/community/web_template/multiple_testimonials/multiple_testimonials.html new file mode 100644 index 00000000..ca741d67 --- /dev/null +++ b/school/community/web_template/multiple_testimonials/multiple_testimonials.html @@ -0,0 +1,17 @@ +
{{ _(title) }}
+
+ {% for testimonial_row in testimonials_table %} + {% set review = frappe.db.get_value("LMS Course Review", testimonial_row.testimonials, ["owner", "review"], as_dict=True) %} +
+ {% set member = frappe.get_doc("User", review.owner) %} +
+ {{ widgets.Avatar(member=member, avatar_class="avatar-testimonial") }} +
+
{{ member.full_name }}
+ {% if member.profession %}
{{ member.profession }}
{% endif %} +
+
+ {{ review.review }} +
+ {% endfor %} +
diff --git a/school/community/web_template/multiple_testimonials/multiple_testimonials.json b/school/community/web_template/multiple_testimonials/multiple_testimonials.json new file mode 100644 index 00000000..5d4db8f0 --- /dev/null +++ b/school/community/web_template/multiple_testimonials/multiple_testimonials.json @@ -0,0 +1,42 @@ +{ + "__unsaved": 1, + "creation": "2021-11-16 15:22:21.788234", + "docstatus": 0, + "doctype": "Web Template", + "fields": [ + { + "__islocal": 1, + "__unsaved": 1, + "fieldname": "title", + "fieldtype": "Data", + "label": "Title", + "reqd": 0 + }, + { + "__islocal": 1, + "__unsaved": 1, + "fieldname": "testimonials_table", + "fieldtype": "Table Break", + "label": "Testimonials", + "reqd": 0 + }, + { + "__islocal": 1, + "__unsaved": 1, + "fieldname": "testimonials", + "fieldtype": "Link", + "label": "Testimonials", + "options": "LMS Course Review", + "reqd": 0 + } + ], + "idx": 0, + "modified": "2021-11-16 17:17:49.089989", + "modified_by": "Administrator", + "module": "Community", + "name": "Multiple Testimonials", + "owner": "Administrator", + "standard": 1, + "template": "", + "type": "Section" +} \ No newline at end of file diff --git a/school/lms/doctype/lms_course_review/lms_course_review.json b/school/lms/doctype/lms_course_review/lms_course_review.json index 09c168ac..c65b9a65 100644 --- a/school/lms/doctype/lms_course_review/lms_course_review.json +++ b/school/lms/doctype/lms_course_review/lms_course_review.json @@ -33,7 +33,7 @@ ], "index_web_pages_for_search": 1, "links": [], - "modified": "2021-08-31 12:37:23.832131", + "modified": "2021-11-16 17:23:50.697891", "modified_by": "Administrator", "module": "LMS", "name": "LMS Course Review", @@ -52,7 +52,9 @@ "write": 1 } ], + "search_fields": "course", "sort_field": "modified", "sort_order": "DESC", + "title_field": "course", "track_changes": 1 } \ No newline at end of file diff --git a/school/public/css/style.css b/school/public/css/style.css index 0f9fa6af..b48c04e8 100644 --- a/school/public/css/style.css +++ b/school/public/css/style.css @@ -8,6 +8,7 @@ --text-xl: 18px; --text-2xl: 20px; --text-3xl: 22px; + --text-4xl: 44px; --navbar-shadow: 0px 1px 8px rgba(0, 0, 0, 0.08) } @@ -751,6 +752,11 @@ input[type=checkbox] { } } +.avatar-testimonial { + width: 48px; + height: 48px; +} + .description-card { padding: 1.5rem; flex-direction: column; @@ -1381,3 +1387,12 @@ pre { text-indent: 1.5rem; background-position: 1rem 0.65rem; } + +.section-heading { + font-size: var(--text-4xl); +} + +.testimonial-card { + flex-direction: column; + padding: 1rem 1rem 2rem; +} diff --git a/school/public/dist/js/website.bundle.HL5DXFIV.js b/school/public/dist/js/website.bundle.HL5DXFIV.js deleted file mode 100644 index 1473663d..00000000 --- a/school/public/dist/js/website.bundle.HL5DXFIV.js +++ /dev/null @@ -1,10 +0,0 @@ -(() => { - // ../community/community/public/js/profile.js - frappe.ready(() => { - if (frappe.session.user == "Guest") { - var link_array = $(".nav-link").filter((i, elem) => $(elem).text().trim() === "My Profile"); - link_array.length && $(link_array[0]).addClass("hide"); - } - }); -})(); -//# sourceMappingURL=website.bundle.HL5DXFIV.js.map diff --git a/school/public/dist/js/website.bundle.HL5DXFIV.js.map b/school/public/dist/js/website.bundle.HL5DXFIV.js.map deleted file mode 100644 index 8d3ffdcc..00000000 --- a/school/public/dist/js/website.bundle.HL5DXFIV.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../../../../apps/community/community/public/js/profile.js"], - "sourcesContent": ["frappe.ready(() => {\n if (frappe.session.user == \"Guest\") {\n var link_array = $('.nav-link').filter((i, elem) => $(elem).text().trim() === \"My Profile\");\n link_array.length && $(link_array[0]).addClass(\"hide\");\n }\n})\n"], - "mappings": ";;AAAA,SAAO,MAAM,MAAM;AACjB,QAAI,OAAO,QAAQ,QAAQ,SAAS;AAClC,UAAI,aAAa,EAAE,aAAa,OAAO,CAAC,GAAG,SAAS,EAAE,MAAM,OAAO,WAAW;AAC9E,iBAAW,UAAU,EAAE,WAAW,IAAI,SAAS;AAAA;AAAA;", - "names": [] -} From 5bfe56c09119aa1d4129f6804e5982d1967b4039 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Wed, 17 Nov 2021 20:34:10 +0530 Subject: [PATCH 2/5] fix: slider --- .../multiple_testimonials.html | 60 ++++++++++++++----- school/public/css/style.css | 58 ++++++++++++++++++ school/public/icons/slider-arrow-left.svg | 3 + school/public/icons/slider-arrow-right.svg | 3 + 4 files changed, 109 insertions(+), 15 deletions(-) create mode 100644 school/public/icons/slider-arrow-left.svg create mode 100644 school/public/icons/slider-arrow-right.svg diff --git a/school/community/web_template/multiple_testimonials/multiple_testimonials.html b/school/community/web_template/multiple_testimonials/multiple_testimonials.html index ca741d67..3891e0d2 100644 --- a/school/community/web_template/multiple_testimonials/multiple_testimonials.html +++ b/school/community/web_template/multiple_testimonials/multiple_testimonials.html @@ -1,17 +1,47 @@ -
{{ _(title) }}
-
- {% for testimonial_row in testimonials_table %} - {% set review = frappe.db.get_value("LMS Course Review", testimonial_row.testimonials, ["owner", "review"], as_dict=True) %} -
- {% set member = frappe.get_doc("User", review.owner) %} -
- {{ widgets.Avatar(member=member, avatar_class="avatar-testimonial") }} -
-
{{ member.full_name }}
- {% if member.profession %}
{{ member.profession }}
{% endif %} +
{{ _(title) }}
+ {% endif %} + {% endfor %} +
+ +
+ + + Previous + + + + + + + Next + +
diff --git a/school/public/css/style.css b/school/public/css/style.css index b48c04e8..4828614a 100644 --- a/school/public/css/style.css +++ b/school/public/css/style.css @@ -1395,4 +1395,62 @@ pre { .testimonial-card { flex-direction: column; padding: 1rem 1rem 2rem; + height: 100%; +} + +.testimonial-author { + font-weight: 500; + font-size: 18px; + line-height: 150%; + color: var(--text-color-dark); +} + +.testimonial-review { + color: var(--text-color-dark); +} + +.testimonial-profession { + font-size: 0.625rem; +} + +.carousel-indicators li { + background-color: var(--gray-600); + width: 10px; + height: 10px; + border-radius: 50%; +} + +.carousel-control-prev-icon { + background-image: url("/assets/school/icons/slider-arrow-left.svg"); + width: 40px; + height: 40px; +} + +.carousel-control-next-icon { + background-image: url("/assets/school/icons/slider-arrow-right.svg"); + width: 40px; + height: 40px; +} + +.carousel-control-prev, .carousel-control-next { + position: inherit; + width: auto; +} + +.carousel-indicators { + position: inherit; + margin: 0; +} + +.slider-controls { + display: flex; + align-items: center; + justify-content: center; + width: 100%; + margin: 40px auto 0; +} + +.carousel-indicators li { + border: none; + margin: 0 6px; } diff --git a/school/public/icons/slider-arrow-left.svg b/school/public/icons/slider-arrow-left.svg new file mode 100644 index 00000000..45fc33c9 --- /dev/null +++ b/school/public/icons/slider-arrow-left.svg @@ -0,0 +1,3 @@ + + + diff --git a/school/public/icons/slider-arrow-right.svg b/school/public/icons/slider-arrow-right.svg new file mode 100644 index 00000000..58cf6311 --- /dev/null +++ b/school/public/icons/slider-arrow-right.svg @@ -0,0 +1,3 @@ + + + From e7f47a448515cb15c0ec39907fca12fd3c4f85c0 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Thu, 18 Nov 2021 10:09:11 +0530 Subject: [PATCH 3/5] fix: slider height --- .../multiple_testimonials.html | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/school/community/web_template/multiple_testimonials/multiple_testimonials.html b/school/community/web_template/multiple_testimonials/multiple_testimonials.html index 3891e0d2..e77a327b 100644 --- a/school/community/web_template/multiple_testimonials/multiple_testimonials.html +++ b/school/community/web_template/multiple_testimonials/multiple_testimonials.html @@ -45,3 +45,17 @@
+ From 2627cee9387a9739e79945056a4e83a9cf3ddfff Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Thu, 18 Nov 2021 15:07:29 +0530 Subject: [PATCH 4/5] fix: increased margin above explore more link --- school/lms/web_template/course_cards/course_cards.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/school/lms/web_template/course_cards/course_cards.html b/school/lms/web_template/course_cards/course_cards.html index 16ef3012..e65a8efb 100644 --- a/school/lms/web_template/course_cards/course_cards.html +++ b/school/lms/web_template/course_cards/course_cards.html @@ -6,7 +6,7 @@ {{ widgets.CourseCard(course=course, read_only=False) }} {% endfor %} - +
Explore More
From d60aa5490318c27aacea759db781cf380ebf7398 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Thu, 18 Nov 2021 15:12:41 +0530 Subject: [PATCH 5/5] fix: condition if testimonials are less than multiple of three --- .../multiple_testimonials/multiple_testimonials.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/school/community/web_template/multiple_testimonials/multiple_testimonials.html b/school/community/web_template/multiple_testimonials/multiple_testimonials.html index e77a327b..9d9ed1bf 100644 --- a/school/community/web_template/multiple_testimonials/multiple_testimonials.html +++ b/school/community/web_template/multiple_testimonials/multiple_testimonials.html @@ -22,7 +22,7 @@ "{{ review.review }}" - {% if loop.index % 3 == 0 %} {% endif %} + {% if loop.index % 3 == 0 or loop.index == testimonials_table | length %} {% endif %} {% endfor %}