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

                <UiInputCheckbox
                  v-model="parameters.bulletinWithTeacher"
                  field="bulletinWithTeacher"
                />

                <UiInputCheckbox
                  v-model="parameters.bulletinSignatureDirector"
                  field="bulletinSignatureDirector"
                />

                <UiInputCheckbox
                  v-model="parameters.bulletinShowEducationWithoutEvaluation"
                  field="bulletinShowEducationWithoutEvaluation"
                />

                <UiInputCheckbox
                  v-model="parameters.bulletinShowAbsences"
                  field="bulletinShowAbsences"
                />

                <UiInputCheckbox
                  v-model="parameters.bulletinPrintAddress"
                  field="bulletinPrintAddress"
                />

                <UiInputCheckbox
                  v-model="parameters.bulletinDisplayLevelAcquired"
                  field="bulletinDisplayLevelAcquired"
                />

                <UiInputCheckbox
                  v-model="parameters.bulletinViewTestResults"
                  field="bulletinViewTestResults"
                />

                <UiInputCheckbox
                  v-model="parameters.bulletinShowAverages"
                  field="bulletinShowAverages"
                />

                <h4 class="my-8">{{ $t('bulletinSettings') }}</h4>

                <UiInputAutocompleteEnum
                  v-model="parameters.bulletinCriteriaSort"
                  field="bulletinCriteriaSort"
                  enum-name="organization_bulletin_criteria_sort"
                />

                <UiInputAutocompleteEnum
                  v-model="parameters.bulletinReceiver"
                  field="bulletinReceiver"
                  enum-name="organization_bulletin_send_to"
                />

                <UiInputCheckbox
                  v-model="parameters.bulletinEditWithoutEvaluation"
                  field="bulletinEditWithoutEvaluation"
                />
              </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_bulletin_page',
})


const organizationProfile = useOrganizationProfileStore()

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

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