{# This file is part of INGInious. See the LICENSE and the COPYRIGHTS files for #} {# more information about the licensing of this file. #} {# Recursively print a list of sections and their content #} {% set level = level|default(3, true) %} {% for section in sections %} {% set ns = namespace(section_tasks=[],have_accessible_tasks=False) %} {% for taskid in section.get_tasks() if taskid in tasks %} {% set ns.section_tasks = ns.section_tasks + [tasks[taskid]] %} {% set ns.have_accessible_tasks = ns.have_accessible_tasks or accessibilities[user_manager.session_username()][taskid].is_open()%} {% endfor %} {% if not section.get_config().get('hidden_if_empty', False) or ns.have_accessible_tasks %} {% if section.is_terminal() %} {% with tasks=ns.section_tasks, tag_list=tag_filter_list, title=section.get_title(), config=section.get_config(),accessibilities=accessibilities %} {% include "task_dispensers/task_list.html" %} {% endwith %} {% else %}