templates/templates/pages/center/center-repository.html.twig line 1

Open in your IDE?
  1. {% extends "layouts/organization.html.twig" %}
  2. {% block bodyClass %}tpl-repository{% endblock %}
  3. {% block siteHeader %}
  4.     {% include 'organisms/organization-header.html.twig' %}
  5. {% endblock %}
  6. {% block pageHeader %}
  7.     {% include 'molecules/page-header.html.twig' with {
  8.         title: 'Directorio'
  9.     } %}
  10. {% endblock %}
  11. {% block pageContent %}
  12.     <section class="org-tier is-minimal is-marginless-top">
  13.         <div class="tier-content">
  14.             <usc-content-filter
  15.                     :options="[{key: null, name: 'Todos', selected: true}, {key: 'is-type-1', name: 'PDI', selected: false}, {key: 'is-type-2', name: 'PAS', selected: false} ]"
  16.             >
  17.                 <template v-slot:filters>
  18.                     <usc-text-filter
  19.                             target-container="#banners-container-1"
  20.                             target-items=".ml-specs"
  21.                     ></usc-text-filter>
  22.                 </template>
  23.                 <div class="org-modules-container repository-content" id="banners-container-1">
  24.                     {% include 'molecules/specs/contact-hidden.html.twig' with {
  25.                         link: path('department-staff-person'),
  26.                         title: 'Carlos Hidalgo', modifiers:'is-type-2'} %}
  27.                     {% include 'molecules/specs/contact-hidden.html.twig' with {
  28.                         link: path('department-staff-person'),
  29.                         title: 'Xandra Rodríguez Lemos', modifiers:'is-type-1'} %}
  30.                     {% include 'molecules/specs/contact-hidden.html.twig' with {
  31.                         link: path('department-staff-person'),
  32.                         title: 'Macarena Rodríguez Toural', modifiers:'is-type-1'} %}
  33.                     {% include 'molecules/specs/contact-hidden.html.twig' with {
  34.                         link: path('department-staff-person'),
  35.                         title: 'Henrique Santiago Rodríguez',modifiers: 'is-type-2'} %}
  36.                     {% include 'molecules/specs/contact-hidden.html.twig' with {
  37.                         link: path('department-staff-person'),
  38.                         title: 'Sebastián Salgado', modifiers:'is-type-2'} %}
  39.                     {% include 'molecules/specs/contact-hidden.html.twig' with {
  40.                         link: path('department-staff-person'),
  41.                         title: 'Isabel Rodríguez Docarmo',modifiers: 'is-type-2'} %}
  42.                     {% include 'molecules/specs/contact-hidden.html.twig' with {
  43.                         link: path('department-staff-person'),
  44.                         title: 'Enriqueta Lamenca Martínez', modifiers:'is-type-1'} %}
  45.                     {% include 'molecules/specs/contact-hidden.html.twig' with {
  46.                         link: path('department-staff-person'),
  47.                         title: 'Sabela Samuel Rodríguez',modifiers: 'is-type-2'} %}
  48.                     {% include 'molecules/specs/contact-hidden.html.twig' with {
  49.                         link: path('department-staff-person'),
  50.                         title: 'Carmo Fidalgo Sabarís', modifiers:'is-type-1'} %}
  51.                     {% include 'molecules/specs/contact-hidden.html.twig' with {
  52.                         link: path('department-staff-person'),
  53.                         title: 'Helena Domínguez Dasilva',modifiers: 'is-type-2'} %}
  54.                     {% include 'molecules/specs/contact-hidden.html.twig' with {
  55.                         link: path('department-staff-person'),
  56.                         title: 'Xela Cruz Costa',modifiers: 'is-type-2'} %}
  57.                     {% include 'molecules/specs/contact-hidden.html.twig' with {
  58.                         link: path('department-staff-person'),
  59.                         title: 'Eladio Suárez Álvarez', modifiers:'is-type-1'} %}
  60.                     {% include 'molecules/specs/contact-hidden.html.twig' with {
  61.                         link: path('department-staff-person'),
  62.                         title: 'Miguel Campos Ricárdez', modifiers:'is-type-2'} %}
  63.                     {% include 'molecules/specs/contact-hidden.html.twig' with {
  64.                         link: path('department-staff-person'),
  65.                         title: 'Manuel Pérez Roma',modifiers: 'is-type-2'} %}
  66.                     {% include 'molecules/specs/contact-hidden.html.twig' with {
  67.                         link: path('department-staff-person'),
  68.                         title: 'Fabiola Rodríguez Castro', modifiers:'is-type-1'} %}
  69.                     {% include 'molecules/specs/contact-hidden.html.twig' with {
  70.                         link: path('department-staff-person'),
  71.                         title: 'Enrique Santiago Rodríguez',modifiers: 'is-type-2'} %}
  72.                 </div>
  73.             </usc-content-filter>
  74.         </div>
  75.     </section>
  76. {% endblock %}
  77. {% block siteFooter %}
  78.     {% include 'organisms/site-footer.html.twig' %}
  79. {% endblock %}
  80. {% block javascripts %}
  81.     {{ parent() }}
  82.     <script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
  83.     <script type="text/javascript">
  84.       $(function () {
  85.         if (!Array.isArray) {
  86.           Array.isArray = function(arg) {
  87.             return Object.prototype.toString.call(arg) === '[object Array]';
  88.           };
  89.         }
  90.         function renderEmail(email) {
  91.           return '<a href="mailto:' + email + '">' + email + '</a>';
  92.         }
  93.         function renderEntry(data) {
  94.           var html = '';
  95.           if (data.telefono && Array.isArray(data.telefono) && data.telefono.length > 0) {
  96.             html += '<dt>Teléfono</dt><dd property="telephone">' +
  97.                 data.telefono.join('<br/>') + '</dd>';
  98.           }
  99.           if (data.correo && data.correo.length > 0) {
  100.             html += '<dt>Email</dt><dd property="email">' + renderEmail(data.correo) + '</dd>';
  101.           }
  102.           if (html === '') {
  103.             return '<strong>Non hai datos de contacto</strong>';
  104.           }
  105.           return '<dl class="at-desc-list">' + html + '</dl>';
  106.         }
  107.         $('a.more-contact-details-button').click(function(evt) {
  108.           evt.stopPropagation();
  109.           evt.preventDefault();
  110.           var postVars = {};
  111.           var container = $(this).parent();
  112.           var dropDown = container.find('div.more-contact-details');
  113.           if (dropDown.attr("aria-expanded") === "true") {
  114.             dropDown.attr("aria-expanded", "false");
  115.             container.find('div.more-contact-details').html('');
  116.             return;
  117.           }
  118.           // Amosar só un contedor aberto a vez.
  119.           $('.repository-content .more-contact-details-container').attr("aria-expanded", "false").html('');
  120.           postVars.id = $(this).data('contactId');
  121.           container.find('.more-contact-details-container').html(
  122.               '<strong>Cargando información de contacto</strong>'
  123.           );
  124.           dropDown.attr("aria-expanded", "true");
  125.           $.ajax({
  126.             type: 'post',
  127.             url: '{{ path('repository_contact_info') }}',
  128.             data: postVars,
  129.             success: function (data) {
  130.               if (data.data) {
  131.                 container.find('.more-contact-details-container').html(renderEntry(data.data));
  132.               }
  133.             },
  134.             error: function (xhr, ajaxOptions, thrownError) {
  135.               container.find('.more-contact-details-container').html(
  136.                   '<strong>ERROR! Please try again later</strong>'
  137.               );
  138.             }
  139.           });
  140.         });
  141.       });
  142.     </script>
  143. {% endblock %}