redesigned index nominum item page

This commit is contained in:
2022-03-10 18:07:38 +01:00
parent 1ca1469233
commit 9f806420d5
6 changed files with 350 additions and 105 deletions
+42 -13
View File
@@ -16,11 +16,16 @@
<div v-for="(note, i) in content.note" :key="i" class="note" v-html="note" />
</section>
<section v-if="content.autorities.length" class="autorities">
<h3>Autorities</h3>
<section v-if="content.attestedForms" class="attested-forms">
<h3>formes attestées</h3>
<ul>
<li v-for="(aut, i) in content.autorities" :key="i">
<a :href="aut.identifier" target="_blanck">{{ aut.autority }}</a>
<li v-for="(af, i) in content.attestedForms" :key="i">
<span class="form">{{ af.title }}</span>
<!-- <ul>
<li v-for="(uuid, j) in af.uuid" :key="j">
<a href="#">{{ uuid }}</a>
</li>
</ul> -->
</li>
</ul>
</section>
@@ -30,16 +35,11 @@
<IndexItemOcurrences v-if="content" :content="content" />
<template v-if="content" v-slot:nav>
<section v-if="content.attestedForms" class="attested-forms">
<h3>Attested forms</h3>
<section v-if="content.autorities.length" class="autorities">
<h3>Autorities</h3>
<ul>
<li v-for="(af, i) in content.attestedForms" :key="i">
<h4>{{ af.title }}</h4>
<ul>
<li v-for="(uuid, j) in af.uuid" :key="j">
<a href="#">{{ uuid }}</a>
</li>
</ul>
<li v-for="(aut, i) in content.autorities" :key="i">
<a :href="aut.identifier" target="_blanck">{{ aut.autority }}</a>
</li>
</ul>
</section>
@@ -88,6 +88,7 @@ export default {
methods: {
parseOccurences (content) {
console.log('parseOccurences', content)
// ! parsing occurences
for (let i = 0; i < content.occurences.length; i++) {
let ed = content.occurences[i]
for (let j = 0; j < ed.occurences.length; j++) {
@@ -104,6 +105,34 @@ export default {
}
}
}
// ! parsing attested-forms
for (let f = 0; f < content.attestedForms.length; f++) {
let form = content.attestedForms[f]
content.attestedForms[f].occurences = []
for (let u = 0; u < form.uuid.length; u++) {
// ? some UUID are duplicate
let oc = {
uuid: form.uuid[u]
}
for (let e = 0; e < content.occurences.length; e++) {
let ed = content.occurences[e]
for (let o = 0; o < ed.occurences.length; o++) {
let occ = ed.occurences[o]
if (oc.uuid === occ.uuid && occ.title) {
oc.title = occ.title
oc.ed = {
uuid: ed.item,
title: ed.biblio
}
content.attestedForms[f].occurences.push(oc)
// content.attestedForms[f].uuid[u] = oc
break
}
}
if (oc.title) break
}
}
}
this.content = content
}
}