templates/base_layout.html.twig line 1

Open in your IDE?
  1. <!DOCTYPE html>
  2. <html lang="cs">
  3. <head>
  4. <!-- Meta Tags -->
  5. <meta charset="UTF-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <meta name="description" content="Aplikace, která umí usnadnit život všem energetikům">
  8. <meta name="author" content="FINFORCE s.r.o.">
  9. <!-- Favicon -->
  10. <link rel="apple-touch-icon" sizes="180x180" href="{{ asset('apple-touch-icon.png') }}">
  11. <link rel="icon" type="image/png" sizes="32x32" href="{{ asset('favicon-32x32.png') }}">
  12. <link rel="icon" type="image/png" sizes="16x16" href="{{ asset('favicon-16x16.png') }}">
  13. <link rel="manifest" href="{{ asset('site.webmanifest') }}" crossorigin="use-credentials">
  14. <!-- App css -->
  15. {{ encore_entry_link_tags('app-styles-icons') }}
  16. <title>{% block title %}E-Manažer{% endblock %}</title>
  17. {% block stylesheets %}{% endblock %}
  18. <script>
  19. window.locale = '{{ app.request.locale }}';
  20. </script>
  21. {% block chatcode %}{% endblock %}
  22. {# Unified idle logout script for both app and admin, only for authenticated users #}
  23. {% if app.user is not null %}
  24. {% set __route = app.request.attributes.get('_route') ?? '' %}
  25. {% set __path = app.request.getPathInfo() %}
  26. {% set __is_admin = (__route starts with 'admin_') or (__path starts with '/admin') %}
  27. <script>
  28. (function () {
  29. var TIMEOUT_MS = 24 * 60 * 1000; // 24 minutes
  30. var LOGOUT_URL = '{{ __is_admin ? path('admin_logout', {'timeout': 1}) : path('logout', {'timeout': 1}) }}';
  31. var timerId;
  32. function triggerLogout() {
  33. try {
  34. var current = window.location.href;
  35. var sep = LOGOUT_URL.indexOf('?') === -1 ? '?' : '&';
  36. window.location.href = LOGOUT_URL + sep + 'rt=' + encodeURIComponent(current);
  37. } catch (e) {
  38. window.location.href = LOGOUT_URL;
  39. }
  40. }
  41. function resetTimer() {
  42. if (timerId) {
  43. clearTimeout(timerId);
  44. }
  45. timerId = setTimeout(triggerLogout, TIMEOUT_MS);
  46. }
  47. var events = ['click', 'mousemove', 'keydown', 'scroll', 'touchstart', 'wheel'];
  48. events.forEach(function (evt) {
  49. window.addEventListener(evt, resetTimer, { passive: true });
  50. });
  51. document.addEventListener('visibilitychange', function () {
  52. if (!document.hidden) {
  53. resetTimer();
  54. }
  55. });
  56. resetTimer();
  57. })();
  58. </script>
  59. {% endif %}
  60. </head>
  61. {% block body %}
  62. <body>
  63. </body>
  64. {% endblock %}
  65. </html>