Skip to content

Commit

Permalink
feature(website): add reporting page (#656)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkue authored Nov 28, 2023
1 parent 43dca26 commit 4175abc
Show file tree
Hide file tree
Showing 7 changed files with 179 additions and 6 deletions.
1 change: 1 addition & 0 deletions shared/locales/de/website-common.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"privacy-policy": "Datenschutzrichtlinie",
"recipient-selection": "Selektion der Empfänger:innen",
"recipients": "Empfänger:innen",
"reporting": "Dokumente",
"team": "Team",
"terms-and-conditions": "Teilnahmebedingungen",
"terms-of-use": "Nutzungsbedingungen",
Expand Down
57 changes: 57 additions & 0 deletions shared/locales/de/website-reporting.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"title": "Dokumente",
"table-columns": {
"title": "Dokument",
"language": "Sprache",
"href": "Link"
},
"table-caption": "Neue Berichte werden kontinuierlich hinzugefügt.",
"download-pdf": "PDF",
"reports": [
{
"title": "Finanzbericht 2022",
"href": "https://drive.google.com/file/d/13OJlzxznbsRhE3ywYHOF3ggh7e89zZtn/view",
"language": "Englisch"
},
{
"title": "Finanzbericht 2022",
"href": "https://drive.google.com/file/d/1ivgdOqI3WkJ5ymSuDMNS0BP3SffVxCKk/view",
"language": "Deutsch"
},
{
"title": "Jahresbericht 2021",
"href": "https://drive.google.com/file/d/1WmuWDMvbngCY73scZM5_qD3BpIambigG/view",
"language": "Englisch/Deutsch"
},
{
"title": "Finanzbericht 2021",
"href": "https://drive.google.com/file/d/1WdTi_NWhpGX7nHQh1Duu9W-klmGQT1Ik/view",
"language": "Englisch"
},
{
"title": "Finanzbericht 2021",
"href": "https://drive.google.com/file/d/1WfUPKVuEcCICqNn4PR_dPU1Rg2ji1q6W/view",
"language": "Deutsch"
},
{
"title": "Prüfbericht 2021",
"href": "https://drive.google.com/file/d/16b-w5B2PhkRBZbBQOTmBXfxTGrDvf2FE/view",
"language": "Deutsch"
},
{
"title": "Jahresbericht 2020",
"href": "https://drive.google.com/file/d/15_v8B7eLJxDJVNfoYWABwKNcfHbz1U_o/view",
"language": "Englisch/Deutsch"
},
{
"title": "Prüfbericht 2020",
"href": "https://drive.google.com/file/d/15aaPhuCCTicG74lNeg6OA9vEsq4nkE0o/view",
"language": "Deutsch"
},
{
"title": "Bestätigung Steuerbefreiung",
"href": "https://drive.google.com/file/d/1-YAtyYjUL_LqMKyG0IN41Cohr58EAy7S/view",
"language": "Deutsch"
}
]
}
1 change: 1 addition & 0 deletions shared/locales/en/website-common.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"privacy-policy": "Privacy Policy",
"recipient-selection": "Recipient Selection",
"recipients": "Recipients",
"reporting": "Reporting",
"team": "Team",
"terms-and-conditions": "Terms and Conditions",
"terms-of-use": "Terms of Use",
Expand Down
57 changes: 57 additions & 0 deletions shared/locales/en/website-reporting.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"title": "Reporting",
"table-columns": {
"title": "Document",
"language": "Language",
"href": "Link"
},
"table-caption": "New reports are continuously added.",
"download-pdf": "PDF",
"reports": [
{
"title": "Financial Statement 2022",
"href": "https://drive.google.com/file/d/13OJlzxznbsRhE3ywYHOF3ggh7e89zZtn/view",
"language": "English"
},
{
"title": "Financial Statement 2022",
"href": "https://drive.google.com/file/d/1ivgdOqI3WkJ5ymSuDMNS0BP3SffVxCKk/view",
"language": "German"
},
{
"title": "Annual Report 2021",
"href": "https://drive.google.com/file/d/1WmuWDMvbngCY73scZM5_qD3BpIambigG/view",
"language": "English/German"
},
{
"title": "Financial Statement 2021",
"href": "https://drive.google.com/file/d/1WdTi_NWhpGX7nHQh1Duu9W-klmGQT1Ik/view",
"language": "English"
},
{
"title": "Financial Statement 2021",
"href": "https://drive.google.com/file/d/1WfUPKVuEcCICqNn4PR_dPU1Rg2ji1q6W/view",
"language": "German"
},
{
"title": "Audit Report 2021",
"href": "https://drive.google.com/file/d/16b-w5B2PhkRBZbBQOTmBXfxTGrDvf2FE/view",
"language": "German"
},
{
"title": "Annual Report 2020",
"href": "https://drive.google.com/file/d/15_v8B7eLJxDJVNfoYWABwKNcfHbz1U_o/view",
"language": "English/German"
},
{
"title": "Audit Report 2020",
"href": "https://drive.google.com/file/d/15aaPhuCCTicG74lNeg6OA9vEsq4nkE0o/view",
"language": "German"
},
{
"title": "Confirmation Tax Exemption",
"href": "https://drive.google.com/file/d/1-YAtyYjUL_LqMKyG0IN41Cohr58EAy7S/view",
"language": "German"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import { DefaultPageProps } from '@/app/[lang]/[region]';
import { getMetadata } from '@/metadata';
import { Translator } from '@socialincome/shared/src/utils/i18n';
import {
BaseContainer,
Table,
TableBody,
TableCaption,
TableCell,
TableHead,
TableHeader,
TableRow,
Typography,
} from '@socialincome/ui';
import Link from 'next/link';

export async function generateMetadata({ params }: DefaultPageProps) {
return getMetadata(params.lang, 'website-reporting');
}

export default async function Page({ params }: DefaultPageProps) {
const translator = await Translator.getInstance({
language: params.lang,
namespaces: ['website-reporting'],
});

return (
<BaseContainer className="mx-auto flex max-w-2xl flex-col space-y-12 pb-16">
<Typography size="4xl" weight="bold">
{translator.t('title')}
</Typography>
<Table>
<TableCaption>{translator.t('table-caption')}</TableCaption>
<TableHeader>
<TableRow>
<TableHead>{translator.t('table-columns.title')}</TableHead>
<TableHead>{translator.t('table-columns.language')}</TableHead>
<TableHead className="text-right">{translator.t('table-columns.href')}</TableHead>
</TableRow>
</TableHeader>

<TableBody>
{translator.t<{ title: string; href: string; language: string }[]>('reports').map((report, index) => (
<TableRow key={index}>
<TableCell className="font-medium">{report.title}</TableCell>
<TableCell>{report.language}</TableCell>
<TableCell className="text-right">
<Link href={report.href} target="_blank" className="text-primary underline">
{translator.t('download-pdf')}
</Link>
</TableCell>
</TableRow>
))}
</TableBody>
</Table>
</BaseContainer>
);
}
3 changes: 1 addition & 2 deletions website/src/components/navbar/navbar-client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ type NavigationSection = {
href?: string;
links?: {
title: string;
description?: string;
href: string;
}[];
};
Expand Down Expand Up @@ -179,7 +178,7 @@ export function NavbarClient({
{navigation.map((section, index) => (
<div key={index}>
{_.isEmpty(section.links) && section.href ? (
// Entire section is a link with hover effect
// This section is a link with hover effect
<Link
href={section.href}
className="hover:bg-accent flex flex-1 items-center justify-between px-5 py-4 text-lg font-medium md:px-0"
Expand Down
8 changes: 4 additions & 4 deletions website/src/components/navbar/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,22 @@ export default async function Navbar({ lang, region, showNavigation = true }: Na
{
title: translator.t('navigation.finances'),
href: `/${lang}/${region}/transparency/finances`,
description: translator.t('navigation.finances-description'),
},
{
title: translator.t('navigation.recipient-selection'),
href: `/${lang}/${region}/transparency/recipient-selection`,
description: translator.t('navigation.recipient-selection-description'),
},
{
title: translator.t('navigation.faq'),
href: `/${lang}/${region}/faq`,
description: translator.t('navigation.faq-description'),
},
{
title: translator.t('navigation.evidence'),
href: `/${lang}/${region}/transparency/evidence`,
description: translator.t('navigation.evidence-description'),
},
{
title: translator.t('navigation.reporting'),
href: `/${lang}/${region}/transparency/reporting`,
},
],
},
Expand Down

0 comments on commit 4175abc

Please sign in to comment.