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.

74 lines
1.7 KiB

  1. <template>
  2. <v-list dense>
  3. <v-btn
  4. color="ms-4 my-1 mb-2 primary text-capitalize"
  5. :to="to"
  6. nuxt
  7. >
  8. <v-icon left>
  9. mdi-play-circle-outline
  10. </v-icon>
  11. Start annotation
  12. </v-btn>
  13. <template v-for="(item, i) in items">
  14. <v-list-item
  15. v-if="isVisible(item)"
  16. :key="i"
  17. @click="$router.push('/projects/' + $route.params.id + '/' + item.link)"
  18. >
  19. <v-list-item-action>
  20. <v-icon>
  21. {{ item.icon }}
  22. </v-icon>
  23. </v-list-item-action>
  24. <v-list-item-content>
  25. <v-list-item-title>
  26. {{ item.text }}
  27. </v-list-item-title>
  28. </v-list-item-content>
  29. </v-list-item>
  30. </template>
  31. </v-list>
  32. </template>
  33. <script>
  34. export default {
  35. props: {
  36. link: {
  37. type: String,
  38. default: '',
  39. required: true
  40. },
  41. role: {
  42. type: Object,
  43. default: () => {},
  44. required: true
  45. }
  46. },
  47. data() {
  48. return {
  49. items: [
  50. { icon: 'mdi-home', text: 'Home', link: '', adminOnly: false },
  51. { icon: 'mdi-database', text: 'Dataset', link: 'dataset', adminOnly: true },
  52. { icon: 'label', text: 'Labels', link: 'labels', adminOnly: true },
  53. { icon: 'person', text: 'Members', link: 'members', adminOnly: true },
  54. { icon: 'mdi-book-open-outline', text: 'Guideline', link: 'guideline', adminOnly: true },
  55. { icon: 'mdi-chart-bar', text: 'Statistics', link: 'statistics', adminOnly: true }
  56. ]
  57. }
  58. },
  59. computed: {
  60. to() {
  61. return `/projects/${this.$route.params.id}/${this.link}`
  62. }
  63. },
  64. methods: {
  65. isVisible(item) {
  66. return !item.adminOnly || this.role.is_project_admin
  67. }
  68. }
  69. }
  70. </script>