Bootstrapped during the 2026-06-06 BlockNinja consolidation. Was previously an unversioned directory inside ~/src/blockninja-themes/corporate-modernist. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
64 lines
2.0 KiB
Plaintext
64 lines
2.0 KiB
Plaintext
package main
|
|
|
|
// testimonialQuoteComponent renders the corporate-modernist:testimonial_quote block.
|
|
templ testimonialQuoteComponent(data TestimonialQuoteData) {
|
|
<section class="cm-section" data-block="corporate-modernist:testimonial_quote">
|
|
<div class="cm-content-well">
|
|
<figure style="max-width: 70ch; margin: 0 auto;">
|
|
if data.Quote != "" {
|
|
<blockquote class="cm-pull-quote">
|
|
{ data.Quote }
|
|
</blockquote>
|
|
} else {
|
|
<blockquote class="cm-pull-quote">
|
|
No testimonial provided.
|
|
</blockquote>
|
|
}
|
|
<figcaption style="display: flex; align-items: center; gap: 1rem; margin-top: 1.5rem;">
|
|
if data.Headshot != "" {
|
|
<img src={ data.Headshot } alt={ testimonialQuoteHeadshotAlt(data) } style="width: 3rem; height: 3rem; border-radius: 50%; object-fit: cover; display: block;"/>
|
|
} else {
|
|
<span class="cm-img-empty" style="width: 3rem; height: 3rem; aspect-ratio: 1 / 1; border-radius: 50%;"></span>
|
|
}
|
|
<div>
|
|
if data.Name != "" {
|
|
<div class="cm-display" style="font-size: 1rem; font-weight: 600; margin: 0;">{ data.Name }</div>
|
|
}
|
|
if data.Role != "" || data.Company != "" {
|
|
<div class="cm-stat-label" style="margin: 0.25rem 0 0 0;">{ testimonialQuoteAttribution(data) }</div>
|
|
}
|
|
</div>
|
|
if data.Logo != "" {
|
|
<img src={ data.Logo } alt={ testimonialQuoteLogoAlt(data) } class="cm-logo" style="max-height: 1.5rem; width: auto; margin-left: auto; display: block;"/>
|
|
}
|
|
</figcaption>
|
|
</figure>
|
|
</div>
|
|
</section>
|
|
}
|
|
|
|
func testimonialQuoteHeadshotAlt(data TestimonialQuoteData) string {
|
|
if data.Name != "" {
|
|
return data.Name
|
|
}
|
|
return "Testimonial portrait"
|
|
}
|
|
|
|
func testimonialQuoteLogoAlt(data TestimonialQuoteData) string {
|
|
if data.Company != "" {
|
|
return data.Company + " logo"
|
|
}
|
|
return "Company logo"
|
|
}
|
|
|
|
func testimonialQuoteAttribution(data TestimonialQuoteData) string {
|
|
switch {
|
|
case data.Role != "" && data.Company != "":
|
|
return data.Role + ", " + data.Company
|
|
case data.Role != "":
|
|
return data.Role
|
|
default:
|
|
return data.Company
|
|
}
|
|
}
|