<!doctype html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport"
    content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>{{ core_config.app_name }}</title>
  <link rel="icon" type="image/svg+xml"
    href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'><circle cx='32' cy='32' r='32' fill='%2348536b'/></svg>">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.20.1/cdn/themes/light.css" />
  <script type="module" src="https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.20.1/cdn/shoelace.js"></script>
  <link rel="stylesheet" href="/assets/base.css">
  <script src="/assets/sortable.min.js"></script>
  <script src="/assets/base.js"></script>
</head>

<body>

  <header style="display: flex; align-items: center; gap: 2rem;">
    <h1>{{ core_config.app_name }}</h1>
    <sl-button-group>
      {% for path,title in server_config.main_menu.items() %}
      <sl-button href="{{path}}">{{title}}</sl-button>
      {% endfor %}
      <sl-button href="/system">
        <sl-icon slot="prefix" name="gear"></sl-icon>
        system
      </sl-button>
    </sl-button-group>
    {% if not header_info_new_line %}
    <div>{{ header_info() }}</div>
    {% endif %}
    {% if header_info_new_line %}
    <span>{{ header_info() }}</span>
    {% endif %}
  </header>


  <sl-divider></sl-divider>




  {% for message in flash_messages %}

  {% if message.error %}
  <sl-alert variant="danger" open closable class="alert-closable">
    <sl-icon slot="icon" name="exclamation-octagon"></sl-icon>
    <strong>{{ message.message }}</strong>
  </sl-alert>
  {% else %}
  <sl-alert variant="primary" open closable class="alert-closable">
    <sl-icon slot="icon" name="info-circle"></sl-icon>
    <strong>{{ message.message }}</strong>
  </sl-alert>
  {% endif%}

  <sl-divider></sl-divider>
  {% endfor %}


  <main>
    {% block content -%}
    {%- endblock %}
  </main>


  <sl-divider></sl-divider>

  <footer>

    app: v{{ app_version }}, mm-base6: v{{ mm_base6_version }} / server time: {{ utc_now() | dt }}<br>
    {{ footer_info() }}
  </footer>

</body>

</html>