<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://www.springframework.org/security/tags" prefix="security" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>

<security:authentication property="authorities[0]" var="role" scope="page" />
<c:set var="roleUser" value="${fn:trim(role)}" />
<div class="navbar fixed-top print-hide" id="header">
	<div class="navbar-inner">
		<div class="container">
			<a title="Park&Save" href="/parkandsave/welcome" class="pw-logo-white"><span>ParkAndSave</span></a>
			<ul class="nav">
				<li><a rel="nofollow" href="/parkandsave/user/register">Registrarse</a></li>
				<li><a rel="nofollow" href="/help">Ayuda</a></li>
				<c:choose>
					<c:when test="${'ROLE_USER' eq roleUser}">
						<li class="hover-dropdown selected">
							<a href="/user/myPage"><security:authentication property="principal.username"/><b class="caret"></b></a>
							<ul class="hover-dropdown-menu">
								<li><a href="/user/myPage">Mi página</a></li>
								<li><a href="/user/settings/">Configurar cuenta</a></li>
								<li><a href="/logout/">Cerrar sesión</a></li>
							</ul>
						</li>
					</c:when>
					<c:otherwise>
						<li class="selected"><a rel="nofollow" href="/parkandsave/login">Iniciar sesión</a></li>
					</c:otherwise>
				</c:choose>
			</ul>
		</div>
	</div>
</div>