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.

135 lines
3.0 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. mdi-play-circle-outline
  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. export default {
  38. props: {
  39. link: {
  40. type: String,
  41. default: '',
  42. required: true
  43. },
  44. role: {
  45. type: Object,
  46. default: () => {},
  47. required: true
  48. },
  49. project: {
  50. type: Object,
  51. default: () => {},
  52. required: true
  53. }
  54. },
  55. data() {
  56. return {
  57. selected: 0
  58. }
  59. },
  60. computed: {
  61. filteredItems() {
  62. const items = [
  63. {
  64. icon: 'mdi-home',
  65. text: this.$t('projectHome.home'),
  66. link: '',
  67. isVisible: true
  68. },
  69. {
  70. icon: 'mdi-database',
  71. text: this.$t('dataset.dataset'),
  72. link: 'dataset',
  73. isVisible: true
  74. },
  75. {
  76. icon: 'label',
  77. text: this.$t('labels.labels'),
  78. link: 'labels',
  79. isVisible: this.role.is_project_admin && this.project.canDefineLabel
  80. },
  81. {
  82. icon: 'label',
  83. text: 'Relations',
  84. link: 'links',
  85. isVisible: this.role.is_project_admin && this.project.canDefineRelation
  86. },
  87. {
  88. icon: 'person',
  89. text: this.$t('members.members'),
  90. link: 'members',
  91. isVisible: this.role.is_project_admin
  92. },
  93. {
  94. icon: 'mdi-comment-account-outline',
  95. text: 'Comments',
  96. link: 'comments',
  97. isVisible: this.role.is_project_admin
  98. },
  99. {
  100. icon: 'mdi-book-open-outline',
  101. text: this.$t('guideline.guideline'),
  102. link: 'guideline',
  103. isVisible: this.role.is_project_admin
  104. },
  105. {
  106. icon: 'mdi-chart-bar',
  107. text: this.$t('statistics.statistics'),
  108. link: 'statistics',
  109. isVisible: this.role.is_project_admin
  110. },
  111. {
  112. icon: 'mdi-cog',
  113. text: this.$t('settings.title'),
  114. link: 'settings',
  115. isVisible: this.role.is_project_admin
  116. }
  117. ]
  118. return items.filter(item => item.isVisible)
  119. }
  120. },
  121. methods: {
  122. toLabeling() {
  123. const query = this.$services.option.findOption(this.$route.params.id)
  124. this.$router.push({
  125. path: this.localePath(this.link),
  126. query
  127. })
  128. }
  129. }
  130. }
  131. </script>