templates/Front/Scholar/Lesson/show.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block back_to_dashboard %}
  3. {% include 'Front/Scholar/Partial/_back_to_dashboard.html.twig' %}
  4. {% endblock back_to_dashboard %}
  5. {% block title %}{{ lesson.name }} - {{ parent() }}{% endblock %}
  6. {% set currentRoute = app.request.attributes.get('_route') %}
  7. {% block stylesheets %}
  8. {{ parent() }}
  9. {{ encore_entry_link_tags('styles', 'core', 'core') }}
  10. {% endblock %}
  11. {% block before_navbar %}
  12. {% include 'Front/Scholar/Partial/_preview_manager_heager.html.twig' with {
  13. 'channel': channel,
  14. 'currentRoute': currentRoute,
  15. } %}
  16. {% endblock before_navbar %}
  17. {% block body_markup %}
  18. <body class="progression lesson-view {% if is_granted('IS_AUTHENTICATED_REMEMBERED') %}logged-in{% endif %}"
  19. style="font-family: 'Poppins';"
  20. id="page-training-lesson"
  21. {% if currentRoute == 'front_channel_lesson_show' %}
  22. data-training_id={{ training.id }}
  23. data-module_id={{ module.id }}
  24. data-lesson_id={{ lesson.id }}
  25. {% endif %}
  26. >
  27. {% endblock body_markup %}
  28. {% block content %}
  29. {% if currentRoute in ['front_channel_lesson_show', 'front_channel_lesson_show_without_training', 'manager_channel_module_lesson_show', 'manager_channel_training_module_lesson_show'] %}
  30. {% set trainingModuleLessons = module | get_lessons %}
  31. {% elseif currentRoute in ['manager_channel_lesson_show'] %}
  32. {% set trainingModuleLessons = [lesson] %}
  33. {% endif %}
  34. {% if app.user %}
  35. <twig:ChannelUserData:CursusLockout
  36. :cursus="cursus ?? null"
  37. ></twig:ChannelUserData:CursusLockout>
  38. {% endif %}
  39. {% include 'Front/Scholar/Partial/_menu_lessons_mobile.html.twig' %}
  40. <div class="container pt-md-5 pb-md-5 pt-3 pb-3 summary-lesson font-size-14">
  41. <div class="row">
  42. <div class="col-md-9 col-12">
  43. <div>
  44. {% for key, messageType in app.flashes() %}
  45. <div>
  46. {% for message in messageType %}
  47. <div class="alert alert-{{ key|replace({'error': 'danger'}) }}">
  48. {{ message | trans }}
  49. </div>
  50. {% endfor %}
  51. </div>
  52. {% endfor %}
  53. </div>
  54. <h2 class="v2-title-big">{{- 'front.scholar.lesson.show.summary_title.label'|trans({'%name%': lesson.name}) -}}</h2>
  55. {% include 'Front/Scholar/Partial/_content_alert.html.twig' %}
  56. <div class="col-12 col-lg-6 d-flex justify-content-between align-items-baseline p-0">
  57. {% if lesson is lock_by_interface %}
  58. {% set lessonStats = lesson.lockBy.lessonStats %}
  59. {% else %}
  60. {% set lessonStats = lesson.lessonStats %}
  61. {% endif %}
  62. {% if lessonStats is not null %}
  63. {{ get_rating_component(lessonStats.lessonReviewMarkAvg, 5, {'class': 'blue-stars', 'hide_when_null': true}) }}
  64. {% endif %}
  65. <div>
  66. {% if lesson.updatedAt is not null %}
  67. {{- 'front.scholar.training.show.createdAt.label'|trans({
  68. '%date%': lesson.updatedAt|format_date('long', locale=app.request.locale),
  69. })|raw -}}
  70. {% else %}
  71. {{- 'front.scholar.training.show.createdAt.label'|trans({
  72. '%date%': lesson.createdAt|format_date('long', locale=app.request.locale),
  73. })|raw -}}
  74. {% endif %}
  75. </div>
  76. </div>
  77. <div class="description-lesson mt-4 lesson-content">
  78. <p class="text-subcateg description-style">{{- lesson.description|raw -}}</p>
  79. </div>
  80. {% if lesson.objective is not null %}
  81. <div class="pt-30px">
  82. <div class="font-weight-bold pb-10px">{{- 'front.scholar.lesson.show.objectif_cours.label'|trans -}}</div>
  83. <p class="text-subcateg description-style">{{- lesson.objective -}}</p>
  84. </div>
  85. {% endif %}
  86. {% if lesson.lessonPrerequisites|length > 0 %}
  87. <div class="pt-30px mb-3">
  88. <div class="font-weight-bold pb-10px">{{- 'front.scholar.lesson.show.pre_requis.label'|trans -}}</div>
  89. {% for prerequisite in lesson.lessonPrerequisites %}
  90. <p class="font-size-14 m-0">{{- '- ' ~ prerequisite.label -}}</p>
  91. {% endfor %}
  92. </div>
  93. {% endif %}
  94. {% if lesson.minimumTime is not null %}
  95. {% set minimumTime = lesson.minimumTime | format_datetime(pattern = "HH'h'mm", locale=app.request.locale) %}
  96. {% else %}
  97. {% set minimumTime = null %}
  98. {% endif %}
  99. {% set caseStudy = lesson.caseStudy %}
  100. {% set mcq = lesson.exerciseCount %}
  101. {% if minimumTime or caseStudy or mcq %}
  102. <div class="row pt-20px">
  103. <div class="col-6 col-md-4 pt-10px">
  104. <div class="d-flex flex-row">
  105. <img class="small-svg" src="{{ asset('build/common/watch.svg', 'common') }}"
  106. alt="Temps minimum logo"/>
  107. <div>
  108. <div class="font-weight-bold">{{- 'front.scholar.lesson.show.temps_minimum.label'|trans -}}</div>
  109. <div class="text-subcateg">{{- minimumTime -}}</div>
  110. </div>
  111. </div>
  112. </div>
  113. <div class="col-6 col-md-4 pt-10px">
  114. <div class="d-flex flex-row">
  115. <img class="small-svg" src="{{ asset('build/common/sheet-user.svg', 'common') }}"
  116. alt="Cas pratique logo"/>
  117. <div>
  118. <div class="font-weight-bold">{{- 'front.scholar.lesson.show.cas_pratique.label'|trans -}}</div>
  119. {% if caseStudy %}
  120. <div class="text-subcateg">Oui</div>
  121. {% else %}
  122. <div class="text-subcateg">Non</div>
  123. {% endif %}
  124. </div>
  125. </div>
  126. </div>
  127. <div class="col-6 col-md-4 pt-10px">
  128. <div class="d-flex flex-row">
  129. <img class="small-svg" src="{{ asset('build/common/sheet-pen.svg', 'common') }}"
  130. alt="QCM logo"/>
  131. <div>
  132. <div class="font-weight-bold">{{- 'front.scholar.lesson.show.qcm.label'|trans -}}</div>
  133. {% if mcq %}
  134. <div class="text-subcateg">Oui</div>
  135. {% else %}
  136. <div class="text-subcateg">Non</div>
  137. {% endif %}
  138. </div>
  139. </div>
  140. </div>
  141. </div>
  142. {% endif %}
  143. {% if currentRoute == 'front_channel_lesson_show' %}
  144. {% include 'Front/Scholar/Partial/_scholar_navigation_previous_after.html.twig' with {
  145. next_informations: get_next_informations_lesson_summary(training, module, lesson),
  146. previous_informations: get_previous_informations_lesson_summary(training, module, lesson),
  147. } %}
  148. {% endif %}
  149. </div>
  150. <div class="col-3 d-none d-md-block">
  151. {% include 'Front/Scholar/Partial/menu_lessons.html.twig' %}
  152. </div>
  153. </div>
  154. </div>
  155. {{ parent() }}
  156. {% endblock content %}
  157. {% block inner_content %}
  158. {{ parent() }}
  159. {% endblock inner_content %}
  160. {% block body %}
  161. {{ parent() }}
  162. {% endblock %}
  163. {% block javascripts %}
  164. {% if app.user and currentRoute == 'front_channel_lesson_show' %}
  165. <script>
  166. var attendanceLessonUrl = '{{ url('async_channel_scholar_attendance_lesson', {
  167. 'channelId': channel.id
  168. }) }}';
  169. </script>
  170. {% endif %}
  171. {{ parent() }}
  172. {% endblock %}