{% 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.code }} {% else %} {{ course.title }} {% endif %}

{% for teacher in course.teachers %} {% if course.teachers | length > 2 %} {% else %} {% endif %} {% endfor %}
{{ course.notifications }}
{% if item.student_info %}
{% if (item.student_info.progress is not null) and (item.student_info.score 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 %} {% for row in session %}
{{ row.title }} {{ row.title }} {% if row.edit_actions != '' %} {% endif %}
{% if row.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 %}