templates/platform/component/molecule/default_list_footer_documents.html.twig line 1

Open in your IDE?
  1. {% if componentKey is not defined %}
  2.     {% set componentKey = "default_list_footer_documents" %}
  3. {% endif %}
  4. {% set item_config = generateComponentOptions(value, componentKey) %}
  5. {% if canDisplayComponentByAcl(item_config) %}
  6.     <div data-component-acl="{{ componentKey }}" class="{% if value.container is defined %}{{ value.container }}{% endif %}">
  7.         {% embed '@component/_template/_atom_wrapper.html.twig' with {value: value.title, atom_key: componentKey ~ '.title'} %}
  8.             {% block atom %}
  9.                 {% include '@component/atom/title.html.twig' with {'title': value} %}
  10.             {% endblock atom %}
  11.         {% endembed %}
  12.         <ul class="list-unstyled footer-docs-list">
  13.             {% if value.order is defined %}
  14.                 {% set order = value.order %}
  15.             {% else %}
  16.                 {% set order = [] %}
  17.             {% endif %}
  18.             {% set documents =  [] %}
  19.             {% set slug = value.hook is defined ? value.hook : false %}
  20.             {% if value.hook is defined %}
  21.                 {% set documents = getDocumentsByHook( value.hook.slug, order ) %}
  22.             {% endif %}
  23.             {% for document in documents %}
  24.                 {% set displayForFront = canDisplayDocument(app.user, document) %}
  25.                 {% if app.request.get('_route') in getAclConstantByKey('ACL_SECURITY_ROUTES') %}
  26.                     {% set displayForFront = canDisplayDocument(app.user, document) and app.request.get('_route') in getAclConstantByKey('ACL_SECURITY_ROUTES') and document.public is same as(true) %}
  27.                 {% endif %}
  28.                 {% if displayForFront %}
  29.                     <li>
  30.                         <a href="{% if document.externLink is not null %}{{ document.externLink }}{% else %}{{ path('front_common_document', {slug: document.slug}) }}{% endif %}"
  31.                            data-display="{{ document.display }}"
  32.                            data-document-slug="{{ document.slug }}"
  33.                            target="_blank"
  34.                            class="general-document {% if value.list is defined and value.list.class is defined %}{{ value.list.class }}{% endif %}">
  35.                             {% if document.title is not same as(null) %}{{ document.title|raw }}{% else %}{{ document.slug|trans|capitalize }}{% endif %}
  36.                         </a>
  37.                     </li>
  38.                 {% endif %}
  39.             {% else %}
  40.                 {% if slug is not same as(false) and app.user is not same as(null) and (app.user.isDeveloper or app.user.isSuperAdmin)  %}
  41.                     <div class="dev-info d-flex align-items-center justify-content-between flex-column p-3 w-100 text-center"
  42.                     >
  43.                         <p class="text-center">
  44.                             <span class=" font-weight-bold">Il n'y a pas de documents à l'heure actuelle.</span> <br> (Seuls les ROLE_DEVELOPER voient cette information)
  45.                         </p>
  46.                         <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>
  47.                     </div>
  48.                 {% endif %}
  49.             {% endfor %}
  50.         </ul>
  51.         <div class="d-flex align-items-end footer-signature">
  52.             {% if value.end_item is defined %}
  53.                 {% include '@component/molecule/footer_signature.html.twig' with {'value': value.end_item, componentKey: componentKey ~ '.end_item'} %}
  54.             {% endif %}
  55.         </div>
  56.     </div>
  57. {% endif %}