1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- <template>
- <MainContentLayout id="list-corpus">
- <template v-slot:header>
- <h1>Corpus</h1>
- <span v-if="!editionslist.length" class="loading">Loading ...</span>
- </template>
- <ul v-if="editionslist.length" class="item-list">
- <li v-for="(corpus,index) in editionslist" :key="index">
- <header>
- <h2>{{ corpus.author.title }}</h2>
- <h3>{{ corpus.author.date }}</h3>
- </header>
- <section class="editions">
- <h4 class="editions-quantity">
- {{ corpus.author.editionsQuantity.quantity }} {{ corpus.author.editionsQuantity.unit }}
- </h4>
- <!-- <div v-if="corpus.author.editions" class="editions" v-html="corpus.author.editions"/> -->
- </section>
- <section class="texts">
- <h4 class="texts-quantity">
- {{ corpus.author.textsQuantity.quantity }}
- {{ corpus.author.textsQuantity.unit }}
- </h4>
- <ul class="texts-list">
- <li v-for="text in corpus.editions.content" :key="text.uuid">
- <h3>
- <a
- class="title"
- :href="text.url"
- :uuid="text.uuid"
- @click.prevent="onclick"
- @keyup.enter="onclick"
- v-html="text.title"
- />
- </h3>
- <p
- class="biblio"
- v-html="text.biblio.description"
- />
- </li>
- </ul>
- </section>
- <!-- <CorpusItem :item="item" /> -->
- </li>
- </ul>
- <template v-slot:nav />
- </MainContentLayout>
- </template>
- <script>
- // import CorpusItem from '../components/Content/CorpusItem'
- import MainContentLayout from '../components/Layouts/MainContentLayout'
- import { mapState, mapActions } from 'vuex'
- export default {
- name: 'ListCorpus',
- metaInfo: {
- title: 'Corpus'
- },
- components: {
- // CorpusItem,
- MainContentLayout
- },
- data: () => ({
- // editionslist: []
- }),
- computed: {
- ...mapState({
- editionslist: state => state.Corpus.editionslist
- })
- },
- created () {
- if (!this.editionslist.length) {
- this.getCorpuses()
- }
- },
- methods: {
- ...mapActions({
- getCorpuses: 'Corpus/getCorpuses'
- }),
- onclick (e) {
- console.log('clicked on editon', e)
- this.$router.push({
- name: `edition`,
- params: { id: e.target.getAttribute('uuid') }
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- </style>
|