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

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% set currentRoute = app.request.attributes.get('_route') %}
  3. {% set has_front_access = is_granted('FRONT_ACCESS', {
  4. 'training': sub,
  5. }) %}
  6. {% block stylesheets %}
  7. {{ parent() }}
  8. {{ encore_entry_link_tags('styles', 'core', 'core') }}
  9. {% endblock %}
  10. {% block before_navbar %}
  11. {% if currentRoute == 'manager_channel_training_show' %}
  12. <div style="background-color: #E9F8F8;" class="p-2 justify-content-center align-items-center d-flex flex-column flex-md-row text-center">
  13. {% set headerReturnLink = null %}
  14. {% if currentRoute == 'manager_channel_training_show' %}
  15. {% set headerReturnLink = path('manager_channel_trainings', {'channelId': channel.id}) %}
  16. {% endif %}
  17. <div style="font-weight: bold; color: #212B7A" class="mx-1">Vous êtes en mode visualisation de l'interface pour les administrateurs.</div>
  18. <div style="font-weight: bold"><a href="{{- headerReturnLink -}}" style="text-decoration: underline">Revenir à la page d'administration</a></div>
  19. </div>
  20. {% endif %}
  21. {% endblock before_navbar %}
  22. {% block title %}{{ sub.name }} - {{ parent() }}{% endblock %}
  23. {% block content %}
  24. {% set advice_avg = sub|advice_avg_by_training %}
  25. {% if app.user %}
  26. <twig:ChannelUserData:CursusLockout
  27. :cursus="cursus ?? null"
  28. ></twig:ChannelUserData:CursusLockout>
  29. {% endif %}
  30. <div class="jumbotron-v2 mb-4">
  31. <div class="container">
  32. <h2 class="v2-title-big">
  33. {{- 'front.scholar.training.show.title.label'|trans({
  34. '%name%': sub.name,
  35. }) -}}
  36. </h2>
  37. <div class="md-none">
  38. <div class="info-content mt-4 {% if advice_avg is same as null %} info-without-advice {% endif %}">
  39. <div>
  40. <i class="fas fa-users"></i>
  41. <p>{{ sub|countCursusForTraining }}</p>
  42. </div>
  43. {% if advice_avg is not same as null %}
  44. <div>
  45. <i class="fas fa-star"></i>
  46. <p>{{ advice_avg }} ({{ sub|get_count_advice_training }})</p>
  47. </div>
  48. {% endif %}
  49. <div class="dot-div"></div>
  50. <div>
  51. {% if sub.updatedAt is not null %}
  52. {{- 'front.scholar.training.show.createdAt.label'|trans({
  53. '%date%': sub.updatedAt|format_datetime('long', locale=app.request.locale),
  54. })|raw -}}
  55. {% else %}
  56. {{- 'front.scholar.training.show.createdAt.label'|trans({
  57. '%date%': sub.createdAt|format_datetime('long', locale=app.request.locale),
  58. })|raw -}}
  59. {% endif %}
  60. </div>
  61. </div>
  62. </div>
  63. <div class="md-set">
  64. <div class="info-content mt-4">
  65. <div>
  66. <div>
  67. <i class="fas fa-users"></i>
  68. <p>{{ sub|countCursusForTraining }}</p>
  69. </div>
  70. {% if advice_avg is not same as null %}
  71. <div class="info-content-stars">
  72. <i class="fas fa-star"></i>
  73. <p>{{ advice_avg }} ({{ sub|get_count_advice_training }})</p>
  74. </div>
  75. {% endif %}
  76. </div>
  77. <div class="mt-2">
  78. <div class="dot-div">
  79. <i class="fas fa-circle"></i>
  80. </div>
  81. <div>
  82. {% if sub.updatedAt is not null %}
  83. {{- 'front.scholar.training.show.createdAt.label'|trans({
  84. '%date%': sub.updatedAt|format_datetime('long', locale=app.request.locale),
  85. })|raw -}}
  86. {% else %}
  87. {{- 'front.scholar.training.show.createdAt.label'|trans({
  88. '%date%': sub.createdAt|format_datetime('long', locale=app.request.locale),
  89. })|raw -}}
  90. {% endif %}
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. <div class="description mt-4">
  96. <p>{{ sub.description }}</p>
  97. </div>
  98. </div>
  99. </div>
  100. {{ parent() }}
  101. {% endblock content %}
  102. {% block inner_content %}
  103. <div class="row">
  104. <div class="col-lg-9 col-md-8 mb-3">
  105. <h2 class="v2-title-small mt-5">{{ 'front.scholar.training.show.sub_title.programm.label'|trans }}</h2>
  106. <div id="accordion" class="accordion-nellapp mt-5">
  107. {% for module in firstModules %}
  108. {% include 'Front/Scholar/Training/Partial/accordion-item.html.twig' with {'module' : module, 'loop': loop, 'training' : sub} %}
  109. {% endfor %}
  110. {% if lastModules|length %}
  111. <div class="more-module" style="display: none">
  112. {% for module in lastModules %}
  113. {% include 'Front/Scholar/Training/Partial/accordion-item.html.twig' with {'module' : module, 'loop': loop, 'training': sub} %}
  114. {% endfor %}
  115. </div>
  116. <div class="w100-flex-center-x mt-3 div-btn-see-more">
  117. <button class="btn-see-more-v2"
  118. data-btn-more-module="true">
  119. {{ 'front.scholar.training.list.button.see_more.label'|trans }}
  120. 5/{{ 5 + lastModules|length }}
  121. </button>
  122. </div>
  123. <div class="w100-flex-center-x mt-3 div-btn-see-less" style="display: none">
  124. <button class="btn-see-more-v2"
  125. data-btn-less-module="true">
  126. {{ 'front.scholar.training.list.button.see_less.label'|trans }}
  127. </button>
  128. </div>
  129. {% endif %}
  130. </div>
  131. </div>
  132. <div class="col-lg-3 col-md-4 order-first order-md-last">
  133. <div class="card-elevation-training">
  134. <div class="card-img-top">
  135. <img class="img-top-card img-responsive" src="{{ sub|get_training_img_url }}" alt="{{ sub.name }}">
  136. </div>
  137. <div class="card-body">
  138. <div class="channel-name d-flex">
  139. <div>
  140. <div class="img-logo-rounded">
  141. {% include 'Front/Channel/Image/_image_main_avatar.html.twig' with {'channel': sub.ownerChannel} %}
  142. </div>
  143. </div>
  144. <div class="channel-description">
  145. <a href="{{ path('front_channel_show', {'channelId' : sub.ownerChannel.id }) }}"
  146. class="font-weight-bold">{{ sub.ownerChannel.name }}</a>
  147. {% if sub.ownerChannel.slogan is not empty %}
  148. <p class="small">
  149. {{ sub.ownerChannel.slogan }}
  150. </p>
  151. {% endif %}
  152. </div>
  153. </div>
  154. <div class="training-stats mt-4">
  155. {% if sub.trainingType is not null %}
  156. <div class="row mt-3">
  157. <div class="col-12 content-stat">
  158. <div>
  159. <i class="fas fa-book-open"></i>
  160. </div>
  161. <p>{{ sub | get_training_type_key | trans }}</p>
  162. </div>
  163. </div>
  164. {% endif %}
  165. {% if sub.totalHourDescription is not null %}
  166. <div class="row mt-3">
  167. <div class="col-12 content-stat">
  168. <div>
  169. <i class="fas fa-stopwatch"></i>
  170. </div>
  171. <p>{{ sub.totalHourDescription }} {{ 'front.scholar.training.show.card.total_hour.label'|trans }}</p>
  172. </div>
  173. </div>
  174. {% endif %}
  175. {% if sub.videoDescription is not null %}
  176. <div class="row mt-3">
  177. <div class="col-12 content-stat">
  178. <div>
  179. <i class="fas fa-file-video"></i>
  180. </div>
  181. <p>{{ sub.videoDescription }} {{ 'front.scholar.training.show.card.video_time.label'|trans }}</p>
  182. </div>
  183. </div>
  184. {% endif %}
  185. {% set count_exercises = sub|count_exercises_by_training %}
  186. {% if count_exercises != 0 %}
  187. <div class="row mt-3">
  188. <div class="col-12 content-stat">
  189. <div>
  190. <i class="far fa-list-alt"></i>
  191. </div>
  192. <p>{{ count_exercises }} {{ 'front.scholar.training.show.card.use_case.label'|trans }}</p>
  193. </div>
  194. </div>
  195. {% endif %}
  196. {% if sub.diplomaDescription is not null %}
  197. <div class="row mt-3">
  198. <div class="col-12 content-stat">
  199. <div>
  200. <i class="fas fa-graduation-cap"></i>
  201. </div>
  202. <p>{{ sub.diplomaDescription }}</p>
  203. </div>
  204. </div>
  205. {% endif %}
  206. </div>
  207. {% if sub.trainingProduct is not null and not has_front_access %}
  208. <div class="mt-4 w100-flex-center-x">
  209. {% set value = sub.trainingProduct.price * 1 %}
  210. <p class="price-card-training">{{ 'front.scholar.training.show.card.price.label'|trans({'%price%' : value}) }}
  211. *</p>
  212. </div>
  213. <div class="mt-2 w100-flex-center-x">
  214. <p class="price-note-card-training">{{ 'front.scholar.training.show.card.price.note'|trans({'%funding_contact_path%' : path('front_channel_training_payment_funding_contact', {'training_id': sub.id})}) | raw }}</p>
  215. </div>
  216. {% endif %}
  217. {% if not sub.public and currentRoute == 'front_channel_training_show' %}
  218. <div class="text-center mt-4 div-btn-card-show-training d-flex flex-column">
  219. {% if has_front_access %}
  220. <div class="w100-flex-center-x">
  221. <div class="progress-circle">
  222. <div class="c100 p{{ trainingProgression.progression }} blue light-green-fill medium">
  223. <div class="slice">
  224. <div class="bar"></div>
  225. <div class="fill"></div>
  226. </div>
  227. </div>
  228. </div>
  229. </div>
  230. <div class="mb-2 training-progress-percent">
  231. {{ trainingProgression.progression }} %
  232. </div>
  233. {% if nellapp_url_exist('core', 'app_account_show_cursus') and cursus is defined and cursus is not null %}
  234. <a href="{{ nellapp_url('core', 'app_account_show_cursus', {
  235. 'cursusId': cursus.id
  236. }) }}"
  237. class="see-training-progress-link">{{ 'front.scholar.training.show.card.progression.link.label' | trans }}
  238. </a>
  239. {% endif %}
  240. {% set lastChapterAchieved = getLastAchievedChapter(sub) %}
  241. {% if lastChapterAchieved is not null %}
  242. <a href="{{ path('front_channel_chapter_show', {
  243. 'trainingId': lastChapterAchieved['trainingId'],
  244. 'moduleId': lastChapterAchieved['moduleId'],
  245. 'lessonId': lastChapterAchieved['lessonId'],
  246. 'chapterId': lastChapterAchieved['chapterId'],
  247. }) }}"
  248. class="btn-nellapp-v2 mt-3 d-inline-block">
  249. {{ 'front.scholar.training.show.card.continue_btn.label' | trans }}
  250. </a>
  251. {% endif %}
  252. {% else %}
  253. <a href="{{ path('front_channel_training_payment_funding_contact', {'training_id': sub.id}) }}"
  254. class="btn btn-nellapp-v2">
  255. {{ 'front.scholar.training.show.actions.follow.label'|trans }}
  256. </a>
  257. {% endif %}
  258. </div>
  259. {% endif %}
  260. </div>
  261. </div>
  262. {% include 'Front/Scholar/Partial/_back_to_dashboard.html.twig' with {
  263. 'wrapper_class': 'mt-3 d-flex justify-content-center',
  264. 'button_class': 'nellapp-outline-btn text-decoration-none',
  265. } %}
  266. </div>
  267. </div>
  268. {% if training_descriptions|length > 0 %}
  269. <div class="row">
  270. <div class="col-12">
  271. <h2 class="v2-title-small mt-5 mb-2">{{ 'front.scholar.training.show.sub_title.plus.label'|trans }}</h2>
  272. </div>
  273. <div class="col-lg-9 col-md-8">
  274. <div class="row">
  275. {% for description in training_descriptions %}
  276. <div class="col-12 col-sm-12 col-md-12 col-lg-6 col-xl-6 mt-4">
  277. {% include 'Front/Scholar/Card/training-description.html.twig' with {'description' : description} %}
  278. </div>
  279. {% endfor %}
  280. </div>
  281. </div>
  282. </div>
  283. {% endif %}
  284. <div class="row mt-3">
  285. <div class="col-12">
  286. <h2 class="v2-title-small mt-5 mb-2">{{ 'front.scholar.training.show.sub_title.channel.label'|trans }}</h2>
  287. </div>
  288. <div class="col-lg-9 col-md-8">
  289. <div class="row">
  290. <div class="col-12">
  291. <div class="mt-3">
  292. {% include 'Front/Scholar/Card/channel.html.twig' with {'channel' : sub.ownerChannel} %}
  293. </div>
  294. </div>
  295. </div>
  296. </div>
  297. </div>
  298. {% if teacher_entities|length > 0 %}
  299. <div class="row mt-3">
  300. <div class="col-12">
  301. <h2 class="v2-title-small mt-5 mb-2">{{ 'front.scholar.training.show.sub_title.teacher.label'|trans }}
  302. ({{ teacher_entities|length }})</h2>
  303. </div>
  304. </div>
  305. {% for teacher in teacher_entities %}
  306. <div class="col-lg-9 col-md-8">
  307. <div class="row">
  308. <div class="col-12">
  309. <div class="mt-3">
  310. {% include 'Front/Scholar/Card/teacher.html.twig' with {'teacher' : teacher} %}
  311. </div>
  312. </div>
  313. </div>
  314. </div>
  315. {% endfor %}
  316. {% endif %}
  317. {% if training_advices is defined and training_advices|length > 0 %}
  318. <div class="row mt-3 mb-5">
  319. <div class="col-lg-9 col-md-8">
  320. <div class="row">
  321. <div class="col-12">
  322. <div class="div-title-between mt-5 mb-2">
  323. <h2 class="v2-title-small">{{ 'front.scholar.training.show.sub_title.advice.label'|trans }}
  324. ({{ training_advices|length }})</h2>
  325. <p class=""><i class="far fa-star"></i> {{ advice_avg }}</p>
  326. </div>
  327. </div>
  328. <div class="col-12">
  329. <div class="mt-3">
  330. {% set adviceCount = 1 %}
  331. {% set break = false %}
  332. {% for advice in training_advices %}
  333. {% if not break %}
  334. {% include 'Front/Scholar/Card/advice.html.twig' with {'advice' : advice} %}
  335. {% set adviceCount = adviceCount + 1 %}
  336. {% if adviceCount == 6 %}
  337. {% set break = true %}
  338. {% endif %}
  339. {% endif %}
  340. {% endfor %}
  341. {% set adviceCount = 1 %}
  342. {% if training_advices|length > 5 %}
  343. <div class="div-more-advice">
  344. {% for advice in training_advices %}
  345. {% set adviceCount = adviceCount + 1 %}
  346. {% if adviceCount > 6 %}
  347. {% include 'Front/Scholar/Card/advice.html.twig' with {'advice' : advice} %}
  348. {% endif %}
  349. {% endfor %}
  350. </div>
  351. {% endif %}
  352. </div>
  353. </div>
  354. </div>
  355. </div>
  356. </div>
  357. {% endif %}
  358. {% if form is defined and app.user %}
  359. <div class="row">
  360. <div class="col-lg-9 col-md-8">
  361. <p class="small-description">{{ 'front.scholar.training.show.sub_title.advice.sentence.enter_key.label'|trans }}</p>
  362. </div>
  363. </div>
  364. <div class="row" {% if advice_user is defined and advice_user is not null %} {% if advice_user.note is not null %}data-advice-current-note="{{ advice_user.note }}"{% endif %}{% endif %}>
  365. <div class="col-lg-9 col-md-8 mt-1">
  366. <div class="form-advice-content">
  367. <div class="avatar-rounded">{{ app.user|user_avatar }}</div>
  368. <div class="form-advice-bg-gray">
  369. {{ form_start(form) }}
  370. <div style="display: none">
  371. {{ form_widget(form.note) }}
  372. </div>
  373. {{ form_widget(form.comment) }}
  374. {{ form_errors(form.comment) }}
  375. {{ form_end(form) }}
  376. <div class="stars-rating">
  377. <i class="far fa-star" data-rating="1"></i>
  378. <i class="far fa-star" data-rating="2"></i>
  379. <i class="far fa-star" data-rating="3"></i>
  380. <i class="far fa-star" data-rating="4"></i>
  381. <i class="far fa-star" data-rating="5"></i>
  382. </div>
  383. <div class="center-y ml-2">
  384. <span id="span-nb-note-advice">0</span>
  385. </div>
  386. </div>
  387. </div>
  388. </div>
  389. </div>
  390. {% if advice_user is not null %}
  391. {% if advice_user.id is not null %}
  392. <div class="row">
  393. <div class="col-lg-9 col-md-8 mt-1">
  394. <div class="w100-flex-end-x">
  395. <a class="delete-btn-advice"
  396. href="{{ path('front_training_advice_delete', {'id' : advice_user.id}) }}">{{ 'front.scholar.training.show.sub_title.advice.action.delete.label'|trans }}</a>
  397. </div>
  398. </div>
  399. </div>
  400. {% endif %}
  401. {% endif %}
  402. {% endif %}
  403. {% if training_advices is defined and training_advices|length > 5 %}
  404. <div class="row">
  405. <div class="col-lg-9 col-md-8 mt-5">
  406. <div class="w100-flex-center-x">
  407. <button class="see-more-btn"
  408. id="training-advice-see-more">{{ 'front.scholar.training.advice.see_more.label'|trans({'%count%': training_advices|length}) }}</button>
  409. </div>
  410. </div>
  411. </div>
  412. {% endif %}
  413. <div class="empty-div-bottom"></div>
  414. {% endblock inner_content %}
  415. {% block body %}
  416. {{ parent() }}
  417. {% if is_granted('CHANNEL_USER_PERM_TRAINING_SHOW', sub) %}
  418. <div class="modal fade" id="delete-modal" tabindex="-1" role="dialog"
  419. aria-labelledby="delete-modal-label" aria-hidden="true">
  420. <div class="modal-dialog" role="document">
  421. <div class="modal-content">
  422. <div class="modal-header">
  423. <h5 class="modal-title" id="delete-modal-label">
  424. {{ 'front.scholar.training.show.actions.delete.modal.title.label'|trans({
  425. '%name%': sub.name,
  426. })|raw }}
  427. </h5>
  428. </div>
  429. <div class="modal-body">
  430. {{ 'front.scholar.training.show.actions.delete.modal.body.label'|trans({
  431. '%name%': sub.name,
  432. })|raw }}
  433. </div>
  434. <div class="modal-footer">
  435. <button type="button" class="btn btn-link" data-dismiss="modal">
  436. {{ 'front.scholar.training.show.actions.delete.modal.cancel.label'|trans }}
  437. </button>
  438. <a href="{{ path('front_channel_training_delete', {'id': sub.id, 'channelId': channel.id}) }}"
  439. class="btn btn-danger btn-raised">
  440. {{ 'front.scholar.training.show.actions.delete.modal.delete.label'|trans }}
  441. </a>
  442. </div>
  443. </div>
  444. </div>
  445. </div>
  446. {% endif %}
  447. {% endblock body %}