AlertBar.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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 { StencilPreview } from 'vue-advanced-cropper'
  50. import { useOrganizationProfileStore } from '~/stores/organizationProfile'
  51. const organizationProfile = useOrganizationProfileStore()
  52. const ability = useAbility()
  53. const { mdAndUp, smAndDown } = useDisplay()
  54. const unfoldWarnings = ref(false)
  55. const onFoldedWarningClick = () => {
  56. unfoldWarnings.value = !unfoldWarnings.value
  57. }
  58. const showAlertBars = computed(() => mdAndUp.value || unfoldWarnings.value)
  59. </script>
  60. <style scoped lang="scss">
  61. .folded-bar {
  62. position: relative;
  63. font-size: 14px;
  64. display: flex;
  65. flex-direction: row;
  66. justify-content: center;
  67. align-items: center;
  68. text-align: center;
  69. padding: 12px;
  70. cursor: pointer;
  71. }
  72. </style>