{{/*
This file is part of SystemTestPortal.
Copyright (C) 2017  Institute of Software Technology, University of Stuttgart

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

SystemTestPortal 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 General Public License for more details.

You should have received a copy of the GNU General Public License
along with SystemTestPortal.  If not, see <http://www.gnu.org/licenses/>.
*/}}

{{define "navbar"}}
<!-- Main Navbar -->
<nav class="navbar navbar-expand-sm navbar-dark fixed-top bg-dark">
    <a class="navbar-brand" href="#">
        <img src="/static/img/STP-Logo.png" width="30" height="30" alt="">
    </a>
    <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
		<span class="navbar-toggler-icon"></span>
	</button>
	<div class="collapse navbar-collapse" id="navbarCollapse">
		<ul class="navbar-nav mr-auto">
            <li class="nav-item"  data-toggle="tooltip" data-placement="bottom"
                title="" data-original-title="This feature will be available in a future version">
                <a class="nav-link disabled not-clickable" href="#" disabled>Dashboard</a>
            </li>
			<li class="nav-item">
				<a class="nav-link" href="/explore">Explore</a>
			</li>
		</ul>
        <ul class="navbar-nav mt-md-0">
			{{ if .LoggedIn }}
            <li class="nav-item">
                <a class="nav-link" href="/register">Add new account</a>
            </li>
            <li class="nav-item dropdown">
                <a class="nav-link dropdown-toggle" href="./{{.User.ID}}" id="userMenu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                    {{.User.DisplayName}}
                </a>
                <div class="dropdown-menu pull-left" id="userMenuDropdown" aria-labelledby="userMenu">
                    <span class="dropdown-item" data-toggle="tooltip" data-placement="bottom"
                          title="" data-original-title="This feature will be available in a future version">
                        <a class="disabled not-clickable" href="" disabled>Profile</a>
                    </span>
                    <span class="dropdown-item" data-toggle="tooltip" data-placement="bottom"
                          title="" data-original-title="This feature will be available in a future version">
                        <a class="disabled not-clickable" href="" disabled>Settings</a>
                    </span>
                    <a class="dropdown-item" href="javascript: logout()">
                        <strong>Sign out</strong>
                    </a>
                </div>
            </li>
			{{ else }}
            <li class="nav-item" id="signin-link" data-trigger="manual" data-toggle="tooltip" data-placement="left" data-template='<div class="tooltip tooltip-inverted" role="tooltip"><div class="arrow"></div><div class="tooltip-inner"></div></div>'
                title="" data-original-title="Sign in to proceed!">
                <a class="nav-link" data-toggle="modal" data-target="#login-modal" href="">
                    Sign in
                </a>
            </li>
			{{ end }}
		</ul>
	</div>
</nav>
<script src="/static/js/logout.js"></script>
{{template "modal-login"}}
{{end}}