index item's occurences well diplayed & links are functioning
This commit is contained in:
+1
-1
@@ -219,7 +219,7 @@ section[role="main-content"]{
|
|||||||
.index{
|
.index{
|
||||||
}
|
}
|
||||||
|
|
||||||
#nominum{
|
.index-item{
|
||||||
header{
|
header{
|
||||||
h1{
|
h1{
|
||||||
@include title2black;
|
@include title2black;
|
||||||
|
|||||||
@@ -0,0 +1,83 @@
|
|||||||
|
<template>
|
||||||
|
<section class="occurences">
|
||||||
|
<ul>
|
||||||
|
<li
|
||||||
|
v-for="ed in content.occurences"
|
||||||
|
:key="ed.item"
|
||||||
|
>
|
||||||
|
<h3>
|
||||||
|
<a
|
||||||
|
:href="'/edition/'+ed.item"
|
||||||
|
:uuid="ed.item"
|
||||||
|
@click.prevent="onclick"
|
||||||
|
@keyup.enter="onclick"
|
||||||
|
>
|
||||||
|
{{ ed.item }}
|
||||||
|
</a>
|
||||||
|
</h3>
|
||||||
|
<ul>
|
||||||
|
<li
|
||||||
|
v-for="oc in ocAsArray(ed.occurences)"
|
||||||
|
:key="oc.uuid"
|
||||||
|
>
|
||||||
|
<!-- <li
|
||||||
|
v-for="oc in ed.occurences"
|
||||||
|
:key="oc.uuid"
|
||||||
|
> -->
|
||||||
|
<h4>
|
||||||
|
<a
|
||||||
|
:href="'/edition/'+ed.item+'/'+oc.uuid"
|
||||||
|
:uuid="oc.uuid"
|
||||||
|
:eduuid="ed.item"
|
||||||
|
@click.prevent="onclick"
|
||||||
|
@keyup.enter="onclick"
|
||||||
|
>
|
||||||
|
{{ oc.title }}
|
||||||
|
</a>
|
||||||
|
</h4>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: 'IndexItemOcurrences',
|
||||||
|
props: {
|
||||||
|
content: Object
|
||||||
|
},
|
||||||
|
data: () => ({
|
||||||
|
|
||||||
|
}),
|
||||||
|
methods: {
|
||||||
|
ocAsArray (oc) {
|
||||||
|
console.log('Array.isArray(oc)', Array.isArray(oc))
|
||||||
|
return Array.isArray(oc) ? oc : [oc]
|
||||||
|
},
|
||||||
|
onclick (e) {
|
||||||
|
console.log('clicked on text occurence', e)
|
||||||
|
if (e.target.getAttribute('eduuid')) {
|
||||||
|
this.$router.push({
|
||||||
|
name: `editiontext`,
|
||||||
|
params: {
|
||||||
|
id: e.target.getAttribute('eduuid'),
|
||||||
|
textid: e.target.getAttribute('uuid')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.$router.push({
|
||||||
|
name: `edition`,
|
||||||
|
params: {
|
||||||
|
id: e.target.getAttribute('uuid')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
</style>
|
||||||
+18
-7
@@ -1,12 +1,19 @@
|
|||||||
<template>
|
<template>
|
||||||
<MainContentLayout id="locorum">
|
<MainContentLayout id="locorum" class="index-item">
|
||||||
<template v-slot:header>
|
<template v-if="!content" v-slot:header>
|
||||||
<h1 v-if="content">{{ content.title }}</h1>
|
<span class="loading">Loading ...</span>
|
||||||
<p v-if="content">{{ content.type }}</p>
|
|
||||||
<span v-if="!content">Loading ...</span>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-slot:nav />
|
<template v-if="content" v-slot:header>
|
||||||
|
<h1>{{ content.title }}</h1>
|
||||||
|
<p>
|
||||||
|
{{ content.type }}
|
||||||
|
</p>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<!-- default slot -->
|
||||||
|
<IndexItemOcurrences v-if="content" :content="content" />
|
||||||
|
|
||||||
</MainContentLayout>
|
</MainContentLayout>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -14,15 +21,19 @@
|
|||||||
|
|
||||||
import { REST } from 'api/rest-axios'
|
import { REST } from 'api/rest-axios'
|
||||||
import MainContentLayout from '../components/Layouts/MainContentLayout'
|
import MainContentLayout from '../components/Layouts/MainContentLayout'
|
||||||
|
import IndexItemOcurrences from '../components/Content/IndexItemOcurrences'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Locorum',
|
name: 'Locorum',
|
||||||
components: {
|
components: {
|
||||||
MainContentLayout
|
MainContentLayout,
|
||||||
|
IndexItemOcurrences
|
||||||
},
|
},
|
||||||
data: () => ({
|
data: () => ({
|
||||||
content: null
|
content: null
|
||||||
}),
|
}),
|
||||||
|
computed: {
|
||||||
|
},
|
||||||
beforeCreate () {
|
beforeCreate () {
|
||||||
console.log('locorum this.$route', this.$route)
|
console.log('locorum this.$route', this.$route)
|
||||||
REST.get(`/indexLocorum/` + this.$route.params.id, {})
|
REST.get(`/indexLocorum/` + this.$route.params.id, {})
|
||||||
|
|||||||
+5
-61
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<MainContentLayout id="nominum">
|
<MainContentLayout id="nominum" class="index-item">
|
||||||
<template v-if="!content" v-slot:header>
|
<template v-if="!content" v-slot:header>
|
||||||
<span class="loading">Loading ...</span>
|
<span class="loading">Loading ...</span>
|
||||||
</template>
|
</template>
|
||||||
@@ -13,45 +13,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<!-- default slot -->
|
<!-- default slot -->
|
||||||
<section class="occurences">
|
<IndexItemOcurrences v-if="content" :content="content" />
|
||||||
<ul>
|
|
||||||
<li
|
|
||||||
v-for="ed in content.occurences"
|
|
||||||
:key="ed.item"
|
|
||||||
>
|
|
||||||
<h3>
|
|
||||||
<a
|
|
||||||
:href="'/edition/'+ed.item"
|
|
||||||
:uuid="ed.item"
|
|
||||||
@click.prevent="onclick"
|
|
||||||
@keyup.enter="onclick"
|
|
||||||
>
|
|
||||||
{{ ed.item }}
|
|
||||||
</a>
|
|
||||||
</h3>
|
|
||||||
<ul >
|
|
||||||
<li
|
|
||||||
v-for="oc in ed.occurences"
|
|
||||||
:key="oc.uuid"
|
|
||||||
>
|
|
||||||
<h4>
|
|
||||||
<a
|
|
||||||
:href="'/edition/'+ed.item+'/'+oc.uuid"
|
|
||||||
:uuid="oc.uuid"
|
|
||||||
:eduuid="ed.item"
|
|
||||||
@click.prevent="onclick"
|
|
||||||
@keyup.enter="onclick"
|
|
||||||
>
|
|
||||||
{{ oc.title }}
|
|
||||||
</a>
|
|
||||||
</h4>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<template v-slot:nav />
|
|
||||||
</MainContentLayout>
|
</MainContentLayout>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -59,11 +22,13 @@
|
|||||||
|
|
||||||
import { REST } from 'api/rest-axios'
|
import { REST } from 'api/rest-axios'
|
||||||
import MainContentLayout from '../components/Layouts/MainContentLayout'
|
import MainContentLayout from '../components/Layouts/MainContentLayout'
|
||||||
|
import IndexItemOcurrences from '../components/Content/IndexItemOcurrences'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Nominum',
|
name: 'Nominum',
|
||||||
components: {
|
components: {
|
||||||
MainContentLayout
|
MainContentLayout,
|
||||||
|
IndexItemOcurrences
|
||||||
},
|
},
|
||||||
data: () => ({
|
data: () => ({
|
||||||
content: null
|
content: null
|
||||||
@@ -81,27 +46,6 @@ export default {
|
|||||||
console.warn('Issue with nominum', error)
|
console.warn('Issue with nominum', error)
|
||||||
Promise.reject(error)
|
Promise.reject(error)
|
||||||
})
|
})
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
onclick (e) {
|
|
||||||
console.log('clicked on nominum text occurence', e)
|
|
||||||
if (e.target.getAttribute('eduuid')) {
|
|
||||||
this.$router.push({
|
|
||||||
name: `editiontext`,
|
|
||||||
params: {
|
|
||||||
id: e.target.getAttribute('eduuid'),
|
|
||||||
textid: e.target.getAttribute('uuid')
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
this.$router.push({
|
|
||||||
name: `edition`,
|
|
||||||
params: {
|
|
||||||
id: e.target.getAttribute('uuid')
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
+13
-6
@@ -1,11 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<MainContentLayout id="operum">
|
<MainContentLayout id="operum" class="index-item">
|
||||||
<template v-slot:header>
|
<template v-if="!content" v-slot:header>
|
||||||
<h1 v-if="content">{{ content.title }}</h1>
|
<span class="loading">Loading ...</span>
|
||||||
<span v-if="!content">Loading ...</span>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-slot:nav />
|
<template v-if="content" v-slot:header>
|
||||||
|
<h1>{{ content.title }}</h1>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<!-- default slot -->
|
||||||
|
<IndexItemOcurrences v-if="content" :content="content" />
|
||||||
|
|
||||||
</MainContentLayout>
|
</MainContentLayout>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -13,11 +18,13 @@
|
|||||||
|
|
||||||
import { REST } from 'api/rest-axios'
|
import { REST } from 'api/rest-axios'
|
||||||
import MainContentLayout from '../components/Layouts/MainContentLayout'
|
import MainContentLayout from '../components/Layouts/MainContentLayout'
|
||||||
|
import IndexItemOcurrences from '../components/Content/IndexItemOcurrences'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Operum',
|
name: 'Operum',
|
||||||
components: {
|
components: {
|
||||||
MainContentLayout
|
MainContentLayout,
|
||||||
|
IndexItemOcurrences
|
||||||
},
|
},
|
||||||
data: () => ({
|
data: () => ({
|
||||||
content: null
|
content: null
|
||||||
|
|||||||
Reference in New Issue
Block a user