{% apply minimize %}
<!DOCTYPE html>
<html lang="it">
<head>
  {% block head %}
  <title>{{ title }} - ALLERTA sistema gestionale {{ owner }}</title>
  <link href="{{ urlsoftware }}/resources/images/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon">
  <meta name="viewport" content="user-scalable=no, initial-scale=1">
  <meta name="google" content="notranslate">
  <meta name="robots" content="none">
  <link rel="manifest" href="manifest.webmanifest">
  {% if delete_caches %}
  <script{% if enable_js_nonce %} nonce="{{ nonce }}"{% endif %}>
  //from https://stackoverflow.com/a/57149239
  if ('caches' in window) {
    console.log("Deleting caches...");
    caches.keys()
    .then(function(keyList) {
      Promise.all(keyList.map(function(key) {
        caches.delete(key);
        console.log("deleted cache: "+key);
      }));
    });
  }
  /*{% if not delete_service_workers %}*/
  location.href="?";
  /*{% endif %}*/
  </script>
  {% endif %}
  {% if delete_service_workers %}
  <script{% if enable_js_nonce %} nonce="{{ nonce }}"{% endif %}>
  //from https://stackoverflow.com/a/47515250
  if(window.navigator && navigator.serviceWorker) {
    console.log("UnRegistering service workers...");
    navigator.serviceWorker.getRegistrations()
    .then(function(registrations) {
      for(let registration of registrations) {
        console.log("deleted service worker:");
        console.log(registration);
        registration.unregister();
      }
    });
    location.href="?";
  }
  /*{% if delete_service_workers_and_disable %}*/
  document.cookie = "disableServiceWorkerInstallation=1";
  /*{% endif %}*/
  </script>
  {% endif %}
  {{ script('main.js') }}
  <script{% if enable_js_nonce %} nonce="{{ nonce }}"{% endif %}>$.fn.loading.defaults.message = "{{ 'Loading...'|t }}";</script>
  {% endblock %}
  {% if enable_debug_bar %}{{ debug_bar_head|raw }}{% endif %}
</head>
<body>
{% if show_menu %}
  {% block menu %}
  {# Menu #}
  <div style="display: none" class="topnav" id="topNavBar">
    <a href="{{ urlsoftware }}list.php" class="active">{{ 'Availability List'|t }}</a>
    <a href="{{ urlsoftware }}services.php">{{ 'Services'|t }}</a>
    <a href="{{ urlsoftware }}trainings.php">{{ 'Trainings'|t }}</a>
    <a href="{{ urlsoftware }}log.php">{{ 'Logs'|t }}</a>
    <a style="float: right;" id="logout">{{ 'Hi, %s.'|t|format(user.name) }} <b
        id="logout-text">{{ 'Logout'|t }}</b></a>
    <a class="pjax_disable icon" id="menuButton">☰</a>
  </div>
  {# /Menu #}
  {% endblock %}
{% endif %}
  <div class="alert alert-danger m-3" id="offline_alert" style="display: none" role="alert">
    <b>{{ 'You are offline'|t }}.</b> {{ 'Last update'|t }}: <p style="display: inline" id="offline_update"></p>
  </div>
  <div id="jsDisabledNotice">
    <p>{{ "JavaScript is disabled or it's not supported in your browser but it's required for using Allerta-VVF. If you want to continue, please enable JS <a href='?JSless=1'>or use the JS-less version</a>."|t|raw }}</p>
  </div>
  {# Content #}
  <div style="display: none" id="content">
{% block pjax_content %}
{% if message %}
<div class="alert alert-info m-3" role="alert">
  {{ message|raw }}
</div>
{% endif %}
{% if pjax_requested %}<title>{{ title }} - ALLERTA sistema gestionale {{ owner }}</title>{% endif %}
{% block content %}{% endblock %}
{% endblock %}
  </div>
  {# /Content #}
  {% if enable_debug_bar %}{{ debug_bar|raw }}{% endif %}
{% if show_footer %}
  {% block footer %}
  {# Footer #}
  <div id="footer" class="footer text-center p-3" style="background-color: rgba(0, 0, 0, 0.2); display: none;">
    Allerta-VVF, software libero realizzato per {{ owner }}.<br>
    <p style="margin-bottom: 0" id="frontend_version">Frontend versione </p>
  </div>
  {# /Footer #}
  {% endblock %}
{% endif %}
</body>
</html>
{% endapply %}