{# TABS #}
{% macro adventure_tab(tabname, title, selected, id, tab_class, index) %}
{{title}}
{% endmacro %}
{% for adventure in adventures %} {% if adventure.is_teacher_adventure %} {{ adventure_tab(adventure.short_name, adventure.name, adventure.short_name == initial_tab, 'adventure' + loop.index|string, 'teacher_tab', loop.index ) }} {% elif adventure.is_command_adventure %} {{ adventure_tab(adventure.short_name, adventure.name, adventure.short_name == initial_tab, 'adventure' + loop.index|string, 'command_tab', loop.index ) }} {% else %} {{ adventure_tab(adventure.short_name, adventure.name, adventure.short_name == initial_tab, 'adventure' + loop.index|string, '', loop.index) }} {% endif %} {% endfor %} {% if parsons %} {{ adventure_tab('parsons', _('parsons_title'), False, 'parsons', 'special_tab', adventures|length + 1 ) }} {% endif %} {% if quiz %} {{ adventure_tab('quiz', _('quiz_tab'), False, 'quiz', 'special_tab', (adventures|length + (2 if parsons else 1)) ) }} {% endif %}
{# PANES #}
{% for adventure in adventures %}
{% if adventure.is_teacher_adventure %}{{ adventure.text|safe }}{% else %}{{ adventure.text|commonmark }}{% endif %}
{% if adventure.example_code %}
{% if adventure.is_teacher_adventure %}{{ adventure.example_code|safe }}{% else %}{{ adventure.example_code|commonmark }}{% endif %}
{% endif %} {% if public_adventures_page %}
{{ render_partial('htmx-adventure-card.html', user={"username": username}, adventure=adventure, level=level ) }}
{% endif %}
{% for story in adventure.extra_stories %}
{{ story.text|commonmark }}
{% if story.example_code %}
{{ story.example_code|commonmark }}
{% endif %}
{% endfor %}
{% endfor %} {% if parsons %} {% endif %} {% if quiz %} {% endif %}