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.                             <div>
  52.                                 &gt;Festivo: <strong>{{ festivo.date |date('d/m/Y') }}{% if festivo.horarioReducidos is empty %} - {{ 'Cerrado' | trans }} {% else %} {% for hor in festivo.horarioReducidos %}{% if hor.horaInicio|date('H:i') != '00:00' %} - {{ hor.horaInicio |date('H:i') }} a {{ hor.horaFin |date('H:i') }} {% else %} - {{ 'Cerrado' | trans }} {% endif %}{% endfor %}{% endif %}</strong>
  53.                             </div>
  54.                         {% endif %}
  55.                     {% endfor %}
  56.                 </div>
  57.                 
  58.             </div>
  59.             <div id="tel" class="col-12 col-md-4">
  60.                 <span>{{ oficina.telefono }}</span>
  61.             </div>
  62.         </div>
  63.         <div id="info-ofi">
  64.             <div id="lin-ofi" class="row">
  65.                 <div class="texto col-12 col-lg-6">
  66.                     <p id="title">{{ oficina.title }}</p>
  67.                     {{ oficina.descripcion|raw }}
  68.                 </div>
  69.                 <div class="tabla col-12 col-lg-6">
  70.                         <p class="precios">{{ 'Precios' | trans}}</p>
  71.                         <div class="cont-table">
  72.                             <table id="tabla-cot">
  73.                                 <tr>
  74.                                     <th>{{ 'Divisa' | trans}}</th>
  75.                                     <th>{{ 'Compramos' | trans}}</th>
  76.                                     <th>{{ 'Vendemos' | trans}}</th>
  77.                                 </tr>
  78.                                 {% for cotizacion in cotizaciones %}
  79.                                     <tr data-oficina="{{ cotizacion.oficina }}">
  80.                                         <td>
  81.                                             <a class="d-none d-sm-block" href="{{ path('divisas', {'nombre': cotizacion.shortName.slug(app.request.locale)}) }}"><span class="banderas">
  82.                                                 {% if cotizacion.shortName.imagen %}
  83.                                                     {{ sonata_thumbnail(cotizacion.shortName.imagen, 'flag') }}
  84.                                                 {% endif %}
  85.                                             </span>{{ cotizacion.shortName.nombre }}</a>
  86.                                             <a class="d-block d-sm-none" href="{{ path('divisas', {'nombre': cotizacion.shortName.slug(app.request.locale)}) }}"><span class="banderas">
  87.                                                 {% if cotizacion.shortName.imagen %}
  88.                                                     {{ sonata_thumbnail(cotizacion.shortName.imagen, 'flag') }}
  89.                                                 {% endif %}
  90.                                             </span>{{ cotizacion.shortName }}</a>
  91.                                         </td>
  92.                                         <td>
  93.                                             {% if cotizacion.oficina.id == 66 %}
  94.                                                 -
  95.                                             {% elseif oficina.franjas is empty %}
  96.                                                 -
  97.                                             {% else %}
  98.                                                 {{ cotizacion.precioCompra|number_format(cotizacion.shortName.numDecimales) }}
  99.                                             {% endif %}
  100.                                         </td>
  101.                                         <td>
  102.                                             {% if oficina.franjas is empty %}
  103.                                                 -
  104.                                             {% elseif cotizacion.oficina.permiteCompra == 1 %}
  105.                                                 {{ cotizacion.precioVenta|number_format(cotizacion.shortName.numDecimales) }}
  106.                                             {% else %}
  107.                                                 -
  108.                                             {% endif %}
  109.                                         </td>
  110.                                     </tr>
  111.                                 {% endfor %}
  112.                             </table>
  113.                         </div>
  114.                         {% if oficina != "" %}<p class="info-select">{{ 'Precios para' | trans}} {{ diaMax }}</p>{% endif %}
  115.                         <div id="mas-cot">
  116.                             <a href="/cotizaciones">{{ 'Ver mas cotizaciones >' | trans}}</a>
  117.                         </div>
  118.                 </div>
  119.             </div>
  120.         </div>
  121.         
  122.         {% if oficina.servicios | length > 0 %}
  123.         <h2>{{ 'Servicios disponibles en esta oficina de cambio' | trans }}</h2>
  124.         <div id="ofi-servicios" class="row">
  125.         <ul>
  126.         {% for servicio in oficina.servicios %}
  127.             <li >
  128.                 <div class="card">
  129.                 {% if servicio.imagenCabecera %}
  130.                 {{ sonata_thumbnail(servicio.imagenCabecera, 'reference') }}
  131.                 {% elseif servicio.translate('es').imagenCabecera %}
  132.                 {{ sonata_thumbnail(servicio.translate('es').imagenCabecera, 'reference') }}
  133.                 {% endif %}
  134.                 <div class="card-body">
  135.                     <h5 class="card-title">{{ servicio.texto }}</h5>
  136.                 </div>
  137.                 </div>
  138.             <li>
  139.             
  140.         {% endfor %}
  141.         <ul>
  142.         </div>
  143.         {% endif %}
  144.         
  145.         <div id="text-servicios">
  146.             {{ oficina.serviciosTexto|raw }}
  147.         </div>
  148.         
  149.     
  150.    
  151.     
  152.         <div id="mapa" class="container">
  153.             <div id="map"></div>
  154.             <div id="texto-mapa">
  155.                 <p>{{ oficina.direccion }}</p>
  156.                 <a target="_blank" href="https://www.google.com/maps/dir/Current+Location/{{ oficina.latitud }},{{ oficina.longitud }}">{{ '¿Cómo llegar? >' | trans}}</a>
  157.             </div>
  158.         </div>
  159.     
  160.         <div id="resto" class="container">
  161.             <p id="ind">{{ 'Indicaciones para llegar:' | trans}}</p>
  162.             {{ oficina.indicaciones|raw }}
  163.         </div>
  164.     </div>
  165.     
  166.     {% block empresas %}
  167.         {{ render(controller('App\\Controller\\DefaultController::empresas' )) }}
  168.     {% endblock %}
  169.     
  170. {#     {{ dump(oficinaIdioma) }} #}
  171. {% endblock %}
  172. {% block javascripts_footer %}
  173.     {{ parent() }}
  174.     
  175.     <script>
  176. //             function initMap() {
  177. //                 
  178. //                 var mapElement = document.getElementById('map');
  179. //   
  180. //                 if (mapElement) {
  181. //                     
  182. //                     var map = new google.maps.Map(mapElement, {
  183. //                         center: { lat: {{ oficina.latitud }}, lng: {{ oficina.longitud }} },
  184. //                         zoom: 12
  185. //                     });
  186. //                 }
  187. //             }
  188.             
  189.     </script>
  190.     
  191.     {% include "includes/mapa_javascript.html.twig" with { oficinasMapa:[oficina] } only %}
  192.     
  193. {% endblock %}