fix: slider
This commit is contained in:
@@ -1,17 +1,47 @@
|
||||
<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 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>
|
||||
</div>
|
||||
{{ review.review }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% if loop.index % 3 == 0 %} </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>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
3
school/public/icons/slider-arrow-left.svg
Normal file
3
school/public/icons/slider-arrow-left.svg
Normal 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 |
3
school/public/icons/slider-arrow-right.svg
Normal file
3
school/public/icons/slider-arrow-right.svg
Normal 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 |
Reference in New Issue
Block a user