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

<c:url var="homeUrl" value="/home.html" />
<c:url var="postLoginUrl" value="/j_spring_security_check" />
<c:url var="logoutUrl" value="/j_spring_security_logout" />

<div id="subhd" class="yui-g">
	<div class="yui-u first">
		<div id="topNav">
			<ul>
				<li><a href="${homeUrl}">Początek</a></li>
			</ul>
		</div>
	</div>
	<div class="yui-u">
		<security:authorize access="isAnonymous()">
			<div id="sessionInfo" style="padding:7px 20px">
				<form id="loginForm" action="${postLoginUrl}" method="post" style="font-size:85%">
					<span style="white-space:no-wrap">Nazwa użytkownika: <input type="text" name="j_username" style="width:100px" /></span>
					<span style="margin-left:5px;white-space:no-wrap">Hasło: <input type="password" name="j_password" style="width:100px" /></span>
					<span style="margin-left:5px"><input type="submit" value="Zaloguj się" /></span>
				</form>
			</div>
		</security:authorize>
		<security:authorize access="isAuthenticated()">
			<div id="sessionInfo">
				Witaj, <security:authentication property="principal.username" />.
				<a href="${logoutUrl}">Log out</a>
			</div>
		</security:authorize>
	</div>
</div>
