templates/Default/homepage/iframe_simple_page.html.twig line 1

Open in your IDE?
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2.         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
  4. <head>
  5.     <title>{{ 'widget.simple.title' | trans }}</title>
  6.     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  7.     <meta name="description" content="{{  'widget.simple.desc' | trans }}"/>
  8.     <style>
  9.         body{
  10.             margin:0;
  11.             padding: 0;
  12.             font-family: arial, helvetica, sans-serif;
  13.         {% if app.request.query.get('bgImgLink') %}
  14.             background-image: url("{{  app.request.query.get('bgImgLink')  }}");
  15.             background-repeat: no-repeat;
  16.             background-size: cover;
  17.             background-position: 50%;
  18.         {% else %}
  19.             background-color: #ffffff;
  20.         {% endif %}
  21.             height: 100%;
  22.             width: 100%;
  23.         }
  24.         .title {
  25.         {% if app.request.query.get('headerType') == "true" %}
  26.             background-color: transparent;
  27.             color: #000000;
  28.         {% else %}
  29.             background-color: rgba(0,0,0,0.6) ;/*#7952b3;*/
  30.             color: #ffffff;
  31.         {% endif %}
  32.             margin: 0;
  33.             padding: 15px 0;
  34.             text-align: center;
  35.         }
  36.         form{
  37.             padding: 10px;
  38.         }
  39.         .field input{
  40.             background: #fff url({{ asset('images/widget/widget-departure.png') }}) no-repeat 3px 50%;
  41.             height:30px;
  42.             margin: 0 0 10px 0;
  43.             border: 1px solid #7e9eab;
  44.             width: 100%;
  45.             text-indent: 25px;
  46.             border-radius: 3px;
  47.             width: -webkit-fill-available;
  48.             line-height: 1.5;
  49.             color: #495057;
  50.         }
  51.         #arr{
  52.             background: #fff url({{ asset('images/widget/widget-arrival.png') }}) no-repeat 3px 50%;
  53.         }
  54.         #date{
  55.             text-indent: 11px;
  56.             background: #fff url({{ asset('images/widget/widget-date.png') }}) no-repeat 3px 50%;
  57.         }
  58.         #bt{
  59.             display: block;
  60.             width: 100%;
  61.             color: {% if app.request.query.get('buttonColor') %} #{{ app.request.query.get("buttonColor") }}{% else %} #ffffff {% endif %}; /*#113c51;/*#7952b3;*/
  62.             /*border: 1px solid #113c51;*/ /*#7952b3;*/
  63.             padding: 7px 0;
  64.             text-align: center;
  65.             border-radius: 6px;
  66.             text-decoration: none;
  67.             background-color: {% if app.request.query.get('buttonBgColor') %} #{{ app.request.query.get("buttonBgColor") }}{% else %} #2ecc71 {% endif %};
  68.             font-weight: bold;
  69.         }
  70.         #bt:hover{
  71.             -webkit-animation: bounce 0.6s ;
  72.         }
  73.         @-webkit-keyframes bounce {
  74.             40% {-webkit-transform: translateY(3px) }
  75.             80% {-webkit-transform: translateY(-1px) }
  76.             100% {-webkit-transform: translateY(0)}
  77.         }
  78.         #bt-hidden-submit{
  79.             display: none;
  80.         }
  81.         img{
  82.             margin: 0 auto;
  83.             display: block;
  84.             width: 100%;
  85.             max-width: 300px;
  86.         }
  87.         .form-container{
  88.             height: 100%;
  89.             width: 100%;
  90.         }
  91.     </style>
  92.     <script type="text/javascript"
  93.             src="https://maps.googleapis.com/maps/api/js?libraries=places&key={{ constant('App\\Service\\MapsApi::GMAPSKEY_JSAUTOCOMPLETE') }}&language={{ app.request.locale | slice(0,2) }}"></script>
  94. </head>
  95. <body>
  96. <p class="title">
  97.     {% if app.request.query.get("widgetTitle") %}
  98.         <strong>{{ app.request.query.get("widgetTitle") }}</strong>
  99.     {% else %}
  100.         <strong>{{ 'widget.simple.txt.0' | trans }}</strong>
  101.         <br />
  102.         <strong>{{ 'widget.simple.txt.1' | trans }}</strong>
  103.     {% endif %}
  104. </p>
  105. <div class="form-container">
  106.     <form action="{{ path('widget_iframe2_post') }}" method="get" target="_blank" name="form">
  107.         <div class="field">
  108.             {#<label>Départ</label>#}
  109.             <input type="text" id="dep" name="dep" placeholder="{{ 'widget.simple.dep' | trans }}" value="{{ app.request.query.get('dep') }}" required/>
  110.             <input type="hidden" id="depLat" name="depLat" value="{{ app.request.query.get('depLat') }}"/>
  111.             <input type="hidden" id="depLng" name="depLng" value="{{ app.request.query.get('depLng') }}"/>
  112.         </div>
  113.         <div class="field">
  114.             {#<label>Arrivée</label>#}
  115.             <input type="text" id="arr" name="arr" placeholder="{{ 'widget.simple.arr' | trans }}" value="{{ app.request.query.get('arr') }}" required/>
  116.             <input type="hidden" id="arrLat" name="arrLat" value="{{ app.request.query.get('arrLat') }}"/>
  117.             <input type="hidden" id="arrLng" name="arrLng" value="{{ app.request.query.get('arrLng') }}"/>
  118.         </div>
  119.         <div class="field">
  120.             {#<label>Date</label>#}
  121.             <input type="date" id="date" name="date"/>
  122.         </div>
  123.         <div class="field">
  124.             <a href="#" value="Rechercher" id="bt" onClick="document.getElementById('bt-hidden-submit').click(); return false;">{{ 'widget.simple.button' | trans }}</a>
  125.             <input type="submit" id="bt-hidden-submit"/>
  126.         </div>
  127.     </form>
  128.     <img id="imgPoweredBy" src="{{asset('images/widget/widget-logo-multimodal.png')}}"  onClick="document.getElementById('bt-hidden-submit').click(); return false;" />
  129. </div>
  130. <script>
  131.     {% if app.request.query.get('bgImgLink') %}
  132.         document.getElementById('imgPoweredBy').remove(); //TODO do that in php, why using js?
  133.         // document.getElementsByClassName("form-container")[0].style.padding = "20px 0 50px 0"; // TODO use style class instead, usefull?
  134.     {% endif %}
  135.     function initializeAutocomplete(id) {
  136.         var element = document.getElementById(id);
  137.         var autocomplete = new google.maps.places.Autocomplete(element, {types: ['(cities)']});
  138.         google.maps.event.addListener(autocomplete, 'place_changed', function(){
  139.             place = this.getPlace();
  140.             document.getElementById(id+"Lat").value= place.geometry.location.lat();
  141.             document.getElementById(id+"Lng").value= place.geometry.location.lng();
  142.         });
  143.     }
  144.     google.maps.event.addDomListener(window, 'load', function () {
  145.         initializeAutocomplete('dep');
  146.         initializeAutocomplete('arr');
  147.     });
  148. </script>
  149. </body>
  150. </html>