<!--
    OpenCDE - OpenCDE Python implementation
    Copyright (C) 2021 Prabhat Singh <singh01prabhat@gmail.com>

    This file is part of OpenCDE.

    OpenCDE is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    OpenCDE is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with OpenCDE.  If not, see <http://www.gnu.org/licenses/>.
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <!-- Required meta tags -->
    <meta charset="utf-8" />
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1, shrink-to-fit=no"
    />
    <!-- Bootstrap CSS -->
    <link
      rel="stylesheet"
      href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css"
      integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2"
      crossorigin="anonymous"
    />
    <title>{% block title %} {% endblock %}</title>
  </head>
  <body>
    <nav class="navbar navbar-expand-md navbar-dark bg-dark">
      <a class="navbar-brand" href="#">BCF OLD SERVER</a>
      <button
        class="navbar-toggler"
        type="button"
        data-toggle="collapse"
        data-target="#navbarNav"
      >
        <span class="navbar-toggler-icon"></span>
      </button>
      <div class="collapse navbar-collapse" id="navbarNav">
        <ul class="navbar-nav mr-auto">
          <li class="nav-item active">
            <a class="nav-link" href="{{ url_for('foundation_obj.homepage') }}"
              >Home <span class="sr-only">(current)</span></a
            >
          </li>
        </ul>
        {% if current_user.is_authenticated %}
        <ul class="navbar-nav">
          <li class="nav-item">
            <a class="nav-link" style="color: lawngreen; font-weight: bold">
              <i class="fas fa-coins"></i>
              {{ current_user.prettier_budget }}
            </a>
          </li>
          <li class="nav-item">
            <a class="nav-link">Welcome, {{ current_user.username }}</a>
          </li>
          <li class="nav-item">
            <a
              class="nav-link"
              href="{{ url_for('foundation_obj.logoutpage') }}"
              >Logout</a
            >
          </li>
          <li class="nav-item">
            <a
              class="nav-link"
              href="{{ url_for('foundation_obj.create_client') }}"
              >Create Client</a
            >
          </li>
        </ul>
        {% else %}
        <ul class="navbar-nav">
          <li class="nav-item">
            <a
              class="nav-link"
              href="{{ url_for('foundation_obj.login_page') }}"
              >Login</a
            >
          </li>
          <li class="nav-item">
            <a
              class="nav-link"
              href="{{ url_for('foundation_obj.register_page') }}"
              >Register</a
            >
          </li>
        </ul>
        {% endif %}
      </div>
    </nav>
    {% with messages = get_flashed_messages(with_categories=true) %} {% if
    messages %} {% for category, message in messages %}
    <div class="alert alert-{{ category }}">
      <button
        type="button"
        class="m1-2 mb-1 close"
        data-dismiss="alert"
        aria-label="Close"
      >
        <span aria-hidden="true">&times;</span>
      </button>
      {{ message }}
    </div>
    {% endfor %} {% endif %} {% endwith %} {% block content %} {% endblock %}
    <!-- Future Content here -->

    <!-- Optional JavaScript -->
    <!-- jQuery first, then Popper.js, then Bootstrap JS -->
    <script src="https://kit.fontawesome.com/a076d05399.js"></script>
    <script
      src="https://code.jquery.com/jquery-3.5.1.slim.min.js"
      integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj"
      crossorigin="anonymous"
    ></script>
    <script
      src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"
      integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN"
      crossorigin="anonymous"
    ></script>
    <script
      src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"
      integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV"
      crossorigin="anonymous"
    ></script>
  </body>
</html>
