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.

141 lines
3.1 KiB

2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <v-list dense>
  3. <v-btn color="ms-4 my-1 mb-2 primary text-capitalize" nuxt @click="toLabeling">
  4. <v-icon left>
  5. {{ mdiPlayCircleOutline }}
  6. </v-icon>
  7. {{ $t('home.startAnnotation') }}
  8. </v-btn>
  9. <v-list-item-group v-model="selected" mandatory>
  10. <v-list-item
  11. v-for="(item, i) in filteredItems"
  12. :key="i"
  13. @click="$router.push(localePath(`/projects/${$route.params.id}/${item.link}`))"
  14. >
  15. <v-list-item-action>
  16. <v-icon>
  17. {{ item.icon }}
  18. </v-icon>
  19. </v-list-item-action>
  20. <v-list-item-content>
  21. <v-list-item-title>
  22. {{ item.text }}
  23. </v-list-item-title>
  24. </v-list-item-content>
  25. </v-list-item>
  26. </v-list-item-group>
  27. </v-list>
  28. </template>
  29. <script>
  30. import {
  31. mdiHome,
  32. mdiDatabase,
  33. mdiCog,
  34. mdiChartBar,
  35. mdiBookOpenOutline,
  36. mdiCommentAccountOutline,
  37. mdiLabel,
  38. mdiAccount,
  39. mdiPlayCircleOutline
  40. } from '@mdi/js'
  41. export default {
  42. props: {
  43. link: {
  44. type: String,
  45. default: '',
  46. required: true
  47. },
  48. isProjectAdmin: {
  49. type: Boolean,
  50. default: false,
  51. required: true
  52. },
  53. project: {
  54. type: Object,
  55. default: () => {},
  56. required: true
  57. }
  58. },
  59. data() {
  60. return {
  61. selected: 0,
  62. mdiPlayCircleOutline
  63. }
  64. },
  65. computed: {
  66. filteredItems() {
  67. const items = [
  68. {
  69. icon: mdiHome,
  70. text: this.$t('projectHome.home'),
  71. link: '',
  72. isVisible: true
  73. },
  74. {
  75. icon: mdiDatabase,
  76. text: this.$t('dataset.dataset'),
  77. link: 'dataset',
  78. isVisible: true
  79. },
  80. {
  81. icon: mdiLabel,
  82. text: this.$t('labels.labels'),
  83. link: 'labels',
  84. isVisible: this.isProjectAdmin && this.project.canDefineLabel
  85. },
  86. {
  87. icon: mdiLabel,
  88. text: 'Relations',
  89. link: 'links',
  90. isVisible: this.isProjectAdmin && this.project.canDefineRelation
  91. },
  92. {
  93. icon: mdiAccount,
  94. text: this.$t('members.members'),
  95. link: 'members',
  96. isVisible: this.isProjectAdmin
  97. },
  98. {
  99. icon: mdiCommentAccountOutline,
  100. text: 'Comments',
  101. link: 'comments',
  102. isVisible: this.isProjectAdmin
  103. },
  104. {
  105. icon: mdiBookOpenOutline,
  106. text: this.$t('guideline.guideline'),
  107. link: 'guideline',
  108. isVisible: this.isProjectAdmin
  109. },
  110. {
  111. icon: mdiChartBar,
  112. text: this.$t('statistics.statistics'),
  113. link: 'metrics',
  114. isVisible: this.isProjectAdmin
  115. },
  116. {
  117. icon: mdiCog,
  118. text: this.$t('settings.title'),
  119. link: 'settings',
  120. isVisible: this.isProjectAdmin
  121. }
  122. ]
  123. return items.filter((item) => item.isVisible)
  124. }
  125. },
  126. methods: {
  127. toLabeling() {
  128. const query = this.$services.option.findOption(this.$route.params.id)
  129. this.$router.push({
  130. path: this.localePath(this.link),
  131. query
  132. })
  133. }
  134. }
  135. }
  136. </script>