diff --git a/src/components/Leaderboard.astro b/src/components/Leaderboard.astro
index b10c4cc..beaf88f 100644
--- a/src/components/Leaderboard.astro
+++ b/src/components/Leaderboard.astro
@@ -10,7 +10,7 @@ const { grouped } = Astro.props;
import LeaderboardMember from "./LeaderboardMember.astro";
import {
- getMembers, formatDevGroupBounds, filterInactiveMembers, groupMembers, sortMembers, DEV_GROUP_BOUNDS
+ getMembers, formatDevGroupBounds, filterInactiveMembers, groupMembers, sortMembersByDollarsPerDev, DEV_GROUP_BOUNDS
} from '../members.ts';
const members = await getMembers();
@@ -20,24 +20,32 @@ const members = await getMembers();
{groupMembers(filterInactiveMembers(members)).map((groupMembers, idx) => groupMembers.length > 0 &&
{formatDevGroupBounds(DEV_GROUP_BOUNDS[idx])}
+
+
+ Name |
+ $/dev in latest report |
+
+
+
+ {sortMembersByDollarsPerDev(groupMembers).map((member) =>
+
+ )}
+
+
+
)}
+ : (
+
+
Name |
$/dev in latest report |
- {sortMembers(groupMembers).map((member) =>
+
+
+ {sortMembersByDollarsPerDev(filterInactiveMembers(members)).map((member) =>
- )}
-
- )}
- : (
-
-
- Name |
- $/dev in latest report |
-
- {sortMembers(filterInactiveMembers(members)).map((member) =>
-
-
)}
+ )}
+
)}
diff --git a/src/components/MiniLeaderboard.astro b/src/components/MiniLeaderboard.astro
index b12f228..4c83817 100644
--- a/src/components/MiniLeaderboard.astro
+++ b/src/components/MiniLeaderboard.astro
@@ -3,29 +3,33 @@
// SPDX-License-Identifier: Apache-2.0
import {
- getMembers, filterInactiveMembers, sortMembers,
- getDollarsPerDev, fmtCurrency
+ getMembers, filterInactiveMembers, getDollarsPerDev, fmtCurrency, sortMembersByDevs,
} from '../members.ts';
-const members = await getMembers();
+const N_TO_CHOOSE = 5;
+const members = sortMembersByDevs(filterInactiveMembers(await getMembers()));
---
-
-
- Name |
- $/dev in latest report |
-
- {sortMembers(filterInactiveMembers(members)).slice(0, 5).map((member) =>
-
-
-
- {member.data.name}
-
- |
-
- {fmtCurrency(getDollarsPerDev(member.data.annualReports[0]))}
- |
-
)}
+
+
+
+ Name |
+ $/dev in latest report |
+
+
+
+ {members.map((member, idx) => = N_TO_CHOOSE}>
+
+
+
+ {member.data.name}
+
+ |
+
+ {fmtCurrency(getDollarsPerDev(member.data.annualReports[0]))}
+ |
+
)}
+
+
+
diff --git a/src/members.ts b/src/members.ts
index a628a85..c5365c0 100644
--- a/src/members.ts
+++ b/src/members.ts
@@ -104,10 +104,27 @@ export function groupMembers(members: MemberWithId[]): MemberWithId[][] {
return groups;
}
+/**
+ * Sorts members by the average number of devs in their latest annual report.
+ */
+export function sortMembersByDevs(members: MemberWithId[]): MemberWithId[] {
+ return members.toSorted((m1, m2) => {
+ if (m1.data.annualReports.length == 0) {
+ return 1;
+ }
+ if (m2.data.annualReports.length == 0) {
+ return -1;
+ }
+ const devs1 = m1.data.annualReports[0].averageNumberOfDevs;
+ const devs2 = m2.data.annualReports[0].averageNumberOfDevs;
+ return devs2 - devs1;
+ });
+}
+
/**
* Sorts members by the dollars per dev donated in their latest annual report.
*/
-export function sortMembers(members: MemberWithId[]): MemberWithId[] {
+export function sortMembersByDollarsPerDev(members: MemberWithId[]): MemberWithId[] {
return members.toSorted((m1, m2) => {
if (m1.data.annualReports.length == 0) {
return 1;
diff --git a/src/pages/about.astro b/src/pages/about.astro
index c6a651d..e39ec16 100644
--- a/src/pages/about.astro
+++ b/src/pages/about.astro
@@ -32,30 +32,34 @@ import Layout from "../layouts/Layout.astro";
We have four working groups and a steering group comprised of working group leads.
diff --git a/src/pages/index.astro b/src/pages/index.astro
index 1b70229..d54e991 100644
--- a/src/pages/index.astro
+++ b/src/pages/index.astro
@@ -63,7 +63,7 @@ import TextButton from "../components/TextButton.astro";
-
Top orgs opening up
+ Some Member Companies
diff --git a/src/pages/members/[id].astro b/src/pages/members/[id].astro
index 70937f3..8d3a8aa 100644
--- a/src/pages/members/[id].astro
+++ b/src/pages/members/[id].astro
@@ -59,30 +59,34 @@ export async function getStaticPaths() {
-
- Item |
- Amount ($) |
-
-
- Payments to Projects |
- {fmtCurrency(report.payments)} |
-
-
- |
- = {fmtCurrency(getDollarsPerDev(report))} / dev |
-
-
- Value of Time |
- {fmtCurrency(report.monetaryValueOfTime)} |
-
-
- Value of Materials |
- {fmtCurrency(report.monetaryValueOfMaterials)} |
-
-
- Total |
- {fmtCurrency(getReportFullTotal(report))} |
-
+
+
+ Item |
+ Amount ($) |
+
+
+
+
+ Payments to Projects |
+ {fmtCurrency(report.payments)} |
+
+
+ |
+ = {fmtCurrency(getDollarsPerDev(report))} / dev |
+
+
+ Value of Time |
+ {fmtCurrency(report.monetaryValueOfTime)} |
+
+
+ Value of Materials |
+ {fmtCurrency(report.monetaryValueOfMaterials)} |
+
+
+ Total |
+ {fmtCurrency(getReportFullTotal(report))} |
+
+
Read report