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/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" + } +] 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/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 +} 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 && ( )} diff --git a/components/teks/teks.js b/components/teks/teks.js index ac01ab6..515fcf3 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' @@ -177,6 +178,11 @@ export default function Teks({parole}) { parole soumise par {parole.userAdmin.data.attributes.firstname} )} + {parole.creativeCommons && ( + + + + )} {(parole.okiMizikID || parole.streamAudio.length > 0 || parole.gadeEmbed) && ( 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 @@ + + + + + + + + + + +