AlertBar.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <!--
  2. Alert bars
  3. Contient les différentes barres d'alertes qui s'affichent dans certains cas
  4. -->
  5. <template>
  6. <main>
  7. <v-expand-transition>
  8. <div v-if="showAlertBars">
  9. <LayoutAlertBarEnv style="z-index: 510" />
  10. <LayoutAlertBarSwitchUser style="z-index: 509" />
  11. <client-only>
  12. <LayoutAlertBarCotisation
  13. v-if="
  14. organizationProfile.isCmf && ability.can('manage', 'cotisation')
  15. "
  16. style="z-index: 508"
  17. />
  18. </client-only>
  19. <LayoutAlertBarSwitchYear style="z-index: 507" />
  20. <LayoutAlertBarSuperAdmin style="z-index: 506" />
  21. <LayoutAlertBarRegistrationStatus
  22. v-if="organizationProfile.hasModule('IEL')"
  23. style="z-index: 505"
  24. />
  25. </div>
  26. </v-expand-transition>
  27. <div v-if="smAndDown">
  28. <div
  29. class="folded-bar theme-warning"
  30. style="z-index: 504"
  31. @click="onFoldedWarningClick"
  32. >
  33. <v-icon small icon="fas fa-exclamation-triangle mx-1" />
  34. <span>{{ $t('show_warnings') }}</span>
  35. <v-icon
  36. small
  37. :icon="
  38. 'fas mx-1' +
  39. (unfoldWarnings ? ' fa-chevron-up' : ' fa-chevron-down')
  40. "
  41. />
  42. </div>
  43. </div>
  44. </main>
  45. </template>
  46. <script setup lang="ts">
  47. import { useAbility } from '@casl/vue'
  48. import { useDisplay } from 'vuetify'
  49. import { useOrganizationProfileStore } from '~/stores/organizationProfile'
  50. const organizationProfile = useOrganizationProfileStore()
  51. const ability = useAbility()
  52. const { mdAndUp, smAndDown } = useDisplay()
  53. const unfoldWarnings = ref(false)
  54. const onFoldedWarningClick = () => {
  55. unfoldWarnings.value = !unfoldWarnings.value
  56. }
  57. const showAlertBars = computed(() => mdAndUp.value || unfoldWarnings.value)
  58. </script>
  59. <style scoped lang="scss">
  60. .folded-bar {
  61. position: relative;
  62. font-size: 14px;
  63. display: flex;
  64. flex-direction: row;
  65. justify-content: center;
  66. align-items: center;
  67. text-align: center;
  68. padding: 12px;
  69. cursor: pointer;
  70. }
  71. </style>