Merge pull request #262 from pateljannat/testimonials

This commit is contained in:
Jannat Patel
2021-11-18 15:25:33 +05:30
committed by GitHub
10 changed files with 186 additions and 19 deletions

View File

@@ -0,0 +1,61 @@
<div class="course-home-headings section-heading text-center" style="margin-bottom: 40px"> {{ _(title) }} </div>
<div class="carousel slide" id="carouselExampleControls" data-ride="carousel" data-interval="false">
<div class="carousel-inner">
{% for testimonial_row in testimonials_table %}
{% set review = frappe.db.get_value("LMS Course Review", testimonial_row.testimonials, ["owner", "review"], as_dict=True) %}
{% if loop.index % 3 == 1 %}
<div class="carousel-item {% if loop.index == 1 %} active {% endif %}"> <div class="cards-parent">
{% endif %}
<div class="common-card-style testimonial-card">
{% set member = frappe.get_doc("User", review.owner) %}
<div class="d-flex align-items-center mb-4">
<div>
{{ widgets.Avatar(member=member, avatar_class="avatar-testimonial") }}
</div>
<div class="ml-3">
<div class="testimonial-author" >{{ member.full_name }}</div>
{% if member.profession %}<div class="testimonial-profession">{{ member.profession }}</div> {% endif %}
</div>
</div>
<div class="testimonial-review">
"{{ review.review }}"
</div>
</div>
{% if loop.index % 3 == 0 or loop.index == testimonials_table | length %} </div> </div> {% endif %}
{% endfor %}
</div>
<div class="slider-controls">
<a class="carousel-control-prev" href="#carouselExampleControls" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<ol class="carousel-indicators">
{% set number_of_slides = (testimonials_table|length / 3)|round(method="ceil")|int %}
{% for i in range(number_of_slides) %}
<li data-target="#carouselExampleControls" data-slide-to="{{ i }}" {% if i == 0 %} class="active" {% endif %} ></li>
{% endfor %}
</ol>
<a class="carousel-control-next" href="#carouselExampleControls" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>
<script>
frappe.ready(() => {
let max_height = 0;
$(".carousel-item").each((i, item) => {
if (max_height < $(item).height()) {
max_height = $(item).height();
}
});
$(".carousel-inner").css("height", max_height);
})
</script>

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

@@ -6,7 +6,7 @@
{{ widgets.CourseCard(course=course, read_only=False) }}
{% endfor %}
</div>
<a class="button-links d-flex justify-content-center mt-10 intercative-link" style="color: var(--gray-800);" href="/courses">
<a class="button-links d-flex justify-content-center mt-12 intercative-link" style="color: var(--gray-800);" href="/courses">
<div>
Explore More
</div>

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

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

View File

@@ -0,0 +1,3 @@
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M23.3335 26.6666L16.6668 20L23.3335 13.3333" stroke="#4C5A67" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 223 B

View File

@@ -0,0 +1,3 @@
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M16.6663 13.3334L23.333 20L16.6663 26.6667" stroke="#4C5A67" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 222 B