templates/website/product/product-detail-course-content-section.html.twig line 1

Open in your IDE?
  1. {% from 'utils.html.twig' import ico, libraryDuration %}
  2. {% set icosLibrary = {
  3.     1: 'globe',
  4.     2: 'file-text',
  5.     3: 'sound',
  6.     4: 'file-text',
  7.     5: 'video',
  8.     6: 'video',
  9.     7: 'video',
  10.     8: 'video',
  11.     9: 'video'
  12. } %}
  13. {% set libEnum = {
  14. 1: 'CONTENT_EMBED',
  15. 2: 'CONTENT_FILES',
  16. 3: 'CONTENT_AUDIO',
  17. 4: 'CONTENT_TEXT',
  18. 5: 'CONTENT_VIDEO',
  19. 6: 'CONTENT_LIVE',
  20. 7: 'CONTENT_CONFERENCE',
  21. 8: 'CONTENT_VIDEO_FILE',
  22. 9: 'CONTENT_EXTERNAL_LIVE',
  23. } %}
  24. {% if lessonModules|length > 0 %}
  25.     {% set total = lessonModules|length %}
  26.     {% set resta = total-show %}
  27.     <h3 class="tit-sec">{{ getLanguage('content', 'product') }}</h3>
  28.     <div id="contem-modulos" class="perguntas">
  29.         {% for i, lessonModule in lessonModules %}
  30.             {% set n = i+1 %}
  31.             {% if (n == show + 1) %}<div class="js--hidden">{% endif %}
  32.                 <div class="questao{{ n <= open ? ' status--aberto' }}">
  33.                     <div class="pergunta js--abre">
  34.                         <p>
  35.                             <span class="question-number">{{ n }}</span>{{ lessonModule.title }}
  36.                             {% for k, workload in lessonModule.workload %}
  37.                                 {% if workload > 0 %}
  38.                                     <span class="workload">
  39.                                         <span class="ico-clock">{{ ico('clock') }}</span>{{ workload }}
  40.                                         {{ plural(workload, 
  41.                                             getLanguage('workload_hour', 'product'), 
  42.                                             getLanguage('workload_hours', 'product')
  43.                                         )}}
  44.                                     </span>
  45.                                 {% endif %}
  46.                             {% endfor %}
  47.                         </p>
  48.                         <span class="ico seta">{{ ico('chevron-down') }}</span>
  49.                     </div>
  50.                     <div class="resposta product-content js--sub">
  51.                         {% if lessonModule.description is not empty %}
  52.                             {% if lessonModule.description != "null" %}
  53.                                 <div class="desc">{{ lessonModule.description }}</div>
  54.                             {% endif %}
  55.                         {% endif %}
  56.                         <ul class="lessons">
  57.                             {% set paged = [enum('LibraryEnum::CONTENT_FILES'), enum('LibraryEnum::CONTENT_TEXT')] %}
  58.                             {% set isPaged = false %}
  59.                             {% for j, lesson in lessonModule.lessons %}
  60.                                 {% if lesson.library %}
  61.                                     <li class="lesson">
  62.                                         {% if lesson.library.type is defined %}
  63.                                             {% if lesson.library.type > 0 and lesson.library.type < 10 %}
  64.                                                 <i class="ico">{{ ico(icosLibrary[lesson.library.type]) }}</i>
  65.                                             {% endif %}
  66.                                         {% endif %}
  67.                                         <p class="title">{{ lesson.title }}</p>
  68.                                         {% if lesson.library.type is defined %}
  69.                                             {% set isPaged = (lesson.library.type in paged ? true : false) %}
  70.                                         {% endif %}
  71.                                         {% if not isPaged %}
  72.                                             <span class="ico">{{ ico('clock') }}</span>
  73.                                         {% endif %}
  74.                                         <p class="size">
  75.                                             {{ libraryDuration(lesson) }}
  76.                                         </p>
  77.                                         {% if lesson.demonstration == enum('LessonEnum::YES') %}
  78.                                             <p class="acao">
  79.                                                 <a class="btn-watch" href="{{ path('lessonDemoPage', { lessonId: lesson.id, productOfferId: productOffer.id }) }}">{{ getLanguage('watch', 'product') }}</a>
  80.                                             </p>
  81.                                         {% endif %}
  82.                                     </li>
  83.                                 {% endif %}
  84.                             {% endfor %}
  85.                         </ul>
  86.                     </div>
  87.                 </div>
  88.             {% if (n == total) %}</div>{% endif %}
  89.             {# -/ .js--hidden #}
  90.         {% endfor %}
  91.         {# MOSTRAR MAIS #}
  92.         {% if resta > 0 %}
  93.             {% set label = (resta == 1)?'module':'modules' %}
  94.             <div class="modulos-mais">
  95.                 <a id="btn-modulos-mostrar" class="btn-mais">
  96.                     <span class="js--shown">{{ getLanguage('more', 'product') }} {{ resta }} {{ getLanguage(label, 'product') }}</span>
  97.                     <span class="js--hidden">{{ getLanguage('hide', 'product') }} {{ resta }} {{ getLanguage(label, 'product') }}</span>
  98.                 </a>
  99.             </div>
  100.         {% endif %}
  101.     </div>
  102. {% endif %}