templates/structure/show.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% set activeMenu = "infos-pratiques" %}
  3. {% block title %}{{ structure.title|replace({ '<br>':'' }) }}{% endblock %}
  4. {% block stylesheets %}
  5.     {{ parent() }}
  6.     {% if structure.longitude and structure.latitude %}
  7.         {{ encore_entry_link_tags('map') }}
  8.     {% endif %}
  9. {% endblock %}
  10. {% block body %}
  11.     <div class="titre">
  12.         <h1>{{ structure.title|raw }}</h1>
  13.         {% if structure.subtitle %}
  14.             <p class="subtitle mt-0">{{ structure.subtitle }}</p>
  15.         {% endif %}
  16.     </div>
  17.     {% if is_granted('ROLE_EDITOR') %}
  18.         {% set url = ea_url()
  19.             .setController('App\\Controller\\Admin\\StructureCrudController')
  20.             .setAction('edit')
  21.             .setEntityId(structure.id) %}
  22.         <p><a class="adm-link" href="{{ url }}" target="_blank">administrer la structure ({{ structure.id }})</a></p>
  23.     {% endif %}
  24.     <div class="row">
  25.         <div class="col">
  26.             {# <div class="date">
  27.                 {{structure.createdAt|date("d/m/Y")}}
  28.             </div> #}
  29.             
  30.             {% include 'media/postMedias.html.twig' with {'medias': structure.medias, 'mediasType': 'slides' } %}
  31.             {% if structure.chapo|length > 5 %}
  32.                 <div class="chapo">
  33.                     {{ structure.chapo|raw }}
  34.                 </div>
  35.             {% endif %}
  36.             {% set hideThumbnails = false %}{% for media in structure.medias|filter(media => media.role == "slide") %}{% set hideThumbnails = true %}{% endfor %}{# car icig ne veut pas de thumbnail s'il y a des slides #}
  37.             {% if not hideThumbnails %}{% include 'media/postMedias.html.twig' with {'medias': structure.medias, 'mediasType': 'thumbnails' } %}{% endif %}
  38.     
  39.             <div class="contenu">
  40.                 {% if is_granted('ROLE_SUPER_ADMIN') %}<strong>tmpOldIds: {{ structure.tmpOldIds|join(",") }}</strong><br><br>{% endif %}
  41.                 {{ structure.content|raw }}
  42.             </div>
  43.             {% include 'media/postMedias.html.twig' with {'medias': structure.medias, 'mediasType': 'documents' } %}
  44.         </div>
  45.         <div class="col-md-12 col-lg-3">
  46.             {% if structure.address or structure.website %}
  47.                 <h4>Coordonnées</h4>
  48.                 <p class="mb-3">
  49.                     {% if structure.host %}
  50.                         {% set host = structure.host %}
  51.                         Accueilli par :<br>
  52.                         <a href="{{ path('showStructure', {id:host.id}) }}">{{ host.name }}</a><br>
  53.                     {% endif %}
  54.                     {% if structure.includer %}
  55.                         {% set includer = structure.includer %}
  56.                         Inclus dans :<br>
  57.                         <a href="{{ path('showStructure', {id:includer.id}) }}">{{ includer.name }}</a><br>
  58.                     {% endif %}
  59.                     {% if structure.address %}
  60.                         {% set coordonnees = structure.address %}
  61.                         {% if structure.postalCode %}
  62.                             {% set coordonnees = coordonnees ~ structure.postalCode %}
  63.                             {% set prefixTown = " " %}
  64.                         {% else %}
  65.                             {% set prefixTown = "" %}
  66.                         {% endif %}
  67.                         {% if structure.town %}
  68.                             {% set coordonnees = coordonnees ~ prefixTown ~ structure.town %}
  69.                         {% endif %}
  70.                         {% if structure.phone %}
  71.                             {% set coordonnees = coordonnees ~ "</br><em>Tel. : " ~ structure.phone ~ "</em>" %}
  72.                         {% endif %}
  73.                         {% if structure.email %}
  74.                             {% set coordonnees = coordonnees ~ "</br><a href=\"mailto:" ~ structure.email ~ "\" />" ~ structure.email ~ "</a>" %}
  75.                         {% endif %}
  76.                         <address>
  77.                             {{ coordonnees|raw }}
  78.                         </address>
  79.                     {% endif %}
  80.                     {% if structure.website %}
  81.                         <a href="{{ structure.website }}" target="_blank">{{ structure.website|replace({"http://": "", "https://": ""}) }}</a>
  82.                     {% endif %}
  83.                 </p>
  84.             {% endif %}
  85.             
  86.             {% if structure.longitude and structure.latitude %}
  87.                 {% include 'common/mapElts.html.twig' %}
  88.             {% endif %}
  89.         </div>
  90.     </div>
  91.     <div class="row">
  92.         <div class="col">
  93.             {# {{ render(controller('App\\Controller\\StructureController:listSame', { 'id' : structure.id })) }} #}
  94.             {% include 'common/seealso.html.twig' with {'entity': structure } %}
  95.             <p>
  96.                 Une erreur ? Un complément à ajouter ? <a href="{{ path('contact') }}"><strong>Signalez-le nous !</strong></a>
  97.             </p>
  98.             <p>
  99.                 Vous souhaitez faire une autre recherche ? <a href="{{ path('themeList') }}">Faites une recherche par thème ou par mot-clé</a>
  100.             </p>
  101.         </div>
  102.     </div>
  103. {% endblock %}
  104. {% block javascripts %}
  105.     {{ parent() }}
  106.     {% if structure.longitude and structure.latitude %}
  107.         <script>
  108.             var structureId = {{ structure.id }};
  109.         </script>
  110.         {{ encore_entry_script_tags('map') }}
  111.     {% endif %}
  112. {% endblock %}