templates/base.html.twig line 131

Open in your IDE?
  1. <!DOCTYPE html>
  2.     <html lang="en">
  3.         <head>
  4.             <meta charset="utf-8">
  5.             <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
  6.             <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7.             <meta name="viewport" content="width=device-width, initial-scale=1" />
  8.             <Meta name=" robots" content="index, follow" />
  9.             <meta name="theme-color" content="#8fbec0"/>
  10.             <link rel="apple-touch-icon" href="{{asset('assets/icons/192.png')}}">
  11.             <!-- Primary Meta Tags -->
  12.             <title> {% block title %}{{ 'Welcome'|trans }}!{% endblock %} | All the mosque of sharjah  !</title>
  13.             <link rel="manifest" href="/manifest.json">
  14.             <meta name="title" content="As salam aleykum! | Find all the masjids of sharjah listed here !">
  15.             {% set routeParams = app.request.attributes.get('_route_params') %}
  16.             {% set pageParam = app.request.query.get('page') %}
  17.             {% if pageParam is not null %}
  18.                 {% set routeParams = routeParams|merge({'page': pageParam}) %}
  19.             {% endif %}
  20.             <link rel="canonical" href="{{ url(app.request.attributes.get('_route'), routeParams) }}" />
  21.            <!-- Global site tag (gtag.js) - Google Analytics -->
  22.             <script type="text/javascript" async src="https://www.googletagmanager.com/gtag/js?id=G-K36ER9CF16"></script>
  23.             <script type="text/javascript">
  24.               window.dataLayer = window.dataLayer || [];
  25.               function gtag(){dataLayer.push(arguments);}
  26.               gtag('js', new Date());
  27.               gtag('config', 'G-K36ER9CF16');
  28.             </script>
  29.         
  30.             {% block headplus %}
  31.                     {% block meta_description %}<meta name="description" content="The purpose of this site is to list, as much as possible, the mosques of the emirate of Sharjah and why not subsequently expand the collection of images and information on mosques in other Emirates and  or Countries.">{% endblock %}
  32.             {% endblock %}
  33.             {% block stylesheets %}
  34.                 {{ encore_entry_link_tags('app') }}
  35.                 <style type="text/css">
  36.                     .btn-nearest {
  37.                         background-color: #5aa3a6;
  38.                         border-color: #5aa3a6;
  39.                         color: #fff !important;
  40.                     }
  41.                     /*#nearest{display:none}*/
  42.                     @media (max-width: 767px)
  43.                     {
  44.                         .navigation .dl-menuwrapper>ul {
  45.                             background-color: #000;
  46.                             display: block;
  47.                             right: 0%;
  48.                         }
  49.                     }
  50.                     .donate_gateway
  51.                     {
  52.                         width: 50%;
  53.                         margin: auto;
  54.                     }
  55.                     .form_errors {
  56.                         color: red;
  57.                         float: left;
  58.                     }
  59.                     .payment-message{
  60.                         font-size: 23px;
  61.                         color: black;
  62.                         padding: 19px;
  63.                     }
  64.                     .payment-message a{
  65.                         font-size: 23px;
  66.                         color: #007176;
  67.                         padding: 5px;
  68.                         font-weight: bold;
  69.                     }
  70.                     .hidden {
  71.                       display: none !important;
  72.                     }
  73.                     #installContainer {
  74.                       position: relative;
  75.                       bottom: 1em;
  76.                       display: flex;
  77.                       /*justify-content: center;*/
  78.                       /*width: 100%;*/
  79.                     }
  80.                     #installContainer button {
  81.                       background-color: inherit;
  82.                       border: 1px solid black;
  83.                       color: black;
  84.                       font-size: 1em;
  85.                       padding: 0.75em;
  86.                     }
  87.                 </style>
  88.             {% endblock %}
  89.         </head>
  90.         <body>
  91.             <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
  92.               <div class="modal-dialog" role="document">
  93.                 <div class="modal-content">
  94.                   <div class="modal-header">
  95.                     <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  96.                     <h4 class="modal-title" id="exampleModalLabel">{{'modal.new.message'|trans}}</h4>
  97.                   </div>
  98.                   <div class="modal-body">
  99.                     <form>
  100.                       <div class="form-group">
  101.                         <label for="recipient-name" class="control-label">{{'modal.Name'|trans}} <a class="link"><span class="title"></span></a></label>
  102.                         <a class="link"> <img id="img" src=""></a>
  103.                       </div>
  104.                       
  105.                     </form>
  106.                   </div>
  107.                   <div class="modal-footer">
  108.                     <button type="button" class="btn btn-default" data-dismiss="modal">{{"modal.Close"|trans}}</button>
  109.                   </div>
  110.                 </div>
  111.               </div>
  112.             </div>
  113.             <div class="wraper">
  114.                     
  115.             {{ render(controller("App\\Controller\\Front\\MainController::header") )}}
  116.             {% include 'Main/navigation2.html.twig' %}
  117.             </header>
  118.         
  119.             {% block body %}{% endblock %}
  120.             {{ render(controller("App\\Controller\\Front\\MainController::newsletter") )}}
  121.             {{ render(controller("App\\Controller\\Front\\MainController::footer") )}}
  122.             </div>
  123.             {% block javascripts %}
  124.             {#{{ encore_entry_script_tags('app') }}#}
  125.             <script src="{{asset('js/jquery.js')}}"></script>
  126.             <script src="{{asset('js/bootstrap.min.js')}}"></script>
  127.             <script src="{{asset('js/slick.min.js')}}"></script>
  128.             <script src="{{asset('js/wow.min.js')}}"></script>
  129.             <script src="{{asset('js/jquery.bxslider.min.js')}}"></script>
  130.             <script src="{{asset('js/jQuery-plugin-progressbar.js')}}"></script>
  131.             <script src="{{asset('js/chosen.jquery.min.js')}}"></script>
  132.             <script src="{{asset('js/modernizr.custom.js')}}"></script>
  133.             <script src="{{asset('js/jquery.dlmenu.js')}}"></script>
  134.             <script src="{{asset('js/jquery.prettyphoto.js')}}"></script>
  135.             <script src="{{asset('js/jquery.downCount.js')}}"></script>
  136.             <script src="{{asset('js/waypoints-min.js')}}"></script>
  137.             <script src="{{asset('js/custom.js')}}"></script>
  138.             <!--<script src="https://js.stripe.com/v3/"></script>-->
  139.             <script type="text/javascript">
  140.             /*$(document).ready(function(){
  141.                 $(".price-input").click(function () {
  142.                     id = $( this ).attr("id");
  143.                     $('.label-price').each(function(i, obj) {
  144.                         if(obj.id != "label-"+id){
  145.                             console.log(obj.id +" vs label-"+id);
  146.                             $("#"+obj.id).removeClass('label-selected');
  147.                         }
  148.                         else{
  149.                             console.log("ccc   " +obj.id);
  150.                             $("#"+obj.id).addClass('label-selected');
  151.                         }
  152.                     });   
  153.               
  154.                });
  155.                 // Create an instance of the Stripe object with your publishable API key
  156.                 var stripe = Stripe("pk_live_51DFI2eD7hFI8GRlVmwTRhTJoaPIundae32cpopeCDKoP9thZJMC85RnLxakrLjq6fSM86hGn7C5LWiiW087DW9OG00POegwEDE");
  157.                 var checkoutButton = document.getElementById("checkout-button");
  158.                 checkoutButton.addEventListener("click", function (e) {
  159.                    e.preventDefault();
  160.                     //const params = new URLSearchParams([...new FormData(e.target).entries()]);
  161.                     var form = document.getElementById("donate_form"),
  162.                     myData = new FormData(form);
  163.                   fetch("{{path('donate')}}", {
  164.                     method: "POST",
  165.                     body:myData
  166.                   })
  167.                     .then(function (response) {
  168.                       //console.log(response);
  169.                       return response.json();
  170.                     })
  171.                     .then(function (session) {
  172.                         console.log(session);
  173.                         if(session['code'] == 400){
  174.                             document.getElementById("price").innerHTML =  "" ;
  175.                             document.getElementById("other").innerHTML =  "" ;
  176.                             document.getElementById("name").innerHTML =  "" ;
  177.                             document.getElementById("email").innerHTML =  "" ;
  178.                            // document.getElementById("gateway").innerHTML =  "" ;
  179.                             for (const [key, value] of Object.entries(session['errors'])) {
  180.                                 document.getElementById(key).innerHTML =  value ;
  181.                             }
  182.                       }
  183.                       else {
  184.                         return stripe.redirectToCheckout({ sessionId: session.id });
  185.                       }
  186.                       
  187.                     })
  188.                     .then(function (result) {
  189.                       // If redirectToCheckout fails due to a browser or network
  190.                       // error, you should display the localized error message to your
  191.                       // customer using error.message.
  192.                       if (result.error) {
  193.                         alert(result.error.message);
  194.                       }
  195.                     })
  196.                     .catch(function (error) {
  197.                       console.error("Error:", error);
  198.                     });
  199.                 });
  200.             });*/
  201.             if ('serviceWorker' in navigator) {
  202.                     navigator.serviceWorker.register('/service-worker.js?v=1').then(function(registration) {
  203.                         console.log('ServiceWorker registration successful with scope:',  registration.scope);
  204.                     }).catch(function(error) {
  205.                         console.warn('ServiceWorker registration failed:', error);
  206.                     });
  207.                 }
  208.             if ("geolocation" in navigator){ //check geolocation available 
  209.                     //try to get user current location using getCurrentPosition() method
  210.                 console.log('user accepted geolocation')
  211.                 function success(position) {
  212.                     console.log('geolocation succeed')
  213.                     $("#nearest").show();
  214.                     var latitude  = position.coords.latitude;
  215.                     var longitude = position.coords.longitude;
  216.                     var elev = "333";
  217.                     var apiUrl ="https://api.aladhan.com/v1/timings/1398332113?latitude="+latitude+"&longitude="+longitude+"&method=8"
  218.                     //var apiUrl = "https://api.pray.zone/v2/times/today.json?longitude="+longitude+"&latitude="+latitude+"&elevation="+elev+"&timeformat=0";
  219.                     callApi(apiUrl);
  220.                     $('#exampleModal').on('show.bs.modal', function (event) {
  221.                         console.log('js triggered');
  222.                         var button = $(event.relatedTarget) // Button that triggered the modal
  223.                         var url_find_nearest = "{{path('findNearestToClientLocation',{'lat':'lat','lng':'lng'})}}";
  224.                         url_find_nearest = url_find_nearest.replace("lat", latitude);
  225.                         url_find_nearest = url_find_nearest.replace("lng", longitude);
  226.                         var modal = $(this)
  227.                       $.ajax({
  228.                             type: "POST",
  229.                             url: url_find_nearest,  
  230.                             crossDomain: true,
  231.                             cache: false,
  232.                             success: function(data) {  
  233.                                 console.log('ajax geolocation succeed')
  234.                                 var imageSrc = "https://sharjah-masjids.com/media/cache/list/"+data[0]['mainPic'];
  235.                                 var link = "{{path('masjid_show',{'slug':'slug'})}}"
  236.                                 link = link.replace('slug', data[0]['slug'])
  237.                                                                 console.log(link);
  238.                                 //window.location.replace(link);
  239.                                 
  240.                                 modal.find('.modal-title').text(data[0]['name']['{{app.request.locale}}']['name'])
  241.                                 modal.find('.title').text(data[0]['name']['{{app.request.locale}}']['name'])
  242.                                 modal.find('#img').attr('src', imageSrc);
  243.                                 modal.find('.link').attr('href', link);
  244.                             },
  245.                             error: function(error){
  246.                                 console.log("error ajax geolocation");
  247.                             }
  248.                         });
  249.                       // If necessary, you could initiate an AJAX request here (and then do the updating in a callback).
  250.                       // Update the modal's content. We'll use jQuery here, but you could use a data binding library or other methods instead.
  251.                      
  252.                     })
  253.                 }
  254.                 function error(err) {
  255.                     $("#nearest").hide();
  256.                     console.log('geolocation failed depiste user allow geolocation', err.code, err.message);
  257.                     var apiUrl ="https://api.aladhan.com/v1/timingsByCity?city="+city+"&country="+country+"&method=8"
  258.                     //var apiUrl = "https://api.pray.zone/v2/times/today.json?city="+city+"";
  259.                     callApi(apiUrl);
  260.                 }
  261.                 navigator.geolocation.getCurrentPosition(success, error, {
  262.                     enableHighAccuracy: true,
  263.                     timeout: 10000, // 10 secondes
  264.                     maximumAge: 0
  265.                 });
  266.                                             
  267.             }else{
  268.                 console.log('geolocation refused')
  269.                 var apiUrl =" https://api.aladhan.com/v1/timingsByCity?city="+city+"&country="+country+"&method=8"
  270.             }
  271.             function callApi(url){
  272.                 $.ajax({
  273.                     type: "GET",
  274.                     url: url,  
  275.                     crossDomain: true,
  276.                     cache: false,
  277.                     success: function(data) {  
  278.                         $("#fajr").text(data['data']["timings"]["Fajr"])
  279.                         $("#dhor").text(data['data']["timings"]["Dhuhr"])
  280.                         $("#asr").text(data['data']["timings"]["Asr"])
  281.                         $("#maghreb").text(data['data']["timings"]["Maghrib"])
  282.                         $("#icha").text(data['data']["timings"]["Isha"])
  283.                     },
  284.                     error: function(error){
  285.                         console.log("error");
  286.                     }
  287.                 });
  288.             }
  289.             
  290.         </script>
  291.         {% endblock %}
  292.        
  293.     </body>
  294. </html>