templates/frontend/mostra.commonattachments.html.twig line 1

Open in your IDE?
  1. {% extends "base.html.twig" %}
  2. {% block pageTitle %} {{ cat | title }} - {{ titolo }} {% endblock %}
  3. {% block pageStyle %}
  4.     {{ parent() }} 
  5.     <link rel="stylesheet" href="{{ asset('js/tobii/tobii.min.css') }}">
  6. {% endblock %}
  7. {% block pageScriptsHeader %} 
  8.     {{ parent() }} 
  9.     <script src="{{ asset('js/tobii/tobii.min.js') }}"></script>
  10.     <script>
  11.     document.addEventListener('DOMContentLoaded', function() {
  12.         const tobii = new Tobii();
  13.     });
  14.     </script>
  15. {% endblock %}
  16. {% block navigation %} {{ parent() }} {% endblock %}
  17. {% block upperMainContainer %}
  18.     
  19. {% endblock %}
  20. {% set hasBrochures, hasManifesti, hasVernice, hasAllestimento, hasAltro, hasPubblicazioni, hasGiornali = 0, 0, 0, 0, 0, 0, 0 %}
  21. {% if mostra.iddocumento is defined and mostra.iddocumento | length > 0 %}
  22.     {% set hasPubblicazioni = 1 %}
  23. {% endif %}
  24. {% if mostra.idarticolo is defined and mostra.idarticolo | length > 0 %}
  25.     {% set hasGiornali = 1 %}
  26. {% endif %}
  27. {% block mainContainer %}    
  28.     <div class="container cortelazzo-font-regular">
  29.         
  30.         <!-- All data -->
  31.         <div class="row">
  32.             <div class="col-xl-12">
  33.                 <span><a href="{{ path("showMostra") }}">Torna alle esposizioni</a></span>{% if app.user %} | <span><a href="{{ path("adminModifyMostra", {idmostra: mostra.id}) }}">Modifica esposizione</a></span>{% endif %}
  34.             </div>
  35.             <div class="col-xl-12 mb-1 mt-3">
  36.                 <p class="h1 cortelazzo-titles cortelazzo-font-bold">{{ titolo }}</p>
  37.             </div>
  38.         </div>
  39.         <nav class="row navbar-expand-lg navbar-light bg-white">
  40.             <div class="col-xl-12 navbar">
  41.                 <ul class="navbar-nav">
  42.                     {% if opere is defined and opere is not empty %}
  43.                     <li class="nav-item {% if app.request.get('_route') == "opereMostra" %} active {% endif %}">
  44.                         <a class="nav-link" href="{{ path("opereMostra", {"idmostra" : mostra.id}) }}" role="button" class="nav-link">{{ 'opere' | upper }}</a>
  45.                     </li>
  46.                     {% endif %}
  47.                     {% if mostra.getVideos() is not empty %}
  48.                     <li class="nav-item {% if app.request.get('_route') == "videoMostra" %} active {% endif %}">
  49.                         <a class="nav-link" href="{{ path("videoMostra", {"idmostra" : mostra.id}) }}" role="button" class="nav-link">{{ 'video' | upper }}</a>
  50.                     </li>
  51.                     {% endif %}
  52.                     {% if mostra.multimedias is not empty %}
  53.                         {% for multimedia in mostra.multimedias %}
  54.                             {% if multimedia.tipo == 'brochure' %}
  55.                                 {% set hasBrochures = 1 %}
  56.                             {% elseif multimedia.tipo == 'manifesto' %}
  57.                                 {% set hasManifesti = 1 %}
  58.                             {% elseif multimedia.tipo == 'vernice' %}
  59.                                 {% set hasVernice = 1 %}
  60.                             {% elseif multimedia.tipo == 'allestimento' %}
  61.                                 {% set hasAllestimento = 1 %}
  62.                             {% elseif multimedia.tipo == 'altro' %}
  63.                                 {% set hasAltro = 1 %}
  64.                             {% endif %}
  65.                         {% endfor %}
  66.                         {% if hasAllestimento %}
  67.                         <li class="nav-item {% if app.request.get('_route') == "allestimentoMostra" %} active {% endif %}">
  68.                             <a class="nav-link pl-0" href="{{ path("allestimentoMostra", {"idmostra" : mostra.id}) }}" role="button" class="nav-link">{{ 'Allestimento' | upper }}</a>
  69.                         </li>
  70.                         {% endif %}
  71.                         {% if hasBrochures %}
  72.                         <li class="nav-item {% if app.request.get('_route') == "brochureMostra" %} active {% endif %}">
  73.                             <a class="nav-link pl-0" href="{{ path("brochureMostra", {"idmostra" : mostra.id}) }}" role="button" class="nav-link">{{ 'catalogo' | upper }}</a>
  74.                         </li>
  75.                         {% endif %}
  76.                         {% if hasManifesti %}
  77.                         <li class="nav-item {% if app.request.get('_route') == "manifestoMostra" %} active {% endif %}">
  78.                             <a class="nav-link" href="{{ path("manifestoMostra", {"idmostra" : mostra.id}) }}" role="button" class="nav-link">{{ 'manifesto' | upper }}</a>
  79.                         </li>
  80.                         {% endif %}
  81.                         {% if hasVernice %}
  82.                         <li class="nav-item {% if app.request.get('_route') == "verniceMostra" %} active {% endif %}">
  83.                             <a class="nav-link" href="{{ path("verniceMostra", {"idmostra" : mostra.id}) }}" role="button" class="nav-link">{{ 'vernice' | upper }}</a>
  84.                         </li>
  85.                         {% endif %}
  86.                         {% if hasAltro %}
  87.                         <li class="nav-item {% if app.request.get('_route') == "altroMostra" %} active {% endif %}">
  88.                             <a class="nav-link" href="{{ path("altroMostra", {"idmostra" : mostra.id}) }}" role="button" class="nav-link">{{ 'altro' | upper }}</a>
  89.                         </li>
  90.                         {% endif %}
  91.                         {% if hasPubblicazioni %}
  92.                         <li class="nav-item {% if app.request.get('_route') == "pubblicazioniMostra" %} active {% endif %}">
  93.                             <a class="nav-link" href="{{ path("pubblicazioniMostra", {"idmostra" : mostra.id}) }}" role="button">{{ 'pubblicazioni' | upper }}</a>
  94.                         </li>
  95.                         {% endif %}
  96.                         {% if hasGiornali %}
  97.                         <li class="nav-item {% if app.request.get('_route') == "giornaliMostra" %} active {% endif %}">
  98.                             <a class="nav-link" href="{{ path("giornaliMostra", {"idmostra" : mostra.id}) }}" role="button">{{ 'giornali' | upper }}</a>
  99.                         </li>
  100.                         {% endif %}
  101.                     {% endif %}
  102.                 </ul>
  103.             </div>
  104.         </nav>
  105.         <div class="row">
  106.             <div class="col-xl-12">
  107.                 <hr/>
  108.             </div>
  109.         </div>
  110.         {% if app.request.get('_route') == "opereMostra" %}
  111.             <div class="row" id="image-container">
  112.             {% for opera in opere %}
  113.                 {% if not cover_presence[opera.id] %}
  114.                     {% for m in opera.multimedias | slice(0, 1) %}
  115.                         {% if m.multimedia.tipo == "image" %}
  116.                             <div class="col-xl-3 card-item" data-idcard="{{ opera.id }}" >
  117.                                 <a class="hover-underline-removal" href="{{ path("archivio-opere-scheda", {"idopera": opera.id}) }}">
  118.                                     <img class="card-img-top card-img-top-custom" src="{{ asset(uploaded_img_normal ~ m.multimedia.fileref ~ '.' ~ m.multimedia.estensione) }}" alt="{{ m.multimedia.nome }}">
  119.                                     <div class="card-body card-body-custom">
  120.                                         <h5 class="card-title">{{ opera.titolo | replace({"<": "(", ">": ")"}) }}</h5>
  121.                                     </div>
  122.                                 </a>
  123.                             </div>
  124.                         {% endif %}
  125.                     {% endfor %}
  126.                 {% else %}
  127.                     {% for m in opera.multimedias %}
  128.                         {% if m.multimedia.tipo == "image" and m.cover %}
  129.                             <div class="col-xl-3 card-item" data-idcard="{{ opera.id }}" >
  130.                                 <a class="hover-underline-removal" href="{{ path("archivio-opere-scheda", {"idopera": opera.id}) }}">
  131.                                     <img class="card-img-top card-img-top-custom" src="{{ asset(uploaded_img_normal ~ m.multimedia.fileref ~ '.' ~ m.multimedia.estensione) }}" alt="{{ m.multimedia.nome }}">
  132.                                     <div class="card-body card-body-custom">
  133.                                         <h5 class="card-title">{{ opera.titolo | replace({"<": "(", ">": ")"}) }}</h5>
  134.                                     </div>
  135.                                 </a>
  136.                             </div>
  137.                         {% endif %}
  138.                     {% endfor %}
  139.                 {% endif %}
  140.             {% endfor %}
  141.             </div>
  142.         {% elseif app.request.get('_route') == "videoMostra" %}
  143.             
  144.             <div class="row mt-3">
  145.                 {% set count = 0 %}
  146.                 {% for video in mostra.videos %}
  147.                     <figure class='col-xl-2'>
  148.                         <a href="{{ video.url }}" target="_blank">
  149.                             <img class="img-fluid" src="{{ asset("administrator/img/glyphicons-152-new-window@3x.png") }}" />
  150.                         </a>
  151.                         <figcaption class="mt-2" itemprop="caption description">{{ video.titolo }}</figcaption>
  152.                     </figure>
  153.                 {% endfor %}
  154.             </div>
  155.             
  156.         {% elseif app.request.get('_route') == "giornaliMostra" %}
  157.             {% if mostra.idarticolo is defined and mostra.idarticolo | length > 0 %}
  158.             <div class="col-xl-12 mb-3 mt-3">
  159.                 <h3>Giornali correlati</h3>
  160.             </div>
  161.             <ul>
  162.                 {% for giornale in mostra.idarticolo|sort((a, b) => a.anno <=> b.anno) %}
  163.                     <li class="bibliografia-item giornale">
  164.                         {% if giornale.getAutore() is not empty and giornale.getTitolo() is not empty %}
  165.                         <p class="mt-0 mb-0">
  166.                             {% if giornale.getAutore() is not empty %}
  167.                                 {{ giornale.getAutore() }}
  168.                             {% endif %}
  169.                             {% if giornale.getAutore() is not empty and giornale.getTitolo() is not empty %}
  170.                             -
  171.                             {% endif %}
  172.                             {% if giornale.getTitolo() is not empty %}
  173.                                 {{ giornale.getTitolo() }}
  174.                             {% endif %}
  175.                         </p>
  176.                         {% endif %}
  177.                         
  178.                         <p class="mt-0 mb-0">
  179.                             {% if giornale.getIdgiornale() is defined and giornale.getIdgiornale().getNome() is not empty %}
  180.                                 {{ giornale.getIdgiornale().getNome() }} - 
  181.                             {% endif %}
  182.                             
  183.                             {% if giornale.getPagina() is not empty %}
  184.                                 pag. {{ giornale.getPagina() }}
  185.                             {% endif %}
  186.                             ({{ giornale.getGiorno() }}-{{ giornale.getMese() }}-{{ giornale.getAnno() }})
  187.                             {% if giornale.multimediafiles is not empty %}
  188.                                 {% for multimedia in giornale.multimediafiles | slice(0, 1) %}
  189.                                 - <a href="{{ asset(uploaded_img_big ~ multimedia.fileref ~ '.' ~ multimedia.estensione) }}" itemprop="contentUrl" data-size="{{ multimedia.widthbig }}x{{ multimedia.heightbig }}">IMG</a>
  190.                                 {% endfor %}
  191.                             {% endif %}
  192.                         </p>
  193.                     </li>                            
  194.                 {% endfor %}
  195.             </ul>
  196.             {% endif %}
  197.         {% elseif app.request.get('_route') == "pubblicazioniMostra" %}
  198.             {% if mostra.iddocumento is defined and mostra.iddocumento | length > 0 %}
  199.                 <div class="col-xl-12 mb-3 mt-3">
  200.                     <h3>Pubblicazioni correlate</h3>
  201.                 </div>
  202.                 <ul>
  203.                     {% for documento in mostra.iddocumento|sort((a, b) => a.anno <=> b.anno) %}
  204.                         <li>
  205.                             <p class="mt-0 mb-0">
  206.                                 <a href="{{ path('documentoMonografieCataloghi', {'iddocumento': documento.id}) }}">
  207.                                 {{ documento.titolo }}
  208.                                 </a>
  209.                                 {% if documento.getAutore() %} di {{ documento.getAutore() }}
  210.                                 {% endif %}
  211.                             </p>
  212.                             <p class="mt-0 mb-0">
  213.                                 {% if documento.getLuogo() is defined and documento.getLuogo() is not empty %}
  214.                                     {{ documento.getLuogo() }} - 
  215.                                 {% endif %}
  216.                                 ({{ documento.getAnno() }})
  217.                                 {% if documento.file is not empty %}
  218.                                     <a href="{{ asset(uploaded_documents ~ documento.file.fileref|replace({'-':''}) ~ '.' ~ documento.file.estensione) }}">
  219.                                         PDF
  220.                                     </a>
  221.                                 {% endif %}                                    
  222.                             </p>
  223.                         </li>                        
  224.                     {% endfor %}
  225.                 </ul>
  226.             {% endif %}
  227.         {% else %}
  228.             <div class="row mt-3" itemscope itemtype="http://schema.org/ImageGallery">
  229.                 {% set count = 0 %}
  230.                 {% if allestimento is defined %}
  231.                     {% for immagine in allestimento %}
  232.                     <figure class="col-xl-2 card-item" itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">
  233.                         <a href="{{ asset(uploaded_img_big ~ immagine.fileref ~ '.' ~ immagine.estensione) }}" itemprop="contentUrl" data-size="{{ immagine.widthbig }}x{{ immagine.heightbig }}" class="lightbox">
  234.                             <img class="card-img-top card-img-top-custom" src="{{ asset(uploaded_img_thumbnail ~ immagine.fileref ~ '.' ~ immagine.estensione) }}" alt="{{ immagine.nome }}">
  235.                         </a>
  236.                         {% if immagine.nome is not empty %}
  237.                             <figcaption>{{ immagine.descrizione }}</figcaption>
  238.                         {% endif %}
  239.                     </figure>                    
  240.                     {% endfor %}
  241.                 {% endif %}
  242.                 {# {% for m in mostra.multimedias %}
  243.                     {% if m.tipo == cat %}
  244.                         {% if m.multimedia.tipo == 'image' %}
  245.                             <figure class="col-xl-2 card-item" itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">
  246.                                 <a href="{{ asset(uploaded_img_big ~ m.multimedia.fileref ~ '.' ~ m.multimedia.estensione) }}" itemprop="contentUrl" data-size="{{ m.multimedia.widthbig }}x{{ m.multimedia.heightbig }}">
  247.                                     <img class="card-img-top card-img-top-custom" src="{{ asset(uploaded_img_thumbnail ~ m.multimedia.fileref ~ '.' ~ m.multimedia.estensione) }}" alt="{{ m.multimedia.nome }}">
  248.                                 </a>
  249.                                 {% if m.multimedia.nome is not empty %}
  250.                                     <figcaption>{{ m.multimedia.descrizione }}</figcaption>
  251.                                 {% endif %}
  252.                             </figure>
  253.                             {% set count = count + 1 %}
  254.                         {% endif %}        
  255.                     {% endif %}
  256.                 {% endfor %} #}
  257.             </div>
  258.             <div class="row my-gallery mt-3">
  259.                 {% for m in mostra.multimedias %}
  260.                     {% if m.tipo == cat %}
  261.                         {% if m.multimedia.tipo == 'document' %}
  262.                             <figure class='col-xl-2'>
  263.                                 <a href="{{ asset(uploaded_documents ~ m.multimedia.fileref ~ '.' ~ m.multimedia.estensione) }}">
  264.                                     <img class="img-fluid" src="{{ asset('administrator/img/glyphicons-filetypes-65-pdf@3x.png') }}" />
  265.                                 </a>
  266.                                 <figcaption class="mt-2" itemprop="caption description">{{ m.multimedia.nome }}</figcaption>
  267.                             </figure>
  268.                             {% set count = count + 1 %}
  269.                         {% endif %}
  270.                         {% if m.multimedia.tipo == 'image' and app.request.get('_route') != "allestimentoMostra" %}
  271.                             <figure class="col-xl-2" itemprop="associatedMedia" itemscope itemtype="http://schema.org/ImageObject">
  272.                                 <a href="{{ asset(uploaded_img_big ~ m.multimedia.fileref ~ '.' ~ m.multimedia.estensione) }}" itemprop="contentUrl" data-size="{{ m.multimedia.widthnormal }}x{{ m.multimedia.heightnormal }}"  class="lightbox">
  273.                                     <img src="{{ asset(uploaded_img_thumbnail ~ m.multimedia.fileref ~ '.' ~ m.multimedia.estensione) }}" itemprop="thumbnail" alt="{{ m.multimedia.nome }}" />
  274.                                 </a>
  275.                                 <figcaption itemprop="caption description">{{ m.multimedia.nome|replace({'_': ' '}) }}</figcaption>
  276.                             </figure>
  277.                             {% set count = count + 1 %}
  278.                         {% endif %}
  279.                     {% endif %}
  280.                 {% endfor %}
  281.             </div>
  282.         {% endif %}
  283.         
  284.     </div>    
  285. {% endblock %}