ListCorpus.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <MainContentLayout id="list-corpus">
  3. <template v-slot:header>
  4. <h1>Corpus</h1>
  5. <span v-if="!editionslist.length" class="loading">Chargement ...</span>
  6. </template>
  7. <ul v-if="editionslist.length" class="item-list">
  8. <li v-for="(corpus,index) in editionslist" :key="index">
  9. <header>
  10. <h2>{{ corpus.author.title }}</h2>
  11. <h3>{{ corpus.author.date }}</h3>
  12. <section class="notice" v-html="corpus.author.note" />
  13. </header>
  14. <section class="editions">
  15. <h4 class="editions-quantity">
  16. {{ corpus.author.editionsQuantity.quantity }} {{ corpus.author.editionsQuantity.unit }}
  17. </h4>
  18. <!-- <div v-if="corpus.author.editions" class="editions" v-html="corpus.author.editions"/> -->
  19. </section>
  20. <section class="texts">
  21. <h4 class="texts-quantity">
  22. {{ corpus.author.textsQuantity.quantity }}
  23. {{ corpus.author.textsQuantity.unit }}
  24. </h4>
  25. <ul class="texts-list">
  26. <li v-for="text in corpus.editions.content" :key="text.uuid">
  27. <h3>
  28. <a
  29. class="title"
  30. :href="text.url"
  31. :uuid="text.uuid"
  32. @click.prevent="onclick"
  33. @keyup.enter="onclick"
  34. v-html="text.title"
  35. />
  36. </h3>
  37. <p
  38. class="biblio"
  39. v-html="text.biblio.description"
  40. />
  41. </li>
  42. </ul>
  43. </section>
  44. <!-- <CorpusItem :item="item" /> -->
  45. </li>
  46. </ul>
  47. <template v-slot:nav />
  48. </MainContentLayout>
  49. </template>
  50. <script>
  51. // import CorpusItem from '../components/Content/CorpusItem'
  52. import MainContentLayout from '../components/Layouts/MainContentLayout'
  53. import { mapState, mapActions } from 'vuex'
  54. export default {
  55. name: 'ListCorpus',
  56. metaInfo: {
  57. title: 'Corpus'
  58. },
  59. components: {
  60. // CorpusItem,
  61. MainContentLayout
  62. },
  63. data: () => ({
  64. // editionslist: []
  65. }),
  66. computed: {
  67. ...mapState({
  68. editionslist: state => state.Corpus.editionslist
  69. })
  70. },
  71. created () {
  72. if (!this.editionslist.length) {
  73. this.getCorpuses()
  74. }
  75. },
  76. methods: {
  77. ...mapActions({
  78. getCorpuses: 'Corpus/getCorpuses'
  79. }),
  80. onclick (e) {
  81. console.log('clicked on editon', e)
  82. this.$router.push({
  83. name: `edition`,
  84. params: { id: e.target.getAttribute('uuid') }
  85. })
  86. }
  87. }
  88. }
  89. </script>
  90. <style lang="scss" scoped>
  91. </style>