<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>{% block title %}iVistaar{% endblock %}</title>
  <link rel="icon" type="image/png" href="{{ url_for('static', filename='icon.png') }}">
  <link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
</head>
<body>
  <header class="topbar">
    <a class="brand" href="{{ url_for('admin.dashboard') }}" aria-label="iVistaar home">
      <img class="brand-logo" src="{{ url_for('static', filename='logo.png') }}" alt="iVistaar" width="160" height="40">
    </a>
    {% if session.get('logged_in') %}
    <nav>
      <a href="{{ url_for('admin.dashboard') }}">Deployments</a>
      <a href="{{ url_for('admin.events') }}">Events</a>
      <a href="{{ url_for('admin.license_page') }}">License</a>
      <a href="{{ url_for('admin.deploy_new') }}">Connect</a>
      <form class="inline" method="post" action="{{ url_for('admin.logout') }}">
        <button type="submit" class="linkish">Logout</button>
      </form>
    </nav>
    {% endif %}
  </header>

  <main class="container">
    {% with messages = get_flashed_messages(with_categories=true) %}
      {% if messages %}
        <ul class="flash-list">
        {% for category, message in messages %}
          <li class="flash flash-{{ category }}">{{ message }}</li>
        {% endfor %}
        </ul>
      {% endif %}
    {% endwith %}
    {% block content %}{% endblock %}
  </main>
</body>
</html>
