<nav role="navigation" class="fr-sidemenu" aria-label="Navigation entre les thèmes">
    <div class="fr-sidemenu__inner">
        <div class="fr-collapse" id="fr-sidemenu-wrapper">
            <ul class="fr-sidemenu__list">
                {% for th in themes %}
                    {% if th == theme %}
                    <li class="fr-sidemenu__item">
                        <button aria-expanded="true" aria-controls="current-theme-menu" aria-current="true" class="fr-sidemenu__btn">
                            {{ theme.title }}
                        </button>
                        <div class="fr-collapse fr-collapse--expanded" id="current-theme-menu">
                            <ul class="fr-sidemenu__list">
                                {% for sub_theme in sub_themes %}
                                <li class="fr-sidemenu__item">
                                    <a class="fr-sidemenu__link" href="{% if comparison %}{% url 'website:comparison' theme_name=th.name %}{% else %}{% url 'website:theme' theme_name=th.name %}{% endif %}#{{sub_theme.name}}">
                                        {{ sub_theme.title }}
                                    </a>
                                </li>
                                {% endfor %}
                            </ul>
                        </div>
                    </li>
                    {% else %}
                    <li class="fr-sidemenu__item">
                        <a class="fr-sidemenu__link" href="{% if comparison %}{% url 'website:comparison' theme_name=th.name %}{% else %}{% url 'website:theme' theme_name=th.name %}{% endif %}"
                        target="_self">{{th.title}}</a>
                    </li>
                    {% endif %}
                {% endfor %}
            </ul>
        </div>
    </div>
</nav>
