templates/default/ficha_oficina.html.twig line 1

  1. {# {% extends 'default/contenido.html.twig' %} #}
  2. {% extends 'base.html.twig' %}
  3.  {% block idiomas %}
  4.  {% for k,idioma in locales %}
  5.      {% if k == app.request.locale %}    
  6.      <option selected value="{{ path(app.request.get('_route', 'index'), app.request.get('_route_params', [])|merge({_locale: k})) }}" title="{{ idioma }}">{{ k | upper}}</option>
  7.      {% else %}
  8.      <option value="{{ path(app.request.get('_route', 'index'), app.request.get('_route_params', [])|merge({_locale: k, slugP: oficina.provincia.translate(k).slug(), slugL: oficina.localidad.slug, slugO: oficina.translate(k).slug() })) }}" title="{{ idioma }}">{{ k | upper}}</option>
  9.      {% endif %}
  10.  {% endfor %}
  11.  {% endblock %}
  12. {% block bodyId %}ficha-oficina{% endblock %}
  13. {% block body %}
  14.     
  15.     <div id="cab-fi-ofi" class="container">
  16.         <div id="img-ofi">
  17.             {#{% if oficina.imagen %}
  18.                 {{ sonata_media(oficina.imagen, 'cabecera') }}
  19.             {% endif %}#}
  20.             <img src="/img/banner_currency_offices.png"/>
  21.         </div>
  22.         <div id="horario" class="row">
  23.             <div id="franjas" class="col-12 col-md-8">
  24.                 <div id="nomH">
  25.                     <span>{{ 'Horarios' | trans}}</span>
  26.                 </div>
  27.                 <div id="textH">
  28.                     {% for franja in oficina.franjas %}
  29.                         &gt;{{ franja.nombre }}:
  30.                         {# FOR DE LAS HORAS #}
  31.                         {% for horas in franja.franjaHoras %}
  32.                             <strong> {{ horas.horaInicio |date('H:i') }}
  33.                                 a {{ horas.horaFin |date('H:i') }} </strong>
  34.                         {% endfor %}
  35.                         <br/>
  36.                     {% endfor %}
  37.                     {% set hoy = "now"|date("Y-m-d") %}
  38.                     {% for festivo in oficina.dayoffs %}
  39.                         {% set fechaFestivo = festivo.date|date("Y-m-d") %}
  40.                         
  41.                         {% set segundosEnUnDia = 86400 %}
  42.                         {% set segundosDeDiferencia = fechaFestivo|date("U") - hoy|date("U") %}
  43.                         {% set diasDeDiferencia = segundosDeDiferencia / segundosEnUnDia %}
  44.                         
  45.                         {% if fechaFestivo == hoy or diasDeDiferencia >= -2 and diasDeDiferencia <= 30 %}
  46.                             {% for hor in festivo.horarioReducidos %}
  47.                                 <div>
  48.                                     &gt;Festivo: <strong>{{ festivo.date |date('d/m/Y') }}{% if hor.horaInicio|date('H:i') != '00:00' %} - {{ hor.horaInicio |date('H:i') }} a {{ hor.horaFin |date('H:i') }} {% endif %}</strong>
  49.                                 </div>
  50.                             {% endfor %}
  51.                         {% endif %}
  52.                     {% endfor %}
  53.                 </div>
  54.                 
  55.             </div>
  56.             <div id="tel" class="col-12 col-md-4">
  57.                 <span>{{ oficina.telefono }}</span>
  58.             </div>
  59.         </div>
  60.         <div id="info-ofi">
  61.             <div id="lin-ofi" class="row">
  62.                 <div class="texto col-12 col-lg-6">
  63.                     <p id="title">{{ oficina.title }}</p>
  64.                     {{ oficina.descripcion|raw }}
  65.                 </div>
  66.                 <div class="tabla col-12 col-lg-6">
  67.                         <p class="precios">{{ 'Precios' | trans}}</p>
  68.                         <div class="cont-table">
  69.                             <table id="tabla-cot">
  70.                                 <tr>
  71.                                     <th>{{ 'Divisa' | trans}}</th>
  72.                                     <th>{{ 'Compramos' | trans}}</th>
  73.                                     <th>{{ 'Vendemos' | trans}}</th>
  74.                                 </tr>
  75.                                 {% for cotizacion in cotizaciones %}
  76.                                     <tr data-oficina="{{ cotizacion.oficina }}">
  77.                                         <td>
  78.                                             <a class="d-none d-sm-block" href="{{ path('divisas', {'nombre': cotizacion.shortName.slug(app.request.locale)}) }}"><span class="banderas">
  79.                                                 {% if cotizacion.shortName.imagen %}
  80.                                                     {{ sonata_thumbnail(cotizacion.shortName.imagen, 'flag') }}
  81.                                                 {% endif %}
  82.                                             </span>{{ cotizacion.shortName.nombre }}</a>
  83.                                             <a class="d-block d-sm-none" href="{{ path('divisas', {'nombre': cotizacion.shortName.slug(app.request.locale)}) }}"><span class="banderas">
  84.                                                 {% if cotizacion.shortName.imagen %}
  85.                                                     {{ sonata_thumbnail(cotizacion.shortName.imagen, 'flag') }}
  86.                                                 {% endif %}
  87.                                             </span>{{ cotizacion.shortName }}</a>
  88.                                         </td>
  89.                                         <td>
  90.                                             {% if cotizacion.oficina.id == 66 %}
  91.                                                 -
  92.                                             {% elseif oficina.franjas is empty %}
  93.                                                 -
  94.                                             {% else %}
  95.                                                 {{ cotizacion.precioCompra|number_format(cotizacion.shortName.numDecimales) }}
  96.                                             {% endif %}
  97.                                         </td>
  98.                                         <td>
  99.                                             {% if oficina.franjas is empty %}
  100.                                                 -
  101.                                             {% elseif cotizacion.oficina.permiteCompra == 1 %}
  102.                                                 {{ cotizacion.precioVenta|number_format(cotizacion.shortName.numDecimales) }}
  103.                                             {% else %}
  104.                                                 -
  105.                                             {% endif %}
  106.                                         </td>
  107.                                     </tr>
  108.                                 {% endfor %}
  109.                             </table>
  110.                         </div>
  111.                         {% if oficina != "" %}<p class="info-select">{{ 'Precios para' | trans}} {{ diaMax }}</p>{% endif %}
  112.                         <div id="mas-cot">
  113.                             <a href="/cotizaciones">{{ 'Ver mas cotizaciones >' | trans}}</a>
  114.                         </div>
  115.                 </div>
  116.             </div>
  117.         </div>
  118.         
  119.         {% if oficina.servicios | length > 0 %}
  120.         <h2>{{ 'Servicios disponibles en esta oficina de cambio' | trans }}</h2>
  121.         <div id="ofi-servicios" class="row">
  122.         <ul>
  123.         {% for servicio in oficina.servicios %}
  124.             <li >
  125.                 <div class="card">
  126.                 {% if servicio.imagenCabecera %}
  127.                 {{ sonata_thumbnail(servicio.imagenCabecera, 'reference') }}
  128.                 {% elseif servicio.translate('es').imagenCabecera %}
  129.                 {{ sonata_thumbnail(servicio.translate('es').imagenCabecera, 'reference') }}
  130.                 {% endif %}
  131.                 <div class="card-body">
  132.                     <h5 class="card-title">{{ servicio.texto }}</h5>
  133.                 </div>
  134.                 </div>
  135.             <li>
  136.             
  137.         {% endfor %}
  138.         <ul>
  139.         </div>
  140.         {% endif %}
  141.         
  142.         <div id="text-servicios">
  143.             {{ oficina.serviciosTexto|raw }}
  144.         </div>
  145.         
  146.     
  147.    
  148.     
  149.         <div id="mapa" class="container">
  150.             <div id="map"></div>
  151.             <div id="texto-mapa">
  152.                 <p>{{ oficina.direccion }}</p>
  153.                 <a target="_blank" href="https://www.google.com/maps/dir/Current+Location/{{ oficina.latitud }},{{ oficina.longitud }}">{{ '¿Cómo llegar? >' | trans}}</a>
  154.             </div>
  155.         </div>
  156.     
  157.         <div id="resto" class="container">
  158.             <p id="ind">{{ 'Indicaciones para llegar:' | trans}}</p>
  159.             {{ oficina.indicaciones|raw }}
  160.         </div>
  161.     </div>
  162.     
  163.     {% block empresas %}
  164.         {{ render(controller('App\\Controller\\DefaultController::empresas' )) }}
  165.     {% endblock %}
  166.     
  167. {#     {{ dump(oficinaIdioma) }} #}
  168. {% endblock %}
  169. {% block javascripts_footer %}
  170.     {{ parent() }}
  171.     
  172.     <script>
  173. //             function initMap() {
  174. //                 
  175. //                 var mapElement = document.getElementById('map');
  176. //   
  177. //                 if (mapElement) {
  178. //                     
  179. //                     var map = new google.maps.Map(mapElement, {
  180. //                         center: { lat: {{ oficina.latitud }}, lng: {{ oficina.longitud }} },
  181. //                         zoom: 12
  182. //                     });
  183. //                 }
  184. //             }
  185.             
  186.     </script>
  187.     
  188.     {% include "includes/mapa_javascript.html.twig" with { oficinasMapa:[oficina] } only %}
  189.     
  190. {% endblock %}