generated from nhcarrigan/template
feat: move from discord to web forms
This commit is contained in:
@ -16,27 +16,48 @@ export const generateHtml = (app: App): string => {
|
||||
const sanctions = app.sanctions.toSorted((a, b) => {
|
||||
return b.number - a.number;
|
||||
});
|
||||
|
||||
const sanctionHtml = sanctions.map((sanction) => {
|
||||
return sanction.revoked
|
||||
&& sanction.revokedBy !== null
|
||||
&& sanction.revokeDate !== null
|
||||
&& sanction.revokeReason !== null
|
||||
? `<div class="sanction revoked">
|
||||
<details>
|
||||
<summary>${actionIcons.revoked ?? ""} #${sanction.number.toString()}: ${sanction.action} - REVOKED ${platformIcons[sanction.platform.toLowerCase()] ?? "<i class=\"fa-solid fa-question\"></i>"}</summary>
|
||||
<summary>${
|
||||
actionIcons.revoked ?? ""
|
||||
} #${sanction.number.toString()}: ${sanction.action} - REVOKED ${
|
||||
platformIcons[sanction.platform.toLowerCase()]
|
||||
?? "<i class=\"fa-solid fa-question\"></i>"
|
||||
}</summary>
|
||||
<p class="user">${sanction.uuid}</p>
|
||||
<p>${sanction.reason}</p>
|
||||
<p>Performed by: ${sanction.moderator} on ${sanction.date.toLocaleString("en-GB")}</p>
|
||||
<p class="user">Revoked:</p>
|
||||
<p>${sanction.revokeReason ?? "Undocumented."}</p>
|
||||
<p>${sanction.revokeReason}</p>
|
||||
<p>Revoked by: ${
|
||||
sanction.revokedBy
|
||||
} on ${sanction.revokeDate.toLocaleString("en-GB")}</p>
|
||||
</details>
|
||||
</div>
|
||||
`
|
||||
: `<div class="sanction ${sanction.action.toLowerCase()}">
|
||||
<details>
|
||||
<summary>${actionIcons[sanction.action.toLowerCase()] ?? ""} #${sanction.number.toString()}: ${sanction.action} ${platformIcons[sanction.platform.toLowerCase()] ?? "<i class=\"fa-solid fa-question\"></i>"}</summary>
|
||||
<summary>${
|
||||
actionIcons[sanction.action.toLowerCase()] ?? ""
|
||||
} #${sanction.number.toString()}: ${sanction.action} ${
|
||||
platformIcons[sanction.platform.toLowerCase()]
|
||||
?? "<i class=\"fa-solid fa-question\"></i>"
|
||||
}</summary>
|
||||
<p class="user">${sanction.uuid}</p>
|
||||
<p>${sanction.reason}</p>
|
||||
<p>Performed by: ${sanction.moderator} on ${sanction.date.toLocaleString("en-GB")}</p>
|
||||
</details>
|
||||
</div>
|
||||
`;
|
||||
});
|
||||
const html = landingHtml.replace("{{ logs }}", sanctionHtml.join("\n"));
|
||||
const html = landingHtml.
|
||||
replace("{{ logs }}", sanctionHtml.join("\n")).
|
||||
replace("{{ timestamp }}", app.cacheUpdated.toLocaleString("en-GB"));
|
||||
return html;
|
||||
};
|
||||
|
Reference in New Issue
Block a user