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.

138 lines
3.1 KiB

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