{% set group_courses = 'view_grid_courses_grouped_categories_in_sessions'| api_get_configuration_value %} {% macro course_block(course, show_category) %}
{% if course.category != '' and show_category %} {{ course.category }}
{% endif %} {% if course.edit_actions %}
{% if course.document == '' %} {% else %}
{{ course.document }}
{% endif %}
{% endif %}

{% if course.visibility == constant('COURSE_VISIBILITY_CLOSED') %} {{ course.title }} {{ course.visual_code }} {% else %} {{ course.title }} {% endif %}

{% if course.teachers | length > 2 %}
{% endif %} {% for teacher in course.teachers %} {% if course.teachers | length > 2 %}
{{ teacher.firstname }} {{ teacher.lastname }}
{% else %} {% endif %} {% endfor %} {% if course.teachers | length > 2 %}
{% endif %}
{{ course.notifications }}
{% if item.student_info %}
{% if item.student_info.progress is not null or item.student_info.score is not null or item.student_info.certificate is not null %}
{% if (item.student_info.progress is not null) %} {{ "StudentCourseProgressX" | get_lang | format(item.student_info.progress) }} {% endif %} {% if (item.student_info.score is not null) %} {{ "StudentCourseScoreX" | get_lang | format(item.student_info.score) }} {% endif %} {% if (item.student_info.certificate is not null) %} {{ "StudentCourseCertificateX" | get_lang | format(item.student_info.certificate) }} {% endif %}
{% endif %}
{% endif %}
{% endmacro %} {% import _self as blocks %} {% set session_image = 'window_list.png'|img(32, row.title) %} {% for row in session %} {% set collapsable = '' %}
{% if row.course_list_session_style %} {# If not style then no show header #}
{% if row.course_list_session_style == 1 or row.course_list_session_style == 2 %} {# Session link #} {% if remove_session_url == true %} {{ session_image }} {{ row.title }} {% else %} {# Default link #} {% set session_link = _p.web_main ~ 'session/index.php?session_id=' ~ row.id %} {% if row.course_list_session_style == 2 and row.courses|length == 1 %} {# Linkt to first course #} {% set session_link = row.courses.0.link %} {% endif %} {{ session_image }} {{ row.title }} {% endif %} {% elseif row.course_list_session_style == 4 %} {{ session_image }} {{ row.title }} {% elseif row.course_list_session_style == 3 %} {# Collapsible panel #} {# Foldable #} {% set collapsable = 'collapse' %} {% endif %} {% if row.show_actions %} {% endif %} {% if row.collapsable_link %}
{{ row.collapsable_link }}
{% endif %}
{% endif %} {% if row.collapsable_link %} {% if row.collapsed == 1 %} {% set collapsable = 'collapse' %} {% endif %} {% endif %}
{% if row.show_description %} {{ row.description }} {% endif %}
{% if not group_courses %}
{% for item in row.courses %} {{ blocks.course_block(item, true) }} {% endfor %}
{% else %} {% for category_code in row.course_categories %}

{{ category_code }}

{% for course in row.courses %} {% if course.category == category_code %} {{ blocks.course_block(course, false) }} {% endif %} {% endfor %}
{% endfor %} {% endif %}
{% endfor %}