Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions ak/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,13 @@ def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context["entries"] = Entry.objects.published().order_by("-publish_at")[:3]
context["events"] = self.get_events()
context["testimonial"] = (
Testimonial.objects.live().filter(pull_quote__gt="").last()
testimonials = (
Testimonial.objects.live()
.filter(pull_quote__gt="")
.order_by("-first_published_at")
)
context["testimonials"] = testimonials
context["num_testimonials"] = testimonials.count()
if context["events"]:
context["num_months"] = len(context["events"])
else:
Expand Down
2 changes: 1 addition & 1 deletion static/css/v3/buttons.css
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
}

.btn-secondary {
background: var(--color-surface-weak);
border-color: var(--color-stroke-strong);
color: var(--color-text-primary);
}
Expand Down Expand Up @@ -148,6 +147,7 @@
}

.btn.btn-hero.btn-secondary {
background: var(--color-surface-weak);
border-color: var(--color-stroke-weak);
}

Expand Down
1 change: 1 addition & 0 deletions static/css/v3/dialog.css
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@

.dialog-modal__description p {
margin: 0;
padding: 0;
font-family: var(--font-sans);
font-size: var(--font-size-base);
font-weight: var(--font-weight-regular);
Expand Down
42 changes: 34 additions & 8 deletions templates/homepage.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,42 @@ <h4 class="mb-3 text-5xl">165+</h4>
</div>
</div>

{% if testimonial %}
{% if testimonials %}
<div class="testimonials my-12 mb-3 md:mb-6 space-y-4 lg:mt-16 lg:mb-4 lg:space-y-0 lg:space-x-4 md:shadow-lg">
<div class="testimonial p-6 dark:text-white text-slate bg-white md:rounded-lg dark:bg-charcoal dark:bg-neutral-700 md:shadow-lg">
<div class="testimonial p-6 dark:text-white text-slate bg-white md:rounded-lg dark:bg-charcoal dark:bg-neutral-700 md:shadow-lg"
x-data="{ activeSlide: 1, slides: Array.from({ length: {{ num_testimonials }} }, (_, i) => i + 1) }">
<h5 class="text-3xl leading-tight mb-2">Testimonials</h5>
<div class="flex items-end gap-4">
<div class="flex-grow">
{{ testimonial.pull_quote }}
<div class="grid">
{% for t in testimonials %}
<div style="grid-area: 1/1"
x-show="activeSlide === {{ forloop.counter }}"
x-transition.opacity.duration.300ms
{% if not forloop.first %}x-cloak{% endif %}>
<div class="flex flex-col md:flex-row gap-4">
<div class="flex-grow pull-quote">
{{ t.pull_quote }}
</div>
<div class="flex items-end">
<a href="{% url 'testimonial-detail' t.author_slug %}">
<button class="py-2 px-3 text-sm text-white rounded bg-orange">Read&nbsp;More</button>
</a>
</div>
</div>
</div>
{% endfor %}
</div>
<a href="{% url 'testimonial-detail' testimonial.author_slug %}" class="flex-shrink-0 mb-4">
<button class="py-2 px-3 text-sm text-white rounded bg-orange">Read&nbsp;More</button>
</a>
<div class="flex justify-center items-center gap-4 mt-4" x-show="slides.length > 1" x-cloak>
<button :style="activeSlide === 1 ? 'visibility:hidden;pointer-events:none' : ''"
@click="activeSlide--"
class="w-8 h-8 font-bold text-white hover:text-orange bg-gray-400 rounded-full">
<i class="fas fa-chevron-left"></i>
</button>
<span class="text-sm text-gray-500 dark:text-gray-400" x-text="activeSlide + ' / ' + slides.length"></span>
<button :style="activeSlide === slides.length ? 'visibility:hidden;pointer-events:none' : ''"
@click="activeSlide++"
class="w-8 h-8 font-bold text-white hover:text-orange bg-gray-400 rounded-full">
<i class="fas fa-chevron-right"></i>
</button>
</div>
</div>
</div>
Expand Down Expand Up @@ -310,6 +335,7 @@ <h2 class="flex items-center pb-2 mb-3 text-lg md:text-2xl lg:text-2xl font-semi

{% block css %}
<style>
.pull-quote p { margin-bottom: 0; padding-bottom: 0; }
.toon {
background-image: url('{% static 'img/boost-toon.jpg' %}');
background-size: cover;
Expand Down
1 change: 0 additions & 1 deletion testimonials/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ class Testimonial(Page):

# Configure Wagtail admin panels
content_panels = Page.content_panels + [
FieldPanel("title"),
FieldPanel("author"),
FieldPanel("author_slug"),
FieldPanel("author_url"),
Expand Down
Loading