{% if componentKey is not defined %}
{% set componentKey = "default_list_footer_documents" %}
{% endif %}
{% set item_config = generateComponentOptions(value, componentKey) %}
{% if canDisplayComponentByAcl(item_config) %}
<div data-component-acl="{{ componentKey }}" class="{% if value.container is defined %}{{ value.container }}{% endif %}">
{% embed '@component/_template/_atom_wrapper.html.twig' with {value: value.title, atom_key: componentKey ~ '.title'} %}
{% block atom %}
{% include '@component/atom/title.html.twig' with {'title': value} %}
{% endblock atom %}
{% endembed %}
<ul class="list-unstyled footer-docs-list">
{% if value.order is defined %}
{% set order = value.order %}
{% else %}
{% set order = [] %}
{% endif %}
{% set documents = [] %}
{% set slug = value.hook is defined ? value.hook : false %}
{% if value.hook is defined %}
{% set documents = getDocumentsByHook( value.hook.slug, order ) %}
{% endif %}
{% for document in documents %}
{% set displayForFront = canDisplayDocument(app.user, document) %}
{% if app.request.get('_route') in getAclConstantByKey('ACL_SECURITY_ROUTES') %}
{% set displayForFront = canDisplayDocument(app.user, document) and app.request.get('_route') in getAclConstantByKey('ACL_SECURITY_ROUTES') and document.public is same as(true) %}
{% endif %}
{% if displayForFront %}
<li>
<a href="{% if document.externLink is not null %}{{ document.externLink }}{% else %}{{ path('front_common_document', {slug: document.slug}) }}{% endif %}"
data-display="{{ document.display }}"
data-document-slug="{{ document.slug }}"
target="_blank"
class="general-document {% if value.list is defined and value.list.class is defined %}{{ value.list.class }}{% endif %}">
{% if document.title is not same as(null) %}{{ document.title|raw }}{% else %}{{ document.slug|trans|capitalize }}{% endif %}
</a>
</li>
{% endif %}
{% else %}
{% if slug is not same as(false) and app.user is not same as(null) and (app.user.isDeveloper or app.user.isSuperAdmin) %}
<div class="dev-info d-flex align-items-center justify-content-between flex-column p-3 w-100 text-center"
>
<p class="text-center">
<span class=" font-weight-bold">Il n'y a pas de documents à l'heure actuelle.</span> <br> (Seuls les ROLE_DEVELOPER voient cette information)
</p>
<p>Vérifiez que le hook <code>{{ value.hook.slug }}</code> existe et qu'il possède des documents dans la <a href="{{ path('back_customize_documents_document_list') }}" target="_blank">page des documents</a> </p>
</div>
{% endif %}
{% endfor %}
</ul>
<div class="d-flex align-items-end footer-signature">
{% if value.end_item is defined %}
{% include '@component/molecule/footer_signature.html.twig' with {'value': value.end_item, componentKey: componentKey ~ '.end_item'} %}
{% endif %}
</div>
</div>
{% endif %}