From b263703172f009f2ce363bfb886e635cf6caf922 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20FAMIBELLE-PRONZOLA?= Date: Sun, 14 Apr 2024 07:02:02 +0400 Subject: [PATCH 1/6] Add Creative Commons data and conditions --- components/cc/conditions.json | 18 +++++++++++ components/cc/data.json | 60 +++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 components/cc/conditions.json create mode 100644 components/cc/data.json diff --git a/components/cc/conditions.json b/components/cc/conditions.json new file mode 100644 index 0000000..b0ec0eb --- /dev/null +++ b/components/cc/conditions.json @@ -0,0 +1,18 @@ +{ + "by": { + "name": "Attribution", + "description": "Vous devez créditer l'Œuvre, intégrer un lien vers la licence et indiquer si des modifications ont été effectuées à l'Oeuvre. Vous devez indiquer ces informations par tous les moyens raisonnables, sans toutefois suggérer que l'Offrant vous soutient ou soutient la façon dont vous avez utilisé son Oeuvre." + }, + "sa": { + "name": "Partage dans les Mêmes Conditions", + "description": "Dans le cas où vous effectuez un remix, que vous transformez, ou créez à partir du matériel composant l'Oeuvre originale, vous devez diffuser l'Oeuvre modifiée dans les même conditions, c'est à dire avec la même licence avec laquelle l'Oeuvre originale a été diffusée." + }, + "nc": { + "name": "Pas d’Utilisation Commerciale", + "description": "Vous n'êtes pas autorisé à faire un usage commercial de cette Oeuvre, tout ou partie du matériel la composant." + }, + "nd": { + "name": "Pas de modifications", + "description": "Dans le cas où vous effectuez un remix, que vous transformez, ou créez à partir du matériel composant l'Oeuvre originale, vous n'êtes pas autorisé à distribuer ou mettre à disposition l'Oeuvre modifiée." + } +} diff --git a/components/cc/data.json b/components/cc/data.json new file mode 100644 index 0000000..0c97aab --- /dev/null +++ b/components/cc/data.json @@ -0,0 +1,60 @@ +[ + { + "license": "by", + "title": "CC BY 4.0", + "subtitle": "Attribution 4.0 International", + "allowed": { + "Partager": "copier, distribuer et communiquer le matériel par tous moyens et sous tous formats pour toute utilisation, y compris commerciale.", + "Adapter": "remixer, transformer et créer à partir du matériel pour toute utilisation, y compris commerciale." + }, + "link": "https://creativecommons.org/licenses/by/4.0/deed.fr" + }, + { + "license": "by-sa", + "title": "CC BY-SA 4.0", + "subtitle": "Attribution - Partage dans les Mêmes Conditions 4.0 International ", + "allowed": { + "Partager": "copier, distribuer et communiquer le matériel par tous moyens et sous tous formats pour toute utilisation, y compris commerciale.", + "Adapter": "remixer, transformer et créer à partir du matériel pour toute utilisation, y compris commerciale." + }, + "link": "https://creativecommons.org/licenses/by-sa/4.0/deed.fr" + }, + { + "license": "by-nc", + "title": "Attribution - Pas d’Utilisation Commerciale (CC BY-NC)", + "subtitle": "Attribution - Partage dans les Mêmes Conditions 4.0 International", + "allowed": { + "Partager": "copier, distribuer et communiquer le matériel par tous moyens et sous tous formats", + "Adapter": "remixer, transformer et créer à partir du matériel" + }, + "link": "https://creativecommons.org/licenses/by-nc/4.0/deed.fr" + }, + { + "license": "by-nc-sa", + "title": "CC BY-NC-SA 4.0", + "subtitle": "Attribution - Pas d’Utilisation Commerciale - Partage dans les Mêmes Conditions 4.0 International", + "allowed": { + "Partager": "copier, distribuer et communiquer le matériel par tous moyens et sous tous formats", + "Adapter": "remixer, transformer et créer à partir du matériel" + }, + "link": "https://creativecommons.org/licenses/by-nc-sa/4.0/deed.fr" + }, + { + "license": "by-nd", + "title": "CC BY-ND 4.0", + "subtitle": "Attribution - Pas de Modification 4.0 International", + "allowed": { + "Partager": "copier, distribuer et communiquer le matériel par tous moyens et sous tous formats pour toute utilisation, y compris commerciale." + }, + "link": "https://creativecommons.org/licenses/by-nd/4.0/deed.fr" + }, + { + "license": "by-nc-nd", + "title": "CC BY-NC-ND 4.0", + "subtitle": "Attribution - Pas d’Utilisation Commerciale - Pas de Modification 4.0 International", + "allowed": { + "Partager": "copier, distribuer et communiquer le matériel par tous moyens et sous tous formats pour toute utilisation, y compris commerciale." + }, + "link": "https://creativecommons.org/licenses/by-nc-nd/4.0/deed.fr" + } +] From aca216c1361e758bade005dcb946728e827f8ff4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20FAMIBELLE-PRONZOLA?= Date: Sun, 14 Apr 2024 07:02:42 +0400 Subject: [PATCH 2/6] Add Creative Commons images --- public/images/cc/by-nc-nd.svg | 243 +++++++++++++++++++++++++ public/images/cc/by-nc-sa.svg | 202 ++++++++++++++++++++ public/images/cc/by-nc.svg | 190 +++++++++++++++++++ public/images/cc/by-nd.svg | 203 +++++++++++++++++++++ public/images/cc/by-sa.svg | 199 ++++++++++++++++++++ public/images/cc/by.svg | 155 ++++++++++++++++ public/images/cc/icons/Adapter.svg | 20 ++ public/images/cc/icons/Partager.svg | 22 +++ public/images/cc/icons/by.svg | 20 ++ public/images/cc/icons/cc.svg | 27 +++ public/images/cc/icons/ccheart_red.svg | 21 +++ public/images/cc/icons/nc.svg | 23 +++ public/images/cc/icons/nd.svg | 20 ++ public/images/cc/icons/sa.svg | 22 +++ 14 files changed, 1367 insertions(+) create mode 100644 public/images/cc/by-nc-nd.svg create mode 100644 public/images/cc/by-nc-sa.svg create mode 100644 public/images/cc/by-nc.svg create mode 100644 public/images/cc/by-nd.svg create mode 100644 public/images/cc/by-sa.svg create mode 100644 public/images/cc/by.svg create mode 100644 public/images/cc/icons/Adapter.svg create mode 100644 public/images/cc/icons/Partager.svg create mode 100644 public/images/cc/icons/by.svg create mode 100644 public/images/cc/icons/cc.svg create mode 100644 public/images/cc/icons/ccheart_red.svg create mode 100644 public/images/cc/icons/nc.svg create mode 100644 public/images/cc/icons/nd.svg create mode 100644 public/images/cc/icons/sa.svg diff --git a/public/images/cc/by-nc-nd.svg b/public/images/cc/by-nc-nd.svg new file mode 100644 index 0000000..37a32df --- /dev/null +++ b/public/images/cc/by-nc-nd.svg @@ -0,0 +1,243 @@ + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/images/cc/by-nc-sa.svg b/public/images/cc/by-nc-sa.svg new file mode 100644 index 0000000..514c251 --- /dev/null +++ b/public/images/cc/by-nc-sa.svg @@ -0,0 +1,202 @@ + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/images/cc/by-nc.svg b/public/images/cc/by-nc.svg new file mode 100644 index 0000000..597a622 --- /dev/null +++ b/public/images/cc/by-nc.svg @@ -0,0 +1,190 @@ + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/images/cc/by-nd.svg b/public/images/cc/by-nd.svg new file mode 100644 index 0000000..6efd00d --- /dev/null +++ b/public/images/cc/by-nd.svg @@ -0,0 +1,203 @@ + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/images/cc/by-sa.svg b/public/images/cc/by-sa.svg new file mode 100644 index 0000000..f850297 --- /dev/null +++ b/public/images/cc/by-sa.svg @@ -0,0 +1,199 @@ + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/images/cc/by.svg b/public/images/cc/by.svg new file mode 100644 index 0000000..e44c25f --- /dev/null +++ b/public/images/cc/by.svg @@ -0,0 +1,155 @@ + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/images/cc/icons/Adapter.svg b/public/images/cc/icons/Adapter.svg new file mode 100644 index 0000000..778c048 --- /dev/null +++ b/public/images/cc/icons/Adapter.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + diff --git a/public/images/cc/icons/Partager.svg b/public/images/cc/icons/Partager.svg new file mode 100644 index 0000000..8375c34 --- /dev/null +++ b/public/images/cc/icons/Partager.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + diff --git a/public/images/cc/icons/by.svg b/public/images/cc/icons/by.svg new file mode 100644 index 0000000..34099a3 --- /dev/null +++ b/public/images/cc/icons/by.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + diff --git a/public/images/cc/icons/cc.svg b/public/images/cc/icons/cc.svg new file mode 100644 index 0000000..cb08896 --- /dev/null +++ b/public/images/cc/icons/cc.svg @@ -0,0 +1,27 @@ + + + + + + + + + diff --git a/public/images/cc/icons/ccheart_red.svg b/public/images/cc/icons/ccheart_red.svg new file mode 100644 index 0000000..6b1000e --- /dev/null +++ b/public/images/cc/icons/ccheart_red.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + diff --git a/public/images/cc/icons/nc.svg b/public/images/cc/icons/nc.svg new file mode 100644 index 0000000..fcf2f4b --- /dev/null +++ b/public/images/cc/icons/nc.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + diff --git a/public/images/cc/icons/nd.svg b/public/images/cc/icons/nd.svg new file mode 100644 index 0000000..9ec0da5 --- /dev/null +++ b/public/images/cc/icons/nd.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + diff --git a/public/images/cc/icons/sa.svg b/public/images/cc/icons/sa.svg new file mode 100644 index 0000000..8d5ffde --- /dev/null +++ b/public/images/cc/icons/sa.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + From ba6021400b332c61e3c94b1fe094a5badb5075be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20FAMIBELLE-PRONZOLA?= Date: Sun, 14 Apr 2024 07:05:56 +0400 Subject: [PATCH 3/6] Create LicensesInfos component --- components/cc/licenses-infos.js | 96 +++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 components/cc/licenses-infos.js diff --git a/components/cc/licenses-infos.js b/components/cc/licenses-infos.js new file mode 100644 index 0000000..c861a79 --- /dev/null +++ b/components/cc/licenses-infos.js @@ -0,0 +1,96 @@ +/* eslint-disable import/extensions */ + +import Image from 'next/image' +import PropTypes from 'prop-types' +import Typography from '@mui/material/Typography' +import Box from '@mui/material/Box' +import List from '@mui/material/List' +import ListItem from '@mui/material/ListItem' +import ListItemText from '@mui/material/ListItemText' +import Button from '@mui/material/Button' +import Link from '@mui/material/Link' +import OpenInNewIcon from '@mui/icons-material/OpenInNew' + +import licencesData from './data.json' +import licensesConditions from './conditions.json' + +export default function LicensesInfo({license}) { + const licenseInfo = licencesData.find(item => item.license === license) + const licenseList = licenseInfo.license.split('-') + + const conditions = licenseList.map(license => licensesConditions[license]) + + return ( + + + + {license} + + {licenseList.map(license => ( + + {license} + + ))} + + {licenseInfo.title} + {licenseInfo.subtitle} + Vous êtes autorisé à : + + {Object.entries(licenseInfo.allowed).map(([action, description]) => ( + + + {action} + + {action}} + secondary={{description}} + /> + + ))} + + Conditions : + + {conditions.map(({name, description}, index) => ( + + + {licenseList[index]} + + {name}} + secondary={{description}} + /> + + ))} + + + + + + ) +} + +LicensesInfo.propTypes = { + license: PropTypes.string.isRequired +} From ea70d6b0d04c565316a3c61d9a881302d2b52938 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20FAMIBELLE-PRONZOLA?= Date: Sun, 14 Apr 2024 07:06:31 +0400 Subject: [PATCH 4/6] Create LicenseModal component --- components/cc/license-modal.js | 70 ++++++++++++++++++++++++++++++++++ components/teks/teks.js | 1 + 2 files changed, 71 insertions(+) create mode 100644 components/cc/license-modal.js diff --git a/components/cc/license-modal.js b/components/cc/license-modal.js new file mode 100644 index 0000000..6e6aacf --- /dev/null +++ b/components/cc/license-modal.js @@ -0,0 +1,70 @@ +import {useState} from 'react' +import PropTypes from 'prop-types' +import Image from 'next/image' +import Button from '@mui/material/Button' +import Dialog from '@mui/material/Dialog' +import Typography from '@mui/material/Typography' +import Box from '@mui/material/Box' +import DialogActions from '@mui/material/DialogActions' +import DialogContent from '@mui/material/DialogContent' +import DialogTitle from '@mui/material/DialogTitle' +import useMediaQuery from '@mui/material/useMediaQuery' +import {useTheme} from '@mui/material/styles' +import LicensesInfo from './licenses-infos' + +export default function LicenseModal({license}) { + const [open, setOpen] = useState(false) + const theme = useTheme() + const fullScreen = useMediaQuery(theme.breakpoints.down('md')) + + const handleClickOpen = () => { + setOpen(true) + } + + const handleClose = () => { + setOpen(false) + } + + return ( + <> + + + + + {license} + Creative Commons + + + + + + + + + + + ) +} + +LicenseModal.propTypes = { + license: PropTypes.string.isRequired +} diff --git a/components/teks/teks.js b/components/teks/teks.js index 1d9e755..e7b4d01 100644 --- a/components/teks/teks.js +++ b/components/teks/teks.js @@ -15,6 +15,7 @@ import ExplicitIcon from '@mui/icons-material/Explicit' import {formatJsonString, getAlias} from '../../lib/utils/format' +import LicenseModal from '../cc/license-modal' import EntegreMizik from './entegre-mizik' import OkiMizik from './oki-mizik' import DiferansDialog from './diferans-dialog' From dcd6e98b056d20f1903b790b714d3c7c050c223e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20FAMIBELLE-PRONZOLA?= Date: Sun, 14 Apr 2024 07:07:49 +0400 Subject: [PATCH 5/6] Add ccheart_red icon --- components/awtis/mizik-lyen.js | 14 ++++++++++++++ components/teks/teks-kat.js | 13 +++++++++++++ 2 files changed, 27 insertions(+) diff --git a/components/awtis/mizik-lyen.js b/components/awtis/mizik-lyen.js index 02bef3d..6356e0e 100644 --- a/components/awtis/mizik-lyen.js +++ b/components/awtis/mizik-lyen.js @@ -1,6 +1,8 @@ import PropTypes from 'prop-types' import Link from 'next/link' +import Image from 'next/image' import ListItemButton from '@mui/material/ListItemButton' +import Box from '@mui/material/Box' import ListItemText from '@mui/material/ListItemText' import Typography from '@mui/material/Typography' import ListItemAvatar from '@mui/material/ListItemAvatar' @@ -34,6 +36,18 @@ export default function MizikLyen({niAwtis, anPawol, kuveti, slug, meteEsMobilOu primary={{anPawol.attributes.titre}} secondary={niAwtis ? getAlias(anPawol.attributes.artistes, anPawol.attributes.prioriteArtistes) : null} /> + {anPawol.attributes.creativeCommons && ( + + ccheart_red + + )} + {esBrandNew(anPawol.attributes.publishedAt) && ( )} diff --git a/components/teks/teks-kat.js b/components/teks/teks-kat.js index ff30e5f..53758f5 100644 --- a/components/teks/teks-kat.js +++ b/components/teks/teks-kat.js @@ -2,6 +2,7 @@ import PropTypes from 'prop-types' import {useRouter} from 'next/navigation' +import Image from 'next/image' import {format} from 'date-fns' import {fr} from 'date-fns/locale' import Card from '@mui/material/Card' @@ -65,6 +66,18 @@ export default function TeksKat({parole}) { {titre} + {attributes.creativeCommons && ( + + ccheart_red + + )} + {attributes.explicitLyrics && ( )} From 136925daa359540008e2d7b006195bd0aaf87f16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20FAMIBELLE-PRONZOLA?= Date: Sun, 14 Apr 2024 07:08:24 +0400 Subject: [PATCH 6/6] Add Creative Comons license to Teks --- components/teks/teks.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/teks/teks.js b/components/teks/teks.js index e7b4d01..6549f82 100644 --- a/components/teks/teks.js +++ b/components/teks/teks.js @@ -176,6 +176,11 @@ export default function Teks({parole}) { parole soumise par {parole.userAdmin.data.attributes.firstname} )} + {parole.creativeCommons && ( + + + + )} {(parole.okiMizikID || parole.streamAudio.length > 0 || parole.gadeEmbed) && (