Subheader.vue 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <!--
  2. Second header de l'application
  3. Contient entre autres le breadcrumb, les commandes de changement d'année et les listes personnalisées
  4. -->
  5. <template>
  6. <main>
  7. <v-card
  8. id="subheader"
  9. class="d-flex theme-neutral text-body-2 px-2"
  10. flat
  11. rounded="0"
  12. >
  13. <LayoutSubHeaderBreadcrumbs v-if="lgAndUp" class="mr-auto d-flex" />
  14. <span class="flex-fill" />
  15. <v-card
  16. class="d-flex flex-row align-center mr-6"
  17. flat
  18. tile
  19. >
  20. <LayoutSubHeaderActivityYear v-if="smAndUp && !showDateTimeRange" class="activity-year" />
  21. <div v-if="hasMenuOrIsTeacher" class="d-flex flex-row align-center h-100">
  22. <LayoutSubHeaderDataTiming
  23. v-if="smAndUp && !showDateTimeRange"
  24. class="data-timing ml-2"
  25. />
  26. <LayoutSubHeaderDataTimingRange
  27. v-if="smAndUp && showDateTimeRange"
  28. class="data-timing-range ml-n1"
  29. />
  30. <v-btn
  31. v-if="smAndUp"
  32. ref="btn"
  33. class="switch-btn ml-1 theme-neutral-soft"
  34. height="22" min-height="22" max-height="22"
  35. width="25" min-width="25" max-width="25"
  36. elevation="0"
  37. @click="showDateTimeRange = !showDateTimeRange"
  38. >
  39. <v-icon icon="fas fa-history" class="font-weight-normal" style="font-size: 14px;" />
  40. </v-btn>
  41. <v-tooltip location="bottom" :activator="btn">
  42. <span>{{ $t('history_help') }}</span>
  43. </v-tooltip>
  44. <LayoutSubHeaderPersonnalizedList class="personalized-list ml-2 d-flex align-center" />
  45. </div>
  46. </v-card>
  47. </v-card>
  48. </main>
  49. </template>
  50. <script setup lang="ts">
  51. import {useAccessProfileStore} from "~/stores/accessProfile";
  52. import {computed, ComputedRef, ref, Ref} from "@vue/reactivity";
  53. import {useMenu} from "~/composables/layout/useMenu";
  54. import {useDisplay} from "vuetify";
  55. const { smAndUp, mdAndUp, lgAndUp } = useDisplay()
  56. const accessProfile = useAccessProfileStore()
  57. const { hasMenu } = useMenu()
  58. const btn: Ref = ref(null)
  59. const hasMenuOrIsTeacher: ComputedRef<boolean> = computed(
  60. () => hasMenu('Main') || (accessProfile.isTeacher ?? false)
  61. )
  62. const showDateTimeRange: Ref<boolean> = ref(
  63. Object.hasOwn(accessProfile.historical, 'dateStart') && accessProfile.historical.dateStart !== null &&
  64. Object.hasOwn(accessProfile.historical, 'dateEnd') && accessProfile.historical.dateEnd !== null
  65. )
  66. </script>
  67. <style scoped lang="scss">
  68. main {
  69. font-size: 12px;
  70. }
  71. #subheader {
  72. max-height: 36px;
  73. }
  74. :deep(#subheader .v-card) {
  75. max-height: 36px;
  76. background-color: transparent !important;
  77. }
  78. .switch-btn {
  79. border-width: 1px;
  80. border-style: solid;
  81. }
  82. </style>