Subheader.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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">
  22. <LayoutSubHeaderDataTiming
  23. v-if="smAndUp && !showDateTimeRange"
  24. class="data-timing ml-2"
  25. />
  26. <LayoutSubHeaderDataTimingRange
  27. v-if="smAndUp"
  28. class="data-timing-range ml-n1"
  29. @showDateTimeRange="showDateTimeRange=$event"
  30. />
  31. <LayoutSubHeaderPersonnalizedList class="personalized-list ml-2 d-flex align-center" />
  32. </div>
  33. </v-card>
  34. </v-card>
  35. </main>
  36. </template>
  37. <script setup lang="ts">
  38. import {useAccessProfileStore} from "~/stores/accessProfile";
  39. import {computed, ComputedRef, ref, Ref} from "@vue/reactivity";
  40. import {useMenu} from "~/composables/layout/useMenu";
  41. import {useDisplay} from "vuetify";
  42. const { smAndUp, mdAndUp, lgAndUp } = useDisplay()
  43. const accessProfile = useAccessProfileStore()
  44. const { hasMenu } = useMenu()
  45. const hasMenuOrIsTeacher: ComputedRef<boolean> = computed(
  46. () => hasMenu('Main') || (accessProfile.isTeacher ?? false)
  47. )
  48. const showDateTimeRange: Ref<boolean> = ref(
  49. accessProfile.historical.dateStart !== null &&
  50. accessProfile.historical.dateEnd !== null
  51. )
  52. </script>
  53. <style scoped lang="scss">
  54. main {
  55. font-size: 12px;
  56. }
  57. #subheader {
  58. max-height: 36px;
  59. }
  60. :deep(#subheader .v-card) {
  61. max-height: 36px;
  62. background-color: transparent !important;
  63. }
  64. </style>