You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

109 lines
2.7 KiB

  1. <template>
  2. <v-app>
  3. <the-header>
  4. <template #leftDrawerIcon>
  5. <v-app-bar-nav-icon @click="drawerLeft = !drawerLeft" />
  6. </template>
  7. </the-header>
  8. <v-navigation-drawer
  9. v-model="drawerLeft"
  10. app
  11. clipped
  12. color=""
  13. >
  14. <the-side-bar
  15. :link="getLink"
  16. :role="getCurrentUserRole"
  17. />
  18. </v-navigation-drawer>
  19. <v-content>
  20. <v-overlay :value="loading">
  21. <v-progress-circular indeterminate size="64" />
  22. </v-overlay>
  23. <v-container fluid>
  24. <v-row
  25. no-gutters
  26. class="d-none d-sm-flex"
  27. >
  28. <v-col>
  29. <approve-button
  30. :approved="approved"
  31. :disabled="currentDoc ? false : true"
  32. />
  33. <filter-button />
  34. <guideline-button />
  35. </v-col>
  36. <v-spacer />
  37. <v-col>
  38. <paginator />
  39. </v-col>
  40. </v-row>
  41. <v-row justify="center">
  42. <v-col cols="12" md="9">
  43. <nuxt />
  44. </v-col>
  45. <v-col cols="12" md="3">
  46. <metadata-box
  47. v-if="currentDoc && !loading"
  48. :metadata="JSON.parse(currentDoc.meta)"
  49. />
  50. </v-col>
  51. </v-row>
  52. </v-container>
  53. </v-content>
  54. <bottom-navigator class="d-flex d-sm-none" />
  55. </v-app>
  56. </template>
  57. <script>
  58. import { mapActions, mapGetters, mapState } from 'vuex'
  59. import BottomNavigator from '@/components/containers/annotation/BottomNavigator'
  60. import GuidelineButton from '@/components/containers/annotation/GuidelineButton'
  61. import MetadataBox from '@/components/organisms/annotation/MetadataBox'
  62. import FilterButton from '@/components/containers/annotation/FilterButton'
  63. import ApproveButton from '@/components/containers/annotation/ApproveButton'
  64. import Paginator from '~/components/containers/annotation/Paginator'
  65. import TheHeader from '~/components/organisms/layout/TheHeader'
  66. import TheSideBar from '~/components/organisms/layout/TheSideBar'
  67. export default {
  68. middleware: ['check-auth', 'auth'],
  69. components: {
  70. TheSideBar,
  71. TheHeader,
  72. BottomNavigator,
  73. Paginator,
  74. GuidelineButton,
  75. FilterButton,
  76. ApproveButton,
  77. MetadataBox
  78. },
  79. data() {
  80. return {
  81. drawerLeft: null
  82. }
  83. },
  84. computed: {
  85. ...mapGetters('projects', ['getLink', 'getCurrentUserRole']),
  86. ...mapState('documents', ['loading']),
  87. ...mapGetters('documents', ['currentDoc', 'approved'])
  88. },
  89. created() {
  90. this.setCurrentProject(this.$route.params.id)
  91. },
  92. methods: {
  93. ...mapActions('projects', ['setCurrentProject'])
  94. },
  95. validate({ params }) {
  96. return /^\d+$/.test(params.id)
  97. }
  98. }
  99. </script>