<template>
  <LayoutContainer>
    <LayoutCommonSection>
      <UiFormEdition :model="Parameters" :id="organizationProfile.parametersId">
        <template #default="{ entity : parameters }">
          <div v-if="parameters">
            <v-row>
              <v-col cols="12">
                <h4 class="mb-4">{{ $t('teachers') }}</h4>

                <UiInputCheckbox
                  v-model="parameters.createCourse"
                  field="createCourse"
                  label="allow_teachers_to_create_courses"
                />

                <UiInputCheckbox
                  v-model="parameters.consultTeacherListing"
                  field="consultTeacherListing"
                  label="allow_teachers_to_consult_colleagues_informations"
                />

                <UiInputCheckbox
                  v-model="parameters.consultPedagogicResult"
                  field="showAdherentList"
                  label="allow_students_to_consult_their_pedagogical_followup"
                />

                <UiInputCheckbox
                  v-model="parameters.generateAttendanceReport"
                  field="generateAttendanceReport"
                  label="allow_teachers_to_generate_attendance_reports"
                />

                <h4 class="mt-3 mb-4">{{ $t('pupils-members') }}</h4>
                <UiInputCheckbox
                  v-model="parameters.administrationCc"
                  field="administrationCc"
                  label="send_teachers_mail_reports_copy_to_administration"
                />

                <UiInputCheckbox
                  v-model="parameters.allowMembersToChangeGivenNameAndName"
                  field="allowMembersToChangeGivenNameAndName"
                  label="allow_members_to_change_their_names_and_firstnames"
                />
              </v-col>
            </v-row>
          </div>
        </template>
      </UiFormEdition>
    </LayoutCommonSection>
  </LayoutContainer>
</template>

<script setup lang="ts">
import Parameters from '~/models/Organization/Parameters'
import { useOrganizationProfileStore } from '~/stores/organizationProfile'

definePageMeta({
  name: 'parameters_intranet_page',
})

const organizationProfile = useOrganizationProfileStore()

if (organizationProfile.parametersId === null) {
  throw new Error('Missing organization parameters id')
}

</script>

<style scoped lang="scss"></style>
