
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="EXAFS tool for EXABGP messages">
    <meta name="author" content="CESNET / Jiri Vrany, Petr Adamec, Josef Verich">
    <meta name="google" content="notranslate">
    <meta http-equiv="Content-Language" content="en">
    <link rel="icon" href="../../favicon.ico">

    <title>{% block title %}{% endblock %}</title>

    <!-- Bootstrap core CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
    <!-- Custom styles for this template -->
    <link href="/static/mystyle.css" rel="stylesheet">
    <!-- Add more styles or javacsript if needed in template -->
    {% block head %}{% endblock %}


  </head>

  <body>

    <div class="container">
      <nav class="navbar fixed-top navbar-expand-lg navbar-dark bg-dark">
        <div class="container">
          <a class="navbar-brand" href="/">{{ config['APP_NAME'] }}</a>
          <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
          </button>
          <div class="collapse navbar-collapse" id="navbar">
            <ul class="navbar-nav me-auto mb-2 mb-lg-0">
              {% if session['can_edit'] %}
                  {% for item in main_menu['edit'] %}
                    <li class="nav-item"><a class="nav-link" href="{{ url_for(item.url) }}">{{ item.name}}</a></li>
                  {% endfor %}
              {% endif %}
              {% if 3 in session['user_role_ids'] %}
              <li class="nav-item dropdown">
                <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
                  Admin
                </a>
                <ul class="dropdown-menu" aria-labelledby="navbarDropdown">
                  {% for item in main_menu['admin'] %}
                    {% if item.divide_before %}
                      <li><hr class="dropdown-divider"></li>
                    {% endif %}
                    <li><a class="dropdown-item" href="{{ url_for(item.url) }}">{{ item.name }}</a></li>
                  {% endfor %}
                  <li><hr class="dropdown-divider"></li>
                  <li><span class="dropdown-item">ExaFS version {{ session['app_version'] }}</span></li>
                  <li><a class="dropdown-item" href="/apidocs/">API docs</a></li>
                </ul>
              </li>
              {% endif %}
            </ul>
            <span class="navbar-text">
              {{ session['user_name']}} &lt;{{ session['user_email'] }}&gt;, 
              role: {{ session['user_roles']|join(", ") }}, org: {{ session['user_org'] }}</span>
          </div>    
        
        </div>
      </nav>
    </div>  
    <div class="container theme-showcase" role="main">

      {% with messages = get_flashed_messages(with_categories=true)  %}
        {% if messages %}
          {% for category, message in messages %}
            <div class="alert alert-dismissible fade show {{category}} shadow-sm" role="alert">
              {{ message }}
              <button type="button" class="btn-close" data-bs-dismiss="alert"
                            aria-label="Close"></button>
            </div>
          {% endfor %}
        {% endif %}
      {% endwith %}

      {% block content %}{% endblock %}
    </div>
    <nav id="context-menu" class="context-menu">
        <ul class="context-menu__items">
            <li class="context-menu__item">
            <a href="#" class="context-menu__link" data-action="whois"><i class="fa fa-eye"></i>WHOIS</a>
            </li>
            <li class="context-menu__item">
            <a href="#" class="context-menu__link" data-action="copy"><i class="fa fa-copy"></i>Copy</a>
            </li>
        </ul>
    </nav>
    <footer class="bg-light text-muted mt-5 pt-4 border-top">
      <div class="container">
        <div class="row justify-content-between align-items-center">
          <div class="col-md-auto mb-2 mb-md-0">
            <nav class="nav">
              {% for item in footer_menu %}
                <a class="nav-link px-2" href="{{ url_for(item.url) }}">{{ item.name }}</a>
              {% endfor %}
            </nav>
          </div>
          <div class="col-md-auto text-end small">
            ExaFS {{ session['app_version'] }}
          </div>
        </div>
      </div>
    </footer>

    <script type="text/javascript" src="/static/js/ip_context.js"></script>  
    <script type="text/javascript" src="/static/js/enable_tooltips.js"></script>
    <script type="text/javascript" src="/static/js/search_helpers.js"></script>  
    
  </body>
</html>
