{{/*
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 d-print-none">
    <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 cursor-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 .SignedIn }}
            <li class="nav-item">
                <a class="nav-link" href="/register">Add new user</a>
            </li>
            <li class="nav-item dropdown">
                <a class="nav-link dropdown-toggle" href="./{{.User.ID.Actor}}" 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 cursor-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 cursor-not-clickable" href="" disabled>Settings</a>
                    </span>
                    <a class="dropdown-item" href="javascript: signout()">
                        <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="#signin-modal" href="">
                    Sign in
                </a>
            </li>
			{{ end }}
		</ul>
	</div>
</nav>
<div id="modalPlaceholder"></div>
<script src="/static/js/misc/sign-out.js"></script>
{{template "modal-signin"}}
{{end}}