{% load wagtailcore_tags i18n %}
{% translate "Restricted access" as restricted_access_label %}
{% for subpage in pagelist.get_children.live %}
  {% if not subpage.get_view_restrictions or user.is_authenticated %}
    <li>
      {% if subpage.get_view_restrictions %}
        <span class="fr-icon-lock-line"
              aria-hidden="true"
              title="{{ restricted_access_label }}"></span>
      {% endif %}
      <a href="{% pageurl subpage %}">{{ subpage.title }}</a>
      {% if subpage.get_view_restrictions %}<span class="fr-sr-only">({{ restricted_access_label }})</span>{% endif %}
      {% if subpage.get_children.count > 0 %}
        <ul>
          {% include "sites_conformes_content_manager/blocks/sitemap_entry.html" with pagelist=subpage %}
        </ul>
      {% endif %}
    </li>
  {% endif %}
{% endfor %}
