Skip to content

Commit

Permalink
fix: Display and calculation of sponsors
Browse files Browse the repository at this point in the history
  • Loading branch information
nzakas committed Oct 30, 2024
1 parent c10654b commit cd9a945
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/_data/sponsors.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
"monthlyDonation": 350,
"totalDonations": 19964,
"source": "opencollective",
"tier": null
"tier": "bronze-sponsor"
},
{
"name": "Principal Financial Group",
Expand Down Expand Up @@ -1659,4 +1659,4 @@
"tier": "backer"
}
]
}
}
5 changes: 3 additions & 2 deletions src/content/pages/sponsors.html
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,12 @@ <h2 class="section-title h3">{{ site.sponsors_page.tiers.backers.title }}</h2>
</div>
<div class="grid">
<ul role="list" class="sponsors span-1-12 sponsors--backers">
{% set fallback_image = '/assets/images/people/_placeholder-avatar.svg' %}
{% for sponsor in sponsors.backers %}
<li>
<a href="{{ sponsor.url | url }}" class="sponsor-link" rel="nofollow noopener sponsored" target="_blank">
<img loading="lazy" decoding="async" src="{{ sponsor.image }}" height="48" width="48"
onerror="this.src = '/assets/images/people/_placeholder-avatar.svg'"
<img loading="lazy" decoding="async" src="{{ sponsor.image if sponsor.image else fallback_image }}" height="48" width="48"
onerror="this.src = '{{fallback_image}}'"
alt="{{ sponsor.name if sponsor.name else "Anonymous" }} is donating {{ sponsor.monthlyDonation | dollars }} each month"
title="{{ sponsor.name if sponsor.name else "Anonymous" }} is donating {{ sponsor.monthlyDonation | dollars }} each month" />
</a>
Expand Down
2 changes: 1 addition & 1 deletion tools/fetch-sponsors.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ async function fetchOpenCollectiveData() {
: order.amount.value,
totalDonations: order.totalDonations.value,
source: "opencollective",
tier: order.tier ? order.tier.slug : null,
tier: order.tier ? order.tier.slug : getTierSlug(order.amount.value),
}));

const donations = payload.data.donations.nodes
Expand Down

0 comments on commit cd9a945

Please sign in to comment.