feat: seperate sponsors and patrons

This commit is contained in:
ThatOneCalculator 2023-07-14 23:03:07 -07:00
parent ab700600d1
commit c99480529f
No known key found for this signature in database
GPG Key ID: 8703CACD01000000
5 changed files with 43 additions and 17 deletions

View File

@ -1228,6 +1228,7 @@ _aboutMisskey:
donateHost: "Donate to {host}" donateHost: "Donate to {host}"
morePatrons: "We also appreciate the support of many other helpers not listed here. morePatrons: "We also appreciate the support of many other helpers not listed here.
Thank you! 🥰" Thank you! 🥰"
sponsors: "Calckey sponsors"
patrons: "Calckey patrons" patrons: "Calckey patrons"
patronsList: "Listed chronologically, not by donation size. Donate with the link above to get your name on here!" patronsList: "Listed chronologically, not by donation size. Donate with the link above to get your name on here!"
_nsfw: _nsfw:

View File

@ -9,7 +9,7 @@ const _dirname = dirname(_filename);
export const meta = { export const meta = {
tags: ["meta"], tags: ["meta"],
description: "Get list of Calckey patrons from Codeberg", description: "Get Calckey patrons",
requireCredential: false, requireCredential: false,
requireCredentialPrivateMode: false, requireCredentialPrivateMode: false,
@ -51,6 +51,8 @@ export default define(meta, paramDef, async (ps) => {
}); });
await redisClient.set("patrons", JSON.stringify(patrons), "EX", 3600); await redisClient.set("patrons", JSON.stringify(patrons), "EX", 3600);
} }
return {
return patrons["patrons"]; patrons: patrons["patrons"],
sponsors: patrons["sponsors"],
};
}); });

View File

@ -127,6 +127,25 @@
></template ></template
> >
</FormSection> </FormSection>
<FormSection>
<template #label
><Mfm :text="`$[x2 $[jelly ❤] ${i18n.ts._aboutMisskey.sponsors}]`" />
</template
>
<MkSparkle>
<span
v-for="sponsor in sponsors"
:key="sponsor"
style="
margin-bottom: 0.5rem;
margin-right: 0.5rem;
font-size: 1.7rem;
"
>
<Mfm :text="`${sponsor}`" />
</span>
</MkSparkle>
</FormSection>
<FormSection> <FormSection>
<template #label <template #label
><Mfm text="$[jelly ❤]" /> ><Mfm text="$[jelly ❤]" />
@ -147,9 +166,7 @@
<Mfm :text="`${patron}`" /> <Mfm :text="`${patron}`" />
</span> </span>
</MkSparkle> </MkSparkle>
<template #caption>{{ <p>{{ i18n.ts._aboutMisskey.morePatrons }}</p>
i18n.ts._aboutMisskey.morePatrons
}}</template>
</FormSection> </FormSection>
</div> </div>
</MkSpacer> </MkSpacer>
@ -172,11 +189,13 @@ import * as os from "@/os";
import { definePageMetadata } from "@/scripts/page-metadata"; import { definePageMetadata } from "@/scripts/page-metadata";
let patrons = []; let patrons = [];
try { let sponsors = [];
patrons = await os.api("patrons", { forceUpdate: true }); const patronsResp = await os.api("patrons", { forceUpdate: true });
} catch { patrons = patronsResp.patrons;
console.error("Codeberg's down."); sponsors = patronsResp.sponsors;
}
patrons = patrons.filter((patron) => !sponsors.includes(patron));
let easterEggReady = false; let easterEggReady = false;
let easterEggEmojis = $ref([]); let easterEggEmojis = $ref([]);

View File

@ -461,11 +461,8 @@ const timeForThem = $computed(() => {
}); });
let patrons = []; let patrons = [];
try { const patronsResp = await os.api("patrons");
patrons = await os.api("patrons"); patrons = patronsResp.patrons;
} catch {
console.error("Codeberg's down.");
}
function parallaxLoop() { function parallaxLoop() {
parallaxAnimationId = window.requestAnimationFrame(parallaxLoop); parallaxAnimationId = window.requestAnimationFrame(parallaxLoop);

View File

@ -94,7 +94,14 @@
"@Space6host@calckey.social", "@Space6host@calckey.social",
"@zakalwe@plasmatrap.com", "@zakalwe@plasmatrap.com",
"@seasicksailor@calckey.social", "@seasicksailor@calckey.social",
"@Hunkabilly@calckey.world", "@geerue@calckey.social",
"@WXFanatic@m.ai6yr.org",
"@Hunkabilly@calckey.world"
],
"sponsors": [
"@atomicpoet@calckey.social",
"@unattributed@calckey.social",
"@jtbennett@noc.social",
"\nInterkosmos Link" "\nInterkosmos Link"
] ]
} }