feat: testimonials template

This commit is contained in:
Jannat Patel
2021-11-16 19:32:05 +05:30
parent af17270c52
commit f08586ee12
7 changed files with 77 additions and 18 deletions

View File

@@ -0,0 +1,17 @@
<div class="course-home-headings section-heading text-center"> {{ _(title) }} </div>
<div class="cards-parent">
{% for testimonial_row in testimonials_table %}
{% set review = frappe.db.get_value("LMS Course Review", testimonial_row.testimonials, ["owner", "review"], as_dict=True) %}
<div class="common-card-style testimonial-card">
{% set member = frappe.get_doc("User", review.owner) %}
<div class="d-flex">
{{ widgets.Avatar(member=member, avatar_class="avatar-testimonial") }}
<div>
<div class="" >{{ member.full_name }}</div>
{% if member.profession %}<div style="font-size: 14px;">{{ member.profession }}</div> {% endif %}
</div>
</div>
{{ review.review }}
</div>
{% endfor %}
</div>

View File

@@ -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"
}

View File

@@ -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
}

View File

@@ -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;
}

View File

@@ -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

View File

@@ -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": []
}