{% load i18n static %}

<!doctype html>
<html lang="en">
  <head>
  {% block head %}
    {% block meta %}
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="robots" content="NONE,NOARCHIVE" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="Pangea">
    {% endblock %}
    <title>{% block title %}{% if title %}{{ title }} – {% endif %}IdHub{% endblock %}</title>

    <!-- Bootstrap core CSS -->
    {% block style %}
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
    <link rel="stylesheet" href= "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css">
    <link href="{% static "/css/bootstrap.min.css" %}" rel="stylesheet">

    <style>
      .bd-placeholder-img {
        font-size: 1.125rem;
        text-anchor: middle;
        -webkit-user-select: none;
        -moz-user-select: none;
        user-select: none;
      }

      @media (min-width: 768px) {
        .bd-placeholder-img-lg {
          font-size: 3.5rem;
        }
      }
    </style>

  
    <!-- Custom styles for this template -->
    <link href="{% static "/css/dashboard.css" %}" rel="stylesheet">
    {% endblock %}
  {% endblock %}
  </head>
  <body>
    <header class="navbar navbar-dark sticky-top admin bg-green flex-md-nowrap p-0 shadow">
      <a class="navbar-brand col-md-3 col-lg-2 me-0 px-3" href="#">ID HUB</a>
      <div class="navbar-nav navbar-sub-brand">
         PANGEA
      </div>
      <div class="navbar-nav">
        <div class="nav-item text-nowrap">
            <i id="user-avatar" class="bi bi-person-circle"></i>
            <a class="navbar-sub-brand px-3" href="#">{{ user.username }}</a>
            <a class="logout" href="{% url 'idhub:logout' %}">
              <i class="fa-solid fa-arrow-right-from-bracket"></i>
            </a>
        </div>
      </div>
    </header>

    <div class="container-fluid">
      <div class="row">
        <nav id="sidebarMenu" class="col-md-3 col-lg-2 d-md-block bg-light sidebar collapse">
          <div class="position-sticky pt-5">
            <ul class="nav flex-column">
              <li class="nav-item">
                  <a class="admin nav-link {% if section == 'Home' %}active {% endif %}fw-bold" href="{% url 'idhub:admin_dashboard' %}">
                  <i class="bi bi-house-door icon_sidebar"></i>
                  Home
                </a>
                <hr />
              </li>
              <li class="nav-item">
                <a class="admin {% if section == 'People' %}active {% endif %}nav-link fw-bold" data-bs-toggle="collapse" data-bs-target="#people" aria-expanded="false" aria-controls="people" href="javascript:void()">
                  <i class="bi bi-people icon_sidebar"></i>
                  People
                </a>
                <ul class="flex-column mb-2 ul_sidebar accordion-collapse {% if section == 'People' %}expanded{% else %}collapse{% endif %}" id="people" data-bs-parent="#sidebarMenu">
                  <li class="nav-item">
                    <a class="nav-link{% if path == 'admin_people_list' %} active2{% endif %}" href="{% url 'idhub:admin_people_list' %}">
                      People list
                    </a>
                  </li>
                  <li class="nav-item">
                    <a class="nav-link{% if path == 'admin_people_new' %} active2{% endif %}" href="{% url 'idhub:admin_people_new' %}">
                      Register a new user
                    </a>
                  </li>
                </ul>
              </li>
              <li class="nav-item">
                <a class="admin nav-link {% if section == 'AccessControl' %}active {% endif %}fw-bold" data-bs-toggle="collapse" data-bs-target="#control-access" aria-expanded="false" aria-controls="control-access" href="javascript:void()">
                  <i class="fa-solid fa-arrow-right-from-bracket icon_sidebar"></i>
                  Access Control
                </a>
                <ul class="flex-column mb-2 ul_sidebar accordion-collapse {% if section == 'AccessControl' %}expanded{% else %}collapse{% endif %}" id="control-access" data-bs-parent="#sidebarMenu">
                  <li class="nav-item">
                    <a class="nav-link{% if path == 'admin_roles' %} active2{% endif %}" href="{% url 'idhub:admin_roles' %}">
                      roles
                    </a>
                  </li>
                  <li class="nav-item">
                    <a class="nav-link{% if path == 'admin_services' %} active2{% endif %}" href="{% url 'idhub:admin_services' %}">
                      Services
                    </a>
                  </li>
                </ul>
              </li>
              <li class="nav-item">
                <a class="admin nav-link {% if section == 'Credentials' %}active {% endif %}fw-bold" data-bs-toggle="collapse" data-bs-target="#credentials" aria-expanded="false" aria-controls="credentials" href="javascript:void()">
                  <i class="bi bi-patch-check icon_sidebar"></i>
                  Credentials
                </a>
                <ul class="flex-column mb-2 ul_sidebar accordion-collapse {% if section == 'Credentials' %}expanded{% else %}collapse{% endif %}" id="credentials" data-bs-parent="#sidebarMenu">
                  <li class="nav-item">
                    <a class="nav-link{% if path == 'admin_credentials' %} active2{% endif %}" href="{% url 'idhub:admin_credentials' %}">
                      Credentials list
                    </a>
                  </li>
                  <li class="nav-item">
                    <a class="nav-link{% if path == 'admin_credentials_new' %} active2{% endif %}" href="{% url 'idhub:admin_credentials_new' %}">
                      Issue credentials
                    </a>
                  </li>
                  <li class="nav-item">
                    <a class="nav-link{% if path == 'admin_credentials_revoke' %} active2{% endif %}" href="{% url 'idhub:admin_credentials_revoke' %}">
                      Revoke Credentials
                    </a>
                  </li>
                  <li class="nav-item">
                    <a id="wallet" class="nav-link" data-bs-toggle="collapse" data-bs-target="#lwallet" aria-expanded="false" aria-controls="lwallet" href="javascript:void()">
                      Wallet
                    </a>
                    <ul class="flex-column mb-2 accordion-collapse {% if wallet %}expanded{% else %}collapse{% endif %}" id="lwallet" data-bs-parent="#wallet">
                      <li class="nav-item">
                        <a class="nav-link{% if path == 'admin_wallet_identities' %} active2{% endif %}" href="{% url 'idhub:admin_wallet_identities' %}">
                          Identities (DID)
                        </a>
                      </li>
                      <li class="nav-item">
                        <a class="nav-link{% if path == 'admin_wallet_credentials' %} active2{% endif %}" href="{% url 'idhub:admin_wallet_credentials' %}">
                          Credentials
                        </a>
                      </li>
                      <li class="nav-item">
                        <a class="nav-link{% if path == 'admin_wallet_config_issue' %} active2{% endif %}" href="{% url 'idhub:admin_wallet_config_issue' %}">
                          Configure Issue
                        </a>
                      </li>
                    </ul>
                  </li>
                </ul>
              </li>
              <li class="nav-item">
                <a class="admin nav-link {% if section == 'Schemes' %}active {% endif %}fw-bold" data-bs-toggle="collapse" data-bs-target="#schemes" aria-expanded="false" aria-controls="schemes" href="javascript:void()">
                  <i class="bi bi-file-earmark-text icon_sidebar"></i>
                  Schemes
                </a>
                <ul class="flex-column mb-2 ul_sidebar accordion-collapse {% if section == 'Schemes' %}expanded{% else %}collapse{% endif %}" id="schemes" data-bs-parent="#sidebarMenu">
                  <li class="nav-item">
                    <a class="nav-link{% if path == 'admin_schemes' %} active2{% endif %}" href="{% url 'idhub:admin_schemes' %}">
                      List of schemes
                    </a>
                  </li>
                  <li class="nav-item">
                    <a class="nav-link{% if path == 'admin_schemes_import' %} active2{% endif %}" href="{% url 'idhub:admin_schemes_import' %}">
                      Import scheme
                    </a>
                  </li>
                  <li class="nav-item">
                    <a class="nav-link{% if path == 'admin_schemes_export' %} active2{% endif %}" href="{% url 'idhub:admin_schemes_export' %}">
                      Export scheme
                    </a>
                  </li>
                </ul>
              </li>
              <li class="nav-item">
                <a class="admin nav-link {% if section == 'ImportExport' %}active {% endif %}fw-bold" data-bs-toggle="collapse" data-bs-target="#import-export" aria-expanded="false" aria-controls="import-export" href="javascript:void()">
                  <i class="bi bi-arrow-down-square icon_sidebar"></i>
                  Imports/Exports
                </a>
                <ul class="flex-column mb-2 ul_sidebar accordion-collapse {% if section == 'ImportExport' %}expanded{% else %}collapse{% endif %}" id="import-export" data-bs-parent="#sidebarMenu">
                  <li class="nav-item">
                    <a class="nav-link{% if path == 'admin_import' %} active2{% endif %}" href="{% url 'idhub:admin_import' %}">
                      Import
                    </a>
                  </li>
                  <li class="nav-item">
                    <a class="nav-link{% if path == 'admin_export' %} active2{% endif %}" href="{% url 'idhub:admin_export' %}">
                      Export
                    </a>
                  </li>
                </ul>
              </li>
            </ul>
          </div>
        </nav>

        <main class="col-md-9 ms-sm-auto col-lg-10 px-md-4">
          {% block messages %}
            {% for message in messages %}
              <div class="alert {{ message.tags|default:'info' }} alert-dismissible fade show mt-3" role="alert">
                {{ message }}
                <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close">
                </button>
              </div>
            {% endfor %}
          {% endblock messages %}
          <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
            <h1 class="h1">{{ title }}</h1>
            <div class="btn-toolbar mb-2 mb-md-0">
              <div class="btn-group me-2">
                <input class="form-control form-control-grey " type="text" placeholder="Search" aria-label="Search">
              </div>
            </div>
          </div>

          {% block content %}
          {% endblock content %}

        </main>
      </div>
    </div>

    {% block script %}
    <script src="{% static "js/jquery-3.3.1.slim.min.js" %}"></script>
    <script src="{% static "js/popper.min.js" %}"></script>
    <script src="{% static "js/bootstrap.min.js" %}"></script>
    {% block extrascript %}{% endblock %}
    {% endblock %}
  </body>
</html>
