added exctract coming from niminum index #765

This commit is contained in:
2022-03-04 15:31:34 +01:00
parent 27455eb300
commit 848349c1f3
3 changed files with 41 additions and 6 deletions
+15 -3
View File
@@ -2,9 +2,10 @@
<section :class="{opened: isopened}">
<h4>
<a
:href="'/edition/'+ed.item+'/'+oc.uuid"
:href="'/edition/'+ed.item+'/'+oc.uuid+'/'+oc.form"
:uuid="oc.uuid"
:eduuid="ed.item"
:form="oc.form"
@click.prevent="onGoToText"
@keyup.enter="onGoToText"
>
@@ -88,13 +89,24 @@ export default {
title: this.oc.title,
editionTitle: this.editionTitle
})
// if (e.target.getAttribute('form')) {
// this.$router.push({
// name: `editiontext`,
// params: {
// id: e.target.getAttribute('eduuid'),
// textid: e.target.getAttribute('uuid')
// }
// })
// } else {
this.$router.push({
name: `editiontext`,
name: `editiontextextract`,
params: {
id: e.target.getAttribute('eduuid'),
textid: e.target.getAttribute('uuid')
textid: e.target.getAttribute('uuid'),
extract: e.target.getAttribute('form')
}
})
// }
} else {
this.$router.push({
name: `edition`,
+1
View File
@@ -138,6 +138,7 @@ export default {
meta: null,
editionid: null,
textid: null,
extract: null,
texts: [],
textsuuids: [],
metainfotitle: undefined,
+25 -3
View File
@@ -29,7 +29,7 @@
<!-- default slot -->
<IndexItemOcurrences v-if="content" :content="content" />
<template v-slot:nav>
<template v-if="content" v-slot:nav>
<section v-if="content.attestedForms" class="attested-forms">
<h3>Attested forms</h3>
<ul>
@@ -67,13 +67,13 @@ export default {
title: `Nominum ${this.$route.params.id}`
}
},
beforeCreate () {
created () {
console.log('nominum this.$route', this.$route)
REST.get(`${window.apipath}/indexNominum/` + this.$route.params.id, {})
.then(({ data }) => {
console.log('nominum REST: data', data)
if (data.content) {
this.content = data.content
this.parseOccurences(data.content)
}
})
.catch((error) => {
@@ -84,6 +84,28 @@ export default {
query: { fullpath: this.$route.path }
})
})
},
methods: {
parseOccurences (content) {
console.log('parseOccurences', content)
for (let i = 0; i < content.occurences.length; i++) {
let ed = content.occurences[i]
for (let j = 0; j < ed.occurences.length; j++) {
let o = ed.occurences[j]
const uuid = o.uuid
for (let k = 0; k < content.attestedForms.length; k++) {
const form = content.attestedForms[k]
if (form.uuid.indexOf(uuid) >= 0) {
content.occurences[i].occurences[j].form = form.title
break
}
console.warn('no form for occurence', o.uuid, o.title)
content.occurences[i].occurences[j].form = ''
}
}
}
this.content = content
}
}
}
</script>