<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<head>
<title>${user.username} - Overview</title>
<style type="text/css">
@import "/WEB-CONTENT/CSS/layout.css";
</style>
</head>
<body>
	<div id="container">
		<%@include file="/WEB-CONTENT/header.jsp"%>
		<div id="content" class="rounded-corners">
			<h1>
				User:
				<c:out value="${user.username}" />
			</h1>
			<a href="/user/${user.username}/update" class="edit">Update</a> | <a
				href="/user/${user.username}/delete" class="edit"> Delete</a>
			<hr />
			<h2>All projects</h2>
			<a href="/${user.username}/project/add" class="edit">New</a>
			<ul>
				<c:forEach items="${projectList}" var="project">
					<c:forEach items="${ownerList}" var="owner">
						<c:if test="${project.ownerId == owner.id}">
							<li><h3> <span class="grey">${owner.username}</span>-${project.description} <a class="edit"
									href="/${owner.username}/${project.slug}/update">Update</a> | <a
									class="edit" href="/${owner.username}/${project.slug}/delete">Delete</a>
									| <a class="edit"
									href="/${owner.username}/${project.slug}/access">Project
										Access</a> | <a class="edit"
									href="/${owner.username}/${project.slug}/model/add">Add
										Model</a>
							</h3></li>
							<ul>
								<c:forEach items="${umlModelList}" var="umlModel">
									<c:if test="${umlModel.projectId == project.id}">
										<li>${umlModel.description} <a class="edit workspace"
											href="/workspace/${umlModel.generatedKey}" target="_blank">Workspace</a>
											| <a class="edit"
											href="/${owner.username}/${project.slug}/model/${umlModel.slug}/update">Update</a>
											| <a class="edit"
											href="/${owner.username}/${project.slug}/model/${umlModel.slug}/delete">Delete</a>
										</li>
									</c:if>
								</c:forEach>
							</ul>
						</c:if>
					</c:forEach>
				</c:forEach>
			</ul>
		</div>
		<%@include file="/WEB-CONTENT/footer.jsp"%>
	</div>
</body>
</html>