<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib prefix="tags" tagdir="/WEB-INF/tags" %>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse"
data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span> <span
class="icon-bar"></span> <span class="icon-bar"></span> <span
class="icon-bar"></span>
</button>
<a class="navbar-brand" href="${context}">Perforce Self-Service</a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<c:if test="${isAuthenticated}">
<li><a href="#about"><i class="fa fa-info-circle fa-lg"></i> About</a></li>
<li><a href="#contact"><i class="fa fa-envelope fa-lg"></i> Contact</a></li>
<li><a href="${context}/user/groupManagement.htm"><i class="fa fa-users fa-lg"></i> Groups</a></li>
</c:if>
<c:if test="${isAdmin}">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-dashboard fa-lg"></i> Administration <b class="caret"></b></a>
<ul class="dropdown-menu">
<li role="presentation" class="dropdown-header">Security Management</li>
<li><a href="${context}/admin/users.htm">Users</a></li>
<li><a href="${context}/admin/groups.htm">Groups</a></li>
<li><a href="${context}/admin/approvals.htm">Approvals</a></li>
<li><a href="${context}/admin/groups.htm">Protections</a></li>
<li class="divider"></li>
<li role="presentation" class="dropdown-header">Server Settings</li>
<li><a href="${context}/admin/depots.htm">Depots</a></li>
<li><a href="${context}/admin/triggers.htm">Triggers</a></li>
</ul>
</li>
</c:if>
<c:if test="${isAuthenticated}">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-plus-square fa-lg"></i> Help <b class="caret"></b></a>
<ul class="dropdown-menu">
<li role="presentation" class="dropdown-header">Online Documentation</li>
<li><a target="_blank" href="http://www.perforce.com/perforce/doc.current/manuals/p4guide/index.html">P4 User's Guide</a></li>
<li><a target="_blank" href="http://www.perforce.com/perforce/doc.current/manuals/cmdref/index.html">P4 Command Reference</a></li>
<li><a target="_blank" href="http://www.perforce.com/perforce/doc.current/manuals/p4v-gs/index.html">Getting Started with P4V</a></li>
<c:if test="${isAdmin}">
<li><a target="_blank" href="http://www.perforce.com/perforce/doc.current/manuals/p4sag/index.html">Administration Guide</a></li>
<li class="divider"></li>
<li role="presentation" class="dropdown-header">Downloads</li>
<li><a href="${context}/admin/depots.htm">Depots</a></li>
<li><a href="${context}/admin/triggers.htm">Triggers</a></li>
</c:if>
</ul>
</li>
</c:if>
</ul>
<!-- The drop down menu -->
<ul class="nav navbar-nav navbar-right">
<c:choose>
<c:when test="${isAuthenticated}">
<li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#"><span class="top-label label label-danger">3</span><i class="fa fa-bell fa-lg"></i> </a>
<ul class="dropdown-menu dropdown-messages">
<li>
<a href="#">
<div>
<strong><span class=" label label-danger">Andrew Smith</span></strong>
<span class="pull-right text-muted">
<em>Yesterday</em>
</span>
</div>
<div>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque eleifend...</div>
</a>
</li>
<li class="divider"></li>
<li>
<a class="text-center" href="#">
<strong>Read All Messages</strong>
<i class="fa fa-angle-right"></i>
</a>
</li>
</ul>
</li>
<li class="dropdown"><a class="dropdown-toggle" href="#" data-toggle="dropdown"><i class="fa fa-user fa-lg"></i> <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="${context}/logout"><i class="fa fa-sign-out fa-lg"></i> Log out</a></li>
</div>
</li>
</c:when>
<c:otherwise>
<li><a href="${context}/register.htm">Request Account</a></li>
<li class="divider-vertical"></li>
<li class="dropdown"><a class="dropdown-toggle" href="#" data-toggle="dropdown"><i class="fa fa-user fa-lg"></i><strong class="caret"></strong></a>
<div class="dropdown-menu" style="padding: 15px; padding-bottom: 10px;">
<form style="margin: 0px" accept-charset="UTF-8" action="j_spring_security_check" method="post">
<fieldset class='textbox' style="padding:10px">
<input style="margin-top: 8px" type="text" placeholder="Username" name="j_username" />
<input style="margin-top: 8px" type="password" placeholder="Passsword" name="j_password" />
<input style="margin-top: 8px" class="btn-primary" name="commit" type="submit" value="Log In" />
<tags:serverPasswords><div align="right"><a href="#">lost password</a></div></tags:serverPasswords>
</fieldset>
</form>
</div>
</li>
</c:otherwise>
</c:choose>
</ul>
</div>
<!--/.nav-collapse -->
</div>
</div>
<c:if test="${isAdmin}">
<script>
$('.dropdown-toggle').dropdown();
$('.dropdown-menu').find('form').click(function(e) {
e.stopPropagation();
});
</script>
</c:if>