Commit 70ba6204 authored by Daniel Caillibaud's avatar Daniel Caillibaud

en cours, cf fixEditArbre sesatheque

parent 8b6c7a9c
......@@ -66,6 +66,9 @@ export function getUrls (ressource) {
else if (ressource.cle) props.dataUrl = baseUrl + 'api/public/cle/' + ressource.cle
else props.dataUrl = baseUrl + 'api/ressource/' + id
// editUrl
props.editUrl = baseUrl + 'ressource/modifier/' + id
return props
}
......
......@@ -49,22 +49,26 @@ function getAttrs (ressource) {
'data-type': ressource.type,
'data-aliasof': props.aliasOf,
'data-dataurl': props.dataUrl,
'data-editurl': props.editUrl,
href: props.displayUrl
}
if (ressource.description) attrs['data-description'] = ressource.description
if (ressource.commentaires) attrs['data-commentaires'] = ressource.commentaires
if (ressource.categories) attrs['data-categories'] = JSON.stringify(ressource.categories)
// public
let isPublic
if (ressource.hasOwnProperty('public')) {
attrs['data-public'] = ressource.public ? '1' : '0'
isPublic = ressource.public
} else if (ressource.hasOwnProperty('restriction')) {
if (ressource.hasOwnProperty('publie') && !ressource.publie) attrs['data-public'] = '0'
else attrs['data-public'] = ressource.restriction ? '0' : '1'
if (ressource.hasOwnProperty('publie') && !ressource.publie) isPublic = false
else isPublic = !ressource.restriction
}
// cle
if (attrs['data-public'] === '0' && ressource.cle) attrs['data-cle'] = ressource.cle
if (!isPublic && ressource.cle) attrs['data-cle'] = ressource.cle
attrs['data-public'] = isPublic ? '1' : '0'
return attrs
} else if (ressource.type === 'arbre') {
}
if (ressource.type === 'arbre') {
// c'est un dossier sans rid ni aliasOf
return {
alt: '',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment