<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <title>${database.projectName} history</title>
  <style type="text/css">
	* {
		margin: 0;
		padding: 0;
	}
	body {
		font-family: Verdana, "Hiragino Kaku Gothic Pro", "ヒラギノ角ゴ Pro W3", Meiryo, "メイリオ", "MS P Gothic", "MS Pゴシック", sans-serif;
		font-size: 90%;
		margin: 1em 1.5em;
		background-color: #ffffee;
	}

	/* heading */
	h1 {
		font-size: 1.5em;
		border-bottom: 2px solid #af0000;
		border-top: 2px solid #af0000;
	}
	h2 {
		margin-top: 2em;
		border-bottom: 2px solid #af0000;
		border-left: 10px solid #af0000;
		text-indent: 1em;
		font-size: 1.6em;
	}
	h3 {
		width: 10em;
		margin: 0.8em 0;
		padding-left: 1.8em;
		border-bottom: solid 1px #333;
		color: #555;
		font-size: 1.2em;
	}
	h4 {
		margin: 1em 0em;
		font-size: 1em;
		font-weight: normal;
		display: list-item;
	}
	h5 {
		width: 10em;
		font-size: 85%;
		border-bottom: solid 1px #333;
		text-indent: 0.3em;
		color: #555;
	}

	.table-content {
		margin: 0 6em;
	}
	.column-content {
		margin: 0.5em 1em 0.5em 3em;
		line-height: 1.4em;
	}

	div.change-table-content {
		margin-left: 3em;
	}

	dl.column-content dt {
		display: list-item;
	}
	dl.column-content dd {
		margin: 0 4em;
	}
	dl.column-content dd span {
		display: block;
		float: left;
		width: 6em;
		margin-right: 1.5em;
		border-right: dotted 2px #333;
		font-weight: bold;
		font-size: 80%;
		color: #555;
	}
	
	span.dt {
		font-size: 80%;
	}
	p.comment {
		margin-left: 23em;
	}
	p.tablecount {
		margin-left: 23em;
	}
  </style>
</head>

<body>
<h1>History for ${database.projectName} (${database.databaseName})</h1>

#foreach ($schemaDiff in $database.schemaDiffList)
<div class="section">
	<h2><span class="dt">Diff Date: </span>${schemaDiff.diffDate}</h2>
#if ($schemaDiff.hasComment())
	<p class="comment">${schemaDiff.comment}</p>
#end
#if ($schemaDiff.tableCount.hasDiff())
	<p class="tablecount"><span class="dt">table count: </span>${schemaDiff.tableCount.displayForHtml}</p>
#end

#if (!$schemaDiff.addedTableDiffList.isEmpty())
	<h3>Add Table</h3>
	<ul class="table-content">
#foreach ($tableDiff in $schemaDiff.addedTableDiffList)
#if ($schemaDiff.isLatest())
		<li><a href="./${database.schemaHtmlFileName}#${tableDiff.tableName}">${tableDiff.tableName}</a></li>
#else
		<li>${tableDiff.tableName}</li>
#end 
#end
	</ul>
#end
#if (!$schemaDiff.changedTableDiffList.isEmpty())
	<h3>Change Table</h3>
	<div class="table-content">
#foreach ($tableDiff in $schemaDiff.changedTableDiffList)
#if ($schemaDiff.isLatest())
		<h4><a href="./${database.schemaHtmlFileName}#${tableDiff.tableName}">${tableDiff.tableName}</a></h4>
#else
		<h4>${tableDiff.tableName}</h4>
#end
		<div class="change-table-content">
#foreach ($handler in $tableDiff.nextPreviousValidList)
			<h5>$handler.titleName()</h5>
			<div class="column-content">$handler.provide().displayForHtml</div>
#end
#foreach ($content in $tableDiff.nestDiffContentOrderedList)
			<h5>${content.titleName}</h5>
#if ($content.isChange())
			<dl class="column-content">
#foreach ($nestDiff in $content.nestDiffList)
				<dt>${nestDiff.keyName}</dt>
#foreach ($handler in $nestDiff.nextPreviousValidList)
				<dd><span>$handler.titleName()</span>$handler.provide().displayForHtml</dd>
#end
#end
			</dl>
#else
			<ul class="column-content">
#foreach ($nestDiff in $content.nestDiffList)
				<li>${nestDiff.keyName}</li>
#end
			</ul>
#end
#end
		</div>
#end
	</div>
#end
#if (!$schemaDiff.deletedTableDiffList.isEmpty())
	<h3>Delete Table</h3>
	<ul class="table-content">
#foreach ($tableDiff in $schemaDiff.deletedTableDiffList)
		<li>${tableDiff.tableName}</li>
#end
	</ul>
#end
</div>
#end

</body>
</html>
