From 2df60d63877ba180739b699a2b059bf2414d8870 Mon Sep 17 00:00:00 2001 From: Misode Date: Sat, 27 Jan 2024 18:32:11 +0100 Subject: [PATCH] Add download stat on organization pages (#1581) * Add download stat to organization page * Fix plural in projects stat --- pages/organization/[id].vue | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/pages/organization/[id].vue b/pages/organization/[id].vue index 61f933d9..3a854b52 100644 --- a/pages/organization/[id].vue +++ b/pages/organization/[id].vue @@ -86,13 +86,23 @@ -
+
+ +
+
@@ -224,12 +234,15 @@ import UpToDate from '~/assets/images/illustrations/up_to_date.svg' import ProjectCard from '~/components/ui/ProjectCard.vue' import OrganizationIcon from '~/assets/images/utils/organization.svg' +import DownloadIcon from '~/assets/images/utils/download.svg' import CrownIcon from '~/assets/images/utils/crown.svg' import { acceptTeamInvite, removeTeamMember } from '~/helpers/teams.js' const vintl = useVIntl() const { formatMessage } = vintl +const formatCompactNumber = useCompactNumber() + const auth = await useAuth() const user = await useUser() const cosmetics = useCosmetics() @@ -326,6 +339,15 @@ const projectTypes = computed(() => { return Object.keys(obj) }) +const sumDownloads = computed(() => { + let sum = 0 + + for (const project of projects.value) { + sum += project.downloads + } + + return sum +}) const patchIcon = async (icon) => { const ext = icon.name.split('.').pop()