GenerateCardsSteps.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. <!--
  2. -->
  3. <template>
  4. <v-stepper v-model="step">
  5. <v-stepper-items>
  6. <v-stepper-content step="1">
  7. <div class="row">
  8. <LayoutHeaderUniversalCreationTypeCard
  9. v-if="can('manage', 'users')"
  10. title="a_person"
  11. text-content="add_new_person_student"
  12. icon="fa fa-user"
  13. type="access"
  14. @typeClick="onTypeClick"
  15. />
  16. <LayoutHeaderUniversalCreationTypeCard
  17. v-if="can('display', 'agenda_page')
  18. && (can('display', 'course_page')
  19. || can('display', 'exam_page')
  20. || can('display', 'pedagogics_project_page'))"
  21. title="an_event"
  22. text-content="add_an_event_course"
  23. icon="fa fa-calendar-alt"
  24. type="event"
  25. @typeClick="onTypeClick"
  26. />
  27. <LayoutHeaderUniversalCreationTypeCard
  28. v-else-if="can('display', 'agenda_page') && can('manage', 'events')"
  29. title="other_event"
  30. text-content="other_event_text_creation_card"
  31. icon="far fa-calendar"
  32. :link="adminLegacy + '/calendar/create/events'"
  33. />
  34. <LayoutHeaderUniversalCreationTypeCard
  35. v-if="can('display', 'message_send_page')
  36. && (can('manage', 'emails')
  37. || can('manage', 'mails')
  38. || can('manage', 'texto'))"
  39. title="a_correspondence"
  40. text-content="sen_email_letter"
  41. icon="fa fa-comment"
  42. type="message"
  43. @typeClick="onTypeClick"
  44. />
  45. <LayoutHeaderUniversalCreationTypeCard
  46. v-if="can('manage', 'equipments')"
  47. title="a_materiel"
  48. text-content="add_any_type_material"
  49. icon="fa fa-cube"
  50. :link="adminLegacy + '/list/create/equipment'"
  51. />
  52. </div>
  53. </v-stepper-content>
  54. <v-stepper-content step="2">
  55. <div class="row">
  56. <div v-if="type === 'access'" class="row">
  57. <LayoutHeaderUniversalCreationTypeCard
  58. v-if="isLaw1901"
  59. title="an_adherent"
  60. text-content="adherent_text_creation_card"
  61. icon="fa fa-user"
  62. :link="adminLegacy + '/universal_creation_person/adherent'" />
  63. <LayoutHeaderUniversalCreationTypeCard
  64. v-if="isLaw1901"
  65. title="a_ca_member"
  66. text-content="ca_member_text_creation_card"
  67. icon="fa fa-users"
  68. :link="adminLegacy + '/universal_creation_person/ca_member'" />
  69. <LayoutHeaderUniversalCreationTypeCard
  70. title="a_student"
  71. text-content="student_text_creation_card"
  72. icon="fa fa-user"
  73. :link="adminLegacy + '/universal_creation_person/student'" />
  74. <LayoutHeaderUniversalCreationTypeCard
  75. title="a_guardian"
  76. text-content="guardian_text_creation_card"
  77. icon="fa fa-female"
  78. :link="adminLegacy + '/universal_creation_person/guardian'" />
  79. <LayoutHeaderUniversalCreationTypeCard
  80. title="a_teacher"
  81. text-content="teacher_text_creation_card"
  82. icon="fa fa-graduation-cap"
  83. :link="adminLegacy + '/universal_creation_person/teacher'" />
  84. <LayoutHeaderUniversalCreationTypeCard
  85. title="a_member_of_staff"
  86. text-content="personnel_text_creation_card"
  87. icon="fa fa-suitcase"
  88. :link="adminLegacy + '/universal_creation_person/personnel'" />
  89. <LayoutHeaderUniversalCreationTypeCard
  90. title="a_legal_entity"
  91. text-content="moral_text_creation_card"
  92. icon="fa fa-building"
  93. :link="adminLegacy + '/universal_creation_person/company'" />
  94. <LayoutHeaderUniversalCreationTypeCard
  95. title="another_type_of_contact"
  96. text-content="other_contact_text_creation_card"
  97. icon="fa fa-plus"
  98. :link="adminLegacy + '/universal_creation_person/other_contact'" />
  99. </div>
  100. <div v-if="type === 'event'" class="row">
  101. <LayoutHeaderUniversalCreationTypeCard
  102. v-if="can('display', 'course_page')"
  103. title="course"
  104. text-content="course_text_creation_card"
  105. icon="fa fa-users"
  106. :link="adminLegacy + '/calendar/create/courses'" />
  107. <LayoutHeaderUniversalCreationTypeCard
  108. v-if="can('display', 'exam_page')"
  109. title="exam"
  110. text-content="exam_text_creation_card"
  111. icon="fa fa-graduation-cap"
  112. :link="adminLegacy + '/calendar/create/examens'" />
  113. <LayoutHeaderUniversalCreationTypeCard
  114. v-if="can('display', 'pedagogics_project_page')"
  115. title="educational_services"
  116. text-content="educational_services_text_creation_card"
  117. icon="fa fa-suitcase"
  118. :link="adminLegacy + '/calendar/create/educational_projects'" />
  119. <LayoutHeaderUniversalCreationTypeCard
  120. v-if="can('manage', 'events')"
  121. title="other_event"
  122. text-content="other_event_text_creation_card"
  123. icon="far fa-calendar"
  124. :link="adminLegacy + '/calendar/create/events'" />
  125. </div>
  126. <div v-if="type === 'message'" class="row">
  127. <LayoutHeaderUniversalCreationTypeCard
  128. v-if="can('manage', 'emails')"
  129. title="an_email"
  130. text-content="email_text_creation_card"
  131. icon="far fa-envelope"
  132. :link="adminLegacy + '/list/create/emails'" />
  133. <LayoutHeaderUniversalCreationTypeCard
  134. v-if="can('manage', 'mails')"
  135. title="a_letter"
  136. text-content="letter_text_creation_card"
  137. icon="far fa-file-alt"
  138. :link="adminLegacy + '/list/create/mails'" />
  139. <LayoutHeaderUniversalCreationTypeCard
  140. v-if="can('manage', 'texto')"
  141. title="an_sms"
  142. text-content="sms_text_creation_card"
  143. icon="fa fa-mobile-alt"
  144. :link="adminLegacy + '/list/create/sms'" />
  145. </div>
  146. </div>
  147. </v-stepper-content>
  148. </v-stepper-items>
  149. </v-stepper>
  150. </template>
  151. <script setup lang="ts">
  152. import {Ref, ref} from "@vue/reactivity";
  153. import {useOrganizationProfileStore} from "~/stores/organizationProfile";
  154. import {useAbility} from "@casl/vue";
  155. const props = defineProps({
  156. step: {
  157. type: Number,
  158. required: true
  159. }
  160. })
  161. const emit = defineEmits(['updateStep'])
  162. const { can } = useAbility()
  163. const onTypeClick = (step: Number, Cardtype: String) => {
  164. type.value = Cardtype;
  165. emit('updateStep', { stepChoice: step, typeChoice: Cardtype });
  166. }
  167. const type: Ref<String> = ref('');
  168. const organizationProfile = useOrganizationProfileStore()
  169. const runtimeConfig = useRuntimeConfig()
  170. const adminLegacy: Ref<string> = ref(runtimeConfig.baseURL_adminLegacy)
  171. const isLaw1901: Ref<boolean> = ref(organizationProfile.isAssociation())
  172. </script>
  173. <style lang="scss" scoped>
  174. .creation-type-container{
  175. border: none!important;
  176. .icon{
  177. i{
  178. font-size: 50px;
  179. color: var(--v-theme-ot-grey, #777777);
  180. }
  181. }
  182. .infos-container{
  183. padding: 15px 0;
  184. h4{
  185. font-size: 15px;
  186. color: var(--v-theme-ot-green, #00AD8E);
  187. font-weight: bold;
  188. margin-bottom: 6px;
  189. }
  190. p{
  191. font-size: 13px;
  192. padding: 0;
  193. margin: 0;
  194. color: #767676;
  195. }
  196. }
  197. &>div{
  198. &:hover{
  199. cursor: pointer;
  200. background: var(--v-theme-ot-light_green, #a9e0d6);
  201. }
  202. }
  203. }
  204. </style>