<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
		<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
		<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='main.css') }}">

		{% if title %}
		<title> MiniBase - {{ title }} </title>
		{% else %}
		<title> MiniBase </title>
		{% endif %}
	</head>
    <body style="{{ theme.layoutBgColor }};">
        <nav class="navbar navbar-expand-lg" style="{{ theme.layoutNavbarBgColor }}">
            <a class="navbar-brand" style="color: {{ theme.orange }};" href="#">MiniBase</a>
			<button class="navbar-toggler" type="button" data-toggle="collapse" data-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 mr-auto">

                    <!-- Checks if the user is logged in or not-->
					{% if current_user.is_authenticated %}
                    <li class="nav-item"><a class="nav-link" href="{{ url_for('main.home') }}">Overwiev</a></li>
					<li class="nav-item"><a class="nav-link" href="#">Projects</a></li>
					<li class="nav-item"><a class="nav-link" href="{{ url_for('main.customer') }}">Custommer</a></li>
					<li class="nav-item"><a class="nav-link" href="#">Manufacturer</a></li>
					<li class="nav-item"><a class="nav-link" href="#">Contacts</a></li>

					<li class="nav-item dropdown">
						<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Search By</a>
						<div class="dropdown-menu" aria-labelledby="navbarDropdown">
							<a class="dropdown-item" href="#">Project Name</a>
							<a class="dropdown-item" href="#">Customer Name</a>
							<div class="dropdown-divider"></div>
							<a class="dropdown-item" href="#">Project ID</a>
							<a class="dropdown-item" href="#">Customer ID</a>
							<div class="dropdown-divider"></div>
							<a class="dropdown-item" href="#">Cutsom Options</a>
						</div>
					</li>
                    <!-- If not then -->
					{% else %}
					<li class="nav-item"><a class="nav-link disabled" href="#">Overwiev</a></li>
					<li class="nav-item"><a class="nav-link disabled" href="#">Projects</a></li>
					<li class="nav-item"><a class="nav-link disabled" href="#">Custommer</a></li>
					<li class="nav-item"><a class="nav-link disabled" href="#">Manufacturer</a></li>
					<li class="nav-item"><a class="nav-link disabled" href="#">Messages</a></li>
					<li class="nav-item"><a class="nav-link disabled" href="#">FuP</a></li>
					<li class="nav-item"><a class="nav-link disabled" href="#">Contacts</a></li>

					<li class="nav-item dropdown">
						<a class="nav-link dropdown-toggle disabled" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Search By</a>
						<div class="dropdown-menu" aria-labelledby="navbarDropdown">
							<a class="dropdown-item" href="#">Project Name</a>
							<a class="dropdown-item" href="#">Customer Name</a>
							<div class="dropdown-divider"></div>
							<a class="dropdown-item" href="#">Project ID</a>
							<a class="dropdown-item" href="#">Customer ID</a>
							<div class="dropdown-divider"></div>
							<a class="dropdown-item" href="#">Cutsom Options</a>
						</div>
					</li>
                    <!-- End -->
					{% endif %}
				</ul>
                    <ul class="navbar-nav ml-auto">
                    {% if current_user.is_authenticated %}
                    <li class="nav-item"><a class="nav-link" style="color: {{ theme.light_blue }};" href="{{ url_for('users.account') }}">Account</a></li>
                    <li class="nav-item"><a class="nav-link" style="color: {{ theme.light_blue }};" href="{{ url_for('users.logout') }}">Logout</a></li>
                    {% else %}
                    <li class="nav-item"><a class="nav-link" style="color: {{ theme.light_blue }};" href="{{ url_for('users.login') }}">Login</a></li>
                    <li class="nav-item"><a class="nav-link" style="color: {{ theme.light_blue }};" href="{{ url_for('users.register') }}">Register</a></li>
                    {% endif %}
				</ul>
			</div>
		</nav>
        <main>
            <!-- This part will catch anny messages that we whant to send when something has been updated -->
            {% with messages = get_flashed_messages(with_categories=true) %}
                {% if messages %}
                    {% for category, message in messages %}
                        <div class="alert alert-{{ category }}">
                            {{ message }}
                        </div>
                    {% endfor %}
                {% endif %}
            {% endwith %}

            <!-- Every extra template will be placed here for examplem login.htlm and so on -->
            {% block content %}{% endblock %}
        </main>
		<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
		<script src="https://cdn.jsdelivr.net/npm/popper.js@1.12.9/dist/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
		<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.0.0/dist/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
	</body>
</html>
