<!--
# @name: base.html
# @version: 0.1
# @creation_date: 2021-10-20
# @license: The MIT License <https://opensource.org/licenses/MIT>
# @author: Simon Bowie <ad7588@coventry.ac.uk>
# @purpose: Basic layout for all pages
# @acknowledgements:
# https://www.digitalocean.com/community/tutorials/how-to-make-a-web-application-using-flask-in-python-3
# Bootstrap 5.1.3: https://getbootstrap.com/
# Flask-Moment: https://flask-moment.readthedocs.io/en/latest/
# Boostrap select: https://stackoverflow.com/questions/67942546/bootstrap-5-select-dropdown-with-the-multiple-attribute-collapsed

-->

<!DOCTYPE html>
<html>

<head>
    {{ moment.include_moment() }}
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>ExPub Compendium</title>
    <!-- Bootstrap CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
    <link href="{{ url_for('static',filename='styles/custom.css') }}" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.14.0-beta2/css/bootstrap-select.min.css" integrity="sha512-mR/b5Y7FRsKqrYZou7uysnOdCIJib/7r5QeJMFvLNHNhtye3xJp1TdJVPLtetkukFn227nKpXD9OjUc09lx97Q==" crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>

<body class="d-flex flex-column min-vh-100">

    <header>
      <!-- Fixed navbar -->
      <nav class="navbar navbar-expand-md navbar-light sticky-top">
        <div class="container-fluid">
          <a class="navbar-brand" href="{{ url_for('main.index')}}">ExPub Compendium</a>
          <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
              <span class="navbar-toggler-icon"></span>
          </button>
          <div class="collapse navbar-collapse" id="navbarSupportedContent">
            <ul class="navbar-nav">
            <li class="nav-item">
                <a href="{{ url_for('tool.get_tools') }}" class="nav-link">
                    Tools
                </a>
            </li>
            <li class="nav-item">
                <a href="{{ url_for('practice.get_practices') }}" class="nav-link">
                    Practices
                </a>
            </li>
            <li class="nav-item">
                <a href="{{ url_for('sensitivity.get_sensitivities') }}" class="nav-link">
                    Sensitivities
                </a>
            </li>
            <li class="nav-item">
                <a href="{{ url_for('typology.get_typologies') }}" class="nav-link">
                    Typologies
                </a>
            </li>
            <li class="nav-item">
                <a href="{{ url_for('workflow.get_workflows') }}" class="nav-link">
                    Workflows
                </a>
            </li>
            <li class="nav-item">
                <a href="{{ url_for('publisher.get_publishers') }}" class="nav-link">
                    Publishers
                </a>
            </li>
            <li class="nav-item">
                <a href="{{ url_for('book.get_books') }}" class="nav-link">
                    Books
                </a>
            </li>
            <li class="nav-item">
                <a href="{{ url_for('reference.get_references') }}" class="nav-link">
                    References
                </a>
            </li>
            {% if current_user.is_authenticated %}
            <li class="nav-item">
                <a href="{{ url_for('create.create_resource') }}" class="nav-link">
                    Add resource
                </a>
            </li>
            {% endif %}
            {% if current_user.is_authenticated %}
            <li class="nav-item">
                <a href="{{ url_for('main.profile') }}" class="nav-link">
                    Profile
                </a>
            </li>
            {% endif %}
            {% if not current_user.is_authenticated %}
            <li class="nav-item">
                <a href="{{ url_for('auth.login') }}" class="nav-link">
                    Login
                </a>
            </li>
            <li class="nav-item">
                <a href="{{ url_for('auth.signup') }}" class="nav-link">
                    Sign Up
                </a>
            </li>
            {% endif %}
            {% if current_user.is_authenticated %}
            <li class="nav-item">
                <a href="{{ url_for('auth.logout') }}" class="nav-link">
                    Logout
                </a>
            </li>
            {% endif %}
            <li class="nav-item">
                <a href="{{ url_for('main.test') }}" class="nav-link">
                    Test
                </a>
            </li>
            </ul>
          </div>
        </div>
    </nav>
    </header>

    <!-- Begin page content -->
    <main class="flex-shrink-0">
      <div class="layer-bg w-100">
        <img class="img-fluid w-100" src="{{ url_for('static',filename='images/dots-bg.png') }}" alt="bg-shape">
      </div>
      <div class="container">
          {% with messages = get_flashed_messages() %}
          {% if messages %}
              <div class="alert alert-danger">
                  {{ messages[0] }}
              </div>
          {% endif %}
          {% endwith %}
          {% block content %}
          {% endblock %}
      </div>
    </main>

    <!-- Sticky footer-->
    <footer class="footer py-3 mt-auto" style="background-color: #dcddde;">
        <div class="container">
            <span class="text-muted">© 2022–{{ moment().format('YYYY') }} <a href="https://copim.ac.uk/">COPIM</a> and licensed under a <a href="https://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License (CC BY 4.0)</a>.</span>
        </div>
    </footer>
    <!-- JavaScript -->
    <!-- jQuery first, then Popper JS, then Bootstrap JS -->
    <script src="https://code.jquery.com/jquery-3.6.0.js" integrity="sha256-H+K7U5CnXl1h5ywQfKtSj8PCmoN9aaq30gDh27Xc0jk=" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.14.0-beta2/js/bootstrap-select.min.js" integrity="sha512-FHZVRMUW9FsXobt+ONiix6Z0tIkxvQfxtCSirkKc5Sb4TKHmqq1dZa8DphF0XqKb3ldLu/wgMa8mT6uXiLlRlw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
    <script src="{{ url_for('static',filename='js/main.js') }}"></script>
</body>

</html>