#2088 Étiquettes et présentation des manifestations

This commit is contained in:
2023-06-18 22:32:24 +02:00
parent 0151b9fac4
commit d4e66bfaca
+60 -15
View File
@@ -1,6 +1,6 @@
<template> <template>
<MainContentLayout id="biblio"> <MainContentLayout id="biblio">
<template v-if="!content" #header> <template v-if="!expressions.meta || !manifestations.meta" #header>
<span class="loading">Chargement ...</span> <span class="loading">Chargement ...</span>
</template> </template>
<template v-else #header> <template v-else #header>
@@ -22,7 +22,7 @@
:to="{ name:'bibliographie', params: { type: 'manifestations'}}" :to="{ name:'bibliographie', params: { type: 'manifestations'}}"
title="Consulter toutes les manifestations" title="Consulter toutes les manifestations"
> >
{{ manifestations.meta.quantity.quantity }} {{ manifestations.meta.quantity.unit }} {{ manifestations.meta.quantity.quantity }} {{ manifestations.meta.quantity.unit }}
</router-link> </router-link>
</li> </li>
</ul> </ul>
@@ -46,7 +46,7 @@
</h2> </h2>
<p class="date">{{ item.dates }}</p> <p class="date">{{ item.dates }}</p>
<em class="titles">{{ item.titles }}</em> <em class="titles">{{ item.titles }}</em>
<aside v-if="item.manifestations.length"> <aside v-if="item.manifestations && item.manifestations.length">
<h5 <h5
@click.prevent="onToggleManifs" @click.prevent="onToggleManifs"
@keyup.enter="onToggleManifs" @keyup.enter="onToggleManifs"
@@ -84,24 +84,46 @@
</li> </li>
</ul> </ul>
</template> </template>
<!-- or item --> <!-- or expression / manifestation item -->
<template v-else> <template v-else>
<div class="biblio-item"> <div class="biblio-item">
<h2>{{ item.type }}</h2> <h2>{{ item.type }}</h2>
<h2 v-html="item.tei" />
<p class="author">Auteur: {{ item.authors }}</p> <p class="author">Auteur: {{ item.authors }}</p>
<p v-if="item.dates" class="date">Dates : {{ item.dates }}</p> <p v-if="item.dates" class="date">Dates : {{ item.dates }}</p>
<h3>Liste des manifestations :</h3> <p v-if="item.edition" class="date">Édition : {{ item.edition }}</p>
<ul vi-if="item.manifestations.length" class="item-list"> <p v-if="item.editeur" class="date" v-html="'Éditeur : ' + item.editeur" />
<p v-if="item.lieu" class="date">Lieu de publication : {{ item.lieu }}</p>
<p v-if="item.extent" class="date">Format : {{ item.extent }}</p>
<!-- manifestation -->
<h3 v-if="item.manifestations && item.manifestations.length">Liste des manifestations :</h3>
<ul v-if="item.manifestations && item.manifestations.length" class="item-list">
<li v-for="manif in item.manifestations" :key="manif.uuid"> <li v-for="manif in item.manifestations" :key="manif.uuid">
<p v-html="manif.tei"/> <p v-html="manif.tei" />
<router-link <router-link
:to="{ name:'bibliographieItem', params:{ type:'manifestations', uuid:manif.uuid } }" :to="{ name:'bibliographieItem', params:{ type:'manifestations', uuid:manif.uuid } }"
v-html="manif.path" v-html="manif.path"
/> />
</li> </li>
</ul> </ul>
<ul vi-if="item.idno.length" class="item-list"> <!-- note -->
<li v-for="id in item.idno" :key="id.url"> <h3 v-if="item.notes && item.notes.length">Note :</h3>
<ul v-if="item.notes && item.notes.length" class="notes-list">
<li v-for="note in item.notes" :key="note.uuid">
<p v-html="note.tei" />
</li>
</ul>
<!-- BNF -->
<h3 v-if="noticesbnf.length">Notices BnF :</h3>
<ul v-if="noticesbnf.length" class="item-list">
<li v-for="id in noticesbnf" :key="id.url">
<a :href="id.url">{{ id.type }}: {{ id.url }}</a>
</li>
</ul>
<!-- GALLICA -->
<h3 v-if="noticesgallica.length">Exemplaires sur Gallica :</h3>
<ul v-if="noticesgallica.length" class="item-list">
<li v-for="id in noticesgallica" :key="id.url">
<a :href="id.url">{{ id.type }}: {{ id.url }}</a> <a :href="id.url">{{ id.type }}: {{ id.url }}</a>
</li> </li>
</ul> </ul>
@@ -109,7 +131,7 @@
</div> </div>
</template> </template>
<template v-if="!uuid && type === 'manifestations'" #nav> <template v-if="!uuid && type === 'manifestations'" #nav>
<ul class="authors-filters"> <ul class="authors-filters">
<li <li
v-for="author in authors" :key="author" v-for="author in authors" :key="author"
@@ -122,13 +144,13 @@
</li> </li>
</ul> </ul>
</template> </template>
<template v-else #nav> <template v-else #nav>
<aside class="expression-links"> <aside class="expression-links">
<p> <p>
Permalien:<br/><a :href="`${item.url}`">{{ item.url }}</a> Permalien:<br><a :href="`${item.url}`">{{ item.url }}</a>
</p> </p>
<p> <p>
JSON:<br/><a :href="`${apipath}${item.path}${item.uuid}`">{{ apipath }}{{ item.path }}{{ item.uuid }}</a> JSON:<br><a :href="`${apipath}${item.path}${item.uuid}`">{{ apipath }}{{ item.path }}{{ item.uuid }}</a>
</p> </p>
</aside> </aside>
</template> </template>
@@ -163,6 +185,28 @@ export default {
computed: { computed: {
apipath () { apipath () {
return window.apipath return window.apipath
},
noticesbnf (item) {
let n = []
if (this.item && this.item.idno && this.item.idno.length) {
this.item.idno.forEach(id => {
if (id.type === 'catBnf') {
n.push(id)
}
})
}
return n
},
noticesgallica (item) {
let n = []
if (this.item && this.item.idno && this.item.idno.length) {
this.item.idno.forEach(id => {
if (id.type === 'gallica') {
n.push(id)
}
})
}
return n
} }
}, },
watch: { watch: {
@@ -227,6 +271,7 @@ export default {
console.log('Biblio REST item: data', data) console.log('Biblio REST item: data', data)
if (data.content) { if (data.content) {
this.item = data.content this.item = data.content
console.log('getItem item', this.item)
} }
}) })
.catch((error) => { .catch((error) => {
@@ -260,7 +305,7 @@ export default {
this.authors = [] this.authors = []
this.manifestations.content.forEach(manif => { this.manifestations.content.forEach(manif => {
// console.log('this.authors', this.authors) // console.log('manif', manif)
if (this.authors.indexOf(manif.authors) === -1) { if (this.authors.indexOf(manif.authors) === -1) {
this.authors.push(manif.authors) this.authors.push(manif.authors)
this.activeAuthors.push(manif.authors) this.activeAuthors.push(manif.authors)
@@ -278,7 +323,7 @@ export default {
this.expressions.content[i].manifestations = manifs this.expressions.content[i].manifestations = manifs
}) })
this.content = this.expressions.content this.content = this.expressions.content
console.log('content parsed', this.expressions, this.manifestations) console.log('Biblio content parsed', this.expressions, this.manifestations)
}, },
onToggleManifs (e) { onToggleManifs (e) {
console.log('togle manifs', e) console.log('togle manifs', e)