Browse Source

refactor parameters page titles

Olivier Massot 8 months ago
parent
commit
7ad8cd3872

+ 2 - 1
components/Layout/Parameters/Table.vue

@@ -221,7 +221,8 @@ const columns: ComputedRef<Array<ColumnDefinition>> = computed(() => {
   margin: 0 auto;
 
   .v-list {
-    top: 24px;
+    top: 26px;
+    left: 2px;
     padding: 0;
   }
 

+ 8 - 0
layouts/parameters.vue

@@ -17,6 +17,8 @@
 
         <!-- Page will be rendered here-->
         <div class="inner-container">
+          <h3 class="mt-8 mb-4">{{ pageTitle }}</h3>
+
           <slot />
         </div>
       </v-main>
@@ -31,6 +33,12 @@ import { useLayoutStore } from '~/stores/layout'
 
 const layoutStore = useLayoutStore()
 layoutStore.name = 'parameters'
+
+const route = useRoute()
+const i18n = useI18n()
+
+const pageTitle = computed(() => i18n.t(route.name || 'parameters_page'))
+
 </script>
 
 <style scoped lang="scss">

+ 1 - 0
pages/parameters.vue

@@ -16,6 +16,7 @@ definePageMeta({
   name: 'parameters_page',
   layout: false,
 })
+
 </script>
 
 <style scoped lang="scss">

+ 4 - 2
pages/parameters/attendance_booking_reasons/[id].vue

@@ -1,7 +1,5 @@
 <template>
   <div>
-    <h3 class="my-8">{{ $t('attendanceBookingReason') }}</h3>
-
     <v-card class="parameters-page-card">
       <UiFormEdition
         :model="AttendanceBookingReason"
@@ -22,6 +20,10 @@
 import { useI18n } from 'vue-i18n'
 import AttendanceBookingReason from '~/models/Booking/AttendanceBookingReason'
 
+definePageMeta({
+  name: 'attendanceBookingReason',
+})
+
 const i18n = useI18n()
 
 const rules = () => [

+ 4 - 2
pages/parameters/attendance_booking_reasons/new.vue

@@ -1,7 +1,5 @@
 <template>
   <div>
-    <h3 class="my-8">{{ $t('new_attendance_booking_reason') }}</h3>
-
     <v-card class="parameters-page-card">
       <UiFormCreation
         :model="AttendanceBookingReason"
@@ -32,6 +30,10 @@
 import { useI18n } from 'vue-i18n'
 import AttendanceBookingReason from '~/models/Booking/AttendanceBookingReason'
 
+definePageMeta({
+  name: 'new_attendance_booking_reason',
+})
+
 const i18n = useI18n()
 
 const rules = () => [

+ 0 - 2
pages/parameters/attendances.vue

@@ -1,6 +1,4 @@
 <template>
-  <h3 class="my-8">{{ $t("parameters_attendances_page")}}</h3>
-
   <v-card v-if="organizationProfile.isSchool" class="parameters-page-card">
     <h4>{{ $t("alert_configuration") }}</h4>
     <UiLoadingPanel v-if="pending" />

+ 0 - 2
pages/parameters/bulletin.vue

@@ -1,7 +1,5 @@
 <template>
   <LayoutContainer>
-    <h3 class="my-8">{{ $t("parameters_bulletin_page")}}</h3>
-
     <v-card class="parameters-page-card">
       <UiLoadingPanel v-if="pending" />
       <UiForm

+ 4 - 2
pages/parameters/cycles/[id].vue

@@ -1,7 +1,5 @@
 <template>
   <div>
-    <h3 class="my-8">{{ $t('cycle') }}</h3>
-
     <v-card class="parameters-page-card">
       <UiFormEdition :model="Cycle" go-back-route="/parameters/teaching">
         <template #default="{ entity }">
@@ -15,6 +13,10 @@
 import { useI18n } from 'vue-i18n'
 import Cycle from '~/models/Education/Cycle'
 
+definePageMeta({
+  name: 'cycle',
+})
+
 const i18n = useI18n()
 
 const rules = () => [

+ 0 - 2
pages/parameters/education_notation.vue

@@ -1,7 +1,5 @@
 <template>
   <LayoutContainer>
-    <h3 class="my-8">{{ $t("parameters_education_notation_page")}}</h3>
-
     <v-card class="parameters-page-card">
       <UiLoadingPanel v-if="pending" />
       <UiForm

+ 4 - 2
pages/parameters/education_timings/[id].vue

@@ -1,7 +1,5 @@
 <template>
   <div>
-    <h3 class="my-8">{{ $t('educationTiming') }}</h3>
-
     <v-card class="parameters-page-card">
       <UiFormEdition
         :model="EducationTiming"
@@ -22,6 +20,10 @@
 import { useI18n } from 'vue-i18n'
 import EducationTiming from '~/models/Education/EducationTiming'
 
+definePageMeta({
+  name: 'educationTiming',
+})
+
 const i18n = useI18n()
 
 const rules = () => [

+ 0 - 2
pages/parameters/education_timings/index.vue

@@ -1,7 +1,5 @@
 <template>
   <LayoutContainer>
-    <h3 class="my-8">{{ $t("parameters_education_timings_page")}}</h3>
-
       <v-card class="parameters-page-card">
       <LayoutParametersEntityTable
         :model="EducationTiming"

+ 4 - 2
pages/parameters/education_timings/new.vue

@@ -1,7 +1,5 @@
 <template>
   <div>
-    <h3 class="my-8">{{ $t('new_education_timing') }}</h3>
-
     <v-card class="parameters-page-card">
       <UiFormCreation
         :model="EducationTiming"
@@ -32,6 +30,10 @@
 import { useI18n } from 'vue-i18n'
 import EducationTiming from '~/models/Education/EducationTiming'
 
+definePageMeta({
+  name: 'new_education_timing',
+})
+
 const i18n = useI18n()
 
 const rules = () => [

+ 0 - 2
pages/parameters/general_parameters.vue

@@ -1,7 +1,5 @@
 <template>
   <LayoutContainer>
-    <h3 class="my-8">{{ $t("parameters_general_page")}}</h3>
-
     <v-card class="parameters-page-card">
       <UiLoadingPanel v-if="pending" />
       <UiForm

+ 2 - 4
pages/parameters/intranet.vue

@@ -1,7 +1,5 @@
 <template>
   <LayoutContainer>
-    <h3 class="my-8">{{ $t("parameters_intranet_page")}}</h3>
-
     <v-card class="parameters-page-card">
       <UiLoadingPanel v-if="pending" />
       <UiForm
@@ -10,7 +8,7 @@
       >
         <v-row>
           <v-col cols="12">
-            <h3 class="mb-4">{{ $t('teachers')}}</h3>
+            <h4 class="mb-4">{{ $t('teachers')}}</h4>
 
             <UiInputCheckbox
               v-model="parameters.createCourse"
@@ -36,7 +34,7 @@
               label="allow_teachers_to_generate_attendance_reports"
             />
 
-            <h3 class="mt-3 mb-4">{{ $t('pupils-members')}}</h3>
+            <h4 class="mt-3 mb-4">{{ $t('pupils-members')}}</h4>
             <UiInputCheckbox
               v-model="parameters.administrationCc"
               field="administrationCc"

+ 4 - 2
pages/parameters/residence_areas/[id].vue

@@ -1,7 +1,5 @@
 <template>
   <div>
-    <h3 class="my-8">{{ $t('edit_resident_area') }}</h3>
-
     <v-card class="parameters-page-card">
       <UiFormEdition
         :model="ResidenceArea"
@@ -24,6 +22,10 @@
 import { useI18n } from 'vue-i18n'
 import ResidenceArea from '~/models/Billing/ResidenceArea'
 
+definePageMeta({
+  name: 'edit_resident_area',
+})
+
 const i18n = useI18n()
 
 const rules = () => [

+ 0 - 2
pages/parameters/residence_areas/index.vue

@@ -1,6 +1,4 @@
 <template>
-  <h3 class="my-8">{{ $t("parameters_residence_areas_page")}}</h3>
-
   <v-card class="parameters-page-card">
     <LayoutContainer>
       <LayoutParametersEntityTable

+ 4 - 2
pages/parameters/residence_areas/new.vue

@@ -1,7 +1,5 @@
 <template>
   <div>
-    <h3 class="my-8">{{ $t('create_a_new_residence_area') }}</h3>
-
     <v-card class="parameters-page-card">
       <UiFormCreation
         :model="ResidenceArea"
@@ -30,6 +28,10 @@
 import { useI18n } from 'vue-i18n'
 import ResidenceArea from '~/models/Billing/ResidenceArea'
 
+definePageMeta({
+  name: 'create_a_new_residence_area',
+})
+
 const i18n = useI18n()
 
 const rules = () => [

+ 0 - 2
pages/parameters/sms.vue

@@ -1,7 +1,5 @@
 <template>
   <div>
-    <h3 class="my-8">{{ $t('parameters_sms_page') }}</h3>
-
     <v-card class="parameters-page-card">
       <UiForm v-if="parameters" v-model="parameters">
         <v-row>

+ 4 - 2
pages/parameters/subdomains/[id].vue

@@ -1,8 +1,6 @@
 <!-- Page de détails d'un sous-domaine -->
 <template>
   <div>
-    <h3 class="my-8">{{ $t('activate_a_subdomain') }}</h3>
-
     <v-card class="parameters-page-card">
       <UiLoadingPanel v-if="pending" />
       <div v-else-if="subdomain !== null">
@@ -48,6 +46,10 @@ import { TYPE_ALERT } from '~/types/enum/enums'
 import { useRefreshProfile } from '~/composables/data/useRefreshProfile'
 import { useRouteUtils } from '~/composables/utils/useRouteUtils'
 
+definePageMeta({
+  name: 'activate_a_subdomain',
+})
+
 const { em } = useEntityManager()
 const { fetch } = useEntityFetch()
 

+ 4 - 2
pages/parameters/subdomains/new.vue

@@ -1,7 +1,5 @@
 <template>
   <div>
-    <h3 class="my-8">{{ $t('record_a_new_subdomain') }}</h3>
-
     <v-card class="parameters-page-card">
       <UiForm
         ref="form"
@@ -62,6 +60,10 @@ import SubdomainValidation from '~/services/validation/subdomainValidation'
 import { useSubdomainValidation } from '~/composables/form/validation/useSubdomainValidation'
 import Form from '~/components/Ui/Form.vue'
 
+definePageMeta({
+  name: 'record_a_new_subdomain',
+})
+
 const i18n = useI18n()
 
 const { em } = useEntityManager()

+ 0 - 2
pages/parameters/super_admin.vue

@@ -1,7 +1,5 @@
 <template>
   <div>
-    <h3 class="my-8">{{ $t("parameters_super_admin_page")}}</h3>
-
     <v-card class="parameters-page-card">
       <div class="explanation">
         <div class="px-4 d-flex flex-row align-center justify-center py-2">

+ 0 - 2
pages/parameters/teaching.vue

@@ -1,7 +1,5 @@
 <template>
   <LayoutContainer>
-    <h3 class="my-8">{{ $t("parameters_teaching_page")}}</h3>
-
     <v-card class="parameters-page-card">
       <h4>{{ $t('configuration') }}</h4>
 

+ 0 - 2
pages/parameters/website.vue

@@ -1,7 +1,5 @@
 <template>
   <LayoutContainer>
-    <h3 class="my-8">{{ $t("parameters_website_page")}}</h3>
-
     <v-card class="parameters-page-card">
       <h4 class="flex-grow-1 align-self-center">
         {{ $t('your_website') }}