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

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