AlertBar.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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: 1010"/>
  10. <LayoutAlertBarSwitchUser style="z-index: 1009" />
  11. <client-only>
  12. <LayoutAlertBarCotisation
  13. v-if="organizationProfile.isCmf && ability.can('manage', 'cotisation')"
  14. style="z-index: 1008"
  15. />
  16. </client-only>
  17. <LayoutAlertBarSwitchYear style="z-index: 1007"/>
  18. <LayoutAlertBarSuperAdmin style="z-index: 1006"/>
  19. <LayoutAlertBarRegistrationStatus
  20. v-if="organizationProfile.hasModule('IEL')"
  21. style="z-index: 1005"
  22. />
  23. </div>
  24. </v-expand-transition>
  25. <div v-if="smAndDown">
  26. <div
  27. class="folded-bar theme-warning"
  28. style="z-index: 1004"
  29. @click="onFoldedWarningClick"
  30. >
  31. <v-icon small icon="fas fa-exclamation-triangle mx-1" />
  32. <span>{{ $t("show_warnings") }}</span>
  33. <v-icon small :icon="'fas mx-1' + (unfoldWarnings ? ' fa-chevron-up' : ' fa-chevron-down')" />
  34. </div>
  35. </div>
  36. </main>
  37. </template>
  38. <script setup lang="ts">
  39. import { useOrganizationProfileStore } from '~/stores/organizationProfile'
  40. import { useAbility } from '@casl/vue'
  41. import {useDisplay} from 'vuetify';
  42. import {StencilPreview} from 'vue-advanced-cropper';
  43. const organizationProfile = useOrganizationProfileStore()
  44. const ability = useAbility()
  45. const { mdAndUp, smAndDown } = useDisplay()
  46. const unfoldWarnings = ref(false)
  47. const onFoldedWarningClick = () => {
  48. unfoldWarnings.value = !unfoldWarnings.value
  49. }
  50. const showAlertBars = computed(() => mdAndUp.value || unfoldWarnings.value)
  51. </script>
  52. <style scoped lang="scss">
  53. .folded-bar {
  54. position: relative;
  55. font-size: 14px;
  56. display: flex;
  57. flex-direction: row;
  58. justify-content: center;
  59. align-items: center;
  60. text-align: center;
  61. padding: 12px;
  62. cursor: pointer;
  63. }
  64. </style>