my-settings.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <!--
  2. Page 'Mes préférences'
  3. -->
  4. <template>
  5. <LayoutContainer>
  6. <v-col cols="12" sm="12" md="12">
  7. <v-expansion-panels v-model="openedPanels" :multiple="true">
  8. <UiExpansionPanel title="message_settings" icon="fas fa-inbox">
  9. <v-container fluid class="container">
  10. <v-row>
  11. <UiLoadingPanel v-if="pending" />
  12. <UiForm
  13. v-else
  14. v-model="preferences"
  15. action-position="bottom"
  16. >
  17. <v-row>
  18. <v-col cols="12">
  19. <UiInputCheckbox
  20. v-model="preferences.messageReport"
  21. field="messageReport"
  22. label="allow_report_message"
  23. />
  24. </v-col>
  25. </v-row>
  26. </UiForm>
  27. </v-row>
  28. </v-container>
  29. </UiExpansionPanel>
  30. </v-expansion-panels>
  31. </v-col>
  32. </LayoutContainer>
  33. </template>
  34. <script setup lang="ts">
  35. import type { Ref } from 'vue'
  36. import { useEntityFetch } from '~/composables/data/useEntityFetch'
  37. import Preferences from '~/models/Access/Preferences'
  38. import { useAccessProfileStore } from '~/stores/accessProfile'
  39. definePageMeta({
  40. name: 'my_settings_page',
  41. })
  42. const accessProfileStore = useAccessProfileStore()
  43. if (accessProfileStore.preferencesId === null) {
  44. throw new Error("Missing access preference's id")
  45. }
  46. const { fetch } = useEntityFetch()
  47. const openedPanels: Ref<Array<number>> = ref([0])
  48. const { data: preferences, pending } = await fetch(
  49. Preferences,
  50. accessProfileStore.preferencesId,
  51. )
  52. </script>
  53. <style scoped lang="scss"></style>