Nominum.vue 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <template>
  2. <MainContentLayout id="nominum" class="index-item">
  3. <template v-if="!content" v-slot:header>
  4. <span class="loading">Loading ...</span>
  5. </template>
  6. <template v-if="content" v-slot:header>
  7. <h1 v-html="content.title" />
  8. <p>
  9. {{ content.birthDate }}, {{ content.birthPlace }}<br>
  10. {{ content.deathDate }}, {{ content.deathPlace }}
  11. </p>
  12. <p v-if="content.occupation">{{ content.occupation }}</p>
  13. <section class="notes">
  14. <div v-for="(note, i) in content.note" :key="i" class="note" v-html="note" />
  15. </section>
  16. <section v-if="content.autorities.length" class="autorities">
  17. <h3>Autorities</h3>
  18. <ul>
  19. <li v-for="(aut, i) in content.autorities" :key="i">
  20. <a :href="aut.identifier" target="_blanck">{{ aut.autority }}</a>
  21. </li>
  22. </ul>
  23. </section>
  24. </template>
  25. <!-- default slot -->
  26. <IndexItemOcurrences v-if="content" :content="content" />
  27. <template v-slot:nav>
  28. <section v-if="content.attestedForms" class="attested-forms">
  29. <h3>Attested forms</h3>
  30. <ul>
  31. <li v-for="(af, i) in content.attestedForms" :key="i">
  32. <h4>{{ af.title }}</h4>
  33. <ul>
  34. <li v-for="(uuid, j) in af.uuid" :key="j">
  35. <a href="#">{{ uuid }}</a>
  36. </li>
  37. </ul>
  38. </li>
  39. </ul>
  40. </section>
  41. </template>
  42. </MainContentLayout>
  43. </template>
  44. <script>
  45. import { REST } from 'api/rest-axios'
  46. import MainContentLayout from '../components/Layouts/MainContentLayout'
  47. import IndexItemOcurrences from '../components/Content/IndexItemOcurrences'
  48. export default {
  49. name: 'Nominum',
  50. components: {
  51. MainContentLayout,
  52. IndexItemOcurrences
  53. },
  54. data: () => ({
  55. content: null
  56. }),
  57. metaInfo () {
  58. return {
  59. title: `Nominum ${this.$route.params.id}`
  60. }
  61. },
  62. beforeCreate () {
  63. console.log('nominum this.$route', this.$route)
  64. REST.get(`${window.apipath}/indexNominum/` + this.$route.params.id, {})
  65. .then(({ data }) => {
  66. console.log('nominum REST: data', data)
  67. if (data.content) {
  68. this.content = data.content
  69. }
  70. })
  71. .catch((error) => {
  72. console.warn('Issue with nominum', error)
  73. Promise.reject(error)
  74. this.$router.replace({
  75. name: 'notfound',
  76. query: { fullpath: this.$route.path }
  77. })
  78. })
  79. }
  80. }
  81. </script>
  82. <style lang="scss" scoped>
  83. </style>