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.

88 lines
2.4 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. },
  50. data() {
  51. return {
  52. selected: 0
  53. }
  54. },
  55. computed: {
  56. filteredItems() {
  57. const items = [
  58. { icon: 'mdi-home', text: this.$t('projectHome.home'), link: '', adminOnly: false },
  59. { icon: 'mdi-database', text: this.$t('dataset.dataset'), link: 'dataset', adminOnly: true },
  60. { icon: 'label', text: this.$t('labels.labels'), link: 'labels', adminOnly: true },
  61. { icon: 'label', text: 'Relations', link: 'links', adminOnly: true },
  62. { icon: 'person', text: this.$t('members.members'), link: 'members', adminOnly: true },
  63. { icon: 'mdi-comment-account-outline', text: 'Comments', link: 'comments', adminOnly: true },
  64. { icon: 'mdi-book-open-outline', text: this.$t('guideline.guideline'), link: 'guideline', adminOnly: true },
  65. { icon: 'mdi-chart-bar', text: this.$t('statistics.statistics'), link: 'statistics', adminOnly: true },
  66. { icon: 'mdi-cog', text: this.$t('settings.title'), link: 'settings', adminOnly: true }
  67. ]
  68. return items.filter(item => this.isVisible(item))
  69. }
  70. },
  71. methods: {
  72. isVisible(item) {
  73. return !item.adminOnly || this.role.is_project_admin
  74. },
  75. toLabeling() {
  76. const query = this.$services.option.findOption(this.$route.params.id)
  77. this.$router.push({
  78. path: this.localePath(this.link),
  79. query
  80. })
  81. }
  82. }
  83. }
  84. </script>