<?php
$response = $this->response;

if (!$response->success) {
	?>
	<h1>Chyba při tvorbě dokumentace</h1>
	<p>
		Chybová hláška: <strong><?php echo $response->status; ?></strong>
	</p>
	<p>
		Chybový kód: <strong><?php echo $response->statusCode; ?></strong>
	</p>
	<?php 
	return;
}

$doc = $response["documentation"];
$user = $doc->findParentRow("Application_Model_Users", "user");
?>
<h1>Záznam o dokumentaci</h1>
<p>
	Identifikační číslo: <strong>#<?php echo $doc->id; ?></strong>
</p>
<p>
	Tvůrce asociace: <strong><a href="/user/get/<?php echo $user->id; ?>.html"><?php echo $user->username; ?></a></strong>
</p>
<p>
	Dokumentace: <strong><a href="/document/get/<?php echo $doc->documentation_document_uuid; ?>.html"><?php echo $doc->documentation_document_uuid; ?></a></strong> <a href="/documentation/get/<?php echo $doc->documentation_document_uuid; ?>.html">Seznam dokumentace</a>
</p>
<?php 
if ($doc->documented_directory_id) {
	?>
<p>
	Dokumentovaný adresář: <strong><a href="/directory/get/<?php echo $doc->documented_directory_id; ?>.html"><?php echo $doc->documented_directory_id; ?></a></strong> <a href="/documentation/get/d<?php echo $doc->documented_directory_id; ?>.html">Seznam dokumentace</a>
</p>
	<?php 
} else {
	?>
<p>
	Dokumentovaný dokument: <strong><a href="/document/get/<?php echo $doc->documented_document_uuid; ?>.html"><?php echo $doc->documented_document_uuid; ?></a></strong> <a href="/documentation/get/<?php echo $doc->documented_document_uuid; ?>.html">Seznam dokumentace</a>
</p>
	<?php 
}
?>