templates/index.html.twig line 1

  1. {% extends "base.html.twig" %}
  2. {% block title %}
  3.     {{ tString("base_title_tag") }}
  4. {% endblock %}
  5. {% block meta %}
  6.     <meta name="description" content="{{ tString("meta_description") }}">
  7.     <!-- Twitter -->
  8.     <meta name="twitter:card" content="summary">
  9.     <meta name="twitter:site" content="@">
  10.     <meta name="twitter:creator" content="@">
  11.     <meta name="twitter:title" content="{{ tString("meta_title") }}">
  12.     <meta name="twitter:description" content="{{ tString("meta_description") }}">
  13.     <meta name="twitter:image" content="{{ asset("images/logo/sdoktor-logo.png") }}">
  14.     <!-- Facebook -->
  15.     <meta property="og:url" content="{{ app.request.schemeAndHttpHost }}">
  16.     <meta property="og:title" content="{{ tString("meta_title") }}">
  17.     <meta property="og:description" content="{{ tString("meta_description") }}">
  18.     <meta property="og:type" content="website">
  19.     <meta property="og:image" content="{{ asset("images/logo/sdoktor-logo.png") }}">
  20.     <meta property="og:image:type" content="image/png">
  21.     <meta property="og:image:width" content="1200">
  22.     <meta property="og:image:height" content="630">
  23. {% endblock %}
  24. {% block header %}
  25.     {{ include('components/header.html.twig') }}
  26. {% endblock %}
  27. {% block body %}
  28.     {{ include('components/index/banner-2.html.twig') }}
  29.     {{ include('components/index/cta.html.twig') }}
  30.     {{ include('components/index/solution.html.twig') }}
  31.     {{ include('components/index/trusted.html.twig') }}
  32.     {{ include('components/index/download.html.twig') }}
  33.     {{ include('components/index/why.html.twig') }}
  34.     {{ include('components/index/about-app.html.twig') }}
  35.     {{ include('components/packages/how_it_works.html.twig') }}
  36.     {{ include('components/index/query.html.twig') }}
  37.     {% block download %}{% endblock %}
  38. {% endblock %}
  39. {% block javascripts %}
  40.     <script>
  41.         // Function to set a cookie with a given name, value, and expiration date
  42.         function setCookie(name, value, days) {
  43.             var expires = "";
  44.             if (days) {
  45.                 var date = new Date();
  46.                 date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
  47.                 expires = "; expires=" + date.toUTCString();
  48.             }
  49.             document.cookie = name + "=" + value + expires + "; path=/";
  50.         }
  51.         // Function to get the value of a cookie by its name
  52.         function getCookie(name) {
  53.             var nameEQ = name + "=";
  54.             var cookies = document.cookie.split(';');
  55.             for (var i = 0; i < cookies.length; i++) {
  56.                 var cookie = cookies[i];
  57.                 while (cookie.charAt(0) == ' ') {
  58.                     cookie = cookie.substring(1, cookie.length);
  59.                 }
  60.                 if (cookie.indexOf(nameEQ) == 0) {
  61.                     return cookie.substring(nameEQ.length, cookie.length);
  62.                 }
  63.             }
  64.             return null;
  65.         }
  66.         // Check if the user's choice is already stored in a cookie
  67.         var userType = getCookie("userType");
  68.         // If the user's choice is not stored, show the modal
  69.         if (userType === null) {
  70.             //$("#userTypeModal").modal("show");
  71.         }
  72.         // Handle the "Korisnik" (User) button click
  73.         $("#patientButton").click(function () {
  74.             setCookie("userType", "patient", 365);
  75.             $("#userTypeModal").modal("hide");
  76.             // Redirect to a specific URL based on the user's choice
  77.             window.location.href = "/?_locale={{ app.request.locale }}"; // Change to your desired URL for patients
  78.         });
  79.         // Handle the "Liječnik" (Doctor) button click
  80.         $("#doctorButton").click(function () {
  81.             setCookie("userType", "doctor", 365);
  82.             $("#userTypeModal").modal("hide");
  83.             // Redirect to a specific URL based on the user's choice
  84.             window.location.href = "/{{ app.request.locale }}/{{ "paketi"|trans }}/"; // Change to your desired URL for doctors
  85.         });
  86.     </script>
  87. {% endblock %}