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