ListCorpus.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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.author }}</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. title="Consulter cette édition"
  32. />
  33. </h3>
  34. <p
  35. class="biblio"
  36. v-html="text.biblio.description"
  37. />
  38. </li>
  39. </ul>
  40. </section>
  41. <!-- <CorpusItem :item="item" /> -->
  42. </li>
  43. </ul>
  44. <template v-slot:nav />
  45. </MainContentLayout>
  46. </template>
  47. <script>
  48. // import CorpusItem from '../components/Content/CorpusItem'
  49. import MainContentLayout from '../components/Layouts/MainContentLayout'
  50. import { mapState, mapActions } from 'vuex'
  51. export default {
  52. name: 'ListCorpus',
  53. metaInfo: {
  54. title: 'Corpus'
  55. },
  56. components: {
  57. // CorpusItem,
  58. MainContentLayout
  59. },
  60. data: () => ({
  61. // editionslist: []
  62. }),
  63. computed: {
  64. ...mapState({
  65. editionslist: state => state.Corpus.editionslist
  66. })
  67. },
  68. created () {
  69. if (!this.editionslist.length) {
  70. this.getCorpuses()
  71. }
  72. },
  73. methods: {
  74. ...mapActions({
  75. getCorpuses: 'Corpus/getCorpuses'
  76. }),
  77. onclick (e) {
  78. console.log('clicked on editon', e)
  79. this.$router.push({
  80. name: `edition`,
  81. params: { id: e.target.getAttribute('uuid') }
  82. })
  83. }
  84. }
  85. }
  86. </script>
  87. <style lang="scss" scoped>
  88. </style>