<%@ include file="/includes/setup.inc" %>
<html>
  <head>
    <title>
      Struts Library Home Page
    </title>
    <link rel="stylesheet" type="text/css" href='<c:url value="/css/app.css"/>'>
  </head>
  <body>
    <h1>
      Struts Library
    </h1>
    <hr>
    Welcome to the Struts library.
    <p>
      <c:out value="You are logged in as: ${usersession.currentUser.username}"/>
      <p>
        <html:link forward="viewbooks">
          View Books
        </html:link>
        <c:if test="${usersession.currentUser.librarian == true}">
          &nbsp;
          <html:link forward="addbook">
            Add Book
          </html:link>
          &nbsp;
          <html:link forward="adminbooks">
            Book Administration
          </html:link>
        </c:if>
        <hr>
        <c:choose>
          <c:when test="${usersession.loggedIn == true}">
            <html:link forward="logout">
              Log Out
            </html:link>
          </c:when>
          <c:otherwise>
            <html:link forward="login">
              Log In
            </html:link>
          </c:otherwise>
        </c:choose>
      </body>
</html>
