diff --git a/public/locales/bg/open-data.json b/public/locales/bg/open-data.json new file mode 100644 index 000000000..3860cf300 --- /dev/null +++ b/public/locales/bg/open-data.json @@ -0,0 +1,16 @@ +{ + "swagger-text": "За да осигури пълна прозрачност на дейноста си, освен отворен код, Подкрепи.бг предоставя също и отворени данни. Целта е всеки при интерес да може да достъпи анонимизирани данни, показващи движенията на даренията и сумите по сметките, свързани с кампаниите. За да достъпите тези данни, можете да използвате UI като потребител или директно през публичните методи на API. Описанието на API поддържаме чрез Swagger на този адрес:", + "ethical-use": "За етичното използване на отворените данни сме избрали да използваме лиценз", + "rights": ", според който имате право да:", + "share": "Споделяте - да копирате и повторно да разпространявате материала на всякакъв носител или във всякакъв формат.", + "adapt": "Адаптирате - да преработвате, преобразувате и доразвивате материала.", + "note": "Забележка: Ако спазвате условията на лиценза, лицензодателят не може да отмени тези свободи.", + "terms": "При следните условия:", + "acknowledgment": "Признание - Вие сте длъжни да посочите като автор на данните Подкрепи.бг, да дадете електронна препратка към лиценза и да укажете дали сте внесли промени. Можете да направите това по всеки разумен начин, но не по начин, който предполага, че лицензодателят одобрява Вас или използването от Ваша страна на материала.", + "non-commercial-use": "Некомерсиално ползване - Вие нямате право да използвате данните за", + "commercial-purposes": "търговски цели", + "money-gathering": "в смисъла на събирането на пари за данните във вид на файл или за достъп до тях.", + "additional-restrictions": "Без допълнителни ограничения - Вие нямате право да прилагате правни условия или", + "technological-measures": "технологични мерки", + "legal-restrictions": ", които създават правни ограничения за други лица да извършват разрешеното от лиценза." +} diff --git a/public/locales/en/open-data.json b/public/locales/en/open-data.json new file mode 100644 index 000000000..86192d093 --- /dev/null +++ b/public/locales/en/open-data.json @@ -0,0 +1,16 @@ +{ + "swagger-text": "To ensure full transparency of operations, in addition to the open source code, Podkrepi.bg provides also open data. The motivation is for everyone who is interested to be able to access anonymized data for the transactions of donations and amounts between the accounts related to the campaigns. To access the data you can use the UI as regular user or directly through the public methods of the API. The API description is supported using Swagger on the following url:", + "ethical-use": "For the ethical use of our open data we chose to use", + "rights": " according to which you are free to:", + "share": "Share - copy and redistribute the material in any medium or format.", + "adapt": "Adapt - rework, transform and further develop the material.", + "note": "Note: The licensor cannot revoke these freedoms as long as you follow the license terms.", + "terms": "Under the following conditions:", + "acknowledgment": "Acknowledgment - You must give appropriate credit and mention Podkrepi.bg as data owner, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.", + "non-commercial-use": "Non-commercial use - You have no right to use the data for", + "commercial-purposes": "commercial purposes", + "money-gathering": "in the sense of charging money for the data in file form or for access to it.", + "additional-restrictions": "No additional restrictions - You have no right to apply legal terms or", + "technological-measures": "technological measures", + "legal-restrictions": "which create legal restrictions on others doing what the license allows." +} diff --git a/src/common/routes.ts b/src/common/routes.ts index 8889c09d1..0b4e1f4cf 100644 --- a/src/common/routes.ts +++ b/src/common/routes.ts @@ -15,6 +15,11 @@ export const staticUrls = { github: 'https://github.com/podkrepi-bg/frontend#--%D0%B4%D0%B0%D1%80%D0%B8%D1%82%D0%B5%D0%BB%D1%81%D0%BA%D0%B0-%D0%BF%D0%BB%D0%B0%D1%82%D1%84%D0%BE%D1%80%D0%BC%D0%B0-%D0%BF%D0%BE%D0%B4%D0%BA%D1%80%D0%B5%D0%BF%D0%B8%D0%B1%D0%B3', figma: 'https://www.figma.com/file/MmvFKzUv6yE5U2wrOpWtwS/Podkrepi.bg?node-id=3904%3A13406', + swagger: 'https://podkrepi.bg/swagger', + licenses: 'https://creativecommons.org/licenses/by-nc/4.0/', + commercialPurposes: 'https://creativecommons.org/licenses/by-nc/4.0/#commercial_purposes', + technologicalMeasures: + 'https://creativecommons.org/licenses/by-nc-sa/4.0/#technological_measures', projectDocs: 'https://docs.podkrepi.bg/', howToContribute: 'https://docs.podkrepi.bg/general/communication/faq#kak-da-se-vkliucha-v-organizaciata', diff --git a/src/components/client/layout/nav/DevelopmentMenu.tsx b/src/components/client/layout/nav/DevelopmentMenu.tsx index 82dc124df..a84a5590a 100644 --- a/src/components/client/layout/nav/DevelopmentMenu.tsx +++ b/src/components/client/layout/nav/DevelopmentMenu.tsx @@ -55,11 +55,6 @@ const allNavItems: NavItem[] = [ label: 'nav.dev.open-source', target: '_blank', }, - // { - // href: routes.dev.openData, - // label: 'nav.dev.open-data', - // target: '_blank', - // }, ] export const navItems = allNavItems.filter((el) => typeof el.enabled === 'undefined' ?? el.enabled) diff --git a/src/components/client/layout/nav/ProjectMenu.tsx b/src/components/client/layout/nav/ProjectMenu.tsx index 9e1d7c950..6ebc19a28 100644 --- a/src/components/client/layout/nav/ProjectMenu.tsx +++ b/src/components/client/layout/nav/ProjectMenu.tsx @@ -66,6 +66,10 @@ const allNavItems: NavItem[] = [ href: routes.reports, label: 'nav.about.reports', }, + { + href: routes.dev.openData, + label: 'nav.dev.open-data', + }, { href: routes.contact, label: 'nav.about.contacts', diff --git a/src/components/client/open-data/OpenDataPage.styled.tsx b/src/components/client/open-data/OpenDataPage.styled.tsx new file mode 100644 index 000000000..e4d6ce538 --- /dev/null +++ b/src/components/client/open-data/OpenDataPage.styled.tsx @@ -0,0 +1,17 @@ +import { Typography } from '@mui/material' +import { styled } from '@mui/material/styles' + +import theme from 'common/theme' + +export const Text = styled(Typography)(() => ({ + margin: theme.spacing(3, 0), +})) + +export const UnorderedList = styled('ul')(() => ({ + listStyleType: 'disc', + margin: theme.spacing(0, 5), +})) + +export const ListItem = styled('li')(() => ({ + margin: theme.spacing(1, 0), +})) diff --git a/src/components/client/open-data/OpenDataPage.tsx b/src/components/client/open-data/OpenDataPage.tsx new file mode 100644 index 000000000..12a71e4fe --- /dev/null +++ b/src/components/client/open-data/OpenDataPage.tsx @@ -0,0 +1,49 @@ +import React from 'react' + +import { useTranslation } from 'next-i18next' + +import Layout from 'components/client/layout/Layout' +import ExternalLink from 'components/common/ExternalLink' +import { staticUrls } from 'common/routes' + +import { ListItem, Text, UnorderedList } from './OpenDataPage.styled' + +export default function OpenDataPage() { + const { t } = useTranslation() + + return ( + + + {t('open-data:swagger-text')} + https://podkrepi.bg/swagger + + + {t('open-data:ethical-use')} + Creative Commons CC BY-NC 4.0 + {t('open-data:rights')} + + + {t('open-data:share')} + {t('open-data:adapt')} + {t('open-data:note')} + {t('open-data:terms')} + {t('open-data:acknowledgment')} + + {t('open-data:non-commercial-use')} + + {' '} + {t('open-data:commercial-purposes')} + {' '} + {t('open-data:money-gathering')} + + + {t('open-data:additional-restrictions')}{' '} + + {t('open-data:technological-measures')} + {' '} + {t('open-data:legal-restrictions')} + + + + ) +} diff --git a/src/pages/open-data/index.tsx b/src/pages/open-data/index.tsx new file mode 100644 index 000000000..05f69c071 --- /dev/null +++ b/src/pages/open-data/index.tsx @@ -0,0 +1,12 @@ +import { GetStaticProps } from 'next' +import { serverSideTranslations } from 'next-i18next/serverSideTranslations' + +import OpenDataPage from '../../components/client/open-data/OpenDataPage' + +export const getStaticProps: GetStaticProps = async ({ locale }) => ({ + props: { + ...(await serverSideTranslations(locale ?? 'bg', ['common', 'open-data'])), + }, +}) + +export default OpenDataPage