<div class="main-menu-list">
  {% for node, children in menu recursive %}
    <div class="main-menu-list__item
                {% if node == context.node or node == page %}
                  main-menu-list__item_state_current
                {% endif %}
                {% if children|length %}
                  main-menu-list__item_state_has-child
                {% endif %}">
        <a href="{{ request.resource_url(
                      context.__class__(node,
                      context.get_prefix(request, node=node))) }}"
          class="main-menu-list__item-link">
          {{ node.name }}
        </a>
      <div class="main-menu-list">{{ loop(children.items()) }}</div>
    </div>
  {% endfor %}
</div>
