ListCorpus.vue 2.4 KB

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