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="" style="background-color: #f0f8f8;border-radius: 6px;text-align: center;">
  135.                     <img class="img-top-card" src="{{ sub|get_training_img_url }}">
  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.         </div>
  263.     </div>
  264.     {% if training_descriptions|length > 0 %}
  265.         <div class="row">
  266.             <div class="col-12">
  267.                 <h2 class="v2-title-small mt-5 mb-2">{{ 'front.scholar.training.show.sub_title.plus.label'|trans }}</h2>
  268.             </div>
  269.             <div class="col-lg-9 col-md-8">
  270.                 <div class="row">
  271.                     {% for description in training_descriptions %}
  272.                         <div class="col-12 col-sm-12 col-md-12 col-lg-6 col-xl-6 mt-4">
  273.                             {% include 'Front/Scholar/Card/training-description.html.twig' with {'description' : description} %}
  274.                         </div>
  275.                     {% endfor %}
  276.                 </div>
  277.             </div>
  278.         </div>
  279.     {% endif %}
  280.     <div class="row mt-3">
  281.         <div class="col-12">
  282.             <h2 class="v2-title-small mt-5 mb-2">{{ 'front.scholar.training.show.sub_title.channel.label'|trans }}</h2>
  283.         </div>
  284.         <div class="col-lg-9 col-md-8">
  285.             <div class="row">
  286.                 <div class="col-12">
  287.                     <div class="mt-3">
  288.                         {% include 'Front/Scholar/Card/channel.html.twig' with {'channel' : sub.ownerChannel} %}
  289.                     </div>
  290.                 </div>
  291.             </div>
  292.         </div>
  293.     </div>
  294.     {% if teacher_entities|length > 0 %}
  295.         <div class="row mt-3">
  296.             <div class="col-12">
  297.                 <h2 class="v2-title-small mt-5 mb-2">{{ 'front.scholar.training.show.sub_title.teacher.label'|trans }}
  298.                     ({{ teacher_entities|length }})</h2>
  299.             </div>
  300.         </div>
  301.         {% for teacher in teacher_entities %}
  302.             <div class="col-lg-9 col-md-8">
  303.                 <div class="row">
  304.                     <div class="col-12">
  305.                         <div class="mt-3">
  306.                             {% include 'Front/Scholar/Card/teacher.html.twig' with {'teacher' : teacher} %}
  307.                         </div>
  308.                     </div>
  309.                 </div>
  310.             </div>
  311.         {% endfor %}
  312.     {% endif %}
  313.     {% if training_advices is defined and training_advices|length > 0 %}
  314.         <div class="row mt-3 mb-5">
  315.             <div class="col-lg-9 col-md-8">
  316.                 <div class="row">
  317.                     <div class="col-12">
  318.                         <div class="div-title-between mt-5 mb-2">
  319.                             <h2 class="v2-title-small">{{ 'front.scholar.training.show.sub_title.advice.label'|trans }}
  320.                                 ({{ training_advices|length }})</h2>
  321.                             <p class=""><i class="far fa-star"></i> {{ advice_avg }}</p>
  322.                         </div>
  323.                     </div>
  324.                     <div class="col-12">
  325.                         <div class="mt-3">
  326.                             {% set adviceCount = 1 %}
  327.                             {% set break = false %}
  328.                             {% for advice in training_advices %}
  329.                                 {% if not break %}
  330.                                     {% include 'Front/Scholar/Card/advice.html.twig' with {'advice' : advice} %}
  331.                                     {% set adviceCount = adviceCount + 1 %}
  332.                                     {% if adviceCount == 6 %}
  333.                                         {% set break = true %}
  334.                                     {% endif %}
  335.                                 {% endif %}
  336.                             {% endfor %}
  337.                             {% set adviceCount = 1 %}
  338.                             {% if training_advices|length > 5 %}
  339.                                 <div class="div-more-advice">
  340.                                     {% for advice in training_advices %}
  341.                                         {% set adviceCount = adviceCount + 1 %}
  342.                                         {% if adviceCount > 6 %}
  343.                                             {% include 'Front/Scholar/Card/advice.html.twig' with {'advice' : advice} %}
  344.                                         {% endif %}
  345.                                     {% endfor %}
  346.                                 </div>
  347.                             {% endif %}
  348.                         </div>
  349.                     </div>
  350.                 </div>
  351.             </div>
  352.         </div>
  353.     {% endif %}
  354.     {% if form is defined and app.user %}
  355.         <div class="row">
  356.             <div class="col-lg-9 col-md-8">
  357.                 <p class="small-description">{{ 'front.scholar.training.show.sub_title.advice.sentence.enter_key.label'|trans }}</p>
  358.             </div>
  359.         </div>
  360.         <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 %}>
  361.             <div class="col-lg-9 col-md-8 mt-1">
  362.                 <div class="form-advice-content">
  363.                     <div class="avatar-rounded">{{ app.user|user_avatar }}</div>
  364.                     <div class="form-advice-bg-gray">
  365.                         {{ form_start(form) }}
  366.                         <div style="display: none">
  367.                             {{ form_widget(form.note) }}
  368.                         </div>
  369.                         {{ form_widget(form.comment) }}
  370.                         {{ form_errors(form.comment) }}
  371.                         {{ form_end(form) }}
  372.                         <div class="stars-rating">
  373.                             <i class="far fa-star" data-rating="1"></i>
  374.                             <i class="far fa-star" data-rating="2"></i>
  375.                             <i class="far fa-star" data-rating="3"></i>
  376.                             <i class="far fa-star" data-rating="4"></i>
  377.                             <i class="far fa-star" data-rating="5"></i>
  378.                         </div>
  379.                         <div class="center-y ml-2">
  380.                             <span id="span-nb-note-advice">0</span>
  381.                         </div>
  382.                     </div>
  383.                 </div>
  384.             </div>
  385.         </div>
  386.         {% if advice_user is not null %}
  387.             {% if advice_user.id is not null %}
  388.                 <div class="row">
  389.                     <div class="col-lg-9 col-md-8 mt-1">
  390.                         <div class="w100-flex-end-x">
  391.                             <a class="delete-btn-advice"
  392.                                href="{{ path('front_training_advice_delete', {'id' : advice_user.id}) }}">{{ 'front.scholar.training.show.sub_title.advice.action.delete.label'|trans }}</a>
  393.                         </div>
  394.                     </div>
  395.                 </div>
  396.             {% endif %}
  397.         {% endif %}
  398.     {% endif %}
  399.     {% if training_advices is defined and training_advices|length > 5 %}
  400.         <div class="row">
  401.             <div class="col-lg-9 col-md-8 mt-5">
  402.                 <div class="w100-flex-center-x">
  403.                     <button class="see-more-btn"
  404.                             id="training-advice-see-more">{{ 'front.scholar.training.advice.see_more.label'|trans({'%count%': training_advices|length}) }}</button>
  405.                 </div>
  406.             </div>
  407.         </div>
  408.     {% endif %}
  409.     <div class="empty-div-bottom"></div>
  410. {% endblock inner_content %}
  411. {% block body %}
  412.     {{ parent() }}
  413.     {% if is_granted('CHANNEL_USER_PERM_TRAINING_SHOW', sub) %}
  414.         <div class="modal fade" id="delete-modal" tabindex="-1" role="dialog"
  415.              aria-labelledby="delete-modal-label" aria-hidden="true">
  416.             <div class="modal-dialog" role="document">
  417.                 <div class="modal-content">
  418.                     <div class="modal-header">
  419.                         <h5 class="modal-title" id="delete-modal-label">
  420.                             {{ 'front.scholar.training.show.actions.delete.modal.title.label'|trans({
  421.                                 '%name%': sub.name,
  422.                             })|raw }}
  423.                         </h5>
  424.                     </div>
  425.                     <div class="modal-body">
  426.                         {{ 'front.scholar.training.show.actions.delete.modal.body.label'|trans({
  427.                             '%name%': sub.name,
  428.                         })|raw }}
  429.                     </div>
  430.                     <div class="modal-footer">
  431.                         <button type="button" class="btn btn-link" data-dismiss="modal">
  432.                             {{ 'front.scholar.training.show.actions.delete.modal.cancel.label'|trans }}
  433.                         </button>
  434.                         <a href="{{ path('front_channel_training_delete', {'id': sub.id, 'channelId': channel.id}) }}"
  435.                            class="btn btn-danger btn-raised">
  436.                             {{ 'front.scholar.training.show.actions.delete.modal.delete.label'|trans }}
  437.                         </a>
  438.                     </div>
  439.                 </div>
  440.             </div>
  441.         </div>
  442.     {% endif %}
  443. {% endblock body %}