templates/base.html.twig line 1

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.             <script src="https://analytics.ahrefs.com/analytics.js" data-key="5HTfp0J+/1qudztb77oSQw" async></script>
  30.             
  31.             {% block headplus %}
  32.                     {% 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 %}
  33.             {% endblock %}
  34.             {% block stylesheets %}
  35.                 {{ encore_entry_link_tags('app') }}
  36.                 <style type="text/css">
  37.                     .btn-nearest {
  38.                         background-color: #5aa3a6;
  39.                         border-color: #5aa3a6;
  40.                         color: #fff !important;
  41.                     }
  42.                     /*#nearest{display:none}*/
  43.                     @media (max-width: 767px)
  44.                     {
  45.                         .navigation .dl-menuwrapper>ul {
  46.                             background-color: #000;
  47.                             display: block;
  48.                             right: 0%;
  49.                         }
  50.                     }
  51.                     .donate_gateway
  52.                     {
  53.                         width: 50%;
  54.                         margin: auto;
  55.                     }
  56.                     .form_errors {
  57.                         color: red;
  58.                         float: left;
  59.                     }
  60.                     .payment-message{
  61.                         font-size: 23px;
  62.                         color: black;
  63.                         padding: 19px;
  64.                     }
  65.                     .payment-message a{
  66.                         font-size: 23px;
  67.                         color: #007176;
  68.                         padding: 5px;
  69.                         font-weight: bold;
  70.                     }
  71.                     .hidden {
  72.                       display: none !important;
  73.                     }
  74.                     #installContainer {
  75.                       position: relative;
  76.                       bottom: 1em;
  77.                       display: flex;
  78.                       /*justify-content: center;*/
  79.                       /*width: 100%;*/
  80.                     }
  81.                     #installContainer button {
  82.                       background-color: inherit;
  83.                       border: 1px solid black;
  84.                       color: black;
  85.                       font-size: 1em;
  86.                       padding: 0.75em;
  87.                     }
  88.                 </style>
  89.             {% endblock %}
  90.         </head>
  91.         <body>
  92.             <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
  93.               <div class="modal-dialog" role="document">
  94.                 <div class="modal-content">
  95.                   <div class="modal-header">
  96.                     <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  97.                     <h4 class="modal-title" id="exampleModalLabel">New message</h4>
  98.                   </div>
  99.                   <div class="modal-body">
  100.                     <form>
  101.                       <div class="form-group">
  102.                         <label for="recipient-name" class="control-label">Name: <a class="link"><span class="title"></span></a></label>
  103.                         <a class="link"> <img id="img" src=""></a>
  104.                       </div>
  105.                       
  106.                     </form>
  107.                   </div>
  108.                   <div class="modal-footer">
  109.                     <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
  110.                   </div>
  111.                 </div>
  112.               </div>
  113.             </div>
  114.             <div class="wraper">
  115.                     
  116.             {{ render(controller("App\\Controller\\Front\\MainController::header") )}}
  117.             {% include 'Main/navigation2.html.twig' %}
  118.             </header>
  119.         
  120.             {% block body %}{% endblock %}
  121.             {{ render(controller("App\\Controller\\Front\\MainController::newsletter") )}}
  122.             {{ render(controller("App\\Controller\\Front\\MainController::footer") )}}
  123.             </div>
  124.             {% block javascripts %}
  125.             {#{{ encore_entry_script_tags('app') }}#}
  126.             <script src="{{asset('js/jquery.js')}}"></script>
  127.             <script src="{{asset('js/bootstrap.min.js')}}"></script>
  128.             <script src="{{asset('js/slick.min.js')}}"></script>
  129.             <script src="{{asset('js/wow.min.js')}}"></script>
  130.             <script src="{{asset('js/jquery.bxslider.min.js')}}"></script>
  131.             <script src="{{asset('js/jQuery-plugin-progressbar.js')}}"></script>
  132.             <script src="{{asset('js/chosen.jquery.min.js')}}"></script>
  133.             <script src="{{asset('js/modernizr.custom.js')}}"></script>
  134.             <script src="{{asset('js/jquery.dlmenu.js')}}"></script>
  135.             <script src="{{asset('js/jquery.prettyphoto.js')}}"></script>
  136.             <script src="{{asset('js/jquery.downCount.js')}}"></script>
  137.             <script src="{{asset('js/waypoints-min.js')}}"></script>
  138.             <script src="{{asset('js/custom.js')}}"></script>
  139.             <script src="https://polyfill.io/v3/polyfill.min.js?version=3.52.1&features=fetch"></script>
  140.             <!--<script src="https://js.stripe.com/v3/"></script>-->
  141.             <script type="text/javascript">
  142.             /*$(document).ready(function(){
  143.                 $(".price-input").click(function () {
  144.                     id = $( this ).attr("id");
  145.                     $('.label-price').each(function(i, obj) {
  146.                         if(obj.id != "label-"+id){
  147.                             console.log(obj.id +" vs label-"+id);
  148.                             $("#"+obj.id).removeClass('label-selected');
  149.                         }
  150.                         else{
  151.                             console.log("ccc   " +obj.id);
  152.                             $("#"+obj.id).addClass('label-selected');
  153.                         }
  154.                     });   
  155.               
  156.                });
  157.                 // Create an instance of the Stripe object with your publishable API key
  158.                 var stripe = Stripe("pk_live_51DFI2eD7hFI8GRlVmwTRhTJoaPIundae32cpopeCDKoP9thZJMC85RnLxakrLjq6fSM86hGn7C5LWiiW087DW9OG00POegwEDE");
  159.                 var checkoutButton = document.getElementById("checkout-button");
  160.                 checkoutButton.addEventListener("click", function (e) {
  161.                    e.preventDefault();
  162.                     //const params = new URLSearchParams([...new FormData(e.target).entries()]);
  163.                     var form = document.getElementById("donate_form"),
  164.                     myData = new FormData(form);
  165.                   fetch("{{path('donate')}}", {
  166.                     method: "POST",
  167.                     body:myData
  168.                   })
  169.                     .then(function (response) {
  170.                       //console.log(response);
  171.                       return response.json();
  172.                     })
  173.                     .then(function (session) {
  174.                         console.log(session);
  175.                         if(session['code'] == 400){
  176.                             document.getElementById("price").innerHTML =  "" ;
  177.                             document.getElementById("other").innerHTML =  "" ;
  178.                             document.getElementById("name").innerHTML =  "" ;
  179.                             document.getElementById("email").innerHTML =  "" ;
  180.                            // document.getElementById("gateway").innerHTML =  "" ;
  181.                             for (const [key, value] of Object.entries(session['errors'])) {
  182.                                 document.getElementById(key).innerHTML =  value ;
  183.                             }
  184.                       }
  185.                       else {
  186.                         return stripe.redirectToCheckout({ sessionId: session.id });
  187.                       }
  188.                       
  189.                     })
  190.                     .then(function (result) {
  191.                       // If redirectToCheckout fails due to a browser or network
  192.                       // error, you should display the localized error message to your
  193.                       // customer using error.message.
  194.                       if (result.error) {
  195.                         alert(result.error.message);
  196.                       }
  197.                     })
  198.                     .catch(function (error) {
  199.                       console.error("Error:", error);
  200.                     });
  201.                 });
  202.             });*/
  203.             if ('serviceWorker' in navigator) {
  204.                     navigator.serviceWorker.register('/service-worker.js?v=1').then(function(registration) {
  205.                        // console.log('ServiceWorker registration successful with scope:',  registration.scope);
  206.                     }).catch(function(error) {
  207.                        // console.log('ServiceWorker registration failed:', error);
  208.                     });
  209.                 }
  210.             if ("geolocation" in navigator){ //check geolocation available 
  211.                     //try to get user current location using getCurrentPosition() method
  212.                 function success(position) {
  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(data);
  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");
  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() {
  255.                     var apiUrl =" http://api.aladhan.com/v1/timingsByCity?city="+city+"&method=8"
  256.                     //var apiUrl = "https://api.pray.zone/v2/times/today.json?city="+city+"";
  257.                     callApi(apiUrl);
  258.                 }
  259.                 navigator.geolocation.getCurrentPosition(success, error);
  260.                                             
  261.             }else{
  262.                 var apiUrl =" http://api.aladhan.com/v1/timingsByCity?city="+city+"&method=8"
  263.             }
  264.             function callApi(url){
  265.                 $.ajax({
  266.                     type: "GET",
  267.                     url: url,  
  268.                     crossDomain: true,
  269.                     cache: false,
  270.                     success: function(data) {  
  271.                         $("#fajr").text(data['data']["timings"]["Fajr"])
  272.                         $("#dhor").text(data['data']["timings"]["Dhuhr"])
  273.                         $("#asr").text(data['data']["timings"]["Asr"])
  274.                         $("#maghreb").text(data['data']["timings"]["Maghrib"])
  275.                         $("#icha").text(data['data']["timings"]["Isha"])
  276.                     },
  277.                     error: function(error){
  278.                         console.log("error");
  279.                     }
  280.                 });
  281.             }
  282.             
  283.         </script>
  284.         {% endblock %}
  285.        
  286.     </body>
  287. </html>