GenerateCardsSteps.vue 7.9 KB

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