GenerateCardsSteps.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <!--
  2. -->
  3. <template>
  4. <v-stepper v-model="step"
  5. >
  6. <v-stepper-items>
  7. <v-stepper-content step="1">
  8. <div class="row">
  9. <LayoutHeaderUniversalCreationTypeCard
  10. v-if="$can('manage', 'users')"
  11. title="a_person"
  12. text-content="add_new_person_student"
  13. icon="fa fa-user"
  14. type="access"
  15. @typeClick="onTypeClick"
  16. />
  17. <LayoutHeaderUniversalCreationTypeCard
  18. v-if="$can('display', 'agenda_page')
  19. && ($ability.can('display', 'course_page')
  20. || $ability.can('display', 'exam_page')
  21. || $ability.can('display', 'pedagogics_project_page'))"
  22. title="an_event"
  23. text-content="add_an_event_course"
  24. icon="fa fa-calendar-alt"
  25. type="event"
  26. @typeClick="onTypeClick"
  27. />
  28. <LayoutHeaderUniversalCreationTypeCard
  29. v-else-if="$can('display', 'agenda_page') && $can('manage', 'events')"
  30. title="other_event" text-content="other_event_text_creation_card"
  31. icon="far fa-calendar" :link="adminLegacy+ '/calendar/create/events'" />
  32. <LayoutHeaderUniversalCreationTypeCard
  33. v-if="$can('display', 'message_send_page')
  34. && ($ability.can('manage', 'emails')
  35. || $ability.can('manage', 'mails')
  36. || $ability.can('manage', 'texto'))"
  37. title="a_correspondence"
  38. text-content="sen_email_letter"
  39. icon="fa fa-comment"
  40. type="message"
  41. @typeClick="onTypeClick"
  42. />
  43. <LayoutHeaderUniversalCreationTypeCard
  44. v-if="$can('manage', 'equipments')"
  45. title="a_materiel"
  46. text-content="add_any_type_material"
  47. icon="fa fa-cube"
  48. :link="adminLegacy+ '/list/create/equipment'"
  49. />
  50. </div>
  51. </v-stepper-content>
  52. <v-stepper-content step="2">
  53. <div class="row">
  54. <div v-if="type === 'access'" class="row">
  55. <LayoutHeaderUniversalCreationTypeCard v-if="isLaw1901" title="an_adherent" text-content="adherent_text_creation_card" icon="fa fa-user" :link="adminLegacy+ '/universal_creation_person/adherent'" ></LayoutHeaderUniversalCreationTypeCard>
  56. <LayoutHeaderUniversalCreationTypeCard v-if="isLaw1901" title="a_ca_member" text-content="ca_member_text_creation_card" icon="fa fa-users" :link="adminLegacy+ '/universal_creation_person/ca_member'" ></LayoutHeaderUniversalCreationTypeCard>
  57. <LayoutHeaderUniversalCreationTypeCard title="a_student" text-content="student_text_creation_card" icon="fa fa-user" :link="adminLegacy+ '/universal_creation_person/student'" ></LayoutHeaderUniversalCreationTypeCard>
  58. <LayoutHeaderUniversalCreationTypeCard title="a_guardian" text-content="guardian_text_creation_card" icon="fa fa-female" :link="adminLegacy+ '/universal_creation_person/guardian'" ></LayoutHeaderUniversalCreationTypeCard>
  59. <LayoutHeaderUniversalCreationTypeCard title="a_teacher" text-content="teacher_text_creation_card" icon="fa fa-graduation-cap" :link="adminLegacy+ '/universal_creation_person/teacher'" ></LayoutHeaderUniversalCreationTypeCard>
  60. <LayoutHeaderUniversalCreationTypeCard title="a_member_of_staff" text-content="personnel_text_creation_card" icon="fa fa-suitcase" :link="adminLegacy+ '/universal_creation_person/personnel'" ></LayoutHeaderUniversalCreationTypeCard>
  61. <LayoutHeaderUniversalCreationTypeCard title="a_legal_entity" text-content="moral_text_creation_card" icon="fa fa-building" :link="adminLegacy+ '/universal_creation_person/company'" ></LayoutHeaderUniversalCreationTypeCard>
  62. <LayoutHeaderUniversalCreationTypeCard title="another_type_of_contact" text-content="other_contact_text_creation_card" icon="fa fa-plus" :link="adminLegacy+ '/universal_creation_person/other_contact'" ></LayoutHeaderUniversalCreationTypeCard>
  63. </div>
  64. <div v-if="type === 'event'" class="row">
  65. <LayoutHeaderUniversalCreationTypeCard v-if="$can('display', 'course_page')" title="course" text-content="course_text_creation_card" icon="fa fa-users" :link="adminLegacy+ '/calendar/create/courses'" ></LayoutHeaderUniversalCreationTypeCard>
  66. <LayoutHeaderUniversalCreationTypeCard v-if="$can('display', 'exam_page')" title="exam" text-content="exam_text_creation_card" icon="fa fa-graduation-cap" :link="adminLegacy+ '/calendar/create/examens'" ></LayoutHeaderUniversalCreationTypeCard>
  67. <LayoutHeaderUniversalCreationTypeCard v-if="$can('display', 'pedagogics_project_page')" title="educational_services" text-content="educational_services_text_creation_card" icon="fa fa-suitcase" :link="adminLegacy+ '/calendar/create/educational_projects'" ></LayoutHeaderUniversalCreationTypeCard>
  68. <LayoutHeaderUniversalCreationTypeCard v-if="$can('manage', 'events')" title="other_event" text-content="other_event_text_creation_card" icon="far fa-calendar" :link="adminLegacy+ '/calendar/create/events'" ></LayoutHeaderUniversalCreationTypeCard>
  69. </div>
  70. <div v-if="type === 'message'" class="row">
  71. <LayoutHeaderUniversalCreationTypeCard v-if="$can('manage', 'emails')" title="an_email" text-content="email_text_creation_card" icon="far fa-envelope" :link="adminLegacy+ '/list/create/emails'"></LayoutHeaderUniversalCreationTypeCard>
  72. <LayoutHeaderUniversalCreationTypeCard v-if="$can('manage', 'mails')" title="a_letter" text-content="letter_text_creation_card" icon="far fa-file-alt" :link="adminLegacy+ '/list/create/mails'"></LayoutHeaderUniversalCreationTypeCard>
  73. <LayoutHeaderUniversalCreationTypeCard v-if="$can('manage', 'texto')" title="an_sms" text-content="sms_text_creation_card" icon="fa fa-mobile-alt" :link="adminLegacy+ '/list/create/sms'"></LayoutHeaderUniversalCreationTypeCard>
  74. </div>
  75. </div>
  76. </v-stepper-content>
  77. </v-stepper-items>
  78. </v-stepper>
  79. </template>
  80. <script lang="ts">
  81. import {defineComponent, ref, Ref, useContext} from '@nuxtjs/composition-api'
  82. import { $organizationProfile } from '~/services/profile/organizationProfile'
  83. export default defineComponent({
  84. props: {
  85. step: {
  86. type: Number,
  87. required: true
  88. }
  89. },
  90. setup (_,{emit}) {
  91. const { $config, store } = useContext()
  92. const onTypeClick = (step:Number,Cardtype:String)=>{
  93. type.value = Cardtype;
  94. emit('updateStep', {stepChoice: step, typeChoice: Cardtype});
  95. }
  96. const type:Ref<String> = ref('');
  97. const organizationProfile = $organizationProfile(store)
  98. return {
  99. type,
  100. onTypeClick,
  101. adminLegacy: $config.baseURL_adminLegacy,
  102. isLaw1901: organizationProfile.isAssociation()
  103. }
  104. }
  105. })
  106. </script>
  107. <style lang="scss" scoped>
  108. .creation-type-container{
  109. border: none!important;
  110. .icon{
  111. i{
  112. font-size: 50px;
  113. color: var(--v-ot_grey-base, #777777);
  114. }
  115. }
  116. .infos-container{
  117. padding: 15px 0;
  118. h4{
  119. font-size: 15px;
  120. color: var(--v-ot_green-base, #00AD8E);
  121. font-weight: bold;
  122. margin-bottom: 6px;
  123. }
  124. p{
  125. font-size: 13px;
  126. padding: 0;
  127. margin: 0;
  128. color: #767676;
  129. }
  130. }
  131. &>div{
  132. &:hover{
  133. cursor: pointer;
  134. background: var(--v-ot_light_green-base, #a9e0d6);
  135. }
  136. }
  137. }
  138. </style>